From d828e40f6d4d18ec6635d2ecff7cb2239e28dcf1 Mon Sep 17 00:00:00 2001 From: Bjorn Reese Date: Sun, 12 Feb 2017 15:06:31 +0100 Subject: [PATCH] Output at most 8 differing container values --- include/boost/core/lightweight_test.hpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/boost/core/lightweight_test.hpp b/include/boost/core/lightweight_test.hpp index 8ed0f7d..908cc77 100644 --- a/include/boost/core/lightweight_test.hpp +++ b/include/boost/core/lightweight_test.hpp @@ -192,6 +192,7 @@ void test_all_eq_impl(FormattedOutputFunction& output, typename std::iterator_traits::difference_type first_index = 0; typename std::iterator_traits::difference_type second_index = 0; std::size_t error_count = 0; + const std::size_t max_count = 8; do { while ((first_it != first_end) && (second_it != second_end) && (*first_it == *second_it)) @@ -209,6 +210,11 @@ void test_all_eq_impl(FormattedOutputFunction& output, { output << file << "(" << line << "): Container contents differ in function '" << function << "':"; } + else if (error_count >= max_count) + { + output << " ..."; + break; + } output << " [" << first_index << "] '" << test_output_impl(*first_it) << "' != '" << test_output_impl(*second_it) << "'"; ++first_it; ++second_it;