#include <pch.hpp> // include directory /libs/math/src/tr1/ is needed.
#ifdef _MSC_VER
-#pragma warning (disable: 4127) // conditional expression is constant
+# pragma warning (disable: 4127) // conditional expression is constant
// caused by using if(std::numeric_limits<RealType>::has_infinity)
// and if (std::numeric_limits<RealType>::has_quiet_NaN)
#endif
#include <boost/math/concepts/real_concept.hpp> // for real_concept
-#include <boost/test/test_exec_monitor.hpp> // Boost.Test
+#define BOOST_TEST_MAIN
+#include <boost/test/unit_test.hpp> // Boost.Test
#include <boost/test/floating_point_comparison.hpp>
#include <boost/math/distributions/normal.hpp>
using boost::math::normal_distribution;
#include <boost/math/tools/test.hpp>
+#include "test_out_of_range.hpp"
#include <iostream>
+#include <iomanip>
using std::cout;
using std::endl;
using std::setprecision;
BOOST_CHECK_THROW(boost::math::normal_distribution<RealType> nbad1(0, 0), std::domain_error); // zero sd
BOOST_CHECK_THROW(boost::math::normal_distribution<RealType> nbad1(0, -1), std::domain_error); // negative sd
- // Tests on extreme values of random variate x, if has numeric_limit infinity etc.
+ // Tests on extreme values of random variate x, if has std::numeric_limits infinity etc.
normal_distribution<RealType> N01;
if(std::numeric_limits<RealType>::has_infinity)
{
standard_deviation(def_norm01),
static_cast<RealType>(1), 0); // Mean == zero
-
+ // Error tests:
+ check_out_of_range<boost::math::normal_distribution<RealType> >(0, 1); // (All) valid constructor parameter values.
+
+ BOOST_CHECK_THROW(pdf(normal_distribution<RealType>(0, 0), 0), std::domain_error);
+ BOOST_CHECK_THROW(pdf(normal_distribution<RealType>(0, -1), 0), std::domain_error);
+ BOOST_CHECK_THROW(quantile(normal_distribution<RealType>(0, 1), -1), std::domain_error);
+ BOOST_CHECK_THROW(quantile(normal_distribution<RealType>(0, 1), 2), std::domain_error);
} // template <class RealType>void test_spots(RealType)
-int test_main(int, char* [])
+BOOST_AUTO_TEST_CASE( test_main )
{
// Check that can generate normal distribution using the two convenience methods:
boost::math::normal myf1(1., 2); // Using typedef
"to pass.</note>" << std::cout;
#endif
- return 0;
-} // int test_main(int, char* [])
+
+} // BOOST_AUTO_TEST_CASE( test_main )
/*