summaryrefslogtreecommitdiff
path: root/src/mongo/s/comparable_database_version_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/s/comparable_database_version_test.cpp')
-rw-r--r--src/mongo/s/comparable_database_version_test.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/mongo/s/comparable_database_version_test.cpp b/src/mongo/s/comparable_database_version_test.cpp
index d1a499b26f6..ff073db5042 100644
--- a/src/mongo/s/comparable_database_version_test.cpp
+++ b/src/mongo/s/comparable_database_version_test.cpp
@@ -131,11 +131,17 @@ TEST(ComparableDatabaseVersionTest, CompareTwoForcedRefreshVersions) {
ASSERT_FALSE(forcedRefreshVersion1 > forcedRefreshVersion2);
}
-TEST(ComparableDatabaseVersionTest, CompareTwoComparableChunkVersionsWithBoostNone) {
- const auto version1 = ComparableDatabaseVersion::makeComparableDatabaseVersion(boost::none);
- const auto version2 = ComparableDatabaseVersion::makeComparableDatabaseVersion(boost::none);
-
- ASSERT_TRUE(version1 == version2);
+TEST(ComparableDatabaseVersionTest, CompareVersionsAgainstBoostNone) {
+ auto checkGreatherThan = [](const boost::optional<DatabaseVersion>& v1,
+ const boost::optional<DatabaseVersion>& v2) {
+ const auto version1 = ComparableDatabaseVersion::makeComparableDatabaseVersion(v1);
+ const auto version2 = ComparableDatabaseVersion::makeComparableDatabaseVersion(v2);
+ ASSERT_TRUE(version1 < version2);
+ };
+ const DatabaseVersion v(UUID::gen(), Timestamp(42));
+ checkGreatherThan(boost::none, v);
+ checkGreatherThan(v, boost::none);
+ checkGreatherThan(boost::none, boost::none);
}
} // namespace