diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2022-03-28 06:42:13 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2022-03-28 10:08:43 +0000 |
commit | 02b5efaa3bbc043e50e2c64b968241f842c3cffc (patch) | |
tree | b9f9ea83f0dd49656791439322d5ba3d3b6be0b9 /searchcore/src/tests/proton/attribute | |
parent | bb59611ce9611986ee97f19d2bb725dc1d160074 (diff) |
Avoid the need for clone by using unique_ptr.
Diffstat (limited to 'searchcore/src/tests/proton/attribute')
-rw-r--r-- | searchcore/src/tests/proton/attribute/attribute_test.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/searchcore/src/tests/proton/attribute/attribute_test.cpp b/searchcore/src/tests/proton/attribute/attribute_test.cpp index a95d3f7ccca..e64045853d4 100644 --- a/searchcore/src/tests/proton/attribute/attribute_test.cpp +++ b/searchcore/src/tests/proton/attribute/attribute_test.cpp @@ -483,9 +483,9 @@ TEST_F(AttributeWriterTest, handles_update) const document::DocumentType &dt(idb.getDocumentType()); DocumentUpdate upd(*idb.getDocumentTypeRepo(), dt, DocumentId("id:ns:searchdocument::1")); upd.addUpdate(std::move(FieldUpdate(upd.getType().getField("a1")) - .addUpdate(ArithmeticValueUpdate(ArithmeticValueUpdate::Add, 5)))); + .addUpdate(std::make_unique<ArithmeticValueUpdate>(ArithmeticValueUpdate::Add, 5)))); upd.addUpdate(std::move(FieldUpdate(upd.getType().getField("a2")) - .addUpdate(ArithmeticValueUpdate(ArithmeticValueUpdate::Add, 10)))); + .addUpdate(std::make_unique<ArithmeticValueUpdate>(ArithmeticValueUpdate::Add, 10)))); DummyFieldUpdateCallback onUpdate; update(2, upd, 1, onUpdate); @@ -528,7 +528,7 @@ TEST_F(AttributeWriterTest, handles_predicate_update) DocumentUpdate upd(*idb.getDocumentTypeRepo(), dt, DocumentId("id:ns:searchdocument::1")); PredicateFieldValue new_value(builder.feature("foo").value("bar").build()); upd.addUpdate(std::move(FieldUpdate(upd.getType().getField("a1")) - .addUpdate(AssignValueUpdate(new_value)))); + .addUpdate(std::make_unique<AssignValueUpdate>(new_value)))); PredicateIndex &index = static_cast<PredicateAttribute &>(*a1).getIndex(); EXPECT_EQ(1u, index.getZeroConstraintDocs().size()); @@ -729,7 +729,7 @@ TEST_F(AttributeWriterTest, handles_tensor_assign_update) TensorFieldValue new_value(xySparseTensorDataType); new_value = SimpleValue::from_value(*new_tensor); upd.addUpdate(std::move(FieldUpdate(upd.getType().getField("a1")) - .addUpdate(AssignValueUpdate(new_value)))); + .addUpdate(std::make_unique<AssignValueUpdate>(new_value)))); DummyFieldUpdateCallback onUpdate; update(2, upd, 1, onUpdate); EXPECT_EQ(2u, a1->getNumDocs()); @@ -938,7 +938,7 @@ public: TensorDataType tensor_type(vespalib::eval::ValueType::from_spec(dense_tensor)); TensorFieldValue tensor_value(tensor_type); tensor_value= SimpleValue::from_value(*tensor); - upd->addUpdate(std::move(FieldUpdate(upd->getType().getField("a1")).addUpdate(AssignValueUpdate(tensor_value)))); + upd->addUpdate(std::move(FieldUpdate(upd->getType().getField("a1")).addUpdate(std::make_unique<AssignValueUpdate>(tensor_value)))); return upd; } void expect_shared_executor_tasks(size_t exp_accepted_tasks) { |