summaryrefslogtreecommitdiff
path: root/test/core/model
diff options
context:
space:
mode:
Diffstat (limited to 'test/core/model')
-rw-r--r--test/core/model/DocumentTest.cpp18
-rw-r--r--test/core/model/TestAdvanced.hpp2
-rw-r--r--test/core/model/TestDocument.hpp4
-rw-r--r--test/core/model/TestDomain.hpp4
4 files changed, 14 insertions, 14 deletions
diff --git a/test/core/model/DocumentTest.cpp b/test/core/model/DocumentTest.cpp
index 177f69b..a692f73 100644
--- a/test/core/model/DocumentTest.cpp
+++ b/test/core/model/DocumentTest.cpp
@@ -65,11 +65,11 @@ TEST(Document, construct)
foreword->getField()[0].cast<StructuredEntity>();
ASSERT_FALSE(text.isNull());
ASSERT_EQ("text", text->getDescriptor()->getName());
- ASSERT_TRUE(text->hasField("content"));
- ASSERT_EQ(1U, text->getField("content").size());
+ ASSERT_TRUE(text->hasField());
+ ASSERT_EQ(1U, text->getField().size());
ASSERT_TRUE(
- text->getField("content")[0]->isa(typeOf<DocumentPrimitive>()));
- Variant content = text->getField("content")[0]
+ text->getField()[0]->isa(typeOf<DocumentPrimitive>()));
+ Variant content = text->getField()[0]
.cast<DocumentPrimitive>()
->getContent();
ASSERT_EQ("Some introductory text", content.asString());
@@ -99,11 +99,11 @@ TEST(Document, construct)
par->getField()[0].cast<StructuredEntity>();
ASSERT_FALSE(text.isNull());
ASSERT_EQ("text", text->getDescriptor()->getName());
- ASSERT_TRUE(text->hasField("content"));
- ASSERT_EQ(1U, text->getField("content").size());
- ASSERT_TRUE(text->getField("content")[0]->isa(
+ ASSERT_TRUE(text->hasField());
+ ASSERT_EQ(1U, text->getField().size());
+ ASSERT_TRUE(text->getField()[0]->isa(
typeOf<DocumentPrimitive>()));
- Variant content = text->getField("content")[0]
+ Variant content = text->getField()[0]
.cast<DocumentPrimitive>()
->getContent();
ASSERT_EQ("Some actual text", content.asString());
@@ -296,7 +296,7 @@ TEST(Document, validate)
new Attribute{mgr, "myAttr", sys->getStringType(), "default"},
logger);
// the right map content should be valid now.
- child->setAttributes(Variant::mapType{{"myAttr", "content"}});
+ child->setAttributes(Variant::mapType{{"myAttr", "bla"}});
ASSERT_EQ(ValidationState::UNKNOWN, doc->getValidationState());
ASSERT_TRUE(doc->validate(logger));
// but an empty map as well
diff --git a/test/core/model/TestAdvanced.hpp b/test/core/model/TestAdvanced.hpp
index 56738af..5c709f0 100644
--- a/test/core/model/TestAdvanced.hpp
+++ b/test/core/model/TestAdvanced.hpp
@@ -130,7 +130,7 @@ static bool addText(Logger &logger, Handle<Document> doc,
// And the primitive content
Variant content_var{content.c_str()};
Rooted<DocumentPrimitive> primitive{new DocumentPrimitive(
- parent->getManager(), text, content_var, "content")};
+ parent->getManager(), text, content_var, DEFAULT_FIELD_NAME)};
return true;
}
diff --git a/test/core/model/TestDocument.hpp b/test/core/model/TestDocument.hpp
index 0cb52a3..7675dab 100644
--- a/test/core/model/TestDocument.hpp
+++ b/test/core/model/TestDocument.hpp
@@ -60,7 +60,7 @@ static Rooted<Document> constructBookDocument(Manager &mgr, Logger &logger,
// And its primitive content
Variant text{"Some introductory text"};
Rooted<DocumentPrimitive> foreword_primitive{
- new DocumentPrimitive(mgr, foreword_text, text, "content")};
+ new DocumentPrimitive(mgr, foreword_text, text, DEFAULT_FIELD_NAME)};
// Add a section.
Rooted<StructuredEntity> section =
buildStructuredEntity(doc, logger, root, {"section"});
@@ -79,7 +79,7 @@ static Rooted<Document> constructBookDocument(Manager &mgr, Logger &logger,
// And its primitive content
text = Variant{"Some actual text"};
Rooted<DocumentPrimitive> main_primitive{
- new DocumentPrimitive(mgr, main_text, text, "content")};
+ new DocumentPrimitive(mgr, main_text, text, DEFAULT_FIELD_NAME)};
if (main_primitive.isNull()) {
return {nullptr};
}
diff --git a/test/core/model/TestDomain.hpp b/test/core/model/TestDomain.hpp
index 8b572a8..5ac510c 100644
--- a/test/core/model/TestDomain.hpp
+++ b/test/core/model/TestDomain.hpp
@@ -81,8 +81,8 @@ static Rooted<Domain> constructBookDomain(Manager &mgr,
// ... and has a primitive field.
Rooted<FieldDescriptor> text_field{new FieldDescriptor(
- mgr, text, domain->getTypesystems()[0]->getTypes()[0], "content",
- false)};
+ mgr, text, domain->getTypesystems()[0]->getTypes()[0],
+ DEFAULT_FIELD_NAME, false)};
return domain;
}