diff options
author | David Storch <david.storch@10gen.com> | 2016-08-12 15:58:56 -0400 |
---|---|---|
committer | David Storch <david.storch@10gen.com> | 2016-08-18 11:14:17 -0400 |
commit | 26543060c852aac22f26143a04bf7789ec8fec53 (patch) | |
tree | df3ae49e5c4745058be29b7ec8a8e4b528b50a9a /src/mongo/s/query/router_stage_limit_test.cpp | |
parent | 13fa28982d008568f7620d73ddec0c61fad7cbc8 (diff) | |
download | mongo-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/query/router_stage_limit_test.cpp')
-rw-r--r-- | src/mongo/s/query/router_stage_limit_test.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/mongo/s/query/router_stage_limit_test.cpp b/src/mongo/s/query/router_stage_limit_test.cpp index 658b6b4d48d..11c245f67ec 100644 --- a/src/mongo/s/query/router_stage_limit_test.cpp +++ b/src/mongo/s/query/router_stage_limit_test.cpp @@ -51,7 +51,7 @@ TEST(RouterStageLimitTest, LimitIsOne) { auto firstResult = limitStage->next(); ASSERT_OK(firstResult.getStatus()); ASSERT(firstResult.getValue().getResult()); - ASSERT_EQ(*firstResult.getValue().getResult(), BSON("a" << 1)); + ASSERT_BSONOBJ_EQ(*firstResult.getValue().getResult(), BSON("a" << 1)); auto secondResult = limitStage->next(); ASSERT_OK(secondResult.getStatus()); @@ -74,12 +74,12 @@ TEST(RouterStageLimitTest, LimitIsTwo) { auto firstResult = limitStage->next(); ASSERT_OK(firstResult.getStatus()); ASSERT(firstResult.getValue().getResult()); - ASSERT_EQ(*firstResult.getValue().getResult(), BSON("a" << 1)); + ASSERT_BSONOBJ_EQ(*firstResult.getValue().getResult(), BSON("a" << 1)); auto secondResult = limitStage->next(); ASSERT_OK(secondResult.getStatus()); ASSERT(firstResult.getValue().getResult()); - ASSERT_EQ(*secondResult.getValue().getResult(), BSON("a" << 2)); + ASSERT_BSONOBJ_EQ(*secondResult.getValue().getResult(), BSON("a" << 2)); auto thirdResult = limitStage->next(); ASSERT_OK(thirdResult.getStatus()); @@ -98,7 +98,7 @@ TEST(RouterStageLimitTest, LimitStagePropagatesError) { auto firstResult = limitStage->next(); ASSERT_OK(firstResult.getStatus()); ASSERT(firstResult.getValue().getResult()); - ASSERT_EQ(*firstResult.getValue().getResult(), BSON("a" << 1)); + ASSERT_BSONOBJ_EQ(*firstResult.getValue().getResult(), BSON("a" << 1)); auto secondResult = limitStage->next(); ASSERT_NOT_OK(secondResult.getStatus()); @@ -124,7 +124,7 @@ TEST(RouterStageLimitTest, LimitStagePropagatesViewDefinition) { ASSERT_OK(result.getStatus()); ASSERT(!result.getValue().getResult()); ASSERT(result.getValue().getViewDefinition()); - ASSERT_EQ(*result.getValue().getViewDefinition(), viewDef); + ASSERT_BSONOBJ_EQ(*result.getValue().getViewDefinition(), viewDef); } TEST(RouterStageLimitTest, LimitStageToleratesMidStreamEOF) { @@ -142,7 +142,7 @@ TEST(RouterStageLimitTest, LimitStageToleratesMidStreamEOF) { auto firstResult = limitStage->next(); ASSERT_OK(firstResult.getStatus()); ASSERT(firstResult.getValue().getResult()); - ASSERT_EQ(*firstResult.getValue().getResult(), BSON("a" << 1)); + ASSERT_BSONOBJ_EQ(*firstResult.getValue().getResult(), BSON("a" << 1)); auto secondResult = limitStage->next(); ASSERT_OK(secondResult.getStatus()); @@ -151,7 +151,7 @@ TEST(RouterStageLimitTest, LimitStageToleratesMidStreamEOF) { auto thirdResult = limitStage->next(); ASSERT_OK(thirdResult.getStatus()); ASSERT(thirdResult.getValue().getResult()); - ASSERT_EQ(*thirdResult.getValue().getResult(), BSON("a" << 2)); + ASSERT_BSONOBJ_EQ(*thirdResult.getValue().getResult(), BSON("a" << 2)); auto fourthResult = limitStage->next(); ASSERT_OK(fourthResult.getStatus()); @@ -170,13 +170,13 @@ TEST(RouterStageLimitTest, LimitStageRemotesExhausted) { auto firstResult = limitStage->next(); ASSERT_OK(firstResult.getStatus()); ASSERT(firstResult.getValue().getResult()); - ASSERT_EQ(*firstResult.getValue().getResult(), BSON("a" << 1)); + ASSERT_BSONOBJ_EQ(*firstResult.getValue().getResult(), BSON("a" << 1)); ASSERT_TRUE(limitStage->remotesExhausted()); auto secondResult = limitStage->next(); ASSERT_OK(secondResult.getStatus()); ASSERT(secondResult.getValue().getResult()); - ASSERT_EQ(*secondResult.getValue().getResult(), BSON("a" << 2)); + ASSERT_BSONOBJ_EQ(*secondResult.getValue().getResult(), BSON("a" << 2)); ASSERT_TRUE(limitStage->remotesExhausted()); auto thirdResult = limitStage->next(); |