From a2fc557d7901b4101011dbcaed6f9b3afdceb97e Mon Sep 17 00:00:00 2001 From: "Paul A. Bristow" Date: Wed, 1 Aug 2012 16:37:01 +0000 Subject: [PATCH] Added comments [SVN r79835] --- test/s_.ipp | 14 +++++++++----- test/test_nonfinite_io.cpp | 16 +++++++++++----- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/test/s_.ipp b/test/s_.ipp index 6df30043f..a9cc74689 100644 --- a/test/s_.ipp +++ b/test/s_.ipp @@ -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 s = S_("foo"); +// and // CharType c = S_('a'); // -// provided that CharType is char or wchar_t - -#include +// 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 + //------------------------------------------------------------------------------ #define S_(a) make_literal_helper(a, L##a) @@ -61,4 +64,5 @@ inline string_literal_helper make_literal_helper(const char* s, const wchar_t* w # pragma warning(pop) #endif -#endif +#endif // BOOST_MATH_S__HPP + diff --git a/test/test_nonfinite_io.cpp b/test/test_nonfinite_io.cpp index a5f6eb202..7ee913707 100644 --- a/test/test_nonfinite_io.cpp +++ b/test/test_nonfinite_io.cpp @@ -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::changesign; 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 @@ BOOST_AUTO_TEST_CASE(trap_test) template 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(); trap_test_finite_impl(); trap_test_finite_impl(); @@ -105,7 +108,7 @@ template void trap_test_put_inf_impl(); template 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(); trap_test_inf_impl(); trap_test_inf_impl(); @@ -174,7 +177,7 @@ template void trap_test_put_nan_impl(); template 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(); trap_test_nan_impl(); trap_test_nan_impl(); @@ -238,6 +241,9 @@ template void trap_test_get_nan_impl() //------------------------------------------------------------------------------ +// 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)\ {\