|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r71442 - trunk/libs/math/test
From: pbristow_at_[hidden]
Date: 2011-04-23 10:19:33
Author: pbristow
Date: 2011-04-23 10:19:32 EDT (Sat, 23 Apr 2011)
New Revision: 71442
URL: http://svn.boost.org/trac/boost/changeset/71442
Log:
Added test for signed zero.
Text files modified:
trunk/libs/math/test/test_signed_zero.cpp | 15 +++++++++++++--
1 files changed, 13 insertions(+), 2 deletions(-)
Modified: trunk/libs/math/test/test_signed_zero.cpp
==============================================================================
--- trunk/libs/math/test/test_signed_zero.cpp (original)
+++ trunk/libs/math/test/test_signed_zero.cpp 2011-04-23 10:19:32 EDT (Sat, 23 Apr 2011)
@@ -6,7 +6,8 @@
// or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifdef _MSC_VER
-# pragma warning(disable : 4702)
+# pragma warning(disable : 4702) // Unreachable code.
+# pragma warning(disable : 4127) // expression is constant.
#endif
#define BOOST_TEST_MAIN
@@ -14,10 +15,12 @@
#include <iomanip>
#include <locale>
#include <sstream>
+#include <limits>
+
#include <boost/test/auto_unit_test.hpp>
+#include <boost/math/special_functions/nonfinite_num_facets.hpp>
#include "almost_equal.ipp"
#include "S_.ipp"
-#include <boost/math/special_functions/nonfinite_num_facets.hpp>
namespace {
@@ -45,6 +48,14 @@
template<class CharType, class ValType> void signed_zero_test_impl()
{
+
+ if (static_cast<CharType>(-1e-6f)/std::numeric_limits<CharType>::max() != -0)
+ {
+ BOOST_MESSAGE("Signed zero is not supported on this platform.");
+ return;
+ }
+
+
std::locale old_locale;
std::locale tmp_locale(
old_locale, new nonfinite_num_put<CharType>(signed_zero));
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