summaryrefslogtreecommitdiff
path: root/src/mongo/db/repl/oplog_buffer_collection_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/repl/oplog_buffer_collection_test.cpp')
-rw-r--r--src/mongo/db/repl/oplog_buffer_collection_test.cpp41
1 files changed, 29 insertions, 12 deletions
diff --git a/src/mongo/db/repl/oplog_buffer_collection_test.cpp b/src/mongo/db/repl/oplog_buffer_collection_test.cpp
index d50f214dfb9..ca8582fc754 100644
--- a/src/mongo/db/repl/oplog_buffer_collection_test.cpp
+++ b/src/mongo/db/repl/oplog_buffer_collection_test.cpp
@@ -118,12 +118,9 @@ NamespaceString makeNamespace(const T& t, const char* suffix = "") {
BSONObj makeOplogEntry(int t) {
return BSON("ts" << Timestamp(t, t) << "ns"
<< "a.a"
- << "v"
- << 2
- << "op"
+ << "v" << 2 << "op"
<< "i"
- << "o"
- << BSON("_id" << t << "a" << t));
+ << "o" << BSON("_id" << t << "a" << t));
}
TEST_F(OplogBufferCollectionTest, DefaultNamespace) {
@@ -603,7 +600,9 @@ TEST_F(OplogBufferCollectionTest, PopAndPeekReturnDocumentsInOrder) {
oplogBuffer.startup(_opCtx.get());
const std::vector<BSONObj> oplog = {
- makeOplogEntry(1), makeOplogEntry(2), makeOplogEntry(3),
+ makeOplogEntry(1),
+ makeOplogEntry(2),
+ makeOplogEntry(3),
};
ASSERT_EQUALS(oplogBuffer.getCount(), 0UL);
oplogBuffer.push(_opCtx.get(), oplog.begin(), oplog.end());
@@ -646,7 +645,9 @@ TEST_F(OplogBufferCollectionTest, LastObjectPushedReturnsNewestOplogEntry) {
oplogBuffer.startup(_opCtx.get());
const std::vector<BSONObj> oplog = {
- makeOplogEntry(1), makeOplogEntry(2), makeOplogEntry(3),
+ makeOplogEntry(1),
+ makeOplogEntry(2),
+ makeOplogEntry(3),
};
ASSERT_EQUALS(oplogBuffer.getCount(), 0UL);
oplogBuffer.push(_opCtx.get(), oplog.begin(), oplog.end());
@@ -682,7 +683,9 @@ TEST_F(OplogBufferCollectionTest,
oplogBuffer.startup(_opCtx.get());
const std::vector<BSONObj> oplog = {
- makeOplogEntry(3), makeOplogEntry(4), makeOplogEntry(5),
+ makeOplogEntry(3),
+ makeOplogEntry(4),
+ makeOplogEntry(5),
};
ASSERT_BSONOBJ_EQ(*oplogBuffer.lastObjectPushed(_opCtx.get()), secondDoc);
@@ -907,7 +910,12 @@ void _testPushSentinelsProperly(OperationContext* opCtx,
OplogBufferCollection oplogBuffer(storageInterface, nss);
oplogBuffer.startup(opCtx);
const std::vector<BSONObj> oplog = {
- BSONObj(), makeOplogEntry(1), BSONObj(), BSONObj(), makeOplogEntry(2), BSONObj(),
+ BSONObj(),
+ makeOplogEntry(1),
+ BSONObj(),
+ BSONObj(),
+ makeOplogEntry(2),
+ BSONObj(),
};
ASSERT_EQUALS(oplogBuffer.getCount(), 0UL);
pushDocsFn(opCtx, &oplogBuffer, oplog);
@@ -937,7 +945,8 @@ DEATH_TEST_F(
oplogBuffer.startup(_opCtx.get());
const std::vector<BSONObj> oplog = {
- makeOplogEntry(2), makeOplogEntry(1),
+ makeOplogEntry(2),
+ makeOplogEntry(1),
};
ASSERT_EQUALS(oplogBuffer.getCount(), 0UL);
oplogBuffer.push(_opCtx.get(), oplog.begin(), oplog.end());
@@ -949,7 +958,10 @@ TEST_F(OplogBufferCollectionTest, SentinelInMiddleIsReturnedInOrder) {
oplogBuffer.startup(_opCtx.get());
const std::vector<BSONObj> oplog = {
- makeOplogEntry(1), makeOplogEntry(2), BSONObj(), makeOplogEntry(3),
+ makeOplogEntry(1),
+ makeOplogEntry(2),
+ BSONObj(),
+ makeOplogEntry(3),
};
ASSERT_EQUALS(oplogBuffer.getCount(), 0UL);
oplogBuffer.push(_opCtx.get(), oplog.cbegin(), oplog.cend());
@@ -1066,7 +1078,12 @@ TEST_F(OplogBufferCollectionTest, MultipleSentinelsAreReturnedInOrder) {
oplogBuffer.startup(_opCtx.get());
const std::vector<BSONObj> oplog = {
- BSONObj(), makeOplogEntry(1), BSONObj(), BSONObj(), makeOplogEntry(2), BSONObj(),
+ BSONObj(),
+ makeOplogEntry(1),
+ BSONObj(),
+ BSONObj(),
+ makeOplogEntry(2),
+ BSONObj(),
};
ASSERT_EQUALS(oplogBuffer.getCount(), 0UL);
oplogBuffer.push(_opCtx.get(), oplog.cbegin(), oplog.cend());