Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r79835 - trunk/libs/math/test
From: pbristow_at_[hidden]
Date: 2012-08-01 12:37:02


Author: pbristow
Date: 2012-08-01 12:37:01 EDT (Wed, 01 Aug 2012)
New Revision: 79835
URL: http://svn.boost.org/trac/boost/changeset/79835

Log:
Added comments
Text files modified:
   trunk/libs/math/test/s_.ipp | 14 +++++++++-----
   trunk/libs/math/test/test_nonfinite_io.cpp | 16 +++++++++++-----
   2 files changed, 20 insertions(+), 10 deletions(-)

Modified: trunk/libs/math/test/s_.ipp
==============================================================================
--- trunk/libs/math/test/s_.ipp (original)
+++ trunk/libs/math/test/s_.ipp 2012-08-01 12:37:01 EDT (Wed, 01 Aug 2012)
@@ -2,6 +2,7 @@
 #define BOOST_MATH_S__HPP
 
 // Copyright (c) 2006 Johan Rade
+// Copyright (c) 2012 Paul A. Bristow
 
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt
@@ -10,17 +11,19 @@
 // The macro S_ lets you write
 //
 // basic_string<CharType> s = S_("foo");
+// and
 // CharType c = S_('a');
 //
-// provided that CharType is char or wchar_t
-
-#include <string>
+// provided that CharType is either char or wchar_t.
+// Used by tests of output of signed zero and others.
 
 #ifdef _MSC_VER
 # pragma warning(push)
-# pragma warning(disable : 4512)
+# pragma warning(disable : 4512) // conditional expression is constant.
 #endif
 
+#include <string>
+
 //------------------------------------------------------------------------------
 
 #define S_(a) make_literal_helper(a, L##a)
@@ -61,4 +64,5 @@
 # pragma warning(pop)
 #endif
 
-#endif
+#endif // BOOST_MATH_S__HPP
+

Modified: trunk/libs/math/test/test_nonfinite_io.cpp
==============================================================================
--- trunk/libs/math/test/test_nonfinite_io.cpp (original)
+++ trunk/libs/math/test/test_nonfinite_io.cpp 2012-08-01 12:37:01 EDT (Wed, 01 Aug 2012)
@@ -8,9 +8,7 @@
 // test_nonfinite_trap.cpp
 
 #ifdef _MSC_VER
-# pragma warning(disable : 4702) // Unreachable code.
 # pragma warning(disable : 4127) // Expression is constant.
-
 #endif
 
 #define BOOST_TEST_MAIN
@@ -35,6 +33,11 @@
 using boost::math::isnan;
 
 //------------------------------------------------------------------------------
+// Test nonfinite_num_put and nonfinite_num_get facets by checking
+// loopback (output and re-input) of a few values,
+// but using all the built-in char and floating-point types.
+// Only the default output is used but various ostream options are tested seperately below.
+// Finite, infinite and NaN values (positive and negative) are used for the test.
 
 void trap_test_finite();
 void trap_test_inf();
@@ -52,7 +55,7 @@
 template<class CharType, class ValType> void trap_test_finite_impl();
 
 void trap_test_finite()
-{
+{ // Test finite using all the built-in char and floating-point types.
     trap_test_finite_impl<char, float>();
     trap_test_finite_impl<char, double>();
     trap_test_finite_impl<char, long double>();
@@ -105,7 +108,7 @@
 template<class CharType, class ValType> void trap_test_get_inf_impl();
 
 void trap_test_inf()
-{
+{ // Test infinity using all the built-in char and floating-point types.
     trap_test_inf_impl<char, float>();
     trap_test_inf_impl<char, double>();
     trap_test_inf_impl<char, long double>();
@@ -174,7 +177,7 @@
 template<class CharType, class ValType> void trap_test_get_nan_impl();
 
 void trap_test_nan()
-{
+{ // Test NaN using all the built-in char and floating-point types.
     trap_test_nan_impl<char, float>();
     trap_test_nan_impl<char, double>();
     trap_test_nan_impl<char, long double>();
@@ -238,6 +241,9 @@
 
 //------------------------------------------------------------------------------
 
+// Test a selection of stream output options comparing result with expected string.
+// Only uses CharType = char and ValType = double.
+// Other types have already been tested above.
 
 #define CHECKOUT(manips, expected)\
   {\


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