diff options
author | Pasta <pasta@dashboost.org> | 2021-12-18 12:50:58 -0500 |
---|---|---|
committer | pasta <pasta@dashboost.org> | 2023-01-03 19:31:29 -0600 |
commit | f2fc03ec856d7d19a20c482514350cced38f9504 (patch) | |
tree | f783af485b07464f29e0f5876db293a5ce44ca03 /src/test/util_tests.cpp | |
parent | 3f8591d46b46cec2c4effc01f8822222087d74c4 (diff) |
refactor: use braced init for integer constants instead of c style casts
Diffstat (limited to 'src/test/util_tests.cpp')
-rw-r--r-- | src/test/util_tests.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/test/util_tests.cpp b/src/test/util_tests.cpp index 4d04c076e3..6b6bb18523 100644 --- a/src/test/util_tests.cpp +++ b/src/test/util_tests.cpp @@ -810,8 +810,8 @@ BOOST_AUTO_TEST_CASE(test_ParseInt64) BOOST_CHECK(ParseInt64("01234", &n) && n == 1234LL); // no octal BOOST_CHECK(ParseInt64("2147483647", &n) && n == 2147483647LL); BOOST_CHECK(ParseInt64("-2147483648", &n) && n == -2147483648LL); - BOOST_CHECK(ParseInt64("9223372036854775807", &n) && n == (int64_t)9223372036854775807); - BOOST_CHECK(ParseInt64("-9223372036854775808", &n) && n == (int64_t)-9223372036854775807-1); + BOOST_CHECK(ParseInt64("9223372036854775807", &n) && n == int64_t{9223372036854775807}); + BOOST_CHECK(ParseInt64("-9223372036854775808", &n) && n == int64_t{-9223372036854775807-1}); BOOST_CHECK(ParseInt64("-1234", &n) && n == -1234LL); // Invalid values BOOST_CHECK(!ParseInt64("", &n)); @@ -907,8 +907,8 @@ BOOST_AUTO_TEST_CASE(test_ParseUInt32) BOOST_CHECK(ParseUInt32("1234", &n) && n == 1234); BOOST_CHECK(ParseUInt32("01234", &n) && n == 1234); // no octal BOOST_CHECK(ParseUInt32("2147483647", &n) && n == 2147483647); - BOOST_CHECK(ParseUInt32("2147483648", &n) && n == (uint32_t)2147483648); - BOOST_CHECK(ParseUInt32("4294967295", &n) && n == (uint32_t)4294967295); + BOOST_CHECK(ParseUInt32("2147483648", &n) && n == uint32_t{2147483648}); + BOOST_CHECK(ParseUInt32("4294967295", &n) && n == uint32_t{4294967295}); BOOST_CHECK(ParseUInt32("+1234", &n) && n == 1234); BOOST_CHECK(ParseUInt32("00000000000000001234", &n) && n == 1234); BOOST_CHECK(ParseUInt32("00000000000000000000", &n) && n == 0); |