summaryrefslogtreecommitdiff
path: root/src/mongo/db/field_parser_test.cpp
diff options
context:
space:
mode:
authorAndy Schwerin <schwerin@mongodb.com>2015-05-07 16:45:29 -0400
committerAndy Schwerin <schwerin@mongodb.com>2015-05-13 17:58:55 -0400
commit532dfe1180c2da552bebed70af1e7fba34cf355c (patch)
tree9fb15c1576003307169bd249db500ad1aee21d99 /src/mongo/db/field_parser_test.cpp
parentcd97edbe4be0e6ddc9139a21e13594fd19a26a5e (diff)
downloadmongo-532dfe1180c2da552bebed70af1e7fba34cf355c.tar.gz
SERVER-13874 Make mongo::Milliseconds et al. aliases for equivalent stdx::chrono types.
Also introduces operators for adding stdx::chrono::duration to Date_t, subtracting two Date_ts to get Milliseconds, and remove the use of reinterpret_cast from the implementation of BSON Timestamp type.
Diffstat (limited to 'src/mongo/db/field_parser_test.cpp')
-rw-r--r--src/mongo/db/field_parser_test.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mongo/db/field_parser_test.cpp b/src/mongo/db/field_parser_test.cpp
index 902b6548e64..184d883a2b4 100644
--- a/src/mongo/db/field_parser_test.cpp
+++ b/src/mongo/db/field_parser_test.cpp
@@ -72,7 +72,7 @@ namespace {
valBool = true;
valArray = BSON_ARRAY(1 << 2 << 3);
valObj = BSON("a" << 1);
- valDate = 1ULL;
+ valDate = Date_t::fromMillisSinceEpoch(1);
valString = "a string";
valOID = OID::gen();
valLong = 1LL;
@@ -132,13 +132,13 @@ namespace {
}
TEST_F(ExtractionFixture, GetDate) {
- BSONField<Date_t> notThere("otherDate", 99ULL);
+ BSONField<Date_t> notThere("otherDate", Date_t::fromMillisSinceEpoch(99));
BSONField<Date_t> wrongType(aString.name());
Date_t val;
ASSERT_TRUE(FieldParser::extract(doc, aDate, &val));
ASSERT_EQUALS(val, valDate);
ASSERT_TRUE(FieldParser::extract(doc, notThere, &val));
- ASSERT_EQUALS(val, 99ULL);
+ ASSERT_EQUALS(val, Date_t::fromMillisSinceEpoch(99));
ASSERT_FALSE(FieldParser::extract(doc, wrongType, &val));
}