From 9d89642e2bc33b8630e92d8b5a0e6d4116040897 Mon Sep 17 00:00:00 2001 From: Benjamin Paassen Date: Mon, 12 Jan 2015 15:59:46 +0100 Subject: some further trials to solve the issue of segfault in HTML test, but failed. --- test/core/model/TestDocumentBuilder.hpp | 8 ++++++++ test/plugins/html/DemoOutputTest.cpp | 7 +++++++ 2 files changed, 15 insertions(+) (limited to 'test') diff --git a/test/core/model/TestDocumentBuilder.hpp b/test/core/model/TestDocumentBuilder.hpp index a1c8dde..a09b081 100644 --- a/test/core/model/TestDocumentBuilder.hpp +++ b/test/core/model/TestDocumentBuilder.hpp @@ -155,6 +155,10 @@ Rooted buildStructuredEntity( if (descriptor == nullptr) { return {nullptr}; } + if(!descriptor->isa(RttiTypes::StructuredClass)){ + return {nullptr}; + logger.error("The descriptor was not an AnnotationClass!"); + } // Then construct the StructuredEntity itself. Rooted entity{new StructuredEntity( parent->getManager(), parent, descriptor.cast(), @@ -283,6 +287,10 @@ Rooted buildAnnotationEntity( if (descriptor == nullptr) { return {nullptr}; } + if(!descriptor->isa(RttiTypes::AnnotationClass)){ + return {nullptr}; + logger.error("The descriptor was not an AnnotationClass!"); + } // Then construct the AnnotationEntity itself Rooted anno{new AnnotationEntity( document->getManager(), document, descriptor.cast(), diff --git a/test/plugins/html/DemoOutputTest.cpp b/test/plugins/html/DemoOutputTest.cpp index 9d1949e..d496811 100644 --- a/test/plugins/html/DemoOutputTest.cpp +++ b/test/plugins/html/DemoOutputTest.cpp @@ -111,6 +111,13 @@ TEST(DemoHTMLTransformer, AnnotationProcessing) buildAnnotationEntity(doc, logger, {"emphasized"}, em_start, em_end); buildAnnotationEntity(doc, logger, {"strong"}, strong_start, strong_end); + +#ifdef MANAGER_GRAPHVIZ_EXPORT + // dump the manager state + mgr.exportGraphviz("build/annotationDocument.dot"); +#endif + + // Check serialization. DemoHTMLTransformer transformer; std::stringstream out; -- cgit v1.2.3