summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAllison Easton <allison.easton@mongodb.com>2022-08-31 06:54:18 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-08-31 07:32:19 +0000
commit6ffbe0d149bf9419b227a0fa80928437c92ed8c5 (patch)
tree81640ab197afcc44a52ab8bb375ce020ff44f0a9
parent2171665abd7d04153bb63e248ce1732aa299d968 (diff)
downloadmongo-6ffbe0d149bf9419b227a0fa80928437c92ed8c5.tar.gz
SERVER-69245 Fix compilation of unittests with C++20
-rw-r--r--src/mongo/db/s/operation_sharding_state_test.cpp22
-rw-r--r--src/mongo/s/write_ops/batched_command_response_test.cpp2
2 files changed, 11 insertions, 13 deletions
diff --git a/src/mongo/db/s/operation_sharding_state_test.cpp b/src/mongo/db/s/operation_sharding_state_test.cpp
index a85ebdde57a..837a65c64dc 100644
--- a/src/mongo/db/s/operation_sharding_state_test.cpp
+++ b/src/mongo/db/s/operation_sharding_state_test.cpp
@@ -47,9 +47,8 @@ TEST_F(OperationShardingStateTest, ScopedSetShardRoleDbVersion) {
}
TEST_F(OperationShardingStateTest, ScopedSetShardRoleShardVersion) {
- ChunkVersion shardVersion({OID::gen(), Timestamp(1, 0)}, {1, 0});
- ScopedSetShardRole scopedSetShardRole(
- operationContext(), kNss, ShardVersion(shardVersion), boost::none);
+ ShardVersion shardVersion(ChunkVersion({OID::gen(), Timestamp(1, 0)}, {1, 0}));
+ ScopedSetShardRole scopedSetShardRole(operationContext(), kNss, shardVersion, boost::none);
auto& oss = OperationShardingState::get(operationContext());
ASSERT_EQ(shardVersion, *oss.getShardVersion(kNss));
@@ -59,27 +58,26 @@ TEST_F(OperationShardingStateTest, ScopedSetShardRoleChangeShardVersionSameNames
auto& oss = OperationShardingState::get(operationContext());
{
- ChunkVersion shardVersion1({OID::gen(), Timestamp(10, 0)}, {1, 0});
+ ShardVersion shardVersion1(ChunkVersion({OID::gen(), Timestamp(10, 0)}, {1, 0}));
ScopedSetShardRole scopedSetShardRole1(
- operationContext(), kNss, ShardVersion(shardVersion1), boost::none);
+ operationContext(), kNss, shardVersion1, boost::none);
ASSERT_EQ(shardVersion1, *oss.getShardVersion(kNss));
}
{
- ChunkVersion shardVersion2({OID::gen(), Timestamp(20, 0)}, {1, 0});
+ ShardVersion shardVersion2(ChunkVersion({OID::gen(), Timestamp(20, 0)}, {1, 0}));
ScopedSetShardRole scopedSetShardRole2(
- operationContext(), kNss, ShardVersion(shardVersion2), boost::none);
+ operationContext(), kNss, shardVersion2, boost::none);
ASSERT_EQ(shardVersion2, *oss.getShardVersion(kNss));
}
}
TEST_F(OperationShardingStateTest, ScopedSetShardRoleRecursiveShardVersionDifferentNamespaces) {
- ChunkVersion shardVersion1({OID::gen(), Timestamp(10, 0)}, {1, 0});
- ChunkVersion shardVersion2({OID::gen(), Timestamp(20, 0)}, {1, 0});
+ ShardVersion shardVersion1(ChunkVersion({OID::gen(), Timestamp(10, 0)}, {1, 0}));
+ ShardVersion shardVersion2(ChunkVersion({OID::gen(), Timestamp(20, 0)}, {1, 0}));
- ScopedSetShardRole scopedSetShardRole1(
- operationContext(), kNss, ShardVersion(shardVersion1), boost::none);
+ ScopedSetShardRole scopedSetShardRole1(operationContext(), kNss, shardVersion1, boost::none);
ScopedSetShardRole scopedSetShardRole2(
- operationContext(), kAnotherNss, ShardVersion(shardVersion2), boost::none);
+ operationContext(), kAnotherNss, shardVersion2, boost::none);
auto& oss = OperationShardingState::get(operationContext());
ASSERT_EQ(shardVersion1, *oss.getShardVersion(kNss));
diff --git a/src/mongo/s/write_ops/batched_command_response_test.cpp b/src/mongo/s/write_ops/batched_command_response_test.cpp
index c36f734a193..757961a5348 100644
--- a/src/mongo/s/write_ops/batched_command_response_test.cpp
+++ b/src/mongo/s/write_ops/batched_command_response_test.cpp
@@ -156,7 +156,7 @@ TEST(BatchedCommandResponseTest, TooManyBigErrors) {
}
TEST(BatchedCommandResponseTest, CompatibilityFromWriteErrorToBatchCommandResponse) {
- ChunkVersion versionReceived({OID::gen(), Timestamp(2, 0)}, {1, 0});
+ ShardVersion versionReceived(ChunkVersion({OID::gen(), Timestamp(2, 0)}, {1, 0}));
write_ops::UpdateCommandReply reply;
reply.getWriteCommandReplyBase().setN(1);