summaryrefslogtreecommitdiff
path: root/tests/test.cpp
diff options
context:
space:
mode:
authorarseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>2010-08-29 15:37:29 +0000
committerarseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>2010-08-29 15:37:29 +0000
commitf481f038d64a3d0a1db1a3ae9a13be6a4bb18a7d (patch)
tree0ce811d39357ee5cf18e8c5cd623a522ea0fb866 /tests/test.cpp
parentc66ffdf720b1c1c8ce854d3adcca4e40033655c1 (diff)
tests: Added XPath variable and variable set tests
git-svn-id: http://pugixml.googlecode.com/svn/trunk@679 99668b35-9821-0410-8761-19e4c4f06640
Diffstat (limited to 'tests/test.cpp')
-rw-r--r--tests/test.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/tests/test.cpp b/tests/test.cpp
index 43c6b22..9091f14 100644
--- a/tests/test.cpp
+++ b/tests/test.cpp
@@ -60,6 +60,15 @@ bool test_node(const pugi::xml_node& node, const pugi::char_t* contents, const p
return writer.as_string() == contents;
}
+bool test_double_nan(double value)
+{
+#if defined(_MSC_VER) || defined(__BORLANDC__)
+ return _isnan(value) != 0;
+#else
+ return value != value;
+#endif
+}
+
#ifndef PUGIXML_NO_XPATH
bool test_xpath_string(const pugi::xpath_node& node, const pugi::char_t* query, const pugi::char_t* expected)
{
@@ -99,13 +108,7 @@ bool test_xpath_number_nan(const pugi::xpath_node& node, const pugi::char_t* que
{
pugi::xpath_query q(query);
- double r = q.evaluate_number(node);
-
-#if defined(_MSC_VER) || defined(__BORLANDC__)
- return _isnan(r) != 0;
-#else
- return r != r;
-#endif
+ return test_double_nan(q.evaluate_number(node));
}
bool test_xpath_fail_compile(const pugi::char_t* query)