From 838f089461838aea38e967eefdd42a06e80dbea2 Mon Sep 17 00:00:00 2001 From: Benjamin Paassen Date: Fri, 9 Jan 2015 15:26:48 +0100 Subject: used new addChild method. --- test/core/XMLTest.cpp | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/test/core/XMLTest.cpp b/test/core/XMLTest.cpp index 2623342..f7a0b4a 100644 --- a/test/core/XMLTest.cpp +++ b/test/core/XMLTest.cpp @@ -27,26 +27,25 @@ namespace xml { TEST(XMLNode, testSerialize) { - Manager mgr; - + Manager mgr{1}; Rooted html{new Element{mgr, {nullptr}, "html"}}; Rooted head{new Element{mgr, html, "head"}}; - html->children.push_back(head); + html->addChild(head); Rooted title{new Element{mgr, head, "title"}}; - head->children.push_back(title); - title->children.push_back(new Text(mgr, title, "my title")); + head->addChild(title); + title->addChild(new Text(mgr, title, "my title")); Rooted body{new Element{mgr, html, "body"}}; - html->children.push_back(body); + html->addChild(body); // This div element contains our text. Rooted div{ new Element{mgr, body, "div", {{"class", "content"}, {"id", "1"}}}}; - body->children.push_back(div); + body->addChild(div); Rooted p{new Element{mgr, div, "p"}}; - div->children.push_back(p); - p->children.push_back(new Text(mgr, p, "my text")); + div->addChild(p); + p->addChild(new Text(mgr, p, "my text")); Rooted p2{new Element{mgr, div, "p"}}; - div->children.push_back(p2); - p2->children.push_back(new Text(mgr, p2, "my text")); + div->addChild(p2); + p2->addChild(new Text(mgr, p2, "my text")); // Now this is what we expect to see: std::string expected{ -- cgit v1.2.3