summaryrefslogtreecommitdiff
path: root/src/mongo/db/query/query_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/db/query/query_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/db/query/query_request_test.cpp')
-rw-r--r--src/mongo/db/query/query_request_test.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/mongo/db/query/query_request_test.cpp b/src/mongo/db/query/query_request_test.cpp
index 6fa047efdca..f5fcc6b5245 100644
--- a/src/mongo/db/query/query_request_test.cpp
+++ b/src/mongo/db/query/query_request_test.cpp
@@ -231,7 +231,7 @@ TEST(QueryRequestTest, AllowTailableWithNaturalSort) {
auto result = QueryRequest::makeFromFindCommand(nss, cmdObj, isExplain);
ASSERT_OK(result.getStatus());
ASSERT_TRUE(result.getValue()->isTailable());
- ASSERT_EQ(result.getValue()->getSort(), BSON("$natural" << 1));
+ ASSERT_BSONOBJ_EQ(result.getValue()->getSort(), BSON("$natural" << 1));
}
TEST(QueryRequestTest, IsIsolatedReturnsTrueWithIsolated) {
@@ -398,9 +398,9 @@ TEST(QueryRequestTest, ParseFromCommandHintAsString) {
assertGet(QueryRequest::makeFromFindCommand(nss, cmdObj, isExplain)));
BSONObj hintObj = qr->getHint();
- ASSERT_EQUALS(BSON("$hint"
- << "foo_1"),
- hintObj);
+ ASSERT_BSONOBJ_EQ(BSON("$hint"
+ << "foo_1"),
+ hintObj);
}
TEST(QueryRequestTest, ParseFromCommandValidSortProj) {
@@ -824,7 +824,7 @@ TEST(QueryRequestTest, ParseFromCommandSkipIsZero) {
bool isExplain = false;
unique_ptr<QueryRequest> qr(
assertGet(QueryRequest::makeFromFindCommand(nss, cmdObj, isExplain)));
- ASSERT_EQ(BSON("a" << 3), qr->getFilter());
+ ASSERT_BSONOBJ_EQ(BSON("a" << 3), qr->getFilter());
ASSERT_FALSE(qr->getSkip());
}
@@ -848,7 +848,7 @@ TEST(QueryRequestTest, ParseFromCommandLimitIsZero) {
bool isExplain = false;
unique_ptr<QueryRequest> qr(
assertGet(QueryRequest::makeFromFindCommand(nss, cmdObj, isExplain)));
- ASSERT_EQ(BSON("a" << 3), qr->getFilter());
+ ASSERT_BSONOBJ_EQ(BSON("a" << 3), qr->getFilter());
ASSERT_FALSE(qr->getLimit());
}