test_gamma.cpp 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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 http://www.boost.org/LICENSE_1_
  5. #include "setup.hpp"
  6. #include "table_type.hpp"
  7. #include <boost/math/special_functions/gamma.hpp>
  8. #include "libs/math/test/test_gamma.hpp"
  9. void expected_results()
  10. {
  11. //
  12. // Define the max and mean errors expected for
  13. // various compilers and platforms.
  14. //
  15. add_expected_result(
  16. ".*", // compiler
  17. ".*", // stdlib
  18. ".*", // platform
  19. ".*", // test type(s)
  20. "near.*", // test data group
  21. "tgamma", 200, 100); // test function
  22. add_expected_result(
  23. ".*", // compiler
  24. ".*", // stdlib
  25. ".*", // platform
  26. ".*", // test type(s)
  27. "near.*", // test data group
  28. "lgamma", 10000000, 10000000); // test function
  29. add_expected_result(
  30. ".*", // compiler
  31. ".*", // stdlib
  32. ".*", // platform
  33. ".*", // test type(s)
  34. "tgamma1pm1.*", // test data group
  35. "tgamma1pm1", 1000, 150); // test function
  36. add_expected_result(
  37. ".*", // compiler
  38. ".*", // stdlib
  39. ".*", // platform
  40. ".*", // test type(s)
  41. ".*", // test data group
  42. "tgamma", 40, 20); // test function
  43. //
  44. // Finish off by printing out the compiler/stdlib/platform names,
  45. // we do this to make it easier to mark up expected error rates.
  46. //
  47. std::cout << "Tests run with " << BOOST_COMPILER << ", "
  48. << BOOST_STDLIB << ", " << BOOST_PLATFORM << std::endl;
  49. }
  50. template <class T>
  51. void test(T t, const char* p)
  52. {
  53. test_gamma(t, p);
  54. }
  55. BOOST_AUTO_TEST_CASE( test_main )
  56. {
  57. expected_results();
  58. ALL_TESTS
  59. }