All of the ParsePrechecks
are already done by ToIntegral
, so remove them from ParseIntegral
.
Also:
- Remove redundant
{}
. See #20457 (review) - Add missing failing c-string test case
- Add missing failing test cases for non-int32_t integral types
All of the ParsePrechecks
are already done by ToIntegral
, so remove them from ParseIntegral
.
Also:
{}
. See #20457 (review)
Also:
* Remove redundant {} from return statement
* Add missing failing c-string test case and "-" and "+" strings
* Add missing failing test cases for non-int32_t integral types
ParsePrechecks
function now since the only remaining caller ParseDouble
is unused (last use of ParseDouble
removed in 78c312c983255e15fc274de2368a2ec13ce81cbf).
FUZZ=string src/test/fuzz/fuzz
) can be used to try to test that ParseInt32
(and the other functions in that family) stays identical to the old behaviour (LegacyParseInt32
) also after the removal of ParsePrechecks
.
1473@@ -1474,6 +1474,35 @@ BOOST_AUTO_TEST_CASE(test_ParseInt32)
1474 BOOST_CHECK(!ParseInt32("32482348723847471234", nullptr));
1475 }
1476
1477+template <typename T>
1478+static void RunToIntegralTests()
1479+{
1480+ BOOST_CHECK(!ToIntegral<T>(STRING_WITH_EMBEDDED_NULL_CHAR));