diff options
author | Benjamin Paassen <bpaassen@techfak.uni-bielefeld.de> | 2015-01-09 11:30:43 +0100 |
---|---|---|
committer | Benjamin Paassen <bpaassen@techfak.uni-bielefeld.de> | 2015-01-09 11:30:43 +0100 |
commit | 33caaa0d202d4d6a3abd1462f3d5650e9b6d506f (patch) | |
tree | 4aa7809c30b84afa6623c1cf759d5b7d8883725f /test | |
parent | 1a05a69ebfaed97a387ec5f5ccdada7e82409743 (diff) |
added a parent reference to XML nodes.
Diffstat (limited to 'test')
-rw-r--r-- | test/core/XMLTest.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/test/core/XMLTest.cpp b/test/core/XMLTest.cpp index 124b58d..53bd28d 100644 --- a/test/core/XMLTest.cpp +++ b/test/core/XMLTest.cpp @@ -29,24 +29,24 @@ TEST(Node, testSerialize) { Manager mgr; - Rooted<Element> html{new Element{mgr, "html"}}; - Rooted<Element> head{new Element{mgr, "head"}}; + Rooted<Element> html{new Element{mgr, {nullptr}, "html"}}; + Rooted<Element> head{new Element{mgr, html, "head"}}; html->children.push_back(head); - Rooted<Element> title{new Element{mgr, "title"}}; + Rooted<Element> title{new Element{mgr, head, "title"}}; head->children.push_back(title); - title->children.push_back(new Text(mgr, "my title")); - Rooted<Element> body{new Element{mgr, "body"}}; + title->children.push_back(new Text(mgr, title, "my title")); + Rooted<Element> body{new Element{mgr, html, "body"}}; html->children.push_back(body); // This div element contains our text. Rooted<Element> div{ - new Element{mgr, "div", {{"class", "content"}, {"id", "1"}}}}; + new Element{mgr, body, "div", {{"class", "content"}, {"id", "1"}}}}; body->children.push_back(div); - Rooted<Element> p{new Element{mgr, "p"}}; + Rooted<Element> p{new Element{mgr, div, "p"}}; div->children.push_back(p); - p->children.push_back(new Text(mgr, "my text")); - Rooted<Element> p2{new Element{mgr, "p"}}; + p->children.push_back(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, "my text")); + p2->children.push_back(new Text(mgr, p2, "my text")); // Now this is what we expect to see: std::string expected{ |