From 498947c71897bfad865d37252df6689c1a78e1d8 Mon Sep 17 00:00:00 2001 From: "arseny.kapoulkine" Date: Mon, 18 Oct 2010 16:59:31 +0000 Subject: 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 --- tests/test_dom_traverse.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'tests/test_dom_traverse.cpp') 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, "value") xml_attribute attr_copy = attr; CHECK(attr_copy.internal_object() == attr.internal_object()); } + +TEST_XML(dom_hash_value, "value") +{ + 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()); +} -- cgit v1.2.3