summaryrefslogtreecommitdiffstats
path: root/searchcore
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2022-03-29 13:51:55 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2022-03-29 13:51:55 +0000
commit11f15ddddb70427d1b571d76ca6ef734a1f15a0f (patch)
tree8a65f6fe9c47acefce648e5cdd1a91cfa832c569 /searchcore
parent1cd2c6a3ba9e392c00b91bfe3cf1215a80c6679f (diff)
Minor simplifications after PR feedback.
Diffstat (limited to 'searchcore')
-rw-r--r--searchcore/src/tests/proton/common/attribute_updater/attribute_updater_test.cpp12
-rw-r--r--searchcore/src/tests/proton/documentdb/feedhandler/feedhandler_test.cpp2
-rw-r--r--searchcore/src/tests/proton/feedoperation/feedoperation_test.cpp2
3 files changed, 8 insertions, 8 deletions
diff --git a/searchcore/src/tests/proton/common/attribute_updater/attribute_updater_test.cpp b/searchcore/src/tests/proton/common/attribute_updater/attribute_updater_test.cpp
index d2897216ea2..8fa5c2994b0 100644
--- a/searchcore/src/tests/proton/common/attribute_updater/attribute_updater_test.cpp
+++ b/searchcore/src/tests/proton/common/attribute_updater/attribute_updater_test.cpp
@@ -226,7 +226,7 @@ TEST_F("require that single attributes are updated", Fixture)
{
BasicType bt(BasicType::STRING);
AttributePtr vec = create<std::string, StringAttribute>(3, "first", 0, "in1/string",Config(bt, ct));
- f.applyValueUpdate(*vec, 0, std::make_unique<AssignValueUpdate>(std::make_unique<StringFieldValue>("second")));
+ f.applyValueUpdate(*vec, 0, std::make_unique<AssignValueUpdate>(StringFieldValue::make("second")));
f.applyValueUpdate(*vec, 2, std::make_unique<ClearValueUpdate>());
EXPECT_EQUAL(3u, vec->getNumDocs());
EXPECT_TRUE(check(vec, 0, std::vector<WeightedString>{WeightedString("second")}));
@@ -293,8 +293,8 @@ TEST_F("require that array attributes are updated", Fixture)
{
BasicType bt(BasicType::STRING);
AttributePtr vec = create<std::string, StringAttribute>(5, "first", 1, "in1/astring", Config(bt, ct));
- auto first = std::make_unique<StringFieldValue>("first");
- auto second = std::make_unique<StringFieldValue>("second");
+ auto first = StringFieldValue::make("first");
+ auto second = StringFieldValue::make("second");
auto assign = std::make_unique<ArrayFieldValue>(f.docType->getField("astring").getDataType());
assign->add(*second);
f.applyArrayUpdates(*vec, std::move(assign), std::move(first), std::move(second));
@@ -348,9 +348,9 @@ TEST_F("require that weighted set attributes are updated", Fixture)
{
BasicType bt(BasicType::STRING);
AttributePtr vec = create<std::string, StringAttribute>(5, "first", 100, "in1/wsstring", Config(bt, ct));
- auto first = std::make_unique<StringFieldValue>("first");
- auto copyOfFirst = std::make_unique<StringFieldValue>("first");
- auto second = std::make_unique<StringFieldValue>("second");
+ auto first = StringFieldValue::make("first");
+ auto copyOfFirst = StringFieldValue::make("first");
+ auto second = StringFieldValue::make("second");
auto assign = std::make_unique<WeightedSetFieldValue>(f.docType->getField("wsstring").getDataType());
assign->add(*second, 20);
f.applyWeightedSetUpdates(*vec, std::move(assign), std::move(first), std::move(copyOfFirst), std::move(second));
diff --git a/searchcore/src/tests/proton/documentdb/feedhandler/feedhandler_test.cpp b/searchcore/src/tests/proton/documentdb/feedhandler/feedhandler_test.cpp
index 94595f0efc7..8b20d448a2a 100644
--- a/searchcore/src/tests/proton/documentdb/feedhandler/feedhandler_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/feedhandler/feedhandler_test.cpp
@@ -774,7 +774,7 @@ TEST_F("require that all value updates will be inspected before rejected", Schem
EXPECT_FALSE(FeedRejectHelper::mustReject(*docUpdate));
docUpdate->addUpdate(std::move(FieldUpdate(docType->getField("i1")).addUpdate(std::make_unique<ClearValueUpdate>())));
EXPECT_FALSE(FeedRejectHelper::mustReject(*docUpdate));
- docUpdate->addUpdate(std::move(FieldUpdate(docType->getField("i1")).addUpdate(std::make_unique<AssignValueUpdate>(std::make_unique<StringFieldValue>()))));
+ docUpdate->addUpdate(std::move(FieldUpdate(docType->getField("i1")).addUpdate(std::make_unique<AssignValueUpdate>(StringFieldValue::make()))));
EXPECT_TRUE(FeedRejectHelper::mustReject(*docUpdate));
}
diff --git a/searchcore/src/tests/proton/feedoperation/feedoperation_test.cpp b/searchcore/src/tests/proton/feedoperation/feedoperation_test.cpp
index dea3a3e69a6..039524a237c 100644
--- a/searchcore/src/tests/proton/feedoperation/feedoperation_test.cpp
+++ b/searchcore/src/tests/proton/feedoperation/feedoperation_test.cpp
@@ -122,7 +122,7 @@ public:
auto makeUpdate() {
auto upd(std::make_shared<DocumentUpdate>(*_repo, _docType, docId));
upd->addUpdate(FieldUpdate(upd->getType().getField("string")).
- addUpdate(std::make_unique<AssignValueUpdate>(std::make_unique<StringFieldValue>("newval"))));
+ addUpdate(std::make_unique<AssignValueUpdate>(StringFieldValue::make("newval"))));
return upd;
}
auto makeDoc() {