From e03ee5c6df7939134345ace00fcc3087335f62d8 Mon Sep 17 00:00:00 2001 From: Henrik Edin Date: Thu, 15 Nov 2018 15:01:22 -0500 Subject: SERVER-38160 Allow compilation with Visual Studio 2017. Take SCons MSCommon from SCons 3.0.1 Fix missing includes Suppress constant arithmetic warnings in unit tests --- src/mongo/bson/bson_obj_test.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/mongo/bson') diff --git a/src/mongo/bson/bson_obj_test.cpp b/src/mongo/bson/bson_obj_test.cpp index 7d0ccbbbf18..1a1781e0b03 100644 --- a/src/mongo/bson/bson_obj_test.cpp +++ b/src/mongo/bson/bson_obj_test.cpp @@ -189,8 +189,16 @@ TEST(BSONObjCompare, NumberLong_Double) { const double equal = -9223372036854775808.0; // 2**63 const double closestAbove = -9223372036854774784.0; // -2**63 + epsilon +// VS2017 Doesn't like the tests below, even though we're using static_cast +#if defined(_MSC_VER) +#pragma warning(push) +#pragma warning(disable : 4056) // warning C4056: overflow in floating-point constant arithmetic +#endif invariant(static_cast(minLL) == equal); invariant(static_cast(equal) == minLL); +#if defined(_MSC_VER) +#pragma warning(pop) +#endif ASSERT_BSONOBJ_LT(BSON("" << minLL), BSON("" << (minLL + 1))); -- cgit v1.2.1