summaryrefslogtreecommitdiff
path: root/tests/test.hpp
diff options
context:
space:
mode:
authorarseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>2010-05-09 20:37:49 +0000
committerarseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>2010-05-09 20:37:49 +0000
commit5ff56a6d68ce6fbab0980232d95b5d190e2ecdcf (patch)
tree734c2f28e532135fe7a2088be48f98c7b44cc5fd /tests/test.hpp
parente96af87b5dc678a64aad061cc2955eaa463c09a2 (diff)
Removed document order optimization (it helps on a tiny percentage of queries), XPath tests now compute their own order
git-svn-id: http://pugixml.googlecode.com/svn/trunk@400 99668b35-9821-0410-8761-19e4c4f06640
Diffstat (limited to 'tests/test.hpp')
-rw-r--r--tests/test.hpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/test.hpp b/tests/test.hpp
index be42b8b..49fd3a1 100644
--- a/tests/test.hpp
+++ b/tests/test.hpp
@@ -45,13 +45,15 @@ bool test_xpath_fail_compile(const pugi::char_t* query);
struct xpath_node_set_tester
{
+ pugi::xpath_node* document_order;
+ size_t document_size;
+
pugi::xpath_node_set result;
unsigned int last;
const char* message;
void check(bool condition);
- xpath_node_set_tester(const pugi::xml_node& node, const pugi::char_t* query, const char* message);
xpath_node_set_tester(const pugi::xpath_node_set& set, const char* message);
~xpath_node_set_tester();
@@ -123,7 +125,7 @@ struct dummy_fixture {};
#define CHECK_XPATH_NUMBER(node, query, expected) CHECK_TEXT(test_xpath_number(node, query, expected), STRINGIZE(query) " does not evaluate to " STRINGIZE(expected) " in context " STRINGIZE(node))
#define CHECK_XPATH_NUMBER_NAN(node, query) CHECK_TEXT(test_xpath_number_nan(node, query), STRINGIZE(query) " does not evaluate to NaN in context " STRINGIZE(node))
#define CHECK_XPATH_FAIL(query) CHECK_TEXT(test_xpath_fail_compile(query), STRINGIZE(query) " should not compile")
-#define CHECK_XPATH_NODESET(node, query) xpath_node_set_tester(node, query, CHECK_JOIN2(STRINGIZE(query) " does not evaluate to expected set in context " STRINGIZE(node), " at "__FILE__ ":", __LINE__))
+#define CHECK_XPATH_NODESET(node, query) xpath_node_set_tester(node.select_nodes(query), CHECK_JOIN2(STRINGIZE(query) " does not evaluate to expected set in context " STRINGIZE(node), " at "__FILE__ ":", __LINE__))
#endif
#define STR(text) PUGIXML_TEXT(text)