summaryrefslogtreecommitdiff
path: root/src/mongo/s/catalog/replset/sharding_catalog_assign_key_range_to_zone_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/catalog/replset/sharding_catalog_assign_key_range_to_zone_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/catalog/replset/sharding_catalog_assign_key_range_to_zone_test.cpp')
-rw-r--r--src/mongo/s/catalog/replset/sharding_catalog_assign_key_range_to_zone_test.cpp44
1 files changed, 22 insertions, 22 deletions
diff --git a/src/mongo/s/catalog/replset/sharding_catalog_assign_key_range_to_zone_test.cpp b/src/mongo/s/catalog/replset/sharding_catalog_assign_key_range_to_zone_test.cpp
index e49ef0a3588..104a97a3f6a 100644
--- a/src/mongo/s/catalog/replset/sharding_catalog_assign_key_range_to_zone_test.cpp
+++ b/src/mongo/s/catalog/replset/sharding_catalog_assign_key_range_to_zone_test.cpp
@@ -104,8 +104,8 @@ public:
auto tagDoc = tagDocStatus.getValue();
ASSERT_EQ(ns, tagDoc.getNS());
- ASSERT_EQ(range.getMin(), tagDoc.getMinKey());
- ASSERT_EQ(range.getMax(), tagDoc.getMaxKey());
+ ASSERT_BSONOBJ_EQ(range.getMin(), tagDoc.getMinKey());
+ ASSERT_BSONOBJ_EQ(range.getMax(), tagDoc.getMaxKey());
ASSERT_EQ(zoneName, tagDoc.getTag());
}
@@ -304,8 +304,8 @@ TEST_F(AssignKeyRangeWithOneRangeFixture, NewMaxAlignsWithExistingMinShouldSucce
auto tagDoc = tagDocStatus.getValue();
ASSERT_EQ(shardedNS().ns(), tagDoc.getNS());
- ASSERT_EQ(BSON("x" << 2), tagDoc.getMinKey());
- ASSERT_EQ(BSON("x" << 4), tagDoc.getMaxKey());
+ ASSERT_BSONOBJ_EQ(BSON("x" << 2), tagDoc.getMinKey());
+ ASSERT_BSONOBJ_EQ(BSON("x" << 4), tagDoc.getMaxKey());
ASSERT_EQ(zoneName(), tagDoc.getTag());
}
@@ -321,8 +321,8 @@ TEST_F(AssignKeyRangeWithOneRangeFixture, NewMaxAlignsWithExistingMinShouldSucce
auto tagDoc = tagDocStatus.getValue();
ASSERT_EQ(shardedNS().ns(), tagDoc.getNS());
- ASSERT_EQ(existingRange.getMin(), tagDoc.getMinKey());
- ASSERT_EQ(existingRange.getMax(), tagDoc.getMaxKey());
+ ASSERT_BSONOBJ_EQ(existingRange.getMin(), tagDoc.getMinKey());
+ ASSERT_BSONOBJ_EQ(existingRange.getMax(), tagDoc.getMaxKey());
ASSERT_EQ(zoneName(), tagDoc.getTag());
}
}
@@ -384,8 +384,8 @@ TEST_F(AssignKeyRangeWithOneRangeFixture, NewRangeOverlappingWithDifferentNSShou
auto tagDoc = tagDocStatus.getValue();
ASSERT_EQ(shardedNS().ns(), tagDoc.getNS());
- ASSERT_EQ(existingRange.getMin(), tagDoc.getMinKey());
- ASSERT_EQ(existingRange.getMax(), tagDoc.getMaxKey());
+ ASSERT_BSONOBJ_EQ(existingRange.getMin(), tagDoc.getMinKey());
+ ASSERT_BSONOBJ_EQ(existingRange.getMax(), tagDoc.getMaxKey());
ASSERT_EQ(zoneName(), tagDoc.getTag());
}
{
@@ -398,8 +398,8 @@ TEST_F(AssignKeyRangeWithOneRangeFixture, NewRangeOverlappingWithDifferentNSShou
auto tagDoc = tagDocStatus.getValue();
ASSERT_EQ(shardedCollection.getNs().ns(), tagDoc.getNS());
- ASSERT_EQ(BSON("x" << 5), tagDoc.getMinKey());
- ASSERT_EQ(BSON("x" << 7), tagDoc.getMaxKey());
+ ASSERT_BSONOBJ_EQ(BSON("x" << 5), tagDoc.getMinKey());
+ ASSERT_BSONOBJ_EQ(BSON("x" << 7), tagDoc.getMaxKey());
ASSERT_EQ(zoneName(), tagDoc.getTag());
}
}
@@ -472,8 +472,8 @@ TEST_F(AssignKeyRangeWithOneRangeFixture, NewMinAlignsWithExistingMaxShouldSucce
auto tagDoc = tagDocStatus.getValue();
ASSERT_EQ(shardedNS().ns(), tagDoc.getNS());
- ASSERT_EQ(existingRange.getMin(), tagDoc.getMinKey());
- ASSERT_EQ(existingRange.getMax(), tagDoc.getMaxKey());
+ ASSERT_BSONOBJ_EQ(existingRange.getMin(), tagDoc.getMinKey());
+ ASSERT_BSONOBJ_EQ(existingRange.getMax(), tagDoc.getMaxKey());
ASSERT_EQ(zoneName(), tagDoc.getTag());
}
@@ -487,8 +487,8 @@ TEST_F(AssignKeyRangeWithOneRangeFixture, NewMinAlignsWithExistingMaxShouldSucce
auto tagDoc = tagDocStatus.getValue();
ASSERT_EQ(shardedNS().ns(), tagDoc.getNS());
- ASSERT_EQ(BSON("x" << 8), tagDoc.getMinKey());
- ASSERT_EQ(BSON("x" << 10), tagDoc.getMaxKey());
+ ASSERT_BSONOBJ_EQ(BSON("x" << 8), tagDoc.getMinKey());
+ ASSERT_BSONOBJ_EQ(BSON("x" << 10), tagDoc.getMaxKey());
ASSERT_EQ(zoneName(), tagDoc.getTag());
}
}
@@ -610,8 +610,8 @@ TEST_F(AssignKeyRangeWithOneRangeFixture, RemoveThatIsOnlyMinPrefixOfExistingSho
auto tagDoc = tagDocStatus.getValue();
ASSERT_EQ(ns, tagDoc.getNS());
- ASSERT_EQ(existingRange.getMin(), tagDoc.getMinKey());
- ASSERT_EQ(existingRange.getMax(), tagDoc.getMaxKey());
+ ASSERT_BSONOBJ_EQ(existingRange.getMin(), tagDoc.getMinKey());
+ ASSERT_BSONOBJ_EQ(existingRange.getMax(), tagDoc.getMaxKey());
ASSERT_EQ(zoneName(), tagDoc.getTag());
}
@@ -627,8 +627,8 @@ TEST_F(AssignKeyRangeWithOneRangeFixture, RemoveThatIsOnlyMinPrefixOfExistingSho
auto tagDoc = tagDocStatus.getValue();
ASSERT_EQ(shardedNS().ns(), tagDoc.getNS());
- ASSERT_EQ(existingRange.getMin(), tagDoc.getMinKey());
- ASSERT_EQ(existingRange.getMax(), tagDoc.getMaxKey());
+ ASSERT_BSONOBJ_EQ(existingRange.getMin(), tagDoc.getMinKey());
+ ASSERT_BSONOBJ_EQ(existingRange.getMax(), tagDoc.getMaxKey());
ASSERT_EQ(zoneName(), tagDoc.getTag());
}
}
@@ -662,8 +662,8 @@ TEST_F(AssignKeyRangeWithOneRangeFixture, RemoveThatIsOnlyMaxPrefixOfExistingSho
auto tagDoc = tagDocStatus.getValue();
ASSERT_EQ(ns, tagDoc.getNS());
- ASSERT_EQ(existingRange.getMin(), tagDoc.getMinKey());
- ASSERT_EQ(existingRange.getMax(), tagDoc.getMaxKey());
+ ASSERT_BSONOBJ_EQ(existingRange.getMin(), tagDoc.getMinKey());
+ ASSERT_BSONOBJ_EQ(existingRange.getMax(), tagDoc.getMaxKey());
ASSERT_EQ(zoneName(), tagDoc.getTag());
}
@@ -679,8 +679,8 @@ TEST_F(AssignKeyRangeWithOneRangeFixture, RemoveThatIsOnlyMaxPrefixOfExistingSho
auto tagDoc = tagDocStatus.getValue();
ASSERT_EQ(shardedNS().ns(), tagDoc.getNS());
- ASSERT_EQ(existingRange.getMin(), tagDoc.getMinKey());
- ASSERT_EQ(existingRange.getMax(), tagDoc.getMaxKey());
+ ASSERT_BSONOBJ_EQ(existingRange.getMin(), tagDoc.getMinKey());
+ ASSERT_BSONOBJ_EQ(existingRange.getMax(), tagDoc.getMaxKey());
ASSERT_EQ(zoneName(), tagDoc.getTag());
}
}