2
0
mirror of https://github.com/boostorg/math.git synced 2026-01-19 04:22:09 +00:00

Added comments

[SVN r79835]
This commit is contained in:
Paul A. Bristow
2012-08-01 16:37:01 +00:00
parent 69ba66929d
commit a2fc557d79
2 changed files with 20 additions and 10 deletions

View File

@@ -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 @@ inline string_literal_helper make_literal_helper(const char* s, const wchar_t* w
# pragma warning(pop)
#endif
#endif
#endif // BOOST_MATH_S__HPP

View File

@@ -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<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_put_inf_impl();
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_put_nan_impl();
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 @@ template<class CharType, class ValType> 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)\
{\