diff options
author | Sara Golemon <sara.golemon@mongodb.com> | 2018-10-08 15:42:54 +0000 |
---|---|---|
committer | Sara Golemon <sara.golemon@mongodb.com> | 2018-10-08 18:49:29 +0000 |
commit | 065935311777d1016ea35cf78784f6dc793860e2 (patch) | |
tree | c469c542259372c9d04f76812f6aeec75b5aee69 /src/mongo | |
parent | 93e66d955ec346db14d85e0d3d1685ceccf0d043 (diff) | |
download | mongo-065935311777d1016ea35cf78784f6dc793860e2.tar.gz |
SERVER-37168 Use numeric_limits instead of raw ordinals
Diffstat (limited to 'src/mongo')
-rw-r--r-- | src/mongo/idl/idl_test.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mongo/idl/idl_test.cpp b/src/mongo/idl/idl_test.cpp index 341509638f5..1f85e71e930 100644 --- a/src/mongo/idl/idl_test.cpp +++ b/src/mongo/idl/idl_test.cpp @@ -28,6 +28,8 @@ #include "mongo/platform/basic.h" +#include <limits> + #include "mongo/bson/bsonmisc.h" #include "mongo/bson/bsonobjbuilder.h" #include "mongo/idl/unittest_gen.h" @@ -2428,11 +2430,11 @@ TEST(IDLValidatedField, Int_basic_ranges) { ASSERT_THROWS(obj0.setByte_range_int(256), AssertionException); // IDL ints *are* int32_t, so no number we can pass to the func will actually fail. - obj0.setRange_int(-2147483648); + obj0.setRange_int(std::numeric_limits<std::int32_t>::min()); obj0.setRange_int(-65536); obj0.setRange_int(0); obj0.setRange_int(65536); - obj0.setRange_int(2147483647); + obj0.setRange_int(std::numeric_limits<std::int32_t>::max()); // Positive case parsing. const auto tryPass = [](std::int32_t pos, |