From 2b86d278e9349c2bf23674f025be6dfe90f4b90e Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Thu, 3 Jul 2014 10:41:12 +0100 Subject: [PATCH] Reduce program output. --- test/test_cpp_bin_float_io.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/test/test_cpp_bin_float_io.cpp b/test/test_cpp_bin_float_io.cpp index c426a5c06..9fe628e94 100644 --- a/test/test_cpp_bin_float_io.cpp +++ b/test/test_cpp_bin_float_io.cpp @@ -209,14 +209,21 @@ void do_round_trip(const T& val, std::ios_base::fmtflags f) template void do_round_trip(const T& val) { - std::cout << "Testing value...."; - if(val.backend().sign()) - std::cout << "-"; - std::cout << boost::multiprecision::cpp_int(val.backend().bits()) << "e" << val.backend().exponent() << std::endl; do_round_trip(val, std::ios_base::fmtflags(0)); do_round_trip(val, std::ios_base::fmtflags(std::ios_base::scientific)); if((fabs(val) > 1) && (fabs(val) < 1e100)) do_round_trip(val, std::ios_base::fmtflags(std::ios_base::fixed)); + + static int error_count = 0; + + if(error_count != boost::detail::test_errors()) + { + error_count = boost::detail::test_errors(); + std::cout << "Errors occured while testing value...."; + if(val.backend().sign()) + std::cout << "-"; + std::cout << boost::multiprecision::cpp_int(val.backend().bits()) << "e" << val.backend().exponent() << std::endl; + } } template @@ -236,6 +243,8 @@ void test_round_trip() do_round_trip(T(-val)); do_round_trip(T(1/val)); do_round_trip(T(-1/val)); + + if(boost::detail::test_errors() > 200) break; // escape if there are too many errors. } std::cout << "Execution time = " << boost::chrono::duration_cast >(w.elapsed()).count() << "s" << std::endl;