aboutsummaryrefslogtreecommitdiffstats
path: root/storage/src/tests/distributor
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2022-03-28 10:41:04 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2022-03-28 10:41:04 +0000
commit0ef5980e8551e1684f4c5253ede87dcad887eac1 (patch)
treeab75a3e88c9b76629b3fcc9763c5779eb5a2e1f5 /storage/src/tests/distributor
parent02b5efaa3bbc043e50e2c64b968241f842c3cffc (diff)
Use both lvalue and rvalue specifier to avoid explicit std::move()
Diffstat (limited to 'storage/src/tests/distributor')
-rw-r--r--storage/src/tests/distributor/externaloperationhandlertest.cpp7
-rw-r--r--storage/src/tests/distributor/twophaseupdateoperationtest.cpp8
2 files changed, 6 insertions, 9 deletions
diff --git a/storage/src/tests/distributor/externaloperationhandlertest.cpp b/storage/src/tests/distributor/externaloperationhandlertest.cpp
index c7b50b69779..0e5372043ab 100644
--- a/storage/src/tests/distributor/externaloperationhandlertest.cpp
+++ b/storage/src/tests/distributor/externaloperationhandlertest.cpp
@@ -21,6 +21,9 @@
using document::test::makeDocumentBucket;
using document::DocumentId;
+using document::FieldUpdate;
+using document::StringFieldValue;
+using document::AssignValueUpdate;
using namespace ::testing;
namespace storage::distributor {
@@ -594,9 +597,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(std::make_unique<document::AssignValueUpdate>(document::StringFieldValue("new value")));
- cmd->getUpdate()->addUpdate(std::move(upd));
+ cmd->getUpdate()->addUpdate(FieldUpdate(doc_type->getField("title")).addUpdate(std::make_unique<AssignValueUpdate>(StringFieldValue("new value"))));
ASSERT_NO_FATAL_FAILURE(start_operation_verify_rejected(std::move(cmd)));
EXPECT_EQ("ReturnCode(NO_SPACE, External feed is blocked due to resource exhaustion: full disk)",
diff --git a/storage/src/tests/distributor/twophaseupdateoperationtest.cpp b/storage/src/tests/distributor/twophaseupdateoperationtest.cpp
index df786902965..0e3ce55856b 100644
--- a/storage/src/tests/distributor/twophaseupdateoperationtest.cpp
+++ b/storage/src/tests/distributor/twophaseupdateoperationtest.cpp
@@ -295,9 +295,7 @@ TwoPhaseUpdateOperationTest::sendUpdate(const std::string& bucketState,
update = std::make_shared<document::DocumentUpdate>(
*_repo, *_doc_type,
document::DocumentId("id:ns:" + _doc_type->getName() + "::1"));
- document::FieldUpdate fup(_doc_type->getField("headerval"));
- fup.addUpdate(std::make_unique<ArithmeticValueUpdate>(ArithmeticValueUpdate::Add, 10));
- update->addUpdate(std::move(fup));
+ update->addUpdate(FieldUpdate(_doc_type->getField("headerval")).addUpdate(std::make_unique<ArithmeticValueUpdate>(ArithmeticValueUpdate::Add, 10)));
} else {
// Create an update to a different doctype than the one returned as
// part of the Get. Just a sneaky way to force an eval error.
@@ -305,9 +303,7 @@ TwoPhaseUpdateOperationTest::sendUpdate(const std::string& bucketState,
update = std::make_shared<document::DocumentUpdate>(
*_repo, *badDocType,
document::DocumentId("id:ns:" + _doc_type->getName() + "::1"));
- document::FieldUpdate fup(badDocType->getField("onlyinchild"));
- fup.addUpdate(std::make_unique<ArithmeticValueUpdate>(ArithmeticValueUpdate::Add, 10));
- update->addUpdate(std::move(fup));
+ update->addUpdate(FieldUpdate(badDocType->getField("onlyinchild")).addUpdate(std::make_unique<ArithmeticValueUpdate>(ArithmeticValueUpdate::Add, 10)));
}
update->setCreateIfNonExistent(options._createIfNonExistent);