summaryrefslogtreecommitdiff
path: root/test/core/model/TestDocument.hpp
diff options
context:
space:
mode:
authorAndreas Stöckel <astoecke@techfak.uni-bielefeld.de>2015-01-04 22:21:52 +0100
committerAndreas Stöckel <andreas@somweyr.de>2015-01-04 22:21:52 +0100
commit0d671f899da720ff5035bdab7adf6b11cbf80cb1 (patch)
tree9839d502ff323198d0f9cb479e9809a978c5c550 /test/core/model/TestDocument.hpp
parent7e1c72a5a5d5dc890a49f79c5daec3edcb38a33b (diff)
parent319ad738f677a20403cc27192f1df7bb65ce8c0e (diff)
Merge branch 'master' of somweyr.de:ousia
Diffstat (limited to 'test/core/model/TestDocument.hpp')
-rw-r--r--test/core/model/TestDocument.hpp26
1 files changed, 18 insertions, 8 deletions
diff --git a/test/core/model/TestDocument.hpp b/test/core/model/TestDocument.hpp
index a1a3434..6b0267a 100644
--- a/test/core/model/TestDocument.hpp
+++ b/test/core/model/TestDocument.hpp
@@ -50,13 +50,18 @@ static Rooted<Document> constructBookDocument(Manager &mgr,
return {nullptr};
}
// Add its text.
- Variant text{std::map<std::string, Variant>{
- {"content", Variant("Some introductory text")}}};
- Rooted<DocumentPrimitive> foreword_text =
- DocumentPrimitive::buildEntity(foreword, text, "text");
+ Rooted<StructuredEntity> foreword_text =
+ StructuredEntity::buildEntity(foreword, {bookDomain}, "text");
if (foreword_text.isNull()) {
return {nullptr};
}
+ // And its primitive content
+ Variant text{"Some introductory text"};
+ Rooted<DocumentPrimitive> foreword_primitive =
+ DocumentPrimitive::buildEntity(foreword_text, text, "content");
+ if (foreword_primitive.isNull()) {
+ return {nullptr};
+ }
// Add a section.
Rooted<StructuredEntity> section =
StructuredEntity::buildEntity(root, {bookDomain}, "section");
@@ -67,13 +72,18 @@ static Rooted<Document> constructBookDocument(Manager &mgr,
return {nullptr};
}
// Add its text.
- text = Variant{std::map<std::string, Variant>{
- {"content", Variant("Some introductory text")}}};
- Rooted<DocumentPrimitive> main_text =
- DocumentPrimitive::buildEntity(foreword, text, "text");
+ Rooted<StructuredEntity> main_text =
+ StructuredEntity::buildEntity(main, {bookDomain}, "text");
if (main_text.isNull()) {
return {nullptr};
}
+ // And its primitive content
+ text = Variant{"Some actual text"};
+ Rooted<DocumentPrimitive> main_primitive =
+ DocumentPrimitive::buildEntity(main_text, text, "content");
+ if (main_primitive.isNull()) {
+ return {nullptr};
+ }
return doc;
}