diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 7885649f71..691fbebc07 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -983,7 +983,7 @@ test-suite misc : [ run centered_continued_fraction_test.cpp : : : [ requires cxx17_if_constexpr cxx17_std_apply ] [ check-target-builds ../config//has_float128 "GCC libquadmath and __float128 support" : -lquadmath ] ] [ run luroth_expansion_test.cpp : : : [ requires cxx17_if_constexpr cxx17_std_apply ] [ check-target-builds ../config//has_float128 "GCC libquadmath and __float128 support" : -lquadmath ] ] [ run engel_expansion_test.cpp : : : [ requires cxx17_if_constexpr cxx17_std_apply ] [ check-target-builds ../config//has_float128 "GCC libquadmath and __float128 support" : -lquadmath ] ] - [ run test_classify.cpp pch ../../test/build//boost_unit_test_framework ] + [ run test_classify.cpp pch ../../test/build//boost_unit_test_framework : : : msvc:/bigobj ] [ run test_error_handling.cpp ../../test/build//boost_unit_test_framework ] [ 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" : -lquadmath ] ] [ run test_minima.cpp pch ../../test/build//boost_unit_test_framework ] diff --git a/test/test_autodiff_7.cpp b/test/test_autodiff_7.cpp index c41d806ae4..cbf81c6566 100644 --- a/test/test_autodiff_7.cpp +++ b/test/test_autodiff_7.cpp @@ -23,45 +23,4 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(expm1_hpp, T, all_float_types) { } } -BOOST_AUTO_TEST_CASE_TEMPLATE(fpclassify_hpp, T, all_float_types) { - using boost::math::fpclassify; - using boost::math::isfinite; - using boost::math::isinf; - using boost::math::isnan; - using boost::math::isnormal; - using boost::multiprecision::fpclassify; - using boost::multiprecision::isfinite; - using boost::multiprecision::isinf; - using boost::multiprecision::isnan; - using boost::multiprecision::isnormal; - - using test_constants = test_constants_t; - static constexpr auto m = test_constants::order; - test_detail::RandomSample x_sampler{-1000, 1000}; - for (auto i : boost::irange(test_constants::n_samples)) { - std::ignore = i; - - BOOST_CHECK_EQUAL(fpclassify(make_fvar(0)), FP_ZERO); - BOOST_CHECK_EQUAL(fpclassify(make_fvar(10)), FP_NORMAL); - BOOST_CHECK_EQUAL( - fpclassify(make_fvar(std::numeric_limits::infinity())), - FP_INFINITE); - BOOST_CHECK_EQUAL( - fpclassify(make_fvar(std::numeric_limits::quiet_NaN())), - FP_NAN); - if (std::numeric_limits::has_denorm != std::denorm_absent) { - BOOST_CHECK_EQUAL( - fpclassify(make_fvar(std::numeric_limits::denorm_min())), - FP_SUBNORMAL); - } - - BOOST_CHECK(isfinite(make_fvar(0))); - BOOST_CHECK(isnormal(make_fvar((std::numeric_limits::min)()))); - BOOST_CHECK( - !isnormal(make_fvar(std::numeric_limits::denorm_min()))); - BOOST_CHECK(isinf(make_fvar(std::numeric_limits::infinity()))); - BOOST_CHECK(isnan(make_fvar(std::numeric_limits::quiet_NaN()))); - } -} - BOOST_AUTO_TEST_SUITE_END() diff --git a/test/test_classify.cpp b/test/test_classify.cpp index d7a7c4d249..e6f51a0c77 100644 --- a/test/test_classify.cpp +++ b/test/test_classify.cpp @@ -16,6 +16,8 @@ #include #include +#include "test_autodiff.hpp" + #ifdef _MSC_VER #pragma warning(disable: 4127 4146) // conditional expression is constant #endif @@ -256,6 +258,9 @@ void test_classify(T t, const char* type) #endif } + +BOOST_AUTO_TEST_SUITE(test_fpclassify) + BOOST_AUTO_TEST_CASE( test_main ) { BOOST_MATH_CONTROL_FP; @@ -288,6 +293,16 @@ BOOST_AUTO_TEST_CASE( test_main ) test_classify(unsigned(0), "unsigned"); } +BOOST_AUTO_TEST_CASE_TEMPLATE(fpclassify_autodiff, T, all_float_types) { + test_classify(boost::math::differentiation::make_fvar(0), "autodiff float"); + test_classify(boost::math::differentiation::make_fvar(0), "autodiff float"); + test_classify(boost::math::differentiation::make_fvar(0), "autodiff float"); + test_classify(boost::math::differentiation::make_fvar(0), "autodiff float"); + test_classify(boost::math::differentiation::make_fvar(0), "autodiff float"); +} + +BOOST_AUTO_TEST_SUITE_END() + /* Autorun "i:\Boost-sandbox\math_toolkit\libs\math\test\MSVC80\debug\test_classify.exe" Running 1 test case...