Opened 9 years ago
Closed 7 years ago
#9390 closed Bugs (fixed)
Incomplete BOOST_TEST_DONT_PRINT_LOG_VALUE
Reported by: | Owned by: | Raffi Enficiaud | |
---|---|---|---|
Milestone: | Boost 1.59.0 | Component: | test |
Version: | Boost 1.55.0 | Severity: | Problem |
Keywords: | Cc: | curdeius@… |
Description
When we use a user-defined error without overloaded operator<<(std::ostream&, T const&)
, we have to use BOOST_TEST_DONT_PRINT_LOG_VALUE in order to prevent UTF to print output to log.
BOOST_TEST_DONT_PRINT_LOG_VALUE works correctly only if you use macros like BOOST_CHECK_EQUAL.
However, BOOST_CHECK_EQUAL_COLLECTIONS provokes compile-time error. For instance, on MSVC2010 (Windows x64), the error message is:
compile-time error C2679: binary '<<' : no operator found which takes a right-hand operand of type 'const MyClass' (or there is no acceptable conversion) c:\lib\Boost\include\boost-1_54\boost\test\utils\wrap_stringstream.hpp 66 }}}. The problem is that ```BOOST_CHECK_EQUAL_COLLECTIONS`` uses ```operator<<( basic_wrap_stringstream<CharT>& targ, T const& t )``` from wrap_stringstream.hpp, whereas BOOST_CHECK_EQUAL uses ```print_log_value::operator()( std::ostream& ostr, T const& t )``` from test_tools.hpp. BOOST_TEST_DONT_PRINT_LOG_VALUE only specializes the latter. The solution is to partially specialize the former template as well.
Attachments (2)
Change History (6)
by , 9 years ago
Attachment: | boost_test_dont_print_log-collections.cpp added |
---|
comment:1 by , 9 years ago
Cc: | added |
---|---|
Component: | None → test |
Milestone: | To Be Determined → Boost 1.56.0 |
Owner: | set to |
comment:2 by , 8 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:4 by , 7 years ago
Milestone: | Boost 1.56.0 → Boost 1.59.0 |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
Note:
See TracTickets
for help on using tickets.
Sample program which reveals the problem.