From 3b63a472705fdc48ad0ce895f35192c5b3191899 Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Tue, 26 Jan 2021 20:53:02 +0100 Subject: [PATCH] :rotating_light: suppress warning --- test/src/unit-json_pointer.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/src/unit-json_pointer.cpp b/test/src/unit-json_pointer.cpp index 14d8cd183..fc10c6ff5 100644 --- a/test/src/unit-json_pointer.cpp +++ b/test/src/unit-json_pointer.cpp @@ -358,6 +358,10 @@ TEST_CASE("JSON pointers") CHECK_THROWS_WITH(j_const[jp] == 1, throw_msg.c_str()); } +#if defined(_MSC_VER) +#pragma warning (push) +#pragma warning (disable : 4127) // on some machines, the check below is not constant +#endif if (sizeof(typename json::size_type) < sizeof(unsigned long long)) { auto size_type_max_uul = static_cast((std::numeric_limits::max)()); @@ -371,6 +375,10 @@ TEST_CASE("JSON pointers") CHECK_THROWS_WITH(j_const[jp] == 1, throw_msg.c_str()); } +#if defined(_MSC_VER) +#pragma warning (pop) +#endif + CHECK_THROWS_AS(j.at("/one"_json_pointer) = 1, json::parse_error&); CHECK_THROWS_WITH(j.at("/one"_json_pointer) = 1, "[json.exception.parse_error.109] parse error: array index 'one' is not a number");