aboutsummaryrefslogtreecommitdiffstats
path: root/document/src/tests/fieldsettest.cpp
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2020-08-04 07:25:45 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2020-08-04 12:14:17 +0000
commitbdc43e2dda007965b770cd0a778d6a2f2634d276 (patch)
tree990cb7bd1babbc9c3b9d77e880c290ed383afb16 /document/src/tests/fieldsettest.cpp
parentbd3399a2677b32888ef2588adf1c976ed4cdb5cb (diff)
Remove the unused [header] and [body] fieldsets to simplify backend optimization during get.
Diffstat (limited to 'document/src/tests/fieldsettest.cpp')
-rw-r--r--document/src/tests/fieldsettest.cpp31
1 files changed, 1 insertions, 30 deletions
diff --git a/document/src/tests/fieldsettest.cpp b/document/src/tests/fieldsettest.cpp
index b0cad61b72a..f77bd9bfb09 100644
--- a/document/src/tests/fieldsettest.cpp
+++ b/document/src/tests/fieldsettest.cpp
@@ -43,8 +43,6 @@ TEST_F(FieldSetTest, testParsing)
(void) dynamic_cast<AllFields&>(*repo.parse(docRepo, "[all]"));
(void) dynamic_cast<NoFields&>(*repo.parse(docRepo, "[none]"));
(void) dynamic_cast<DocIdOnly&>(*repo.parse(docRepo, "[id]"));
- (void) dynamic_cast<HeaderFields&>(*repo.parse(docRepo, "[header]"));
- (void) dynamic_cast<BodyFields&>(*repo.parse(docRepo, "[body]"));
FieldSet::UP set = repo.parse(docRepo, "testdoctype1:headerval,content");
FieldCollection& coll = dynamic_cast<FieldCollection&>(*set);
@@ -88,13 +86,10 @@ TEST_F(FieldSetTest, testContains)
const DocumentType& type = *repo.getDocumentType("testdoctype1");
const Field& headerField = type.getField("headerval");
- const Field& bodyField = type.getField("content");
NoFields none;
AllFields all;
DocIdOnly id;
- HeaderFields h;
- BodyFields b;
EXPECT_EQ(false, headerField.contains(type.getField("headerlongval")));
EXPECT_EQ(true, headerField.contains(headerField));
@@ -109,17 +104,7 @@ TEST_F(FieldSetTest, testContains)
EXPECT_EQ(false, none.contains(id));
EXPECT_EQ(true, id.contains(none));
- EXPECT_EQ(true, h.contains(headerField));
- EXPECT_EQ(false, h.contains(bodyField));
-
- EXPECT_EQ(false, b.contains(headerField));
- EXPECT_EQ(true, b.contains(bodyField));
-
FieldSetRepo r;
- EXPECT_EQ(true, checkContains(r, repo, "[body]",
- "testdoctype1:content"));
- EXPECT_EQ(false, checkContains(r, repo, "[header]",
- "testdoctype1:content"));
EXPECT_EQ(true, checkContains(r, repo,
"testdoctype1:content,headerval",
"testdoctype1:content"));
@@ -209,13 +194,8 @@ TEST_F(FieldSetTest, testCopyDocumentFields)
const DocumentTypeRepo& repo = testDocMan.getTypeRepo();
Document::UP src(createTestDocument(testDocMan));
- EXPECT_EQ(std::string("content: megafoo megabar\n"),
- doCopyFields(*src, repo, "[body]"));
EXPECT_EQ(std::string(""),
doCopyFields(*src, repo, "[none]"));
- EXPECT_EQ(std::string("headerval: 5678\n"
- "hstringval: hello fantastic world\n"),
- doCopyFields(*src, repo, "[header]"));
EXPECT_EQ(std::string("content: megafoo megabar\n"
"headerval: 5678\n"
"hstringval: hello fantastic world\n"),
@@ -228,7 +208,7 @@ TEST_F(FieldSetTest, testCopyDocumentFields)
Document dest(src->getType(), DocumentId("id:ns:" + src->getType().getName() + "::bar"));
dest.setValue(dest.getField("content"), StringFieldValue("overwriteme"));
EXPECT_EQ(std::string("content: megafoo megabar\n"),
- doCopyFields(*src, repo, "[body]", &dest));
+ doCopyFields(*src, repo, src->getType().getName() + ":content", &dest));
}
}
@@ -263,8 +243,6 @@ TEST_F(FieldSetTest, testDocumentSubsetCopy)
const char* fieldSets[] = {
"[all]",
"[none]",
- "[header]",
- "[body]",
"testdoctype1:hstringval,content"
};
for (size_t i = 0; i < sizeof(fieldSets) / sizeof(fieldSets[0]); ++i) {
@@ -281,9 +259,7 @@ TEST_F(FieldSetTest, testSerialize)
const char* fieldSets[] = {
"[all]",
"[none]",
- "[header]",
"[docid]",
- "[body]",
"testdoctype1:content",
"testdoctype1:content,hstringval"
};
@@ -301,15 +277,10 @@ TEST_F(FieldSetTest, testStripFields)
const DocumentTypeRepo& repo = testDocMan.getTypeRepo();
Document::UP src(createTestDocument(testDocMan));
- EXPECT_EQ(std::string("content: megafoo megabar\n"),
- doStripFields(*src, repo, "[body]"));
EXPECT_EQ(std::string(""),
doStripFields(*src, repo, "[none]"));
EXPECT_EQ(std::string(""),
doStripFields(*src, repo, "[id]"));
- EXPECT_EQ(std::string("headerval: 5678\n"
- "hstringval: hello fantastic world\n"),
- doStripFields(*src, repo, "[header]"));
EXPECT_EQ(std::string("content: megafoo megabar\n"
"headerval: 5678\n"
"hstringval: hello fantastic world\n"),