diff options
author | Benjamin Paassen <bpaassen@techfak.uni-bielefeld.de> | 2015-01-09 15:26:48 +0100 |
---|---|---|
committer | Benjamin Paassen <bpaassen@techfak.uni-bielefeld.de> | 2015-01-09 15:26:48 +0100 |
commit | 838f089461838aea38e967eefdd42a06e80dbea2 (patch) | |
tree | 36acf861baf5b15aea327bfa061d17137375541b /test/core/XMLTest.cpp | |
parent | 302565043bed0dc68bbe5e86ab94d94b15e43424 (diff) |
used new addChild method.
Diffstat (limited to 'test/core/XMLTest.cpp')
-rw-r--r-- | test/core/XMLTest.cpp | 21 |
1 files 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<Element> html{new Element{mgr, {nullptr}, "html"}}; Rooted<Element> head{new Element{mgr, html, "head"}}; - html->children.push_back(head); + html->addChild(head); Rooted<Element> 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<Element> body{new Element{mgr, html, "body"}}; - html->children.push_back(body); + html->addChild(body); // This div element contains our text. Rooted<Element> div{ new Element{mgr, body, "div", {{"class", "content"}, {"id", "1"}}}}; - body->children.push_back(div); + body->addChild(div); Rooted<Element> 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<Element> 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{ |