diff options
Diffstat (limited to 'src/mongo/db/repl/roll_back_local_operations_test.cpp')
-rw-r--r-- | src/mongo/db/repl/roll_back_local_operations_test.cpp | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/src/mongo/db/repl/roll_back_local_operations_test.cpp b/src/mongo/db/repl/roll_back_local_operations_test.cpp index 87e888a62d0..03abb00dfb2 100644 --- a/src/mongo/db/repl/roll_back_local_operations_test.cpp +++ b/src/mongo/db/repl/roll_back_local_operations_test.cpp @@ -100,7 +100,7 @@ TEST(RollBackLocalOperationsTest, RollbackMultipleLocalOperations) { OplogInterfaceMock localOplog(localOperations); auto i = localOperations.cbegin(); auto rollbackOperation = [&](const BSONObj& operation) { - ASSERT_EQUALS(i->first, operation); + ASSERT_BSONOBJ_EQ(i->first, operation); i++; return Status::OK(); }; @@ -110,7 +110,7 @@ TEST(RollBackLocalOperationsTest, RollbackMultipleLocalOperations) { ASSERT_EQUALS(commonOperation.first["ts"].timestamp(), result.getValue().first); ASSERT_EQUALS(commonOperation.second, result.getValue().second); ASSERT_FALSE(i == localOperations.cend()); - ASSERT_EQUALS(commonOperation.first, i->first); + ASSERT_BSONOBJ_EQ(commonOperation.first, i->first); i++; ASSERT_TRUE(i == localOperations.cend()); } @@ -148,7 +148,7 @@ TEST(RollBackLocalOperationsTest, SkipRemoteOperations) { OplogInterfaceMock localOplog(localOperations); auto i = localOperations.cbegin(); auto rollbackOperation = [&](const BSONObj& operation) { - ASSERT_EQUALS(i->first, operation); + ASSERT_BSONOBJ_EQ(i->first, operation); i++; return Status::OK(); }; @@ -168,7 +168,7 @@ TEST(RollBackLocalOperationsTest, SkipRemoteOperations) { ASSERT_EQUALS(commonOperation.first["ts"].timestamp(), result.getValue().first); ASSERT_EQUALS(commonOperation.second, result.getValue().second); ASSERT_FALSE(i == localOperations.cend()); - ASSERT_EQUALS(commonOperation.first, i->first); + ASSERT_BSONOBJ_EQ(commonOperation.first, i->first); i++; ASSERT_TRUE(i == localOperations.cend()); } @@ -181,7 +181,7 @@ TEST(RollBackLocalOperationsTest, SameTimestampDifferentHashess) { OplogInterfaceMock localOplog(localOperations); auto i = localOperations.cbegin(); auto rollbackOperation = [&](const BSONObj& operation) { - ASSERT_EQUALS(i->first, operation); + ASSERT_BSONOBJ_EQ(i->first, operation); i++; return Status::OK(); }; @@ -201,7 +201,7 @@ TEST(RollBackLocalOperationsTest, SameTimestampDifferentHashess) { ASSERT_EQUALS(commonOperation.first["ts"].timestamp(), result.getValue().first); ASSERT_EQUALS(commonOperation.second, result.getValue().second); ASSERT_FALSE(i == localOperations.cend()); - ASSERT_EQUALS(commonOperation.first, i->first); + ASSERT_BSONOBJ_EQ(commonOperation.first, i->first); i++; ASSERT_TRUE(i == localOperations.cend()); } @@ -266,7 +266,7 @@ TEST(SyncRollBackLocalOperationsTest, RollbackTwoOperations) { auto result = syncRollBackLocalOperations(OplogInterfaceMock(localOperations), OplogInterfaceMock({commonOperation}), [&](const BSONObj& operation) { - ASSERT_EQUALS(i->first, operation); + ASSERT_BSONOBJ_EQ(i->first, operation); i++; return Status::OK(); }); @@ -274,7 +274,7 @@ TEST(SyncRollBackLocalOperationsTest, RollbackTwoOperations) { ASSERT_EQUALS(commonOperation.first["ts"].timestamp(), result.getValue().first); ASSERT_EQUALS(commonOperation.second, result.getValue().second); ASSERT_FALSE(i == localOperations.cend()); - ASSERT_EQUALS(commonOperation.first, i->first); + ASSERT_BSONOBJ_EQ(commonOperation.first, i->first); i++; ASSERT_TRUE(i == localOperations.cend()); } @@ -303,7 +303,7 @@ TEST(SyncRollBackLocalOperationsTest, SameTimestampDifferentHashes) { syncRollBackLocalOperations(OplogInterfaceMock({localOperation, commonOperation}), OplogInterfaceMock({remoteOperation, commonOperation}), [&](const BSONObj& operation) { - ASSERT_EQUALS(localOperation.first, operation); + ASSERT_BSONOBJ_EQ(localOperation.first, operation); called = true; return Status::OK(); }); @@ -322,7 +322,7 @@ TEST(SyncRollBackLocalOperationsTest, SameTimestampEndOfLocalOplog) { syncRollBackLocalOperations(OplogInterfaceMock({localOperation}), OplogInterfaceMock({remoteOperation, commonOperation}), [&](const BSONObj& operation) { - ASSERT_EQUALS(localOperation.first, operation); + ASSERT_BSONOBJ_EQ(localOperation.first, operation); called = true; return Status::OK(); }); @@ -348,13 +348,14 @@ TEST(SyncRollBackLocalOperationsTest, SameTimestampEndOfRemoteOplog) { auto localOperation = makeOpAndRecordId(1, 2); auto remoteOperation = makeOpAndRecordId(1, 3); bool called = false; - auto result = syncRollBackLocalOperations(OplogInterfaceMock({localOperation, commonOperation}), - OplogInterfaceMock({remoteOperation}), - [&](const BSONObj& operation) { - ASSERT_EQUALS(localOperation.first, operation); - called = true; - return Status::OK(); - }); + auto result = + syncRollBackLocalOperations(OplogInterfaceMock({localOperation, commonOperation}), + OplogInterfaceMock({remoteOperation}), + [&](const BSONObj& operation) { + ASSERT_BSONOBJ_EQ(localOperation.first, operation); + called = true; + return Status::OK(); + }); ASSERT_EQUALS(ErrorCodes::NoMatchingDocument, result.getStatus().code()); ASSERT_STRING_CONTAINS(result.getStatus().reason(), "RS100 reached beginning of remote oplog"); ASSERT_TRUE(called); @@ -369,7 +370,7 @@ TEST(SyncRollBackLocalOperationsTest, DifferentTimestampEndOfLocalOplog) { syncRollBackLocalOperations(OplogInterfaceMock({localOperation}), OplogInterfaceMock({remoteOperation, commonOperation}), [&](const BSONObj& operation) { - ASSERT_EQUALS(localOperation.first, operation); + ASSERT_BSONOBJ_EQ(localOperation.first, operation); called = true; return Status::OK(); }); |