diff --git a/tests/src/unit-binary_writer_sinks.cpp b/tests/src/unit-binary_writer_sinks.cpp index 5b14a4c41..db1e18537 100644 --- a/tests/src/unit-binary_writer_sinks.cpp +++ b/tests/src/unit-binary_writer_sinks.cpp @@ -11,6 +11,7 @@ #include using nlohmann::json; +#include #include #include #include @@ -308,14 +309,16 @@ void reference_msgpack_integer(std::vector& out, const json& j) std::vector boundary_integers() { std::vector result; - const std::uint64_t boundaries[] = + const std::array boundaries = { - 0, 1, 22, 23, 24, 25, 31, 32, 33, 126, 127, 128, 129, 254, 255, 256, 257, - 32766, 32767, 32768, 32769, 65534, 65535, 65536, 65537, - 2147483646ULL, 2147483647ULL, 2147483648ULL, 2147483649ULL, - 4294967294ULL, 4294967295ULL, 4294967296ULL, 4294967297ULL, - 9223372036854775806ULL, 9223372036854775807ULL, 9223372036854775808ULL, - 18446744073709551614ULL, 18446744073709551615ULL + { + 0, 1, 22, 23, 24, 25, 31, 32, 33, 126, 127, 128, 129, 254, 255, 256, 257, + 32766, 32767, 32768, 32769, 65534, 65535, 65536, 65537, + 2147483646ULL, 2147483647ULL, 2147483648ULL, 2147483649ULL, + 4294967294ULL, 4294967295ULL, 4294967296ULL, 4294967297ULL, + 9223372036854775806ULL, 9223372036854775807ULL, 9223372036854775808ULL, + 18446744073709551614ULL, 18446744073709551615ULL + } }; for (const std::uint64_t u : boundaries) { @@ -323,9 +326,9 @@ std::vector boundary_integers() if (u <= static_cast((std::numeric_limits::max)())) { const auto n = static_cast(u); - result.emplace_back(static_cast(n)); - result.emplace_back(static_cast(-n)); - result.emplace_back(static_cast(-n - 1)); + result.emplace_back(n); + result.emplace_back(-n); + result.emplace_back(-n - 1); } } return result;