summaryrefslogtreecommitdiff
path: root/test/core/model/DocumentTest.cpp
diff options
context:
space:
mode:
authorBenjamin Paassen <bpaassen@techfak.uni-bielefeld.de>2015-01-12 15:50:10 +0100
committerBenjamin Paassen <bpaassen@techfak.uni-bielefeld.de>2015-01-12 15:50:10 +0100
commit51de9238ddbd6b7f4cdaa5e9a5918cae952891b2 (patch)
tree90f9a91e8a67a5ee95b1cb2e3addda6b51ff7209 /test/core/model/DocumentTest.cpp
parent60d9d3f9f54fab975c39d4c341f118df90628375 (diff)
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.
Diffstat (limited to 'test/core/model/DocumentTest.cpp')
-rw-r--r--test/core/model/DocumentTest.cpp20
1 files changed, 12 insertions, 8 deletions
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<SystemTypesystem> sys{new SystemTypesystem(mgr)};
// Get the domain.
@@ -52,7 +52,8 @@ TEST(Document, testDocumentConstruction)
ASSERT_EQ(2U, root->getField().size());
// get foreword (paragraph)
{
- Rooted<StructuredEntity> foreword = root->getField()[0];
+ Rooted<StructuredEntity> foreword =
+ root->getField()[0].cast<StructuredEntity>();
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<StructuredEntity> text = foreword->getField()[0];
+ Rooted<StructuredEntity> text =
+ foreword->getField()[0].cast<StructuredEntity>();
ASSERT_FALSE(text.isNull());
ASSERT_EQ("text", text->getDescriptor()->getName());
ASSERT_TRUE(text->hasField());
@@ -74,24 +76,26 @@ TEST(Document, testDocumentConstruction)
}
// get section
{
- Rooted<StructuredEntity> section = root->getField()[1];
+ Rooted<StructuredEntity> section =
+ root->getField()[1].cast<StructuredEntity>();
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<StructuredEntity> par = section->getField()[0];
+ Rooted<StructuredEntity> par =
+ section->getField()[0].cast<StructuredEntity>();
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<StructuredEntity> text = par->getField()[0];
+ Rooted<StructuredEntity> text =
+ par->getField()[0].cast<StructuredEntity>();
ASSERT_FALSE(text.isNull());
ASSERT_EQ("text", text->getDescriptor()->getName());
ASSERT_TRUE(text->hasField());