From 5c72c7e4cf0a1c436c174f8ff542063114259a5d Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Thu, 6 Nov 2025 15:41:41 +0100 Subject: [PATCH 1/4] Remove BOOST_DECIMAL_REDUCE_TEST_DEPTH from public headers --- include/boost/decimal/detail/config.hpp | 20 ------------------ test/testing_config.hpp | 28 +++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 20 deletions(-) create mode 100644 test/testing_config.hpp diff --git a/include/boost/decimal/detail/config.hpp b/include/boost/decimal/detail/config.hpp index 54d5e2c50..3855e7a62 100644 --- a/include/boost/decimal/detail/config.hpp +++ b/include/boost/decimal/detail/config.hpp @@ -272,26 +272,6 @@ typedef unsigned __int128 builtin_uint128_t; # define BOOST_DECIMAL_NO_CONSTEVAL_DETECTION #endif -#if defined(__clang__) -# if defined __has_feature -# if __has_feature(thread_sanitizer) || __has_feature(address_sanitizer) || __has_feature(thread_sanitizer) -# define BOOST_DECIMAL_REDUCE_TEST_DEPTH -# endif -# endif -#elif defined(__GNUC__) -# if defined(__SANITIZE_THREAD__) || defined(__SANITIZE_ADDRESS__) || defined(__SANITIZE_THREAD__) -# define BOOST_DECIMAL_REDUCE_TEST_DEPTH -# endif -#elif defined(_MSC_VER) -# if defined(_DEBUG) || defined(__SANITIZE_ADDRESS__) -# define BOOST_DECIMAL_REDUCE_TEST_DEPTH -# endif -#endif - -#if !defined(BOOST_DECIMAL_REDUCE_TEST_DEPTH) && ((defined(UBSAN) && (UBSAN == 1))) -# define BOOST_DECIMAL_REDUCE_TEST_DEPTH -#endif - #if defined(__clang__) && __clang_major__ < 19 # define BOOST_DECIMAL_CLANG_STATIC static #else diff --git a/test/testing_config.hpp b/test/testing_config.hpp new file mode 100644 index 000000000..769a95744 --- /dev/null +++ b/test/testing_config.hpp @@ -0,0 +1,28 @@ +// Copyright 2025 Matt Borland +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt + +#ifndef BOOST_DECIMAL_TESTING_CONFIG_HPP +#define BOOST_DECIMAL_TESTING_CONFIG_HPP + +#if defined(__clang__) +# if defined __has_feature +# if __has_feature(thread_sanitizer) || __has_feature(address_sanitizer) || __has_feature(thread_sanitizer) +# define BOOST_DECIMAL_REDUCE_TEST_DEPTH +# endif +# endif +#elif defined(__GNUC__) +# if defined(__SANITIZE_THREAD__) || defined(__SANITIZE_ADDRESS__) || defined(__SANITIZE_THREAD__) +# define BOOST_DECIMAL_REDUCE_TEST_DEPTH +# endif +#elif defined(_MSC_VER) +# if defined(_DEBUG) || defined(__SANITIZE_ADDRESS__) +# define BOOST_DECIMAL_REDUCE_TEST_DEPTH +# endif +#endif + +#if !defined(BOOST_DECIMAL_REDUCE_TEST_DEPTH) && ((defined(UBSAN) && (UBSAN == 1))) +# define BOOST_DECIMAL_REDUCE_TEST_DEPTH +#endif + +#endif // BOOST_DECIMAL_TESTING_CONFIG_HPP From 806252b2e65842b5dd2052e2b8ad6031bc466f90 Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Thu, 6 Nov 2025 15:51:39 +0100 Subject: [PATCH 2/4] Use new testing configuration header --- test/compare_dec128_and_fast.cpp | 1 + test/random_decimal128_comp.cpp | 1 + test/random_decimal128_fast_comp.cpp | 1 + test/random_decimal128_fast_math.cpp | 1 + test/random_decimal128_math.cpp | 1 + test/random_decimal32_comp.cpp | 1 + test/random_decimal32_fast_comp.cpp | 1 + test/random_decimal32_fast_math.cpp | 1 + test/random_decimal32_math.cpp | 1 + test/random_decimal64_comp.cpp | 1 + test/random_decimal64_fast_comp.cpp | 1 + test/random_decimal64_fast_math.cpp | 1 + test/random_decimal64_math.cpp | 1 + test/random_mixed_decimal_comp.cpp | 1 + test/random_mixed_decimal_math.cpp | 1 + test/roundtrip_decimal128.cpp | 2 +- test/roundtrip_decimal128_fast.cpp | 2 +- test/roundtrip_decimal32.cpp | 2 +- test/roundtrip_decimal32_fast.cpp | 2 +- test/roundtrip_decimal64.cpp | 2 +- test/test_acos.cpp | 1 + test/test_acosh.cpp | 1 + test/test_asin.cpp | 1 + test/test_asinh.cpp | 1 + test/test_assoc_laguerre.cpp | 1 + test/test_assoc_legendre.cpp | 1 + test/test_atan.cpp | 1 + test/test_atan2.cpp | 1 + test/test_atanh.cpp | 1 + test/test_beta.cpp | 1 + test/test_cbrt.cpp | 1 + test/test_cmath.cpp | 1 + test/test_cosh.cpp | 1 + test/test_decimal_quantum.cpp | 2 +- test/test_edges_and_behave.cpp | 1 + test/test_edit_members.cpp | 1 + test/test_ellint_1.cpp | 1 + test/test_ellint_2.cpp | 1 + test/test_erf.cpp | 5 ++++- test/test_exp.cpp | 1 + test/test_expm1.cpp | 1 + test/test_fast_math.cpp | 1 + test/test_frexp_ldexp.cpp | 1 + test/test_hermite.cpp | 1 + test/test_laguerre.cpp | 1 + test/test_legendre.cpp | 1 + test/test_lgamma.cpp | 1 + test/test_log.cpp | 1 + test/test_log10.cpp | 1 + test/test_log1p.cpp | 1 + test/test_pow.cpp | 1 + test/test_remainder_remquo.cpp | 1 + test/test_sin_cos.cpp | 1 + test/test_sinh.cpp | 1 + test/test_sqrt.cpp | 1 + test/test_strtod.cpp | 1 + test/test_tan.cpp | 1 + test/test_tanh.cpp | 1 + test/test_tgamma.cpp | 1 + test/test_to_chars.cpp | 1 + test/test_zeta.cpp | 1 + 61 files changed, 64 insertions(+), 7 deletions(-) diff --git a/test/compare_dec128_and_fast.cpp b/test/compare_dec128_and_fast.cpp index 974128d74..87ab7b765 100644 --- a/test/compare_dec128_and_fast.cpp +++ b/test/compare_dec128_and_fast.cpp @@ -2,6 +2,7 @@ // Distributed under the Boost Software License, Version 1.0. // https://www.boost.org/LICENSE_1_0.txt +#include "testing_config.hpp" #include #include #include diff --git a/test/random_decimal128_comp.cpp b/test/random_decimal128_comp.cpp index e889ecd05..b7da3b090 100644 --- a/test/random_decimal128_comp.cpp +++ b/test/random_decimal128_comp.cpp @@ -2,6 +2,7 @@ // Distributed under the Boost Software License, Version 1.0. // https://www.boost.org/LICENSE_1_0.txt +#include "testing_config.hpp" #include #include #include diff --git a/test/random_decimal128_fast_comp.cpp b/test/random_decimal128_fast_comp.cpp index b8c643698..48f26e425 100644 --- a/test/random_decimal128_fast_comp.cpp +++ b/test/random_decimal128_fast_comp.cpp @@ -2,6 +2,7 @@ // Distributed under the Boost Software License, Version 1.0. // https://www.boost.org/LICENSE_1_0.txt +#include "testing_config.hpp" #include #include #include diff --git a/test/random_decimal128_fast_math.cpp b/test/random_decimal128_fast_math.cpp index 19d96fe89..49dc8d7ce 100644 --- a/test/random_decimal128_fast_math.cpp +++ b/test/random_decimal128_fast_math.cpp @@ -2,6 +2,7 @@ // Distributed under the Boost Software License, Version 1.0. // https://www.boost.org/LICENSE_1_0.txt +#include "testing_config.hpp" #include #include #include diff --git a/test/random_decimal128_math.cpp b/test/random_decimal128_math.cpp index 1a5b320cc..913a67641 100644 --- a/test/random_decimal128_math.cpp +++ b/test/random_decimal128_math.cpp @@ -2,6 +2,7 @@ // Distributed under the Boost Software License, Version 1.0. // https://www.boost.org/LICENSE_1_0.txt +#include "testing_config.hpp" #include #include #include diff --git a/test/random_decimal32_comp.cpp b/test/random_decimal32_comp.cpp index 25c3f25fd..335e65b96 100644 --- a/test/random_decimal32_comp.cpp +++ b/test/random_decimal32_comp.cpp @@ -6,6 +6,7 @@ #include #endif +#include "testing_config.hpp" #include #include #include diff --git a/test/random_decimal32_fast_comp.cpp b/test/random_decimal32_fast_comp.cpp index ae010a137..d0cba04ed 100644 --- a/test/random_decimal32_fast_comp.cpp +++ b/test/random_decimal32_fast_comp.cpp @@ -6,6 +6,7 @@ #include #endif +#include "testing_config.hpp" #include #include #include diff --git a/test/random_decimal32_fast_math.cpp b/test/random_decimal32_fast_math.cpp index 120a9b46e..4714c9bf7 100644 --- a/test/random_decimal32_fast_math.cpp +++ b/test/random_decimal32_fast_math.cpp @@ -6,6 +6,7 @@ #include #endif +#include "testing_config.hpp" #include #include #include diff --git a/test/random_decimal32_math.cpp b/test/random_decimal32_math.cpp index 03656427d..15e58f67c 100644 --- a/test/random_decimal32_math.cpp +++ b/test/random_decimal32_math.cpp @@ -2,6 +2,7 @@ // Distributed under the Boost Software License, Version 1.0. // https://www.boost.org/LICENSE_1_0.txt +#include "testing_config.hpp" #include #include #include diff --git a/test/random_decimal64_comp.cpp b/test/random_decimal64_comp.cpp index 559eea48b..cc1c9a871 100644 --- a/test/random_decimal64_comp.cpp +++ b/test/random_decimal64_comp.cpp @@ -2,6 +2,7 @@ // Distributed under the Boost Software License, Version 1.0. // https://www.boost.org/LICENSE_1_0.txt +#include "testing_config.hpp" #include #include #include diff --git a/test/random_decimal64_fast_comp.cpp b/test/random_decimal64_fast_comp.cpp index cba3febc9..dc201aaa1 100644 --- a/test/random_decimal64_fast_comp.cpp +++ b/test/random_decimal64_fast_comp.cpp @@ -2,6 +2,7 @@ // Distributed under the Boost Software License, Version 1.0. // https://www.boost.org/LICENSE_1_0.txt +#include "testing_config.hpp" #include #include #include diff --git a/test/random_decimal64_fast_math.cpp b/test/random_decimal64_fast_math.cpp index 34493afc3..add73e5e1 100644 --- a/test/random_decimal64_fast_math.cpp +++ b/test/random_decimal64_fast_math.cpp @@ -2,6 +2,7 @@ // Distributed under the Boost Software License, Version 1.0. // https://www.boost.org/LICENSE_1_0.txt +#include "testing_config.hpp" #include #include #include diff --git a/test/random_decimal64_math.cpp b/test/random_decimal64_math.cpp index 545c223f6..f877626cd 100644 --- a/test/random_decimal64_math.cpp +++ b/test/random_decimal64_math.cpp @@ -2,6 +2,7 @@ // Distributed under the Boost Software License, Version 1.0. // https://www.boost.org/LICENSE_1_0.txt +#include "testing_config.hpp" #include #include #include diff --git a/test/random_mixed_decimal_comp.cpp b/test/random_mixed_decimal_comp.cpp index d46a4f595..357d46b12 100644 --- a/test/random_mixed_decimal_comp.cpp +++ b/test/random_mixed_decimal_comp.cpp @@ -2,6 +2,7 @@ // Distributed under the Boost Software License, Version 1.0. // https://www.boost.org/LICENSE_1_0.txt +#include "testing_config.hpp" #include #include #include diff --git a/test/random_mixed_decimal_math.cpp b/test/random_mixed_decimal_math.cpp index 81f4efae7..2ac13bf40 100644 --- a/test/random_mixed_decimal_math.cpp +++ b/test/random_mixed_decimal_math.cpp @@ -2,6 +2,7 @@ // Distributed under the Boost Software License, Version 1.0. // https://www.boost.org/LICENSE_1_0.txt +#include "testing_config.hpp" #include #include #include diff --git a/test/roundtrip_decimal128.cpp b/test/roundtrip_decimal128.cpp index 2df3c74f7..4ca58b48f 100644 --- a/test/roundtrip_decimal128.cpp +++ b/test/roundtrip_decimal128.cpp @@ -3,7 +3,7 @@ // https://www.boost.org/LICENSE_1_0.txt #include "mini_to_chars.hpp" - +#include "testing_config.hpp" #include #if defined(__clang__) diff --git a/test/roundtrip_decimal128_fast.cpp b/test/roundtrip_decimal128_fast.cpp index 47af2f7db..a21f3791a 100644 --- a/test/roundtrip_decimal128_fast.cpp +++ b/test/roundtrip_decimal128_fast.cpp @@ -3,7 +3,7 @@ // https://www.boost.org/LICENSE_1_0.txt #include "mini_to_chars.hpp" - +#include "testing_config.hpp" #include #if defined(__clang__) diff --git a/test/roundtrip_decimal32.cpp b/test/roundtrip_decimal32.cpp index 42fe101c5..da3764804 100644 --- a/test/roundtrip_decimal32.cpp +++ b/test/roundtrip_decimal32.cpp @@ -3,7 +3,7 @@ // https://www.boost.org/LICENSE_1_0.txt #include "mini_to_chars.hpp" - +#include "testing_config.hpp" #include #include #include diff --git a/test/roundtrip_decimal32_fast.cpp b/test/roundtrip_decimal32_fast.cpp index e04ea532b..5878a0cd7 100644 --- a/test/roundtrip_decimal32_fast.cpp +++ b/test/roundtrip_decimal32_fast.cpp @@ -3,7 +3,7 @@ // https://www.boost.org/LICENSE_1_0.txt #include "mini_to_chars.hpp" - +#include "testing_config.hpp" #include #include #include diff --git a/test/roundtrip_decimal64.cpp b/test/roundtrip_decimal64.cpp index 448bcb954..f332c28b5 100644 --- a/test/roundtrip_decimal64.cpp +++ b/test/roundtrip_decimal64.cpp @@ -3,7 +3,7 @@ // https://www.boost.org/LICENSE_1_0.txt #include "mini_to_chars.hpp" - +#include "testing_config.hpp" #include #include #include diff --git a/test/test_acos.cpp b/test/test_acos.cpp index 04aca2231..eb30e7840 100644 --- a/test/test_acos.cpp +++ b/test/test_acos.cpp @@ -5,6 +5,7 @@ // Propogates up from boost.math #define _SILENCE_CXX23_DENORM_DEPRECATION_WARNING +#include "testing_config.hpp" #include #if defined(__clang__) diff --git a/test/test_acosh.cpp b/test/test_acosh.cpp index 4728515a1..8118346b1 100644 --- a/test/test_acosh.cpp +++ b/test/test_acosh.cpp @@ -3,6 +3,7 @@ // Distributed under the Boost Software License, Version 1.0. // https://www.boost.org/LICENSE_1_0.txt +#include "testing_config.hpp" #include #include #include diff --git a/test/test_asin.cpp b/test/test_asin.cpp index 3f9f0181e..38eb93227 100644 --- a/test/test_asin.cpp +++ b/test/test_asin.cpp @@ -6,6 +6,7 @@ // Propogates up from boost.math #define _SILENCE_CXX23_DENORM_DEPRECATION_WARNING +#include "testing_config.hpp" #include #if defined(__clang__) diff --git a/test/test_asinh.cpp b/test/test_asinh.cpp index d5c3c4380..f4136c3c5 100644 --- a/test/test_asinh.cpp +++ b/test/test_asinh.cpp @@ -3,6 +3,7 @@ // Distributed under the Boost Software License, Version 1.0. // https://www.boost.org/LICENSE_1_0.txt +#include "testing_config.hpp" #include #include #include diff --git a/test/test_assoc_laguerre.cpp b/test/test_assoc_laguerre.cpp index 338211c88..5b56a8eee 100644 --- a/test/test_assoc_laguerre.cpp +++ b/test/test_assoc_laguerre.cpp @@ -5,6 +5,7 @@ // Propogates up from boost.math #define _SILENCE_CXX23_DENORM_DEPRECATION_WARNING +#include "testing_config.hpp" #include #if defined(__clang__) diff --git a/test/test_assoc_legendre.cpp b/test/test_assoc_legendre.cpp index fc2045368..92e8bd5ad 100644 --- a/test/test_assoc_legendre.cpp +++ b/test/test_assoc_legendre.cpp @@ -5,6 +5,7 @@ // Propogates up from boost.math #define _SILENCE_CXX23_DENORM_DEPRECATION_WARNING +#include "testing_config.hpp" #include #if defined(__clang__) diff --git a/test/test_atan.cpp b/test/test_atan.cpp index 75acf0984..7a3739cd5 100644 --- a/test/test_atan.cpp +++ b/test/test_atan.cpp @@ -6,6 +6,7 @@ // Propogates up from boost.math #define _SILENCE_CXX23_DENORM_DEPRECATION_WARNING +#include "testing_config.hpp" #include #if defined(__clang__) diff --git a/test/test_atan2.cpp b/test/test_atan2.cpp index 98bd8c6ce..3749edc90 100644 --- a/test/test_atan2.cpp +++ b/test/test_atan2.cpp @@ -5,6 +5,7 @@ // Propagates up from boost.math #define _SILENCE_CXX23_DENORM_DEPRECATION_WARNING +#include "testing_config.hpp" #include #if defined(__clang__) diff --git a/test/test_atanh.cpp b/test/test_atanh.cpp index 1367fe7c2..567412a58 100644 --- a/test/test_atanh.cpp +++ b/test/test_atanh.cpp @@ -3,6 +3,7 @@ // Distributed under the Boost Software License, Version 1.0. // https://www.boost.org/LICENSE_1_0.txt +#include "testing_config.hpp" #include #include #include diff --git a/test/test_beta.cpp b/test/test_beta.cpp index 0d3988e22..be33dc2c8 100644 --- a/test/test_beta.cpp +++ b/test/test_beta.cpp @@ -5,6 +5,7 @@ // Propagates up from boost.math #define _SILENCE_CXX23_DENORM_DEPRECATION_WARNING +#include "testing_config.hpp" #include #if defined(__clang__) diff --git a/test/test_cbrt.cpp b/test/test_cbrt.cpp index 92e4404c3..59fe01605 100644 --- a/test/test_cbrt.cpp +++ b/test/test_cbrt.cpp @@ -3,6 +3,7 @@ // Distributed under the Boost Software License, Version 1.0. // https://www.boost.org/LICENSE_1_0.txt +#include "testing_config.hpp" #include #if defined(__clang__) diff --git a/test/test_cmath.cpp b/test/test_cmath.cpp index dc9a86bda..4bc22ebc1 100644 --- a/test/test_cmath.cpp +++ b/test/test_cmath.cpp @@ -5,6 +5,7 @@ // Propogates up from boost.math #define _SILENCE_CXX23_DENORM_DEPRECATION_WARNING +#include "testing_config.hpp" #include #include #include diff --git a/test/test_cosh.cpp b/test/test_cosh.cpp index 71e611cfc..f0118767e 100644 --- a/test/test_cosh.cpp +++ b/test/test_cosh.cpp @@ -3,6 +3,7 @@ // Distributed under the Boost Software License, Version 1.0. // https://www.boost.org/LICENSE_1_0.txt +#include "testing_config.hpp" #include #include #include diff --git a/test/test_decimal_quantum.cpp b/test/test_decimal_quantum.cpp index 5af453324..4126a4f22 100644 --- a/test/test_decimal_quantum.cpp +++ b/test/test_decimal_quantum.cpp @@ -3,7 +3,7 @@ // https://www.boost.org/LICENSE_1_0.txt #include "mini_to_chars.hpp" - +#include "testing_config.hpp" #include #include #include diff --git a/test/test_edges_and_behave.cpp b/test/test_edges_and_behave.cpp index 69b2aae2b..0d90fb4fe 100644 --- a/test/test_edges_and_behave.cpp +++ b/test/test_edges_and_behave.cpp @@ -3,6 +3,7 @@ // Distributed under the Boost Software License, Version 1.0. // https://www.boost.org/LICENSE_1_0.txt +#include "testing_config.hpp" #include #include diff --git a/test/test_edit_members.cpp b/test/test_edit_members.cpp index c4e36c801..8f325c9cc 100644 --- a/test/test_edit_members.cpp +++ b/test/test_edit_members.cpp @@ -4,6 +4,7 @@ #define BOOST_DECIMAL_DEBUG_MEMBERS +#include "testing_config.hpp" #include #include #include diff --git a/test/test_ellint_1.cpp b/test/test_ellint_1.cpp index 9ce19e78e..c293dc7e0 100644 --- a/test/test_ellint_1.cpp +++ b/test/test_ellint_1.cpp @@ -6,6 +6,7 @@ // Propogates up from boost.math #define _SILENCE_CXX23_DENORM_DEPRECATION_WARNING +#include "testing_config.hpp" #include #if defined(__clang__) diff --git a/test/test_ellint_2.cpp b/test/test_ellint_2.cpp index b1f8c1450..d310141f9 100644 --- a/test/test_ellint_2.cpp +++ b/test/test_ellint_2.cpp @@ -6,6 +6,7 @@ // Propogates up from boost.math #define _SILENCE_CXX23_DENORM_DEPRECATION_WARNING +#include "testing_config.hpp" #include #if defined(__clang__) diff --git a/test/test_erf.cpp b/test/test_erf.cpp index c4b844722..5d395cab4 100644 --- a/test/test_erf.cpp +++ b/test/test_erf.cpp @@ -5,6 +5,7 @@ // Propogates up from boost.math #define _SILENCE_CXX23_DENORM_DEPRECATION_WARNING +#include "testing_config.hpp" #include #if defined(__clang__) @@ -33,7 +34,9 @@ // Needed to reduce CI runtime #ifdef _MSC_VER -# define BOOST_DECIMAL_REDUCE_TEST_DEPTH +# ifndef BOOST_DECIMAL_REDUCE_TEST_DEPTH +# define BOOST_DECIMAL_REDUCE_TEST_DEPTH +# endif #endif #if !defined(BOOST_DECIMAL_REDUCE_TEST_DEPTH) && !defined(_MSC_VER) diff --git a/test/test_exp.cpp b/test/test_exp.cpp index c37ecab50..3b8e02594 100644 --- a/test/test_exp.cpp +++ b/test/test_exp.cpp @@ -3,6 +3,7 @@ // Distributed under the Boost Software License, Version 1.0. // https://www.boost.org/LICENSE_1_0.txt +#include "testing_config.hpp" #include #include #include diff --git a/test/test_expm1.cpp b/test/test_expm1.cpp index 573c762b6..3642eb45b 100644 --- a/test/test_expm1.cpp +++ b/test/test_expm1.cpp @@ -3,6 +3,7 @@ // Distributed under the Boost Software License, Version 1.0. // https://www.boost.org/LICENSE_1_0.txt +#include "testing_config.hpp" #include #include #include diff --git a/test/test_fast_math.cpp b/test/test_fast_math.cpp index 6e8ec10d7..468f1bac6 100644 --- a/test/test_fast_math.cpp +++ b/test/test_fast_math.cpp @@ -4,6 +4,7 @@ #define BOOST_DECIMAL_FAST_MATH +#include "testing_config.hpp" #include #include #include diff --git a/test/test_frexp_ldexp.cpp b/test/test_frexp_ldexp.cpp index d918dad71..201558489 100644 --- a/test/test_frexp_ldexp.cpp +++ b/test/test_frexp_ldexp.cpp @@ -3,6 +3,7 @@ // Distributed under the Boost Software License, Version 1.0. // https://www.boost.org/LICENSE_1_0.txt +#include "testing_config.hpp" #include #include #include diff --git a/test/test_hermite.cpp b/test/test_hermite.cpp index dd15dc9de..63ef25f7e 100644 --- a/test/test_hermite.cpp +++ b/test/test_hermite.cpp @@ -5,6 +5,7 @@ // Propogates up from boost.math #define _SILENCE_CXX23_DENORM_DEPRECATION_WARNING +#include "testing_config.hpp" #include #if defined(__clang__) diff --git a/test/test_laguerre.cpp b/test/test_laguerre.cpp index 7d114454e..70af27d47 100644 --- a/test/test_laguerre.cpp +++ b/test/test_laguerre.cpp @@ -5,6 +5,7 @@ // Propogates up from boost.math #define _SILENCE_CXX23_DENORM_DEPRECATION_WARNING +#include "testing_config.hpp" #include #if defined(__clang__) diff --git a/test/test_legendre.cpp b/test/test_legendre.cpp index afc3faffb..71a37f567 100644 --- a/test/test_legendre.cpp +++ b/test/test_legendre.cpp @@ -5,6 +5,7 @@ // Propogates up from boost.math #define _SILENCE_CXX23_DENORM_DEPRECATION_WARNING +#include "testing_config.hpp" #include #if defined(__clang__) diff --git a/test/test_lgamma.cpp b/test/test_lgamma.cpp index 588e64bd9..97346ef52 100644 --- a/test/test_lgamma.cpp +++ b/test/test_lgamma.cpp @@ -3,6 +3,7 @@ // Distributed under the Boost Software License, Version 1.0. // https://www.boost.org/LICENSE_1_0.txt +#include "testing_config.hpp" #include #include #include diff --git a/test/test_log.cpp b/test/test_log.cpp index fecb47ba9..8ce457913 100644 --- a/test/test_log.cpp +++ b/test/test_log.cpp @@ -3,6 +3,7 @@ // Distributed under the Boost Software License, Version 1.0. // https://www.boost.org/LICENSE_1_0.txt +#include "testing_config.hpp" #include #include #include diff --git a/test/test_log10.cpp b/test/test_log10.cpp index d8312606e..89c02a79c 100644 --- a/test/test_log10.cpp +++ b/test/test_log10.cpp @@ -3,6 +3,7 @@ // Distributed under the Boost Software License, Version 1.0. // https://www.boost.org/LICENSE_1_0.txt +#include "testing_config.hpp" #include #if defined(__clang__) diff --git a/test/test_log1p.cpp b/test/test_log1p.cpp index 830bca5b4..760e6d07a 100644 --- a/test/test_log1p.cpp +++ b/test/test_log1p.cpp @@ -3,6 +3,7 @@ // Distributed under the Boost Software License, Version 1.0. // https://www.boost.org/LICENSE_1_0.txt +#include "testing_config.hpp" #include #include #include diff --git a/test/test_pow.cpp b/test/test_pow.cpp index 4ca7bc25d..81244491c 100644 --- a/test/test_pow.cpp +++ b/test/test_pow.cpp @@ -3,6 +3,7 @@ // Distributed under the Boost Software License, Version 1.0. // https://www.boost.org/LICENSE_1_0.txt +#include "testing_config.hpp" #include #include #include diff --git a/test/test_remainder_remquo.cpp b/test/test_remainder_remquo.cpp index 24949d99a..e36e335c4 100644 --- a/test/test_remainder_remquo.cpp +++ b/test/test_remainder_remquo.cpp @@ -5,6 +5,7 @@ // Propogates up from boost.math #define _SILENCE_CXX23_DENORM_DEPRECATION_WARNING +#include "testing_config.hpp" #include #if defined(__clang__) diff --git a/test/test_sin_cos.cpp b/test/test_sin_cos.cpp index 0ab0727dd..f7baa89cd 100644 --- a/test/test_sin_cos.cpp +++ b/test/test_sin_cos.cpp @@ -6,6 +6,7 @@ // Propogates up from boost.math #define _SILENCE_CXX23_DENORM_DEPRECATION_WARNING +#include "testing_config.hpp" #include #include diff --git a/test/test_sinh.cpp b/test/test_sinh.cpp index 9d8d5fcf2..539b9cc41 100644 --- a/test/test_sinh.cpp +++ b/test/test_sinh.cpp @@ -3,6 +3,7 @@ // Distributed under the Boost Software License, Version 1.0. // https://www.boost.org/LICENSE_1_0.txt +#include "testing_config.hpp" #include #include #include diff --git a/test/test_sqrt.cpp b/test/test_sqrt.cpp index 597841c67..578cb2db5 100644 --- a/test/test_sqrt.cpp +++ b/test/test_sqrt.cpp @@ -3,6 +3,7 @@ // Distributed under the Boost Software License, Version 1.0. // https://www.boost.org/LICENSE_1_0.txt +#include "testing_config.hpp" #include #include #include diff --git a/test/test_strtod.cpp b/test/test_strtod.cpp index c54c07cdf..453c13bcd 100644 --- a/test/test_strtod.cpp +++ b/test/test_strtod.cpp @@ -2,6 +2,7 @@ // Distributed under the Boost Software License, Version 1.0. // https://www.boost.org/LICENSE_1_0.txt +#include "testing_config.hpp" #include "mini_to_chars.hpp" #include #include diff --git a/test/test_tan.cpp b/test/test_tan.cpp index 313fa7a35..f112612e3 100644 --- a/test/test_tan.cpp +++ b/test/test_tan.cpp @@ -3,6 +3,7 @@ // Distributed under the Boost Software License, Version 1.0. // https://www.boost.org/LICENSE_1_0.txt +#include "testing_config.hpp" #include #include #include diff --git a/test/test_tanh.cpp b/test/test_tanh.cpp index 4c36a81e2..ffe11d8a7 100644 --- a/test/test_tanh.cpp +++ b/test/test_tanh.cpp @@ -3,6 +3,7 @@ // Distributed under the Boost Software License, Version 1.0. // https://www.boost.org/LICENSE_1_0.txt +#include "testing_config.hpp" #include #include #include diff --git a/test/test_tgamma.cpp b/test/test_tgamma.cpp index 68efb5c9b..6d4ca59c0 100644 --- a/test/test_tgamma.cpp +++ b/test/test_tgamma.cpp @@ -3,6 +3,7 @@ // Distributed under the Boost Software License, Version 1.0. // https://www.boost.org/LICENSE_1_0.txt +#include "testing_config.hpp" #include #include #include diff --git a/test/test_to_chars.cpp b/test/test_to_chars.cpp index 34f4da8d3..99312f5a2 100644 --- a/test/test_to_chars.cpp +++ b/test/test_to_chars.cpp @@ -8,6 +8,7 @@ # pragma GCC diagnostic ignored "-Warray-bounds" #endif +#include "testing_config.hpp" #include "mini_to_chars.hpp" #include #include diff --git a/test/test_zeta.cpp b/test/test_zeta.cpp index 12bb1e9c7..9c98f779f 100644 --- a/test/test_zeta.cpp +++ b/test/test_zeta.cpp @@ -6,6 +6,7 @@ // Propogates up from boost.math #define _SILENCE_CXX23_DENORM_DEPRECATION_WARNING +#include "testing_config.hpp" #include #if defined(__clang__) From b3cd50350b7136cfc13b90e030a50f75feeef2c5 Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Thu, 6 Nov 2025 15:53:13 +0100 Subject: [PATCH 3/4] Remove debug pattern function --- include/boost/decimal/decimal32_t.hpp | 14 ----------- test/test_decimal32.cpp | 35 --------------------------- 2 files changed, 49 deletions(-) diff --git a/include/boost/decimal/decimal32_t.hpp b/include/boost/decimal/decimal32_t.hpp index 4ad62bf46..eeb922d54 100644 --- a/include/boost/decimal/decimal32_t.hpp +++ b/include/boost/decimal/decimal32_t.hpp @@ -170,7 +170,6 @@ BOOST_DECIMAL_EXPORT class decimal32_t final // NOLINT(cppcoreguidelines-special // Debug bit pattern friend constexpr auto from_bits(std::uint32_t bits) noexcept -> decimal32_t; friend BOOST_DECIMAL_CXX20_CONSTEXPR auto to_bits(decimal32_t rhs) noexcept -> std::uint32_t; - friend inline auto debug_pattern(decimal32_t rhs) noexcept -> void; // Equality template between any integer type and decimal32_t template @@ -2037,19 +2036,6 @@ constexpr auto decimal32_t::operator%=(const decimal32_t rhs) noexcept -> decima return *this; } -// LCOV_EXCL_START -inline auto debug_pattern(const decimal32_t rhs) noexcept -> void -{ - #if !defined(BOOST_DECIMAL_DISABLE_IOSTREAM) - std::cerr << "Sig: " << rhs.full_significand() - << "\nExp: " << rhs.biased_exponent() - << "\nNeg: " << rhs.isneg() << std::endl; - #else - static_cast(rhs); - #endif -} -// LCOV_EXCL_STOP - BOOST_DECIMAL_CXX20_CONSTEXPR decimal32_t::operator float() const noexcept { return to_float(*this); diff --git a/test/test_decimal32.cpp b/test/test_decimal32.cpp index f31737ebc..a3bdc32e4 100644 --- a/test/test_decimal32.cpp +++ b/test/test_decimal32.cpp @@ -417,31 +417,6 @@ void test_construct_from_integer() } } -template -void test_construct_from_float() -{ - constexpr decimal32_t one(1, 0); - decimal32_t float_one(T(1)); - if(!BOOST_TEST_EQ(one, float_one)) - { - debug_pattern(float_one); // LCOV_EXCL_LINE - } - - constexpr decimal32_t fraction(12345, -4); - decimal32_t float_frac(T(1.2345)); - if(!BOOST_TEST_EQ(fraction, float_frac)) - { - debug_pattern(float_frac); // LCOV_EXCL_LINE - } - - constexpr decimal32_t neg_frac(98123, -4, true); - decimal32_t neg_float_frac(T(-9.8123)); - if(!BOOST_TEST_EQ(neg_frac, neg_float_frac)) - { - debug_pattern(neg_float_frac); // LCOV_EXCL_LINE - } -} - template void spot_check_addition(T a, T b, T res) { @@ -491,16 +466,6 @@ int main() test_construct_from_integer(); test_construct_from_integer(); - test_construct_from_float(); - test_construct_from_float(); - - #if BOOST_DECIMAL_LDBL_BITS != 128 - test_construct_from_float(); - #endif - #ifdef BOOST_DECIMAL_HAS_FLOAT128 - //test_construct_from_float<__float128>(); - #endif - test_comp(); test_addition(); From 5ffac74da77cad67490a322326669b9080244fa9 Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Thu, 6 Nov 2025 15:54:37 +0100 Subject: [PATCH 4/4] Remove bit_string function --- include/boost/decimal/decimal128_t.hpp | 13 ------ test/test_decimal128_basis.cpp | 56 -------------------------- 2 files changed, 69 deletions(-) diff --git a/include/boost/decimal/decimal128_t.hpp b/include/boost/decimal/decimal128_t.hpp index 5568a71a0..d030e6ae0 100644 --- a/include/boost/decimal/decimal128_t.hpp +++ b/include/boost/decimal/decimal128_t.hpp @@ -530,10 +530,6 @@ BOOST_DECIMAL_EXPORT class decimal128_t final BOOST_DECIMAL_REQUIRES_RETURN(detail::is_integral_v, Integer, std::partial_ordering); #endif - #if !defined(BOOST_DECIMAL_DISABLE_IOSTREAM) - friend inline std::string bit_string(decimal128_t rhs) noexcept; - #endif - // 3.6.4 Same Quantum friend constexpr auto samequantumd128(const decimal128_t& lhs, const decimal128_t& rhs) noexcept -> bool; @@ -606,15 +602,6 @@ BOOST_DECIMAL_EXPORT class decimal128_t final friend constexpr auto fmad128(decimal128_t x, decimal128_t y, decimal128_t z) noexcept -> decimal128_t; }; -#if !defined(BOOST_DECIMAL_DISABLE_IOSTREAM) -inline std::string bit_string(decimal128_t rhs) noexcept -{ - std::stringstream ss; - ss << std::hex << rhs.bits_.high << rhs.bits_.low; - return ss.str(); -} -#endif - #ifdef BOOST_DECIMAL_HAS_INT128 constexpr auto from_bits(const detail::builtin_uint128_t rhs) noexcept -> decimal128_t diff --git a/test/test_decimal128_basis.cpp b/test/test_decimal128_basis.cpp index a383e93a7..758e3315e 100644 --- a/test/test_decimal128_basis.cpp +++ b/test/test_decimal128_basis.cpp @@ -14,61 +14,6 @@ using namespace boost::decimal; -#if BOOST_DECIMAL_ENDIAN_LITTLE_BYTE && defined(BOOST_DECIMAL_HAS_INT128) -void test_binary_constructor() -{ - decimal128_t one(0b1, -6175); - // 0 for sign - // 00000 for combination field - // 00000000 for exp - // 1 for significand - BOOST_TEST_EQ(bit_string(one), "4000000000001"); - - decimal128_t neg_one(-0b1, -6175); - // 1 for sign - // 00000 for combination field - // 00000000 for exp - // 1 for significand - BOOST_TEST_EQ(bit_string(neg_one), "80004000000000001"); - - decimal128_t two(0b10, -6175); - // 0 for sign - // 00000 for combination field - // 00000000 for exp - // 2 for significand - BOOST_TEST_EQ(bit_string(two), "4000000000002"); - - decimal128_t three(0b11, -6175); - // 0 for sign - // 00000 for combination field - // 00000000 for exp - // 3 for significand - BOOST_TEST_EQ(bit_string(three), "4000000000003"); - - decimal128_t big(UINT64_MAX, -6175); - // 0 for sign - // 00000 for combination field - // 00000000 for exp - // FFFFFFFFFFFFFFFF for significand - BOOST_TEST_EQ(bit_string(big), "400000000000ffffffffffffffff"); - - decimal128_t onee1(0b1, -6174); - // 0 for sign - // 00000 for combination field - // 00000001 for exp - // 1 for significand - BOOST_TEST_EQ(bit_string(onee1), "8000000000001"); -} - -#else - -void test_binary_constructor() -{ - //nothing -} - -#endif - void test_non_finite_values() { const decimal128_t one(0b1, 0); @@ -123,7 +68,6 @@ void test_float_constructor() int main() { - test_binary_constructor(); test_non_finite_values(); test_float_constructor();