Ticket #9390: boost_test_dont_print_log-collections.cpp

File boost_test_dont_print_log-collections.cpp, 772 bytes (added by Marek Kurdej <curdeius@…>, 9 years ago)

Sample program which reveals the problem.

Line 
1#define BOOST_TEST_MODULE BoostCheckEqualCollectionsBugTestModule
2
3#include <boost/operators.hpp>
4#include <boost/test/unit_test.hpp>
5#include <vector>
6
7struct MyClass
8 : public ::boost::equality_comparable<MyClass>
9{};
10
11bool operator==(MyClass const& lhs, MyClass const& rhs)
12{
13 return true;
14}
15
16typedef ::std::vector<MyClass> MyClassVec;
17
18//BOOST_TEST_DONT_PRINT_LOG_VALUE(MyClass);
19
20BOOST_AUTO_TEST_CASE(compiles)
21{
22 MyClass actual, expected;
23
24 BOOST_CHECK_EQUAL(actual, expected);
25}
26
27BOOST_AUTO_TEST_CASE(should_compile)
28{
29 MyClassVec actual, expected;
30
31 // uncommenting next line provokes a compile-time error
32 //BOOST_CHECK_EQUAL_COLLECTIONS(actual.cbegin(), actual.cend(), expected.cbegin(), expected.cend());
33}