From 2ec8af445c6a2c8d1a26af5b1c0e1022da5bd63e Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Fri, 7 Jun 2024 17:56:13 +0100 Subject: [PATCH] Add patch to fix another test failure in Boost.Random. --- boost-1.84-random-test-overflow.patch | 33 +++++++++++++++++++++++++-- boost.spec | 5 +++- 2 files changed, 35 insertions(+), 3 deletions(-) diff --git a/boost-1.84-random-test-overflow.patch b/boost-1.84-random-test-overflow.patch index 5c8f6de..27565c3 100644 --- a/boost-1.84-random-test-overflow.patch +++ b/boost-1.84-random-test-overflow.patch @@ -25,6 +25,35 @@ index bc2a936..2b53483 100644 boost::random::piecewise_linear_distribution, #endif boost::random::student_t_distribution, --- -2.45.2 +From 7561690135c67ecf88c2133bad7680ebd2665c36 Mon Sep 17 00:00:00 2001 +From: jzmaddock +Date: Wed, 1 Jun 2022 19:32:55 +0100 +Subject: [PATCH] Update multiprecision_int_test.cpp to not accidentality + overflow type double. Multiprecision now performs correct rounding when + converting to double - previously the max value for uint1024_t would just fit + in a double if it was truncated. But now that it's correctly rounded it + overflows and breaks the calculation. + +--- + test/multiprecision_int_test.cpp | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/test/multiprecision_int_test.cpp b/test/multiprecision_int_test.cpp +index 41ec229b5..a861cca39 100644 +--- a/libs/random/test/multiprecision_int_test.cpp ++++ b/libs/random/test/multiprecision_int_test.cpp +@@ -215,8 +215,11 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(discrete_distributions, distribution_type, other_d + distribution_type d2; + ss >> d2; + BOOST_CHECK(d == d2); +- +- boost::random::independent_bits_engine::digits, boost::multiprecision::uint1024_t > big_random; ++ // ++ // The number of digits in the independent_bits_engine must be low enough that we don't overflow ++ // when converting to a double (see other_distributions declared above). ++ // ++ boost::random::independent_bits_engine::digits - 2, boost::multiprecision::uint1024_t > big_random; + for(unsigned i = 0; i < 200; ++i) + { + result_type r = d(big_random); diff --git a/boost.spec b/boost.spec index ae76f17..0f1e6c6 100644 --- a/boost.spec +++ b/boost.spec @@ -42,7 +42,7 @@ Name: boost %global real_name boost Summary: The free peer-reviewed portable C++ source libraries Version: 1.81.0 -Release: 10%{?dist} +Release: 11%{?dist} License: BSL-1.0 AND MIT AND Python-2.0.1 # Replace each . with _ in %%{version} @@ -1302,6 +1302,9 @@ fi %{_mandir}/man1/b2.1* %changelog +* Fri Jun 07 2024 Jonathan Wakely - 1.81.0-11 +- Add patch to fix another test failure in Boost.Random. + * Thu Jun 06 2024 Jonathan Wakely - 1.81.0-10 - Add missing Requires for rpminspect errors.