mirror of
https://github.com/boostorg/math.git
synced 2026-01-19 04:22:09 +00:00
Add include tests
This commit is contained in:
@@ -8,5 +8,7 @@
|
||||
#define BOOST_MATH_CCMATH
|
||||
|
||||
#include <boost/math/ccmath/sqrt.hpp>
|
||||
#include <boost/math/ccmath/isinf.hpp>
|
||||
#include <boost/math/ccmath/isnan.hpp>
|
||||
|
||||
#endif // BOOST_MATH_CCMATH
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
//
|
||||
// Constexpr implementation of sqrt function
|
||||
|
||||
#ifndef BOOST_MATH_SPECIAL_FUNCTIONS_SQRT
|
||||
#define BOOST_MATH_SPECIAL_FUNCTIONS_SQRT
|
||||
#ifndef BOOST_MATH_CCMATH_SQRT
|
||||
#define BOOST_MATH_CCMATH_SQRT
|
||||
|
||||
#include <limits>
|
||||
#include <type_traits>
|
||||
@@ -53,4 +53,4 @@ inline constexpr double sqrt(Z x)
|
||||
|
||||
}}} // Namespaces
|
||||
|
||||
#endif // BOOST_MATH_SPECIAL_FUNCTIONS_SQRT
|
||||
#endif // BOOST_MATH_CCMATH_SQRT
|
||||
|
||||
16
test/compile_test/ccmath_isinf_incl_test.cpp
Normal file
16
test/compile_test/ccmath_isinf_incl_test.cpp
Normal file
@@ -0,0 +1,16 @@
|
||||
// (C) Copyright Matt Borland 2021.
|
||||
// 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)
|
||||
|
||||
#include <boost/math/ccmath/isinf.hpp>
|
||||
#include "test_compile_result.hpp"
|
||||
|
||||
void compile_and_link_test()
|
||||
{
|
||||
check_result<bool>(boost::math::ccmath::isinf(1.0f));
|
||||
check_result<bool>(boost::math::ccmath::isinf(1.0));
|
||||
#ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
|
||||
check_result<bool>(boost::math::ccmath::isinf(1.0l));
|
||||
#endif
|
||||
}
|
||||
16
test/compile_test/ccmath_isnan_incl_test.cpp
Normal file
16
test/compile_test/ccmath_isnan_incl_test.cpp
Normal file
@@ -0,0 +1,16 @@
|
||||
// (C) Copyright Matt Borland 2021.
|
||||
// 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)
|
||||
|
||||
#include <boost/math/ccmath/isnan.hpp>
|
||||
#include "test_compile_result.hpp"
|
||||
|
||||
void compile_and_link_test()
|
||||
{
|
||||
check_result<bool>(boost::math::ccmath::isnan(1.0f));
|
||||
check_result<bool>(boost::math::ccmath::isnan(1.0));
|
||||
#ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
|
||||
check_result<bool>(boost::math::ccmath::isnan(1.0l));
|
||||
#endif
|
||||
}
|
||||
16
test/compile_test/ccmath_sqrt_incl_test.cpp
Normal file
16
test/compile_test/ccmath_sqrt_incl_test.cpp
Normal file
@@ -0,0 +1,16 @@
|
||||
// (C) Copyright Matt Borland 2021.
|
||||
// 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)
|
||||
|
||||
#include <boost/math/ccmath/sqrt.hpp>
|
||||
#include "test_compile_result.hpp"
|
||||
|
||||
void compile_and_link_test()
|
||||
{
|
||||
check_result<float>(boost::math::ccmath::sqrt(1.0f));
|
||||
check_result<double>(boost::math::ccmath::sqrt(1.0));
|
||||
#ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
|
||||
check_result<long double>(boost::math::ccmath::sqrt(1.0l));
|
||||
#endif
|
||||
}
|
||||
Reference in New Issue
Block a user