mirror of
https://github.com/boostorg/core.git
synced 2025-08-01 13:54:35 +02:00
Removed std::ostringstream
This commit is contained in:
@@ -20,7 +20,6 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <sstream>
|
|
||||||
#include <boost/assert.hpp>
|
#include <boost/assert.hpp>
|
||||||
#include <boost/current_function.hpp>
|
#include <boost/current_function.hpp>
|
||||||
#include <boost/core/no_exceptions_support.hpp>
|
#include <boost/core/no_exceptions_support.hpp>
|
||||||
@@ -182,10 +181,11 @@ inline void test_cstr_ne_impl( char const * expr1, char const * expr2,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class FwdIt1, class FwdIt2>
|
template<class FormattedOutputFunction, class ForwardIterator1, class ForwardIterator2>
|
||||||
void test_all_eq_impl(char const * file, int line, char const * function,
|
void test_all_eq_impl(FormattedOutputFunction& output,
|
||||||
FwdIt1 first_begin, FwdIt1 first_end,
|
char const * file, int line, char const * function,
|
||||||
FwdIt2 second_begin, FwdIt2 second_end)
|
ForwardIterator1 first_begin, ForwardIterator1 first_end,
|
||||||
|
ForwardIterator2 second_begin, ForwardIterator2 second_end)
|
||||||
{
|
{
|
||||||
if (std::distance(first_begin, first_end) != std::distance(second_begin, second_end))
|
if (std::distance(first_begin, first_end) != std::distance(second_begin, second_end))
|
||||||
{
|
{
|
||||||
@@ -193,9 +193,9 @@ void test_all_eq_impl(char const * file, int line, char const * function,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
FwdIt1 first_it = first_begin;
|
ForwardIterator1 first_it = first_begin;
|
||||||
FwdIt2 second_it = second_begin;
|
ForwardIterator2 second_it = second_begin;
|
||||||
std::ostringstream indices;
|
bool first_iteration = true;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
while ((first_it != first_end) && (second_it != second_end) && (*first_it == *second_it))
|
while ((first_it != first_end) && (second_it != second_end) && (*first_it == *second_it))
|
||||||
@@ -208,13 +208,16 @@ void test_all_eq_impl(char const * file, int line, char const * function,
|
|||||||
boost::detail::report_errors_remind();
|
boost::detail::report_errors_remind();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
indices << " [" << std::distance(first_begin, first_it) << "] '" << *first_it << "' != '" << *second_it << "'";
|
if (first_iteration)
|
||||||
|
{
|
||||||
|
first_iteration = true;
|
||||||
|
output << file << "(" << line << "): Container contents differ in function '" << function << "': mismatching indices";
|
||||||
|
}
|
||||||
|
output << " [" << std::distance(first_begin, first_it) << "] '" << *first_it << "' != '" << *second_it << "'";
|
||||||
++first_it;
|
++first_it;
|
||||||
++second_it;
|
++second_it;
|
||||||
} while (first_it != first_end);
|
} while (first_it != first_end);
|
||||||
BOOST_LIGHTWEIGHT_TEST_OSTREAM
|
output << std::endl;
|
||||||
<< file << "(" << line << "): Container contents differ in function '" << function << "': mismatching indices"
|
|
||||||
<< indices.str() << std::endl;
|
|
||||||
++boost::detail::test_errors();
|
++boost::detail::test_errors();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -264,7 +267,7 @@ inline int report_errors()
|
|||||||
#define BOOST_TEST_CSTR_EQ(expr1,expr2) ( ::boost::detail::test_cstr_eq_impl(#expr1, #expr2, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION, expr1, expr2) )
|
#define BOOST_TEST_CSTR_EQ(expr1,expr2) ( ::boost::detail::test_cstr_eq_impl(#expr1, #expr2, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION, expr1, expr2) )
|
||||||
#define BOOST_TEST_CSTR_NE(expr1,expr2) ( ::boost::detail::test_cstr_ne_impl(#expr1, #expr2, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION, expr1, expr2) )
|
#define BOOST_TEST_CSTR_NE(expr1,expr2) ( ::boost::detail::test_cstr_ne_impl(#expr1, #expr2, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION, expr1, expr2) )
|
||||||
|
|
||||||
#define BOOST_TEST_ALL_EQ(begin1, end1, begin2, end2) ( ::boost::detail::test_all_eq_impl(__FILE__, __LINE__, BOOST_CURRENT_FUNCTION, begin1, end1, begin2, end2) )
|
#define BOOST_TEST_ALL_EQ(begin1, end1, begin2, end2) ( ::boost::detail::test_all_eq_impl(BOOST_LIGHTWEIGHT_TEST_OSTREAM, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION, begin1, end1, begin2, end2) )
|
||||||
|
|
||||||
#ifndef BOOST_NO_EXCEPTIONS
|
#ifndef BOOST_NO_EXCEPTIONS
|
||||||
#define BOOST_TEST_THROWS( EXPR, EXCEP ) \
|
#define BOOST_TEST_THROWS( EXPR, EXCEP ) \
|
||||||
|
Reference in New Issue
Block a user