| 1 | #define BOOST_TEST_MODULE BoostCheckEqualCollectionsBugTestModule | 
|---|
| 2 |  | 
|---|
| 3 | #include <boost/operators.hpp> | 
|---|
| 4 | #include <boost/test/unit_test.hpp> | 
|---|
| 5 | #include <vector> | 
|---|
| 6 |  | 
|---|
| 7 | struct MyClass | 
|---|
| 8 | : public ::boost::equality_comparable<MyClass> | 
|---|
| 9 | {}; | 
|---|
| 10 |  | 
|---|
| 11 | bool operator==(MyClass const& lhs, MyClass const& rhs) | 
|---|
| 12 | { | 
|---|
| 13 | return true; | 
|---|
| 14 | } | 
|---|
| 15 |  | 
|---|
| 16 | typedef ::std::vector<MyClass> MyClassVec; | 
|---|
| 17 |  | 
|---|
| 18 | //BOOST_TEST_DONT_PRINT_LOG_VALUE(MyClass); | 
|---|
| 19 |  | 
|---|
| 20 | BOOST_AUTO_TEST_CASE(compiles) | 
|---|
| 21 | { | 
|---|
| 22 | MyClass actual, expected; | 
|---|
| 23 |  | 
|---|
| 24 | BOOST_CHECK_EQUAL(actual, expected); | 
|---|
| 25 | } | 
|---|
| 26 |  | 
|---|
| 27 | BOOST_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 | } | 
|---|