|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r78769 - trunk/libs/math/test
From: pbristow_at_[hidden]
Date: 2012-05-30 12:39:13
Author: pbristow
Date: 2012-05-30 12:39:12 EDT (Wed, 30 May 2012)
New Revision: 78769
URL: http://svn.boost.org/trac/boost/changeset/78769
Log:
Added out of range checks (and normal.hpp now range infinity if supported.
Text files modified:
trunk/libs/math/test/test_normal.cpp | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
Modified: trunk/libs/math/test/test_normal.cpp
==============================================================================
--- trunk/libs/math/test/test_normal.cpp (original)
+++ trunk/libs/math/test/test_normal.cpp 2012-05-30 12:39:12 EDT (Wed, 30 May 2012)
@@ -18,7 +18,7 @@
#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
@@ -30,6 +30,7 @@
#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>
using std::cout;
@@ -283,6 +284,8 @@
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-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk