diff options
author | arseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640> | 2010-08-29 15:25:05 +0000 |
---|---|---|
committer | arseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640> | 2010-08-29 15:25:05 +0000 |
commit | 049fa3906db2786943617bb1b0ce3225be9a772f (patch) | |
tree | 3a502c3c0f3e93f4f3b3022eb13aa2e0bdf47705 /tests/test.cpp | |
parent | 91777e5c172c401ff25bd5a37067c5caca78dc63 (diff) |
tests: Added new evaluate_string tests, fixed tests for NO_STL mode
git-svn-id: http://pugixml.googlecode.com/svn/trunk@661 99668b35-9821-0410-8761-19e4c4f06640
Diffstat (limited to 'tests/test.cpp')
-rw-r--r-- | tests/test.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/test.cpp b/tests/test.cpp index c60619a..96a81e4 100644 --- a/tests/test.cpp +++ b/tests/test.cpp @@ -58,7 +58,16 @@ bool test_xpath_string(const pugi::xml_node& node, const pugi::char_t* query, co { pugi::xpath_query q(query); - return q.evaluate_string(node) == expected; + const size_t capacity = 64; + pugi::char_t result[capacity]; + + size_t size = q.evaluate_string(result, capacity, node); + + if (size <= capacity) return test_string_equal(result, expected); + + std::basic_string<pugi::char_t> buffer(size, ' '); + + return q.evaluate_string(&buffer[0], size, node) == size && test_string_equal(buffer.c_str(), expected); } bool test_xpath_boolean(const pugi::xml_node& node, const pugi::char_t* query, bool expected) |