summaryrefslogtreecommitdiffstats
path: root/searchcore/src/tests/proton/docsummary
diff options
context:
space:
mode:
authorArne H Juul <arnej@yahoo-inc.com>2017-02-22 15:02:04 +0100
committerArne H Juul <arnej@yahoo-inc.com>2017-02-23 10:32:34 +0100
commit7172938674fdc3e8a63218cb9d93036e2963eacd (patch)
tree608689551a2412e9e264537dc7ef295c2c3c24f1 /searchcore/src/tests/proton/docsummary
parent4cff4cef34faff3a5b1f0c51a5852206cb6bee66 (diff)
make useSlimeInsideFields always true
* remove the useSlimeInsideFields argument, it is now always true * remove some now-unused code
Diffstat (limited to 'searchcore/src/tests/proton/docsummary')
-rw-r--r--searchcore/src/tests/proton/docsummary/docsummary.cpp15
-rw-r--r--searchcore/src/tests/proton/docsummary/summaryfieldconverter_test.cpp33
2 files changed, 17 insertions, 31 deletions
diff --git a/searchcore/src/tests/proton/docsummary/docsummary.cpp b/searchcore/src/tests/proton/docsummary/docsummary.cpp
index 3e41873f083..bffc9f9b772 100644
--- a/searchcore/src/tests/proton/docsummary/docsummary.cpp
+++ b/searchcore/src/tests/proton/docsummary/docsummary.cpp
@@ -377,7 +377,7 @@ public:
GeneralResultPtr
Test::getResult(DocumentStoreAdapter & dsa, uint32_t docId)
{
- DocsumStoreValue docsum = dsa.getMappedDocsum(docId, true);
+ DocsumStoreValue docsum = dsa.getMappedDocsum(docId);
ASSERT_TRUE(docsum.pt() != NULL);
GeneralResultPtr retval(new GeneralResult(dsa.getResultClass(),
0, 0, 0));
@@ -573,7 +573,7 @@ Test::requireThatAdapterHandlesMultipleDocuments()
EXPECT_EQUAL(2000u, res->GetEntry("a")->_intval);
}
{ // doc 2
- DocsumStoreValue docsum = dsa.getMappedDocsum(2, true);
+ DocsumStoreValue docsum = dsa.getMappedDocsum(2);
EXPECT_TRUE(docsum.pt() == NULL);
}
{ // doc 0 (again)
@@ -663,10 +663,10 @@ Test::requireThatDocsumRequestIsProcessed()
EXPECT_EQUAL(3u, rep->docsums.size());
EXPECT_EQUAL(2u, rep->docsums[0].docid);
EXPECT_EQUAL(gid2, rep->docsums[0].gid);
- EXPECT_TRUE(assertSlime("{a:20}", *rep, 0, true));
+ EXPECT_TRUE(assertSlime("{a:20}", *rep, 0, false));
EXPECT_EQUAL(4u, rep->docsums[1].docid);
EXPECT_EQUAL(gid4, rep->docsums[1].gid);
- EXPECT_TRUE(assertSlime("{a:40}", *rep, 1, true));
+ EXPECT_TRUE(assertSlime("{a:40}", *rep, 1, false));
EXPECT_EQUAL(search::endDocId, rep->docsums[2].docid);
EXPECT_EQUAL(gid9, rep->docsums[2].gid);
EXPECT_TRUE(rep->docsums[2].data.get() == NULL);
@@ -698,7 +698,7 @@ Test::requireThatRewritersAreUsed()
req.hits.push_back(DocsumRequest::Hit(gid1));
DocsumReply::UP rep = dc._ddb->getDocsums(req);
EXPECT_EQUAL(1u, rep->docsums.size());
- EXPECT_TRUE(assertSlime("{aa:20}", *rep, 0, true));
+ EXPECT_TRUE(assertSlime("{aa:20}", *rep, 0, false));
}
@@ -828,7 +828,7 @@ Test::requireThatAttributesAreUsed()
"bf:[],"
"bg:[],"
"bh:[],"
- "bi:[]}", *rep, 1, true));
+ "bi:[]}", *rep, 1, false));
TEST_DO(assertTensor(Tensor::UP(), "bj", *rep, 1, rclass));
proton::IAttributeManager::SP attributeManager =
@@ -1173,7 +1173,8 @@ Test::requireThatPositionsAreUsed()
"<position x=\"1008\" y=\"1009\" latlong=\"N0.001009;E0.001008\" />'"
",wp2:[{item:1048370,weight:43},{item:1048382,weight:44}]"
",wp2x:'<position x=\"1012\" y=\"1013\" latlong=\"N0.001013;E0.001012\" />"
- "<position x=\"1014\" y=\"1015\" latlong=\"N0.001015;E0.001014\" />'}", *rep, 0, true));
+ "<position x=\"1014\" y=\"1015\" latlong=\"N0.001015;E0.001014\" />'}",
+ *rep, 0, false));
}
diff --git a/searchcore/src/tests/proton/docsummary/summaryfieldconverter_test.cpp b/searchcore/src/tests/proton/docsummary/summaryfieldconverter_test.cpp
index 113113af195..5159f5b6061 100644
--- a/searchcore/src/tests/proton/docsummary/summaryfieldconverter_test.cpp
+++ b/searchcore/src/tests/proton/docsummary/summaryfieldconverter_test.cpp
@@ -432,7 +432,7 @@ T
Test::cvtSummaryAs(bool markup, const FieldValue::UP &fv)
{
ASSERT_TRUE(fv.get() != NULL);
- FieldValue::UP r = SFC::convertSummaryField(markup, *fv, false);
+ FieldValue::UP r = SFC::convertSummaryField(markup, *fv);
return cvtValueAs<T>(r);
}
@@ -487,8 +487,7 @@ void Test::requireThatSummaryIsAnUnmodifiedString() {
setSummaryField("string");
Document summary = makeDocument();
checkString("Foo Bar Baz", SFC::convertSummaryField(false,
- *summary.getValue("string"),
- false).get());
+ *summary.getValue("string")).get());
}
void Test::requireThatAttributeIsAnUnmodifiedString() {
@@ -502,28 +501,18 @@ void Test::requireThatArrayIsFlattenedInSummaryField() {
setSummaryField("string_array");
Document summary = makeDocument();
FieldBlock expect("[\"\\\"foO\\\"\",\"ba\\\\R\"]");
- checkString(expect.json,
- SFC::convertSummaryField(false,
- *summary.getValue("string_array"),
- false).get());
checkData(expect.binary,
SFC::convertSummaryField(false,
- *summary.getValue("string_array"),
- true).get());
+ *summary.getValue("string_array")).get());
}
void Test::requireThatWeightedSetIsFlattenedInSummaryField() {
setSummaryField("string_wset");
Document summary = makeDocument();
FieldBlock expect("[{\"item\":\"\\\"foo\\\"\",\"weight\":2},{\"item\":\"ba\\\\r\",\"weight\":4}]");
- checkString(expect.json,
- SFC::convertSummaryField(false,
- *summary.getValue("string_wset"),
- false).get());
checkData(expect.binary,
SFC::convertSummaryField(false,
- *summary.getValue("string_wset"),
- true).get());
+ *summary.getValue("string_wset")).get());
}
void Test::requireThatPositionsAreTransformedInSummary() {
@@ -672,7 +661,7 @@ Test::requireThatPredicateIsPrinted()
doc.setValue("predicate", PredicateFieldValue(std::move(input)));
checkString("'foo' in ['bar']\n",
- SFC::convertSummaryField(false, *doc.getValue("predicate"), false).get());
+ SFC::convertSummaryField(false, *doc.getValue("predicate")).get());
}
@@ -695,21 +684,17 @@ Test::requireThatTensorIsNotConverted()
TEST_CALL(checkTensor(createTensor({ {{{"x", "4"}, {"y", "5"}}, 7} },
{"x", "y"}),
SFC::convertSummaryField(false,
- *doc.getValue("tensor"),
- true).get()));
+ *doc.getValue("tensor")).get()));
doc.setValue("tensor", TensorFieldValue());
TEST_CALL(checkTensor(Tensor::UP(),
SFC::convertSummaryField(false,
- *doc.getValue("tensor"),
- true).get()));
+ *doc.getValue("tensor")).get()));
}
void Test::checkStringForAllConversions(const string& expected, const FieldValue* fv) {
ASSERT_TRUE(fv != nullptr);
- for (bool use_slime : {true, false}) {
- checkString(expected, SFC::convertSummaryField(false, *fv, use_slime).get());
- }
+ checkString(expected, SFC::convertSummaryField(false, *fv).get());
}
const ReferenceDataType& Test::getAsRefType(const string& name) const {
@@ -751,7 +736,7 @@ void Test::requireThatReferenceInCompositeTypeEmitsSlimeData() {
FieldBlock expect(R"({"inner_ref":"id:ns:target_dummy_document::foo"})");
checkData(expect.binary,
- SFC::convertSummaryField(false, *doc.getValue("nested"), true).get());
+ SFC::convertSummaryField(false, *doc.getValue("nested")).get());
}
} // namespace