2
0
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:
Matt Borland
2021-07-18 15:12:50 +03:00
parent 708c27dfe4
commit 0eb7d247a4
5 changed files with 53 additions and 3 deletions

View File

@@ -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

View File

@@ -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

View 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
}

View 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
}

View 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
}