sf_prime_incl_test.cpp 918 B

12345678910111213141516171819202122232425262728
  1. // Copyright John Maddock 2006.
  2. // Use, modification and distribution are subject to the
  3. // Boost Software License, Version 1.0. (See accompanying file
  4. // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  5. //
  6. // Basic sanity check that header <boost/math/special_functions/factorials.hpp>
  7. // #includes all the files that it needs to.
  8. //
  9. #include <boost/math/special_functions/prime.hpp>
  10. //
  11. // Note this header includes no other headers, this is
  12. // important if this test is to be meaningful:
  13. //
  14. #include "test_compile_result.hpp"
  15. void compile_and_link_test()
  16. {
  17. check_result<boost::uint32_t>(boost::math::prime(u));
  18. //
  19. // Add constexpr tests here:
  20. //
  21. #ifdef BOOST_MATH_HAVE_CONSTEXPR_TABLES
  22. constexpr boost::uint32_t ce_f = boost::math::prime(boost::math::max_prime);
  23. static_assert(ce_f == 104729, "max_prime had incorrect value");
  24. check_result<boost::uint32_t>(ce_f);
  25. #endif
  26. }