summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/core/model/TestDocumentBuilder.hpp8
-rw-r--r--test/plugins/html/DemoOutputTest.cpp7
2 files changed, 15 insertions, 0 deletions
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<StructuredEntity> 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<StructuredEntity> entity{new StructuredEntity(
parent->getManager(), parent, descriptor.cast<StructuredClass>(),
@@ -283,6 +287,10 @@ Rooted<AnnotationEntity> 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<AnnotationEntity> anno{new AnnotationEntity(
document->getManager(), document, descriptor.cast<AnnotationClass>(),
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;