diff options
author | Benjamin Paassen <bpaassen@techfak.uni-bielefeld.de> | 2015-01-15 14:18:07 +0100 |
---|---|---|
committer | Benjamin Paassen <bpaassen@techfak.uni-bielefeld.de> | 2015-01-15 14:18:07 +0100 |
commit | a1245cf2ad80cba0a71ffb184966ee77a7e166cc (patch) | |
tree | 98c593f0277743df25e9b57638c254da8ca0a3cb /test/plugins/html | |
parent | 2194293a5e33cc97a4cb91055ff75425ad14c3d0 (diff) |
Further simplified document buildup by doing the addition to parents of StructureNodes in the constructor and refactored Anchor as standalone class instead of AnnotationEntity child. This made some changes in the test bench necessary as well.
Diffstat (limited to 'test/plugins/html')
-rw-r--r-- | test/plugins/html/DemoOutputTest.cpp | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/test/plugins/html/DemoOutputTest.cpp b/test/plugins/html/DemoOutputTest.cpp index d18a314..5668ddc 100644 --- a/test/plugins/html/DemoOutputTest.cpp +++ b/test/plugins/html/DemoOutputTest.cpp @@ -55,7 +55,7 @@ TEST(DemoHTMLTransformer, writeHTML) ASSERT_TRUE(doc != nullptr); #ifdef MANAGER_GRAPHVIZ_EXPORT - // dump the manager state +// dump the manager state // mgr.exportGraphviz("bookDocument.dot"); #endif @@ -93,31 +93,21 @@ TEST(DemoHTMLTransformer, AnnotationProcessing) Rooted<model::StructuredEntity> p = buildStructuredEntity(doc, logger, book, {"paragraph"}); ASSERT_TRUE(p != nullptr); - Rooted<model::AnnotationEntity::Anchor> em_start = - buildAnchor(logger, p, "1"); - ASSERT_TRUE(em_start != nullptr); + Rooted<model::Anchor> em_start{new model::Anchor(mgr, "1", p)}; ASSERT_TRUE(addText(logger, doc, p, "bla")); - Rooted<model::AnnotationEntity::Anchor> strong_start = - buildAnchor(logger, p, "2"); - ASSERT_TRUE(strong_start != nullptr); + Rooted<model::Anchor> strong_start{new model::Anchor(mgr, "2", p)}; ASSERT_TRUE(addText(logger, doc, p, "blub")); - Rooted<model::AnnotationEntity::Anchor> em_end = - buildAnchor(logger, p, "3"); - ASSERT_TRUE(em_end != nullptr); + Rooted<model::Anchor> em_end{new model::Anchor(mgr, "3", p)}; ASSERT_TRUE(addText(logger, doc, p, "bla")); - Rooted<model::AnnotationEntity::Anchor> strong_end = - buildAnchor(logger, p, "4"); - ASSERT_TRUE(strong_end != nullptr); + Rooted<model::Anchor> strong_end{new model::Anchor(mgr, "4", p)}; buildAnnotationEntity(doc, logger, {"emphasized"}, em_start, em_end); buildAnnotationEntity(doc, logger, {"strong"}, strong_start, strong_end); - #ifdef MANAGER_GRAPHVIZ_EXPORT - // dump the manager state +// dump the manager state // mgr.exportGraphviz("annotationDocument.dot"); #endif - // Check serialization. DemoHTMLTransformer transformer; std::stringstream out; |