diff options
Diffstat (limited to 'src/test/util_tests.cpp')
-rw-r--r-- | src/test/util_tests.cpp | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/src/test/util_tests.cpp b/src/test/util_tests.cpp index 5e9dfb730b..5679086969 100644 --- a/src/test/util_tests.cpp +++ b/src/test/util_tests.cpp @@ -328,7 +328,7 @@ BOOST_AUTO_TEST_CASE(test_ParseInt32) { int32_t n; // Valid values - BOOST_CHECK(ParseInt32("1234", NULL)); + BOOST_CHECK(ParseInt32("1234", nullptr)); BOOST_CHECK(ParseInt32("0", &n) && n == 0); BOOST_CHECK(ParseInt32("1234", &n) && n == 1234); BOOST_CHECK(ParseInt32("01234", &n) && n == 1234); // no octal @@ -347,17 +347,17 @@ BOOST_AUTO_TEST_CASE(test_ParseInt32) std::string teststr(test_bytes, sizeof(test_bytes)); BOOST_CHECK(!ParseInt32(teststr, &n)); // no embedded NULs // Overflow and underflow - BOOST_CHECK(!ParseInt32("-2147483649", NULL)); - BOOST_CHECK(!ParseInt32("2147483648", NULL)); - BOOST_CHECK(!ParseInt32("-32482348723847471234", NULL)); - BOOST_CHECK(!ParseInt32("32482348723847471234", NULL)); + BOOST_CHECK(!ParseInt32("-2147483649", nullptr)); + BOOST_CHECK(!ParseInt32("2147483648", nullptr)); + BOOST_CHECK(!ParseInt32("-32482348723847471234", nullptr)); + BOOST_CHECK(!ParseInt32("32482348723847471234", nullptr)); } BOOST_AUTO_TEST_CASE(test_ParseInt64) { int64_t n; // Valid values - BOOST_CHECK(ParseInt64("1234", NULL)); + BOOST_CHECK(ParseInt64("1234", nullptr)); BOOST_CHECK(ParseInt64("0", &n) && n == 0LL); BOOST_CHECK(ParseInt64("1234", &n) && n == 1234LL); BOOST_CHECK(ParseInt64("01234", &n) && n == 1234LL); // no octal @@ -377,17 +377,17 @@ BOOST_AUTO_TEST_CASE(test_ParseInt64) std::string teststr(test_bytes, sizeof(test_bytes)); BOOST_CHECK(!ParseInt64(teststr, &n)); // no embedded NULs // Overflow and underflow - BOOST_CHECK(!ParseInt64("-9223372036854775809", NULL)); - BOOST_CHECK(!ParseInt64("9223372036854775808", NULL)); - BOOST_CHECK(!ParseInt64("-32482348723847471234", NULL)); - BOOST_CHECK(!ParseInt64("32482348723847471234", NULL)); + BOOST_CHECK(!ParseInt64("-9223372036854775809", nullptr)); + BOOST_CHECK(!ParseInt64("9223372036854775808", nullptr)); + BOOST_CHECK(!ParseInt64("-32482348723847471234", nullptr)); + BOOST_CHECK(!ParseInt64("32482348723847471234", nullptr)); } BOOST_AUTO_TEST_CASE(test_ParseUInt32) { uint32_t n; // Valid values - BOOST_CHECK(ParseUInt32("1234", NULL)); + BOOST_CHECK(ParseUInt32("1234", nullptr)); BOOST_CHECK(ParseUInt32("0", &n) && n == 0); BOOST_CHECK(ParseUInt32("1234", &n) && n == 1234); BOOST_CHECK(ParseUInt32("01234", &n) && n == 1234); // no octal @@ -410,15 +410,15 @@ BOOST_AUTO_TEST_CASE(test_ParseUInt32) BOOST_CHECK(!ParseUInt32("-2147483648", &n)); BOOST_CHECK(!ParseUInt32("4294967296", &n)); BOOST_CHECK(!ParseUInt32("-1234", &n)); - BOOST_CHECK(!ParseUInt32("-32482348723847471234", NULL)); - BOOST_CHECK(!ParseUInt32("32482348723847471234", NULL)); + BOOST_CHECK(!ParseUInt32("-32482348723847471234", nullptr)); + BOOST_CHECK(!ParseUInt32("32482348723847471234", nullptr)); } BOOST_AUTO_TEST_CASE(test_ParseUInt64) { uint64_t n; // Valid values - BOOST_CHECK(ParseUInt64("1234", NULL)); + BOOST_CHECK(ParseUInt64("1234", nullptr)); BOOST_CHECK(ParseUInt64("0", &n) && n == 0LL); BOOST_CHECK(ParseUInt64("1234", &n) && n == 1234LL); BOOST_CHECK(ParseUInt64("01234", &n) && n == 1234LL); // no octal @@ -438,9 +438,9 @@ BOOST_AUTO_TEST_CASE(test_ParseUInt64) std::string teststr(test_bytes, sizeof(test_bytes)); BOOST_CHECK(!ParseUInt64(teststr, &n)); // no embedded NULs // Overflow and underflow - BOOST_CHECK(!ParseUInt64("-9223372036854775809", NULL)); - BOOST_CHECK(!ParseUInt64("18446744073709551616", NULL)); - BOOST_CHECK(!ParseUInt64("-32482348723847471234", NULL)); + BOOST_CHECK(!ParseUInt64("-9223372036854775809", nullptr)); + BOOST_CHECK(!ParseUInt64("18446744073709551616", nullptr)); + BOOST_CHECK(!ParseUInt64("-32482348723847471234", nullptr)); BOOST_CHECK(!ParseUInt64("-2147483648", &n)); BOOST_CHECK(!ParseUInt64("-9223372036854775808", &n)); BOOST_CHECK(!ParseUInt64("-1234", &n)); @@ -450,7 +450,7 @@ BOOST_AUTO_TEST_CASE(test_ParseDouble) { double n; // Valid values - BOOST_CHECK(ParseDouble("1234", NULL)); + BOOST_CHECK(ParseDouble("1234", nullptr)); BOOST_CHECK(ParseDouble("0", &n) && n == 0.0); BOOST_CHECK(ParseDouble("1234", &n) && n == 1234.0); BOOST_CHECK(ParseDouble("01234", &n) && n == 1234.0); // no octal @@ -470,8 +470,8 @@ BOOST_AUTO_TEST_CASE(test_ParseDouble) std::string teststr(test_bytes, sizeof(test_bytes)); BOOST_CHECK(!ParseDouble(teststr, &n)); // no embedded NULs // Overflow and underflow - BOOST_CHECK(!ParseDouble("-1e10000", NULL)); - BOOST_CHECK(!ParseDouble("1e10000", NULL)); + BOOST_CHECK(!ParseDouble("-1e10000", nullptr)); + BOOST_CHECK(!ParseDouble("1e10000", nullptr)); } BOOST_AUTO_TEST_CASE(test_FormatParagraph) |