Skip to content

Commit 3d8e1d5

Browse files
authored
test fix for multiprecision 562 (#1015)
1 parent fac5c41 commit 3d8e1d5

3 files changed

Lines changed: 16 additions & 42 deletions

File tree

test/Jamfile.v2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -983,7 +983,7 @@ test-suite misc :
983983
[ run centered_continued_fraction_test.cpp : : : [ requires cxx17_if_constexpr cxx17_std_apply ] [ check-target-builds ../config//has_float128 "GCC libquadmath and __float128 support" : <linkflags>-lquadmath ] ]
984984
[ run luroth_expansion_test.cpp : : : [ requires cxx17_if_constexpr cxx17_std_apply ] [ check-target-builds ../config//has_float128 "GCC libquadmath and __float128 support" : <linkflags>-lquadmath ] ]
985985
[ run engel_expansion_test.cpp : : : [ requires cxx17_if_constexpr cxx17_std_apply ] [ check-target-builds ../config//has_float128 "GCC libquadmath and __float128 support" : <linkflags>-lquadmath ] ]
986-
[ run test_classify.cpp pch ../../test/build//boost_unit_test_framework ]
986+
[ run test_classify.cpp pch ../../test/build//boost_unit_test_framework : : : <toolset>msvc:<cxxflags>/bigobj ]
987987
[ run test_error_handling.cpp ../../test/build//boost_unit_test_framework ]
988988
[ run legendre_stieltjes_test.cpp ../../test/build//boost_unit_test_framework : : : [ requires cxx11_auto_declarations cxx11_range_based_for ] [ check-target-builds ../config//has_float128 "GCC libquadmath and __float128 support" : <linkflags>-lquadmath ] ]
989989
[ run test_minima.cpp pch ../../test/build//boost_unit_test_framework ]

test/test_autodiff_7.cpp

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -23,45 +23,4 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(expm1_hpp, T, all_float_types) {
2323
}
2424
}
2525

26-
BOOST_AUTO_TEST_CASE_TEMPLATE(fpclassify_hpp, T, all_float_types) {
27-
using boost::math::fpclassify;
28-
using boost::math::isfinite;
29-
using boost::math::isinf;
30-
using boost::math::isnan;
31-
using boost::math::isnormal;
32-
using boost::multiprecision::fpclassify;
33-
using boost::multiprecision::isfinite;
34-
using boost::multiprecision::isinf;
35-
using boost::multiprecision::isnan;
36-
using boost::multiprecision::isnormal;
37-
38-
using test_constants = test_constants_t<T>;
39-
static constexpr auto m = test_constants::order;
40-
test_detail::RandomSample<T> x_sampler{-1000, 1000};
41-
for (auto i : boost::irange(test_constants::n_samples)) {
42-
std::ignore = i;
43-
44-
BOOST_CHECK_EQUAL(fpclassify(make_fvar<T, m>(0)), FP_ZERO);
45-
BOOST_CHECK_EQUAL(fpclassify(make_fvar<T, m>(10)), FP_NORMAL);
46-
BOOST_CHECK_EQUAL(
47-
fpclassify(make_fvar<T, m>(std::numeric_limits<T>::infinity())),
48-
FP_INFINITE);
49-
BOOST_CHECK_EQUAL(
50-
fpclassify(make_fvar<T, m>(std::numeric_limits<T>::quiet_NaN())),
51-
FP_NAN);
52-
if (std::numeric_limits<T>::has_denorm != std::denorm_absent) {
53-
BOOST_CHECK_EQUAL(
54-
fpclassify(make_fvar<T, m>(std::numeric_limits<T>::denorm_min())),
55-
FP_SUBNORMAL);
56-
}
57-
58-
BOOST_CHECK(isfinite(make_fvar<T, m>(0)));
59-
BOOST_CHECK(isnormal(make_fvar<T, m>((std::numeric_limits<T>::min)())));
60-
BOOST_CHECK(
61-
!isnormal(make_fvar<T, m>(std::numeric_limits<T>::denorm_min())));
62-
BOOST_CHECK(isinf(make_fvar<T, m>(std::numeric_limits<T>::infinity())));
63-
BOOST_CHECK(isnan(make_fvar<T, m>(std::numeric_limits<T>::quiet_NaN())));
64-
}
65-
}
66-
6726
BOOST_AUTO_TEST_SUITE_END()

test/test_classify.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
#include <iostream>
1717
#include <iomanip>
1818

19+
#include "test_autodiff.hpp"
20+
1921
#ifdef _MSC_VER
2022
#pragma warning(disable: 4127 4146) // conditional expression is constant
2123
#endif
@@ -256,6 +258,9 @@ void test_classify(T t, const char* type)
256258
#endif
257259
}
258260

261+
262+
BOOST_AUTO_TEST_SUITE(test_fpclassify)
263+
259264
BOOST_AUTO_TEST_CASE( test_main )
260265
{
261266
BOOST_MATH_CONTROL_FP;
@@ -288,6 +293,16 @@ BOOST_AUTO_TEST_CASE( test_main )
288293
test_classify(unsigned(0), "unsigned");
289294
}
290295

296+
BOOST_AUTO_TEST_CASE_TEMPLATE(fpclassify_autodiff, T, all_float_types) {
297+
test_classify(boost::math::differentiation::make_fvar<T, 1>(0), "autodiff float");
298+
test_classify(boost::math::differentiation::make_fvar<T, 2>(0), "autodiff float");
299+
test_classify(boost::math::differentiation::make_fvar<T, 3>(0), "autodiff float");
300+
test_classify(boost::math::differentiation::make_fvar<T, 7>(0), "autodiff float");
301+
test_classify(boost::math::differentiation::make_fvar<T, 12>(0), "autodiff float");
302+
}
303+
304+
BOOST_AUTO_TEST_SUITE_END()
305+
291306
/*
292307
Autorun "i:\Boost-sandbox\math_toolkit\libs\math\test\MSVC80\debug\test_classify.exe"
293308
Running 1 test case...

0 commit comments

Comments
 (0)