https://bugs.gentoo.org/932579 https://github.com/boostorg/charconv/pull/183 --- a/libs/charconv/test/from_chars_float.cpp +++ b/libs/charconv/test/from_chars_float.cpp @@ -440,6 +440,7 @@ void test_issue_37() overflow_spot_value("1.0e+9999", HUGE_VAL); overflow_spot_value("-1.0e+9999", -HUGE_VAL); } + #ifndef BOOST_MATH_UNSUPPORTED_LONG_DOUBLE else { overflow_spot_value("1e99999", HUGE_VALL); @@ -447,6 +448,7 @@ void test_issue_37() overflow_spot_value("1.0e+99999", HUGE_VALL); overflow_spot_value("-1.0e+99999", -HUGE_VALL); } + #endif overflow_spot_value("1e-99999", static_cast(0.0L)); overflow_spot_value("-1.0e-99999", static_cast(-0.0L)); @@ -530,20 +532,22 @@ int main() odd_strings_test(); odd_strings_test(); + #ifndef BOOST_MATH_UNSUPPORTED_LONG_DOUBLE simple_integer_test(); simple_hex_integer_test(); simple_scientific_test(); simple_hex_scientific_test(); + zero_test(); + test_issue_37(); + #endif zero_test(); zero_test(); - zero_test(); boost_json_test(); test_issue_37(); test_issue_37(); - test_issue_37(); test_issue_45(static_cast(-4109895455460520.5), "-4109895455460520.513430", 19); test_issue_45(1.035695536657502e-308, "1.0356955366575023e-3087", 23); @@ -1846,40 +1850,29 @@ int main() spot_check_nan("-nan", fmt); spot_check_nan("nan", fmt); spot_check_nan("-nan", fmt); - spot_check_nan("nan", fmt); - spot_check_nan("-nan", fmt); spot_check_inf("inf", fmt); spot_check_inf("-inf", fmt); spot_check_inf("inf", fmt); spot_check_inf("-inf", fmt); - spot_check_inf("inf", fmt); - spot_check_inf("-inf", fmt); spot_check_nan("NAN", fmt); spot_check_nan("-NAN", fmt); spot_check_nan("NAN", fmt); spot_check_nan("-NAN", fmt); - spot_check_nan("NAN", fmt); - spot_check_nan("-NAN", fmt); spot_check_inf("INF", fmt); spot_check_inf("-INF", fmt); spot_check_inf("INF", fmt); spot_check_inf("-INF", fmt); - spot_check_inf("INF", fmt); - spot_check_inf("-INF", fmt); spot_check_nan("nan(snan)", fmt); spot_check_nan("-nan(snan)", fmt); spot_check_nan("nan(snan)", fmt); spot_check_nan("-nan(snan)", fmt); - spot_check_nan("nan(snan)", fmt); - spot_check_nan("-nan(snan)", fmt); spot_check_nan("-nan(ind)", fmt); spot_check_nan("-nan(ind)", fmt); - spot_check_nan("-nan(ind)", fmt); spot_check_invalid_argument("na7", fmt); spot_check_invalid_argument("na", fmt); @@ -1889,8 +1882,22 @@ int main() spot_check_invalid_argument(" 1.23", fmt); spot_check_invalid_argument(" 1.23", fmt); spot_check_invalid_argument(" 1.23", fmt); + + #ifndef BOOST_MATH_UNSUPPORTED_LONG_DOUBLE + spot_check_nan("nan", fmt); + spot_check_nan("-nan", fmt); + spot_check_inf("inf", fmt); + spot_check_inf("-inf", fmt); + spot_check_nan("NAN", fmt); + spot_check_nan("-NAN", fmt); + spot_check_inf("INF", fmt); + spot_check_inf("-INF", fmt); + spot_check_nan("nan(snan)", fmt); + spot_check_nan("-nan(snan)", fmt); + spot_check_nan("-nan(ind)", fmt); spot_check_invalid_argument(" 1.23", fmt); spot_check_invalid_argument(" 1.23", fmt); + #endif } return boost::report_errors(); --- a/libs/charconv/test/from_chars_string_view.cpp +++ b/libs/charconv/test/from_chars_string_view.cpp @@ -116,17 +116,23 @@ int main() test_float(); test_float(); - test_float(); test_float(); test_float(); + + #ifndef BOOST_MATH_UNSUPPORTED_LONG_DOUBLE + test_float(); test_float(); + #endif #if !defined(BOOST_NO_CXX17_HDR_STRING_VIEW) test_float(); test_float(); + + #ifndef BOOST_MATH_UNSUPPORTED_LONG_DOUBLE test_float(); + #endif #endif --- a/libs/charconv/test/github_issue_110.cpp +++ b/libs/charconv/test/github_issue_110.cpp @@ -42,7 +42,10 @@ int main() { test(); test(); + + #ifndef BOOST_MATH_UNSUPPORTED_LONG_DOUBLE test(); + #endif #ifdef BOOST_CHARCONV_HAS_FLOAT128 test<__float128>(); --- a/libs/charconv/test/github_issue_122.cpp +++ b/libs/charconv/test/github_issue_122.cpp @@ -52,7 +52,10 @@ int main() { test(); test(); + + #ifndef BOOST_MATH_UNSUPPORTED_LONG_DOUBLE test(); + #endif return boost::report_errors(); } --- a/libs/charconv/test/github_issue_152.cpp +++ b/libs/charconv/test/github_issue_152.cpp @@ -188,7 +188,6 @@ int main() { test_non_finite(); test_non_finite(); - test_non_finite(); #ifdef BOOST_CHARCONV_HAS_FLOAT16 test_non_finite(); #endif @@ -204,7 +203,6 @@ int main() test_non_finite_fixed_precision(); test_non_finite_fixed_precision(); - test_non_finite_fixed_precision(); #ifdef BOOST_CHARCONV_HAS_FLOAT16 test_non_finite_fixed_precision(); #endif @@ -220,7 +218,6 @@ int main() test_min_buffer_size(); test_min_buffer_size(); - test_min_buffer_size(); #ifdef BOOST_CHARCONV_HAS_FLOAT32 test_min_buffer_size(); #endif @@ -232,5 +229,11 @@ int main() test_failed_values(); #endif + #ifndef BOOST_MATH_UNSUPPORTED_LONG_DOUBLE + test_non_finite(); + test_non_finite_fixed_precision(); + test_min_buffer_size(); + #endif + return boost::report_errors(); } --- a/libs/charconv/test/github_issue_158.cpp +++ b/libs/charconv/test/github_issue_158.cpp @@ -93,6 +93,7 @@ void test_values_with_negative_exp() BOOST_TEST_CSTR_EQ(buffer, "0.00000000000000000000099999999999999990753745222790"); } +#ifndef BOOST_MATH_UNSUPPORTED_LONG_DOUBLE void test_long_double_with_negative_exp() { char buffer[256]; @@ -126,6 +127,7 @@ void test_long_double_with_negative_exp() // BOOST_TEST_CSTR_EQ(buffer, "0.00000000000000000999999999999999999997135886174218"); BOOST_TEST_CSTR_EQ(buffer, "0.00000000000000001000000000000000000000000000000000"); } +#endif void test_values_with_positive_exp() { @@ -407,6 +409,7 @@ void test_zero() BOOST_TEST_CSTR_EQ(buffer, "0"); } +#ifndef BOOST_MATH_UNSUPPORTED_LONG_DOUBLE void test_long_double_with_positive_exp() { char buffer[256]; @@ -438,6 +441,7 @@ void test_long_double_with_positive_exp() BOOST_TEST(res); BOOST_TEST_CSTR_EQ(buffer, "100000000000000000.00000000000000000000000000000000000000000000000000"); } +#endif template void test_spot_value(T value, int precision, const char* result, boost::charconv::chars_format fmt = boost::charconv::chars_format::fixed) --- a/libs/charconv/test/limits.cpp +++ b/libs/charconv/test/limits.cpp @@ -227,7 +227,10 @@ int main() test_floating_point(); test_floating_point(); + + #ifndef BOOST_MATH_UNSUPPORTED_LONG_DOUBLE test_floating_point(); + #endif #ifdef BOOST_CHARCONV_HAS_INT128 --- a/libs/charconv/test/limits_link_1.cpp +++ b/libs/charconv/test/limits_link_1.cpp @@ -3,6 +3,7 @@ // https://www.boost.org/LICENSE_1_0.txt #include +#include void test_odr_use( int const* ); @@ -28,7 +29,9 @@ void f1() test(); test(); + #ifndef BOOST_MATH_UNSUPPORTED_LONG_DOUBLE test(); + #endif #ifdef BOOST_CHARCONV_HAS_INT128 --- a/libs/charconv/test/limits_link_2.cpp +++ b/libs/charconv/test/limits_link_2.cpp @@ -3,6 +3,7 @@ // https://www.boost.org/LICENSE_1_0.txt #include +#include void test_odr_use( int const* ); @@ -28,7 +29,9 @@ void f2() test(); test(); + #ifndef BOOST_MATH_UNSUPPORTED_LONG_DOUBLE test(); + #endif #ifdef BOOST_CHARCONV_HAS_INT128 --- a/libs/charconv/test/roundtrip.cpp +++ b/libs/charconv/test/roundtrip.cpp @@ -347,6 +347,7 @@ template int64_t Distance(FPType y, FPType x) return ToOrdinal(y) - ToOrdinal(x); } +#ifndef BOOST_MATH_UNSUPPORTED_LONG_DOUBLE template <> void test_roundtrip(long double value) { char buffer[ 256 ]; @@ -381,6 +382,7 @@ template <> void test_roundtrip(long double value) // LCOV_EXCL_STOP } } +#endif // floating point types, boundary values @@ -601,7 +603,7 @@ int main() #endif // long double - #if !(BOOST_CHARCONV_LDBL_BITS == 128) + #if !(BOOST_CHARCONV_LDBL_BITS == 128) && !defined(BOOST_MATH_UNSUPPORTED_LONG_DOUBLE) { long double const ql = std::pow( 1.0L, -64 ); --- a/libs/charconv/test/to_chars_float.cpp +++ b/libs/charconv/test/to_chars_float.cpp @@ -202,7 +202,7 @@ int main() non_finite_values(boost::charconv::chars_format::hex, 2); // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57484 - #if !(defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 9 && defined(__i686__)) + #if !(defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 9 && defined(__i686__)) && !defined(BOOST_MATH_UNSUPPORTED_LONG_DOUBLE) non_finite_values(); #endif --- a/libs/charconv/test/to_chars_float_STL_comp.cpp +++ b/libs/charconv/test/to_chars_float_STL_comp.cpp @@ -212,7 +212,10 @@ int main() // General format random_test(); random_test(); + #ifndef BOOST_MATH_UNSUPPORTED_LONG_DOUBLE random_test(); + #endif + test_spot(0.0); test_spot(-0.0); @@ -224,7 +227,9 @@ int main() // Scientific random_test(boost::charconv::chars_format::scientific); random_test(boost::charconv::chars_format::scientific); + #ifndef BOOST_MATH_UNSUPPORTED_LONG_DOUBLE random_test(boost::charconv::chars_format::scientific); + #endif test_spot(0.0, boost::charconv::chars_format::scientific); test_spot(-0.0, boost::charconv::chars_format::scientific); @@ -237,14 +242,20 @@ int main() // Hex random_test(boost::charconv::chars_format::hex); random_test(boost::charconv::chars_format::hex); + #ifndef BOOST_MATH_UNSUPPORTED_LONG_DOUBLE random_test(boost::charconv::chars_format::hex); + #endif #if !defined(_LIBCPP_VERSION) + random_test(boost::charconv::chars_format::hex, -1e5F, 1e5F); random_test(boost::charconv::chars_format::hex, -1e5, 1e5); + #ifndef BOOST_MATH_UNSUPPORTED_LONG_DOUBLE random_test(boost::charconv::chars_format::hex, -1e5L, 1e5L); #endif + #endif + test_spot(-9.52743282403084637e+306, boost::charconv::chars_format::hex); test_spot(-9.52743282403084637e-306, boost::charconv::chars_format::hex); test_spot(-9.52743282403084637e+305, boost::charconv::chars_format::hex); @@ -261,13 +272,16 @@ int main() // Various non-finite values non_finite_test(); non_finite_test(); - non_finite_test(); non_finite_test(boost::charconv::chars_format::scientific); non_finite_test(boost::charconv::chars_format::scientific); - non_finite_test(boost::charconv::chars_format::scientific); non_finite_test(boost::charconv::chars_format::hex); non_finite_test(boost::charconv::chars_format::hex); + + #ifndef BOOST_MATH_UNSUPPORTED_LONG_DOUBLE + non_finite_test(); + non_finite_test(boost::charconv::chars_format::scientific); non_finite_test(boost::charconv::chars_format::hex); + #endif #if (defined(__GNUC__) && __GNUC__ >= 11) || (defined(_MSC_VER) && _MSC_VER >= 1924) // Selected additional values @@ -288,7 +302,10 @@ int main() // Reported in issue #93 test_spot(3.3F); test_spot(3.3); + + #ifndef BOOST_MATH_UNSUPPORTED_LONG_DOUBLE test_spot(3.3L); + #endif return boost::report_errors(); } --- a/libs/charconv/test/to_chars_sprintf.cpp +++ b/libs/charconv/test/to_chars_sprintf.cpp @@ -627,6 +627,7 @@ int main() // long double + #ifndef BOOST_MATH_UNSUPPORTED_LONG_DOUBLE { for( int i = 0; i < N; ++i ) { @@ -665,6 +666,7 @@ int main() test_sprintf_bv_fp(); } + #endif return boost::report_errors(); } -- 2.45.2