diff options
author | arseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640> | 2010-08-29 15:27:51 +0000 |
---|---|---|
committer | arseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640> | 2010-08-29 15:27:51 +0000 |
commit | e08c065820d734d4f5768470ed6a4f123cbb56ef (patch) | |
tree | c28a4c58b36cd0cd48841617a6a6fc3f8ce350df /tests/test.hpp | |
parent | 7554e206885a3f3aa1a771f0d4ca1d4a921994ad (diff) |
tests: Added XPath tests for attribute context
git-svn-id: http://pugixml.googlecode.com/svn/trunk@664 99668b35-9821-0410-8761-19e4c4f06640
Diffstat (limited to 'tests/test.hpp')
-rw-r--r-- | tests/test.hpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/test.hpp b/tests/test.hpp index 3308b1e..4127697 100644 --- a/tests/test.hpp +++ b/tests/test.hpp @@ -37,10 +37,10 @@ template <typename Node> inline bool test_node_name_value(const Node& node, cons bool test_node(const pugi::xml_node& node, const pugi::char_t* contents, const pugi::char_t* indent, unsigned int flags); #ifndef PUGIXML_NO_XPATH -bool test_xpath_string(const pugi::xml_node& node, const pugi::char_t* query, const pugi::char_t* expected); -bool test_xpath_boolean(const pugi::xml_node& node, const pugi::char_t* query, bool expected); -bool test_xpath_number(const pugi::xml_node& node, const pugi::char_t* query, double expected); -bool test_xpath_number_nan(const pugi::xml_node& node, const pugi::char_t* query); +bool test_xpath_string(const pugi::xpath_node& node, const pugi::char_t* query, const pugi::char_t* expected); +bool test_xpath_boolean(const pugi::xpath_node& node, const pugi::char_t* query, bool expected); +bool test_xpath_number(const pugi::xpath_node& node, const pugi::char_t* query, double expected); +bool test_xpath_number_nan(const pugi::xpath_node& node, const pugi::char_t* query); bool test_xpath_fail_compile(const pugi::char_t* query); struct xpath_node_set_tester @@ -126,7 +126,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.select_nodes(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(xpath_query(query).evaluate_node_set(node), CHECK_JOIN2(STRINGIZE(query) " does not evaluate to expected set in context " STRINGIZE(node), " at "__FILE__ ":", __LINE__)) #endif #define STR(text) PUGIXML_TEXT(text) |