summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorarseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>2009-11-04 19:34:16 +0000
committerarseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>2009-11-04 19:34:16 +0000
commit73b18f7df5964b5bcdb84c38d80dc9dda013ad98 (patch)
treeefecc7a11f910a26bfc69cc9ea3e2e7cc5601e41 /tests
parentec1133444f95601245bc728d9c0fea741e19b42a (diff)
tests: Added allocator coverage tests
git-svn-id: http://pugixml.googlecode.com/svn/trunk@206 99668b35-9821-0410-8761-19e4c4f06640
Diffstat (limited to 'tests')
-rw-r--r--tests/test_xpath.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/test_xpath.cpp b/tests/test_xpath.cpp
index 39814a5..67288b9 100644
--- a/tests/test_xpath.cpp
+++ b/tests/test_xpath.cpp
@@ -20,4 +20,22 @@ TEST_XML(xpath_document_order, "<node><child1 attr1='value1' attr2='value2'/><ch
CHECK(doc.child("node").child("child2").first_child().document_order() == 8);
}
+TEST(xpath_allocator_many_pages)
+{
+ std::string query = "0";
+
+ for (int i = 0; i < 1024; ++i) query += "+string-length('abcdefgh')";
+
+ CHECK_XPATH_NUMBER(xml_node(), query.c_str(), 8192);
+}
+
+TEST(xpath_allocator_large_page)
+{
+ std::string query;
+
+ for (int i = 0; i < 1024; ++i) query += "abcdefgh";
+
+ CHECK_XPATH_NUMBER(xml_node(), ("string-length('" + query + "')").c_str(), 8192);
+}
+
#endif