summaryrefslogtreecommitdiff
path: root/src/mongo/s/write_ops/batched_command_request_test.cpp
diff options
context:
space:
mode:
authorDavid Storch <david.storch@10gen.com>2016-08-12 15:58:56 -0400
committerDavid Storch <david.storch@10gen.com>2016-08-18 11:14:17 -0400
commit26543060c852aac22f26143a04bf7789ec8fec53 (patch)
treedf3ae49e5c4745058be29b7ec8a8e4b528b50a9a /src/mongo/s/write_ops/batched_command_request_test.cpp
parent13fa28982d008568f7620d73ddec0c61fad7cbc8 (diff)
downloadmongo-26543060c852aac22f26143a04bf7789ec8fec53.tar.gz
SERVER-24508 BSONObj::ComparatorInterface
BSONObj instances should now be compared via the comparator interface's evaluate() method. This preferred over using BSONObj::woCompare() directly. If the comparison doesn't require any database semantics (e.g. there is no collation), there is a global instance of the SimpleBSONObjComparator which should be used for BSONObj comparisons. If the comparison requires special semantics, then callers must instantiate their own comparator object.
Diffstat (limited to 'src/mongo/s/write_ops/batched_command_request_test.cpp')
-rw-r--r--src/mongo/s/write_ops/batched_command_request_test.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/mongo/s/write_ops/batched_command_request_test.cpp b/src/mongo/s/write_ops/batched_command_request_test.cpp
index 7a09e8ec3b6..469de14205e 100644
--- a/src/mongo/s/write_ops/batched_command_request_test.cpp
+++ b/src/mongo/s/write_ops/batched_command_request_test.cpp
@@ -96,7 +96,7 @@ TEST(BatchedCommandRequest, InsertClone) {
ASSERT_EQ("xyz.abc", clonedRequest.getNS().toString());
ASSERT_EQ("xyz.abc", clonedRequest.getTargetingNSS().toString());
ASSERT_TRUE(clonedRequest.getOrdered());
- ASSERT_EQ(BSON("w" << 2), clonedRequest.getWriteConcern());
+ ASSERT_BSONOBJ_EQ(BSON("w" << 2), clonedRequest.getWriteConcern());
ASSERT_TRUE(clonedRequest.shouldBypassValidation());
batchedRequest.setShouldBypassValidation(false);
@@ -126,14 +126,14 @@ TEST(BatchedCommandRequest, InsertIndexClone) {
ASSERT_EQ("xyz.system.indexes", clonedRequest.getNS().toString());
ASSERT_EQ("xyz.user", clonedRequest.getTargetingNSS().toString());
ASSERT_TRUE(clonedRequest.getOrdered());
- ASSERT_EQ(BSON("w" << 2), clonedRequest.getWriteConcern());
+ ASSERT_BSONOBJ_EQ(BSON("w" << 2), clonedRequest.getWriteConcern());
auto* clonedInsert = clonedRequest.getInsertRequest();
ASSERT_TRUE(clonedInsert != nullptr);
auto insertDocs = clonedInsert->getDocuments();
ASSERT_EQ(1u, insertDocs.size());
- ASSERT_EQ(indexSpec, insertDocs.front());
+ ASSERT_BSONOBJ_EQ(indexSpec, insertDocs.front());
}
TEST(BatchedCommandRequest, InsertCloneWithId) {
@@ -152,7 +152,7 @@ TEST(BatchedCommandRequest, InsertCloneWithId) {
ASSERT_EQ("xyz.abc", clonedRequest->getNS().toString());
ASSERT_EQ("xyz.abc", clonedRequest->getTargetingNSS().toString());
ASSERT_TRUE(clonedRequest->getOrdered());
- ASSERT_EQ(BSON("w" << 2), clonedRequest->getWriteConcern());
+ ASSERT_BSONOBJ_EQ(BSON("w" << 2), clonedRequest->getWriteConcern());
ASSERT_TRUE(clonedRequest->shouldBypassValidation());
auto* clonedInsert = clonedRequest->getInsertRequest();
@@ -181,7 +181,7 @@ TEST(BatchedCommandRequest, UpdateClone) {
ASSERT_EQ("xyz.abc", clonedRequest.getNS().toString());
ASSERT_EQ("xyz.abc", clonedRequest.getTargetingNSS().toString());
ASSERT_TRUE(clonedRequest.getOrdered());
- ASSERT_EQ(BSON("w" << 2), clonedRequest.getWriteConcern());
+ ASSERT_BSONOBJ_EQ(BSON("w" << 2), clonedRequest.getWriteConcern());
ASSERT_TRUE(clonedRequest.shouldBypassValidation());
}
@@ -199,7 +199,7 @@ TEST(BatchedCommandRequest, DeleteClone) {
ASSERT_EQ("xyz.abc", clonedRequest.getNS().toString());
ASSERT_EQ("xyz.abc", clonedRequest.getTargetingNSS().toString());
ASSERT_TRUE(clonedRequest.getOrdered());
- ASSERT_EQ(BSON("w" << 2), clonedRequest.getWriteConcern());
+ ASSERT_BSONOBJ_EQ(BSON("w" << 2), clonedRequest.getWriteConcern());
}
} // namespace