From 45e479deb09a35f5b68a95611b2cd8bcfa6eb12d Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Thu, 4 Aug 2022 13:37:20 +0100 Subject: [PATCH] Add #include tests for hypergeometric functions. Fix the one error detected. --- .../special_functions/hypergeometric_1F0.hpp | 1 + test/Jamfile.v2 | 6 ++++ test/compile_test/sf_0f1_incl_test.cpp | 23 ++++++++++++ test/compile_test/sf_1f0_incl_test.cpp | 23 ++++++++++++ test/compile_test/sf_1f1_incl_test.cpp | 36 +++++++++++++++++++ test/compile_test/sf_2f0_incl_test.cpp | 23 ++++++++++++ test/compile_test/sf_pfq_incl_test.cpp | 23 ++++++++++++ 7 files changed, 135 insertions(+) create mode 100644 test/compile_test/sf_0f1_incl_test.cpp create mode 100644 test/compile_test/sf_1f0_incl_test.cpp create mode 100644 test/compile_test/sf_1f1_incl_test.cpp create mode 100644 test/compile_test/sf_2f0_incl_test.cpp create mode 100644 test/compile_test/sf_pfq_incl_test.cpp diff --git a/include/boost/math/special_functions/hypergeometric_1F0.hpp b/include/boost/math/special_functions/hypergeometric_1F0.hpp index e3f868be2..c78903af1 100644 --- a/include/boost/math/special_functions/hypergeometric_1F0.hpp +++ b/include/boost/math/special_functions/hypergeometric_1F0.hpp @@ -13,6 +13,7 @@ #include #include +#include namespace boost { namespace math { namespace detail { diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index c74f0f389..1d0d21013 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -1047,6 +1047,12 @@ test-suite misc : [ run compile_test/compl_asinh_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] [ run compile_test/compl_atan_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] [ run compile_test/compl_atanh_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + + [ run compile_test/sf_1f0_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/sf_0f1_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/sf_2f0_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/sf_1f1_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/sf_pfq_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] [ run compile_test/sf_acosh_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] [ run compile_test/sf_asinh_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] [ run compile_test/sf_atanh_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] diff --git a/test/compile_test/sf_0f1_incl_test.cpp b/test/compile_test/sf_0f1_incl_test.cpp new file mode 100644 index 000000000..bac048954 --- /dev/null +++ b/test/compile_test/sf_0f1_incl_test.cpp @@ -0,0 +1,23 @@ +// Copyright John Maddock 2006. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// +// Basic sanity check that header +// #includes all the files that it needs to. +// +#include +// +// Note this header includes no other headers, this is +// important if this test is to be meaningful: +// +#include "test_compile_result.hpp" + +void compile_and_link_test() +{ + check_result(boost::math::hypergeometric_0F1(f, f)); + check_result(boost::math::hypergeometric_0F1(d, d)); +#ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS + check_result(boost::math::hypergeometric_0F1(l, l)); +#endif +} diff --git a/test/compile_test/sf_1f0_incl_test.cpp b/test/compile_test/sf_1f0_incl_test.cpp new file mode 100644 index 000000000..daedf4984 --- /dev/null +++ b/test/compile_test/sf_1f0_incl_test.cpp @@ -0,0 +1,23 @@ +// Copyright John Maddock 2006. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// +// Basic sanity check that header +// #includes all the files that it needs to. +// +#include +// +// Note this header includes no other headers, this is +// important if this test is to be meaningful: +// +#include "test_compile_result.hpp" + +void compile_and_link_test() +{ + check_result(boost::math::hypergeometric_1F0(f, f)); + check_result(boost::math::hypergeometric_1F0(d, d)); +#ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS + check_result(boost::math::hypergeometric_1F0(l, l)); +#endif +} diff --git a/test/compile_test/sf_1f1_incl_test.cpp b/test/compile_test/sf_1f1_incl_test.cpp new file mode 100644 index 000000000..42c7a7cea --- /dev/null +++ b/test/compile_test/sf_1f1_incl_test.cpp @@ -0,0 +1,36 @@ +// Copyright John Maddock 2006. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// +// Basic sanity check that header +// #includes all the files that it needs to. +// +#include +// +// Note this header includes no other headers, this is +// important if this test is to be meaningful: +// +#include "test_compile_result.hpp" + +void compile_and_link_test() +{ + check_result(boost::math::hypergeometric_1F1(f, f, f)); + check_result(boost::math::hypergeometric_1F1(d, d, d)); +#ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS + check_result(boost::math::hypergeometric_1F1(l, l, l)); +#endif + + check_result(boost::math::hypergeometric_1F1_regularized(f, f, f)); + check_result(boost::math::hypergeometric_1F1_regularized(d, d, d)); +#ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS + check_result(boost::math::hypergeometric_1F1_regularized(l, l, l)); +#endif + + check_result(boost::math::log_hypergeometric_1F1(f, f, f)); + check_result(boost::math::log_hypergeometric_1F1(d, d, d)); +#ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS + check_result(boost::math::log_hypergeometric_1F1(l, l, l)); +#endif + +} diff --git a/test/compile_test/sf_2f0_incl_test.cpp b/test/compile_test/sf_2f0_incl_test.cpp new file mode 100644 index 000000000..86570e527 --- /dev/null +++ b/test/compile_test/sf_2f0_incl_test.cpp @@ -0,0 +1,23 @@ +// Copyright John Maddock 2006. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// +// Basic sanity check that header +// #includes all the files that it needs to. +// +#include +// +// Note this header includes no other headers, this is +// important if this test is to be meaningful: +// +#include "test_compile_result.hpp" + +void compile_and_link_test() +{ + check_result(boost::math::hypergeometric_2F0(f, f, f)); + check_result(boost::math::hypergeometric_2F0(d, d, d)); +#ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS + check_result(boost::math::hypergeometric_2F0(l, l, l)); +#endif +} diff --git a/test/compile_test/sf_pfq_incl_test.cpp b/test/compile_test/sf_pfq_incl_test.cpp new file mode 100644 index 000000000..586e02047 --- /dev/null +++ b/test/compile_test/sf_pfq_incl_test.cpp @@ -0,0 +1,23 @@ +// Copyright John Maddock 2006. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// +// Basic sanity check that header +// #includes all the files that it needs to. +// +#include +// +// Note this header includes no other headers, this is +// important if this test is to be meaningful: +// +#include "test_compile_result.hpp" + +void compile_and_link_test() +{ + check_result(boost::math::hypergeometric_pFq({f, f}, {f, f}, f)); + check_result(boost::math::hypergeometric_pFq({ d, d }, {d, d}, d)); +#ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS + check_result(boost::math::hypergeometric_pFq({ l, l }, {l, l}, l)); +#endif +}