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/db/ops/modifier_current_date_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/db/ops/modifier_current_date_test.cpp')
-rw-r--r-- | src/mongo/db/ops/modifier_current_date_test.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/mongo/db/ops/modifier_current_date_test.cpp b/src/mongo/db/ops/modifier_current_date_test.cpp index 126b983adbc..81bcd4d04e0 100644 --- a/src/mongo/db/ops/modifier_current_date_test.cpp +++ b/src/mongo/db/ops/modifier_current_date_test.cpp @@ -44,9 +44,9 @@ using mongo::BSONObj; using mongo::LogBuilder; using mongo::ModifierCurrentDate; using mongo::ModifierInterface; -using mongo::Timestamp; using mongo::Status; using mongo::StringData; +using mongo::Timestamp; using mongo::fromjson; using mongo::mutablebson::ConstElement; using mongo::mutablebson::Document; @@ -177,7 +177,7 @@ TEST(BoolInput, EmptyStartDoc) { BSONObj olderDateObj = fromjson("{ a : { $date : 0 } }"); ASSERT_OK(mod.apply()); - ASSERT_LESS_THAN(olderDateObj, doc.getObject()); + ASSERT_BSONOBJ_LT(olderDateObj, doc.getObject()); ASSERT_FALSE(doc.isInPlaceModeEnabled()); Document logDoc; @@ -198,7 +198,7 @@ TEST(DateInput, EmptyStartDoc) { BSONObj olderDateObj = fromjson("{ a : { $date : 0 } }"); ASSERT_OK(mod.apply()); - ASSERT_LESS_THAN(olderDateObj, doc.getObject()); + ASSERT_BSONOBJ_LT(olderDateObj, doc.getObject()); ASSERT_FALSE(doc.isInPlaceModeEnabled()); Document logDoc; @@ -221,7 +221,7 @@ TEST(TimestampInput, EmptyStartDoc) { BSONObj olderDateObj = BSON("a" << ts); ASSERT_OK(mod.apply()); ASSERT_FALSE(doc.isInPlaceModeEnabled()); - ASSERT_LESS_THAN(olderDateObj, doc.getObject()); + ASSERT_BSONOBJ_LT(olderDateObj, doc.getObject()); Document logDoc; LogBuilder logBuilder(logDoc.root()); @@ -241,7 +241,7 @@ TEST(BoolInput, ExistingStringDoc) { BSONObj olderDateObj = fromjson("{ a : { $date : 0 } }"); ASSERT_OK(mod.apply()); - ASSERT_LESS_THAN(olderDateObj, doc.getObject()); + ASSERT_BSONOBJ_LT(olderDateObj, doc.getObject()); ASSERT_FALSE(doc.isInPlaceModeEnabled()); Document logDoc; @@ -262,7 +262,7 @@ TEST(BoolInput, ExistingDateDoc) { BSONObj olderDateObj = fromjson("{ a : { $date : 0 } }"); ASSERT_OK(mod.apply()); - ASSERT_LESS_THAN(olderDateObj, doc.getObject()); + ASSERT_BSONOBJ_LT(olderDateObj, doc.getObject()); ASSERT_TRUE(doc.isInPlaceModeEnabled()); Document logDoc; @@ -283,7 +283,7 @@ TEST(DateInput, ExistingDateDoc) { BSONObj olderDateObj = fromjson("{ a : { $date : 0 } }"); ASSERT_OK(mod.apply()); - ASSERT_LESS_THAN(olderDateObj, doc.getObject()); + ASSERT_BSONOBJ_LT(olderDateObj, doc.getObject()); ASSERT_TRUE(doc.isInPlaceModeEnabled()); Document logDoc; @@ -306,7 +306,7 @@ TEST(TimestampInput, ExistingDateDoc) { BSONObj olderDateObj = BSON("a" << ts); ASSERT_OK(mod.apply()); ASSERT_TRUE(doc.isInPlaceModeEnabled()); // Same Size as Date - ASSERT_LESS_THAN(olderDateObj, doc.getObject()); + ASSERT_BSONOBJ_LT(olderDateObj, doc.getObject()); Document logDoc; LogBuilder logBuilder(logDoc.root()); @@ -328,7 +328,7 @@ TEST(TimestampInput, ExistingEmbeddedDateDoc) { BSONObj olderDateObj = BSON("a" << BSON("b" << ts)); ASSERT_OK(mod.apply()); ASSERT_TRUE(doc.isInPlaceModeEnabled()); // Same Size as Date - ASSERT_LESS_THAN(olderDateObj, doc.getObject()); + ASSERT_BSONOBJ_LT(olderDateObj, doc.getObject()); Document logDoc; LogBuilder logBuilder(logDoc.root()); @@ -350,7 +350,7 @@ TEST(DottedTimestampInput, EmptyStartDoc) { BSONObj olderDateObj = BSON("a" << BSON("b" << ts)); ASSERT_OK(mod.apply()); ASSERT_FALSE(doc.isInPlaceModeEnabled()); - ASSERT_LESS_THAN(olderDateObj, doc.getObject()); + ASSERT_BSONOBJ_LT(olderDateObj, doc.getObject()); Document logDoc; LogBuilder logBuilder(logDoc.root()); |