From ecda2f0b9d2dca53fb61be084b2db73a9838ffeb Mon Sep 17 00:00:00 2001 From: Eric Niebler Date: Wed, 23 Jun 2004 04:49:48 +0000 Subject: [PATCH] remove std_min and std_max, update minmax coding guidelines [SVN r23162] --- src/test_tools.cpp | 6 ++++-- src/unit_test_result.cpp | 9 +++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/test_tools.cpp b/src/test_tools.cpp index 5ef3e794..d480a3d1 100644 --- a/src/test_tools.cpp +++ b/src/test_tools.cpp @@ -19,7 +19,6 @@ // BOOST #include -#include // STL #include @@ -371,7 +370,7 @@ output_test_stream::match_pattern( bool flush_stream ) (m_pimpl->m_synced_string[i] == c); if( !result ) { - std::string::size_type suffix_size = std_min( m_pimpl->m_synced_string.length() - i, + std::string::size_type suffix_size = (std::min)( m_pimpl->m_synced_string.length() - i, static_cast(5) ); // try to log area around the mismatch @@ -458,6 +457,9 @@ output_test_stream::sync() // Revision History : // // $Log$ +// Revision 1.33 2004/06/23 04:49:48 eric_niebler +// remove std_min and std_max, update minmax coding guidelines +// // Revision 1.32 2004/06/07 07:34:22 rogeeff // detail namespace renamed // diff --git a/src/unit_test_result.cpp b/src/unit_test_result.cpp index 304c25c1..2ebbdcd8 100644 --- a/src/unit_test_result.cpp +++ b/src/unit_test_result.cpp @@ -143,8 +143,9 @@ public: void report_sub_test_cases_stat( std::ostream& where_to, std::size_t indent, unit_test_counter num_passed, unit_test_counter num_failed ) { + BOOST_USING_STD_MAX(); unit_test_counter total_test_cases = num_passed + num_failed; - std::size_t width = static_cast( std::log10( (float)std_max( num_passed, num_failed ) ) ) + 1; + std::size_t width = static_cast( std::log10( (float)max BOOST_PREVENT_MACRO_SUBSTITUTION( num_passed, num_failed ) ) ) + 1; where_to << std::setw( indent ) << "" << std::setw( width ) << num_passed << " test " << ps_name( num_passed != 1, "case" ) << " out of " << total_test_cases << " passed\n" @@ -156,9 +157,10 @@ public: void report_assertions_stat( std::ostream& where_to, std::size_t indent, unit_test_counter num_passed, unit_test_counter num_failed, unit_test_counter num_expected ) { + BOOST_USING_STD_MAX(); unit_test_counter total_assertions = num_passed + num_failed; std::size_t width = total_assertions > 0 - ? static_cast( std::log10( (float)std_max( num_passed, num_failed ) ) ) + 1 + ? static_cast( std::log10( (float)max BOOST_PREVENT_MACRO_SUBSTITUTION( num_passed, num_failed ) ) ) + 1 : 1; where_to << std::setw( indent ) << "" << std::setw( width ) << num_passed @@ -599,6 +601,9 @@ unit_test_result::has_passed() const // Revision History : // // $Log$ +// Revision 1.27 2004/06/23 04:49:48 eric_niebler +// remove std_min and std_max, update minmax coding guidelines +// // Revision 1.26 2004/05/21 06:26:10 rogeeff // licence update //