test_nc_chi_squared.cpp 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. // Copyright John Maddock 2006-15.
  2. // Copyright Paul A. Bristow 2007
  3. // Use, modification and distribution are subject to the
  4. // Boost Software License, Version 1.0. (See accompanying file
  5. // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  6. #define BOOST_TEST_MAIN
  7. #define BOOST_MATH_OVERFLOW_ERROR_POLICY ignore_error
  8. #include "bindings.hpp"
  9. #include "../../test/test_nc_chi_squared.hpp"
  10. #include <boost/test/unit_test.hpp>
  11. BOOST_AUTO_TEST_CASE_EXPECTED_FAILURES(test_main, 10000);
  12. BOOST_AUTO_TEST_CASE(test_main)
  13. {
  14. BOOST_MATH_CONTROL_FP;
  15. error_stream_replacer rep;
  16. #ifdef TYPE_TO_TEST
  17. test_accuracy(static_cast<TYPE_TO_TEST>(0), NAME_OF_TYPE_TO_TEST);
  18. #else
  19. bool test_float = false;
  20. bool test_double = false;
  21. bool test_long_double = false;
  22. if(std::numeric_limits<long double>::digits == std::numeric_limits<double>::digits)
  23. {
  24. //
  25. // Don't bother with long double, it's the same as double:
  26. //
  27. if(BOOST_MATH_PROMOTE_FLOAT_POLICY == false)
  28. test_float = true;
  29. test_double = true;
  30. }
  31. else
  32. {
  33. if(BOOST_MATH_PROMOTE_FLOAT_POLICY == false)
  34. test_float = true;
  35. if(BOOST_MATH_PROMOTE_DOUBLE_POLICY == false)
  36. test_double = true;
  37. test_long_double = true;
  38. }
  39. #ifdef ALWAYS_TEST_DOUBLE
  40. test_double = true;
  41. #endif
  42. if(test_float)
  43. test_accuracy(0.0f, "float");
  44. if(test_double)
  45. test_accuracy(0.0, "double");
  46. if(test_long_double)
  47. test_accuracy(0.0L, "long double");
  48. #ifdef BOOST_MATH_USE_FLOAT128
  49. //test_accuracy(0.0Q, "__float128");
  50. #endif
  51. #endif
  52. }