test_igamma.cpp 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. #include "bindings.hpp"
  7. #include "../../test/test_igamma.hpp"
  8. #include <boost/math/special_functions/gamma.hpp>
  9. BOOST_AUTO_TEST_CASE(test_main)
  10. {
  11. BOOST_MATH_CONTROL_FP;
  12. error_stream_replacer rep;
  13. #ifdef TYPE_TO_TEST
  14. test_gamma(static_cast<TYPE_TO_TEST>(0), NAME_OF_TYPE_TO_TEST);
  15. #else
  16. bool test_float = false;
  17. bool test_double = false;
  18. bool test_long_double = false;
  19. if(std::numeric_limits<long double>::digits == std::numeric_limits<double>::digits)
  20. {
  21. //
  22. // Don't bother with long double, it's the same as double:
  23. //
  24. if(BOOST_MATH_PROMOTE_FLOAT_POLICY == false)
  25. test_float = true;
  26. test_double = true;
  27. }
  28. else
  29. {
  30. if(BOOST_MATH_PROMOTE_FLOAT_POLICY == false)
  31. test_float = true;
  32. if(BOOST_MATH_PROMOTE_DOUBLE_POLICY == false)
  33. test_double = true;
  34. test_long_double = true;
  35. }
  36. #ifdef ALWAYS_TEST_DOUBLE
  37. test_double = true;
  38. #endif
  39. if(test_float)
  40. test_gamma(0.0f, "float");
  41. if(test_double)
  42. test_gamma(0.0, "double");
  43. if(test_long_double)
  44. test_gamma(0.0L, "long double");
  45. #ifdef BOOST_MATH_USE_FLOAT128
  46. //test_gamma(0.0Q, "__float128");
  47. #endif
  48. #endif
  49. }