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 /storage/src/tests/distributor | |
parent | bb59611ce9611986ee97f19d2bb725dc1d160074 (diff) |
Avoid the need for clone by using unique_ptr.
Diffstat (limited to 'storage/src/tests/distributor')
-rw-r--r-- | storage/src/tests/distributor/externaloperationhandlertest.cpp | 2 | ||||
-rw-r--r-- | storage/src/tests/distributor/twophaseupdateoperationtest.cpp | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/storage/src/tests/distributor/externaloperationhandlertest.cpp b/storage/src/tests/distributor/externaloperationhandlertest.cpp index 5aa5845ac4c..c7b50b69779 100644 --- a/storage/src/tests/distributor/externaloperationhandlertest.cpp +++ b/storage/src/tests/distributor/externaloperationhandlertest.cpp @@ -595,7 +595,7 @@ TEST_F(ExternalOperationHandlerTest, non_trivial_updates_are_rejected_if_feed_is auto cmd = makeUpdateCommand("testdoctype1", "id:foo:testdoctype1::foo"); const auto* doc_type = _testDocMan.getTypeRepo().getDocumentType("testdoctype1"); document::FieldUpdate upd(doc_type->getField("title")); - upd.addUpdate(document::AssignValueUpdate(document::StringFieldValue("new value"))); + upd.addUpdate(std::make_unique<document::AssignValueUpdate>(document::StringFieldValue("new value"))); cmd->getUpdate()->addUpdate(std::move(upd)); ASSERT_NO_FATAL_FAILURE(start_operation_verify_rejected(std::move(cmd))); diff --git a/storage/src/tests/distributor/twophaseupdateoperationtest.cpp b/storage/src/tests/distributor/twophaseupdateoperationtest.cpp index 7a7e53a1d2c..df786902965 100644 --- a/storage/src/tests/distributor/twophaseupdateoperationtest.cpp +++ b/storage/src/tests/distributor/twophaseupdateoperationtest.cpp @@ -296,7 +296,7 @@ TwoPhaseUpdateOperationTest::sendUpdate(const std::string& bucketState, *_repo, *_doc_type, document::DocumentId("id:ns:" + _doc_type->getName() + "::1")); document::FieldUpdate fup(_doc_type->getField("headerval")); - fup.addUpdate(ArithmeticValueUpdate(ArithmeticValueUpdate::Add, 10)); + fup.addUpdate(std::make_unique<ArithmeticValueUpdate>(ArithmeticValueUpdate::Add, 10)); update->addUpdate(std::move(fup)); } else { // Create an update to a different doctype than the one returned as @@ -306,7 +306,7 @@ TwoPhaseUpdateOperationTest::sendUpdate(const std::string& bucketState, *_repo, *badDocType, document::DocumentId("id:ns:" + _doc_type->getName() + "::1")); document::FieldUpdate fup(badDocType->getField("onlyinchild")); - fup.addUpdate(ArithmeticValueUpdate(ArithmeticValueUpdate::Add, 10)); + fup.addUpdate(std::make_unique<ArithmeticValueUpdate>(ArithmeticValueUpdate::Add, 10)); update->addUpdate(std::move(fup)); } update->setCreateIfNonExistent(options._createIfNonExistent); |