test_zeta.cpp 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. ///////////////////////////////////////////////////////////////
  2. // Copyright 2011 John Maddock. Distributed under the Boost
  3. // Software License, Version 1.0. (See accompanying file
  4. // LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt
  5. #include "setup.hpp"
  6. #include "table_type.hpp"
  7. #define TEST_UDT
  8. #include <boost/math/special_functions/math_fwd.hpp>
  9. #include "libs/math/test/test_zeta.hpp"
  10. void expected_results()
  11. {
  12. //
  13. // Define the max and mean errors expected for
  14. // various compilers and platforms.
  15. //
  16. add_expected_result(
  17. ".*", // compiler
  18. ".*", // stdlib
  19. ".*", // platform
  20. ".*", // test type(s)
  21. ".*Random values less than 1", // test data group
  22. ".*", 6000, 3000); // test function
  23. #ifdef BOOST_INTEL
  24. add_expected_result(
  25. ".*", // compiler
  26. ".*", // stdlib
  27. ".*", // platform
  28. "float128", // test type(s)
  29. ".*close to and less than 1.*", // test data group
  30. ".*", 10000000L, 2000000L); // test function
  31. #endif
  32. add_expected_result(
  33. ".*", // compiler
  34. ".*", // stdlib
  35. ".*", // platform
  36. ".*", // test type(s)
  37. ".*", // test data group
  38. ".*", 1000, 200); // test function
  39. //
  40. // Finish off by printing out the compiler/stdlib/platform names,
  41. // we do this to make it easier to mark up expected error rates.
  42. //
  43. std::cout << "Tests run with " << BOOST_COMPILER << ", "
  44. << BOOST_STDLIB << ", " << BOOST_PLATFORM << std::endl;
  45. }
  46. template <class T>
  47. void test(T t, const char* p)
  48. {
  49. test_zeta(t, p);
  50. }
  51. BOOST_AUTO_TEST_CASE(test_main)
  52. {
  53. using namespace boost::multiprecision;
  54. expected_results();
  55. //
  56. // Test at:
  57. // 9 decimal digits: tests the least wide arbitrary precision code
  58. // 18 decimal digits: tests 80-bit long double approximations
  59. // 30 decimal digits: tests 128-bit long double approximations
  60. // 35 decimal digits: tests arbitrary precision code
  61. //
  62. ALL_TESTS
  63. }