summaryrefslogtreecommitdiff
path: root/src/mongo/idl
diff options
context:
space:
mode:
authorMark Benvenuto <mark.benvenuto@mongodb.com>2018-12-07 13:53:48 -0500
committerMark Benvenuto <mark.benvenuto@mongodb.com>2018-12-07 18:27:31 -0500
commit5144b7b03d175c90d906343ee55bfad6215386db (patch)
tree415df92e310c3b4d0bbcbc00035f1ab97de56725 /src/mongo/idl
parentd899a205ef66d916b071dd42fbb619775561a523 (diff)
downloadmongo-5144b7b03d175c90d906343ee55bfad6215386db.tar.gz
SERVER-38327 IDL does not support optional types with validators
Diffstat (limited to 'src/mongo/idl')
-rw-r--r--src/mongo/idl/idl_test.cpp2
-rw-r--r--src/mongo/idl/unittest.idl3
2 files changed, 3 insertions, 2 deletions
diff --git a/src/mongo/idl/idl_test.cpp b/src/mongo/idl/idl_test.cpp
index 55c1b945377..5e1f71f31fe 100644
--- a/src/mongo/idl/idl_test.cpp
+++ b/src/mongo/idl/idl_test.cpp
@@ -2432,7 +2432,7 @@ 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(std::numeric_limits<std::int32_t>::min());
+ obj0.setRange_int(std::numeric_limits<std::int32_t>::min() + 1);
obj0.setRange_int(-65536);
obj0.setRange_int(0);
obj0.setRange_int(65536);
diff --git a/src/mongo/idl/unittest.idl b/src/mongo/idl/unittest.idl
index ad522b2259e..846c4042fb0 100644
--- a/src/mongo/idl/unittest.idl
+++ b/src/mongo/idl/unittest.idl
@@ -536,7 +536,8 @@ structs:
validator: { gte: 0, lt: 256 }
range_int:
type: int
- validator: { gte: -2147483648, lte: 2147483647 }
+ # Use INT32_MIN+1 for min since MSVC does not like -2147483647 as a constant.
+ validator: { gte: -2147483647, lte: 2147483647 }
double_basic_ranges:
description: Struct using basic range validators on doubles