diff options
author | Shaun Verch <shaun.verch@mongodb.com> | 2014-05-13 17:01:04 -0400 |
---|---|---|
committer | Shaun Verch <shaun.verch@mongodb.com> | 2014-05-21 12:38:12 -0400 |
commit | 3b97c0870427f676cf3ffbddabc5df8b1fa44fa5 (patch) | |
tree | f27234c3f882e1d3c1fc17f2edc16476ac0460bb /src/mongo/util/time_support_test.cpp | |
parent | 024fb8af552171a22407594babb0f324d971b380 (diff) | |
download | mongo-3b97c0870427f676cf3ffbddabc5df8b1fa44fa5.tar.gz |
SERVER-13760 Do not call dateToISOString if date is not formatable
Diffstat (limited to 'src/mongo/util/time_support_test.cpp')
-rw-r--r-- | src/mongo/util/time_support_test.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/mongo/util/time_support_test.cpp b/src/mongo/util/time_support_test.cpp index d8ea2235291..e1e76072b6a 100644 --- a/src/mongo/util/time_support_test.cpp +++ b/src/mongo/util/time_support_test.cpp @@ -180,6 +180,10 @@ namespace { swull = dateFromISOString("2058-02-20T18:29:11.100Z"); ASSERT_OK(swull.getStatus()); ASSERT_EQUALS(swull.getValue(), 2781455351100ULL); + + swull = dateFromISOString("3001-01-01T08:00:00.000Z"); + ASSERT_OK(swull.getStatus()); + ASSERT_EQUALS(swull.getValue(), 32535244800000ULL); } swull = dateFromISOString("2013-02-20T18:29:11.100Z"); @@ -250,6 +254,15 @@ namespace { swull = dateFromISOString("2058-02-20T13:29:11.100-0500"); ASSERT_OK(swull.getStatus()); ASSERT_EQUALS(swull.getValue(), 2781455351100ULL); + + swull = dateFromISOString("3000-12-31T23:59:59Z"); + ASSERT_OK(swull.getStatus()); + ASSERT_EQUALS(swull.getValue(), 32535215999000ULL); + } + else { + swull = dateFromISOString("2038-01-19T03:14:07Z"); + ASSERT_OK(swull.getStatus()); + ASSERT_EQUALS(swull.getValue(), 2147483647000ULL); } swull = dateFromISOString("2013-02-20T13:29:11.100-0500"); |