From 26543060c852aac22f26143a04bf7789ec8fec53 Mon Sep 17 00:00:00 2001 From: David Storch Date: Fri, 12 Aug 2016 15:58:56 -0400 Subject: 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. --- src/mongo/s/query/router_stage_limit_test.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/mongo/s/query/router_stage_limit_test.cpp') 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(); -- cgit v1.2.1