From 51de9238ddbd6b7f4cdaa5e9a5918cae952891b2 Mon Sep 17 00:00:00 2001 From: Benjamin Paassen Date: Mon, 12 Jan 2015 15:50:10 +0100 Subject: Tried to introduce another StructureNode class as common superclass for StructuredEntity, Anchor and DocumentPrimitive. Nearly seems to work, but not entirely so. There are still issues with the Manager it seems. --- test/core/model/DocumentTest.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'test/core/model/DocumentTest.cpp') diff --git a/test/core/model/DocumentTest.cpp b/test/core/model/DocumentTest.cpp index d11bb78..4b0447d 100644 --- a/test/core/model/DocumentTest.cpp +++ b/test/core/model/DocumentTest.cpp @@ -34,7 +34,7 @@ namespace model { TEST(Document, testDocumentConstruction) { // Construct Manager - TerminalLogger logger {std::cerr, true}; + TerminalLogger logger{std::cerr, true}; Manager mgr{1}; Rooted sys{new SystemTypesystem(mgr)}; // Get the domain. @@ -52,7 +52,8 @@ TEST(Document, testDocumentConstruction) ASSERT_EQ(2U, root->getField().size()); // get foreword (paragraph) { - Rooted foreword = root->getField()[0]; + Rooted foreword = + root->getField()[0].cast(); ASSERT_FALSE(foreword.isNull()); ASSERT_EQ("paragraph", foreword->getDescriptor()->getName()); // it should contain one text node @@ -61,7 +62,8 @@ TEST(Document, testDocumentConstruction) // which in turn should have a primitive content field containing the // right text. { - Rooted text = foreword->getField()[0]; + Rooted text = + foreword->getField()[0].cast(); ASSERT_FALSE(text.isNull()); ASSERT_EQ("text", text->getDescriptor()->getName()); ASSERT_TRUE(text->hasField()); @@ -74,24 +76,26 @@ TEST(Document, testDocumentConstruction) } // get section { - Rooted section = root->getField()[1]; + Rooted section = + root->getField()[1].cast(); ASSERT_FALSE(section.isNull()); ASSERT_EQ("section", section->getDescriptor()->getName()); // it should contain one paragraph ASSERT_TRUE(section->hasField()); ASSERT_EQ(1U, section->getField().size()); { - Rooted par = section->getField()[0]; + Rooted par = + section->getField()[0].cast(); ASSERT_FALSE(par.isNull()); ASSERT_EQ("paragraph", par->getDescriptor()->getName()); // it should contain one text node ASSERT_TRUE(par->hasField()); ASSERT_EQ(1U, par->getField().size()); // which in turn should have a primitive content field containing - // the - // right text. + // the right text. { - Rooted text = par->getField()[0]; + Rooted text = + par->getField()[0].cast(); ASSERT_FALSE(text.isNull()); ASSERT_EQ("text", text->getDescriptor()->getName()); ASSERT_TRUE(text->hasField()); -- cgit v1.2.3