summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorarseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>2010-10-18 16:59:31 +0000
committerarseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>2010-10-18 16:59:31 +0000
commit498947c71897bfad865d37252df6689c1a78e1d8 (patch)
tree9e9a4fbed47c89bb468d4083227ea6d6285ed8ec /tests
parentb1bc4e4ed595d64ee6145ff97ac2c3c7aac6d369 (diff)
Fixed internal_object() const-correctness, added xml_node::hash_value and xml_attribute::hash_value functions
git-svn-id: http://pugixml.googlecode.com/svn/trunk@767 99668b35-9821-0410-8761-19e4c4f06640
Diffstat (limited to 'tests')
-rw-r--r--tests/test_dom_traverse.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/test_dom_traverse.cpp b/tests/test_dom_traverse.cpp
index 865b90a..0ee87ed 100644
--- a/tests/test_dom_traverse.cpp
+++ b/tests/test_dom_traverse.cpp
@@ -782,3 +782,25 @@ TEST_XML(dom_internal_object, "<node attr='value'>value</node>")
xml_attribute attr_copy = attr;
CHECK(attr_copy.internal_object() == attr.internal_object());
}
+
+TEST_XML(dom_hash_value, "<node attr='value'>value</node>")
+{
+ xml_node node = doc.child(STR("node"));
+ xml_attribute attr = node.first_attribute();
+ xml_node value = node.first_child();
+
+ CHECK(xml_node().hash_value() == 0);
+ CHECK(xml_attribute().hash_value() == 0);
+
+ CHECK(node.hash_value() != 0);
+ CHECK(value.hash_value() != 0);
+ CHECK(node.hash_value() != value.hash_value());
+
+ CHECK(attr.hash_value() != 0);
+
+ xml_node node_copy = node;
+ CHECK(node_copy.hash_value() == node.hash_value());
+
+ xml_attribute attr_copy = attr;
+ CHECK(attr_copy.hash_value() == attr.hash_value());
+}