diff options
Diffstat (limited to 'test/core')
-rw-r--r-- | test/core/model/DocumentTest.cpp | 4 | ||||
-rw-r--r-- | test/core/model/TestAdvanced.hpp | 6 |
2 files changed, 4 insertions, 6 deletions
diff --git a/test/core/model/DocumentTest.cpp b/test/core/model/DocumentTest.cpp index 5acf13f..0c6eea6 100644 --- a/test/core/model/DocumentTest.cpp +++ b/test/core/model/DocumentTest.cpp @@ -269,12 +269,12 @@ TEST(Document, validate) doc->referenceDomain(domain); Rooted<StructuredEntity> root = buildRootStructuredEntity(doc, logger, {"root"}); - Rooted<Anchor> start{new Anchor(mgr, "start", root)}; + Rooted<Anchor> start{new Anchor(mgr, root)}; Rooted<StructuredEntity> child = buildStructuredEntity(doc, logger, root, {"childSub"}); Rooted<DocumentPrimitive> primitive{ new DocumentPrimitive(mgr, child, {2}, "int")}; - Rooted<Anchor> end{new Anchor(mgr, "end", root)}; + Rooted<Anchor> end{new Anchor(mgr, root)}; ASSERT_EQ(ValidationState::UNKNOWN, doc->getValidationState()); ASSERT_TRUE(doc->validate(logger)); // then add an AnnotationEntity without Anchors. diff --git a/test/core/model/TestAdvanced.hpp b/test/core/model/TestAdvanced.hpp index 575860b..27f33cc 100644 --- a/test/core/model/TestAdvanced.hpp +++ b/test/core/model/TestAdvanced.hpp @@ -150,19 +150,17 @@ static bool addHeading(Logger &logger, Handle<Document> doc, return true; } -static int annoIdx = 1; - // Only works for non-overlapping annotations! static bool addAnnotation(Logger &logger, Handle<Document> doc, Handle<StructuredEntity> parent, const std::string &text, const std::string &annoClass) { Manager &mgr = parent->getManager(); - Rooted<Anchor> start{new Anchor(mgr, std::to_string(annoIdx++), parent)}; + Rooted<Anchor> start{new Anchor(mgr, parent)}; if (!addText(logger, doc, parent, text)) { return false; } - Rooted<Anchor> end{new Anchor(mgr, std::to_string(annoIdx++), parent)}; + Rooted<Anchor> end{new Anchor(mgr, parent)}; Rooted<AnnotationEntity> anno = buildAnnotationEntity(doc, logger, {annoClass}, start, end); if (anno.isNull()) { |