From 9a532b73cb37e9aed2f6fd35a4e4e2dce10ee8f6 Mon Sep 17 00:00:00 2001 From: jez Date: Wed, 25 Nov 2009 10:24:21 +0000 Subject: [PATCH] NamedNodeMap tests - not complete yet --- tests/DOM/test_NamedNodeMap.hpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/DOM/test_NamedNodeMap.hpp b/tests/DOM/test_NamedNodeMap.hpp index 478583d0..54a2a0fe 100644 --- a/tests/DOM/test_NamedNodeMap.hpp +++ b/tests/DOM/test_NamedNodeMap.hpp @@ -14,6 +14,7 @@ class NamedNodeMapTest : public TestCase typedef string_adaptor SA; typedef Arabica::DOM::Element Element; + typedef Arabica::DOM::Node Node; typedef Arabica::DOM::NamedNodeMap NamedNodeMap; public: @@ -80,8 +81,10 @@ class NamedNodeMapTest : public TestCase Element d = parse("").getDocumentElement(); NamedNodeMap nm = d.getAttributes(); assertEquals(1, nm.getLength()); - nm.removeNamedItem(s("a")); + Node a = nm.removeNamedItem(s("a")); assertEquals(0, nm.getLength()); + nm.setNamedItem(a); + assertEquals(1, nm.getLength()); } // test4 void test5() @@ -89,8 +92,10 @@ class NamedNodeMapTest : public TestCase Element d = parse("").getDocumentElement(); NamedNodeMap nm = d.getAttributes(); assertEquals(2, nm.getLength()); - nm.removeNamedItemNS(s("urn:a"), s("a")); + Node a = nm.removeNamedItemNS(s("urn:a"), s("a")); assertEquals(1, nm.getLength()); + nm.setNamedItemNS(a); + assertEquals(2, nm.getLength()); } // test5 };