1 // (C) Copyright John Maddock 2014.
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 #include <pch_light.hpp>
7 #include "test_trigamma.hpp"
8
expected_results()9 void expected_results()
10 {
11 //
12 // Define the max and mean errors expected for
13 // various compilers and platforms.
14 //
15 const char* largest_type;
16 #ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
17 if(boost::math::policies::digits<double, boost::math::policies::policy<> >() == boost::math::policies::digits<long double, boost::math::policies::policy<> >())
18 {
19 largest_type = "(long\\s+)?double|real_concept";
20 }
21 else
22 {
23 largest_type = "long double|real_concept";
24 }
25 #else
26 largest_type = "(long\\s+)?double|real_concept";
27 #endif
28
29 add_expected_result(
30 ".*", // compiler
31 ".*", // stdlib
32 ".*", // platform
33 largest_type, // test type(s)
34 ".*", // test data group
35 ".*", 20, 10); // test function
36 //
37 // Finish off by printing out the compiler/stdlib/platform names,
38 // we do this to make it easier to mark up expected error rates.
39 //
40 std::cout << "Tests run with " << BOOST_COMPILER << ", "
41 << BOOST_STDLIB << ", " << BOOST_PLATFORM << std::endl;
42 }
43
BOOST_AUTO_TEST_CASE(test_main)44 BOOST_AUTO_TEST_CASE( test_main )
45 {
46 expected_results();
47 BOOST_MATH_CONTROL_FP;
48
49 test_trigamma(0.0F, "float");
50 test_trigamma(0.0, "double");
51 #ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
52 test_trigamma(0.0L, "long double");
53 test_trigamma(boost::math::concepts::real_concept(0.1), "real_concept");
54 #endif
55 }
56
57