summaryrefslogtreecommitdiff
path: root/tests/test_xpath_api.cpp
diff options
context:
space:
mode:
authorarseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>2010-08-29 15:49:06 +0000
committerarseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>2010-08-29 15:49:06 +0000
commit998a534df7232c142521c57e7abd5e366ac3a8eb (patch)
tree90a55d6548e69ebaf84529ec0622f04237bba4b2 /tests/test_xpath_api.cpp
parent6d44879c5a01c10f8ce6687fa01676753225be7b (diff)
tests: Changed XPath checking macros to avoid query copying under GCC
git-svn-id: http://pugixml.googlecode.com/svn/trunk@692 99668b35-9821-0410-8761-19e4c4f06640
Diffstat (limited to 'tests/test_xpath_api.cpp')
-rw-r--r--tests/test_xpath_api.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/tests/test_xpath_api.cpp b/tests/test_xpath_api.cpp
index b91910a..90f316e 100644
--- a/tests/test_xpath_api.cpp
+++ b/tests/test_xpath_api.cpp
@@ -169,10 +169,18 @@ TEST_XML(xpath_api_evaluate_attr, "<node attr='3'/>")
#ifdef PUGIXML_NO_EXCEPTIONS
TEST_XML(xpath_api_evaluate_fail, "<node attr='3'/>")
{
- CHECK_XPATH_BOOLEAN(doc, STR(""), false);
- CHECK_XPATH_NUMBER_NAN(doc, STR(""));
- CHECK_XPATH_STRING(doc, STR(""), STR(""));
- CHECK_XPATH_NODESET(doc, STR(""));
+ xpath_query q(STR(""));
+
+ CHECK(q.evaluate_boolean(doc) == false);
+ CHECK_DOUBLE_NAN(q.evaluate_number(doc));
+
+ CHECK(q.evaluate_string(0, 0, doc) == 1); // null terminator
+
+#ifndef PUGIXML_NO_STL
+ CHECK(q.evaluate_string(doc).empty());
+#endif
+
+ CHECK(q.evaluate_node_set(doc).empty());
}
#endif