From a1245cf2ad80cba0a71ffb184966ee77a7e166cc Mon Sep 17 00:00:00 2001 From: Benjamin Paassen Date: Thu, 15 Jan 2015 14:18:07 +0100 Subject: 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. --- test/plugins/html/DemoOutputTest.cpp | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) (limited to 'test/plugins/html/DemoOutputTest.cpp') 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 p = buildStructuredEntity(doc, logger, book, {"paragraph"}); ASSERT_TRUE(p != nullptr); - Rooted em_start = - buildAnchor(logger, p, "1"); - ASSERT_TRUE(em_start != nullptr); + Rooted em_start{new model::Anchor(mgr, "1", p)}; ASSERT_TRUE(addText(logger, doc, p, "bla")); - Rooted strong_start = - buildAnchor(logger, p, "2"); - ASSERT_TRUE(strong_start != nullptr); + Rooted strong_start{new model::Anchor(mgr, "2", p)}; ASSERT_TRUE(addText(logger, doc, p, "blub")); - Rooted em_end = - buildAnchor(logger, p, "3"); - ASSERT_TRUE(em_end != nullptr); + Rooted em_end{new model::Anchor(mgr, "3", p)}; ASSERT_TRUE(addText(logger, doc, p, "bla")); - Rooted strong_end = - buildAnchor(logger, p, "4"); - ASSERT_TRUE(strong_end != nullptr); + Rooted 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; -- cgit v1.2.3