1 // (C) Copyright Gennadiy Rozental 2011-2015.
2 // Distributed under the Boost Software License, Version 1.0.
3 // (See accompanying file LICENSE_1_0.txt or copy at
4 // http://www.boost.org/LICENSE_1_0.txt)
6 // See http://www.boost.org/libs/test for the library home page.
10 // Version : $Revision: 62023 $
12 // Description : unit test for new assertion construction based on input expression
13 // ***************************************************************************
16 #define BOOST_TEST_MODULE Boost.Test assertion consruction test
17 #include <boost/test/unit_test.hpp>
18 #include <boost/test/tools/assertion.hpp>
19 #include <boost/test/utils/is_forward_iterable.hpp>
21 #include <boost/noncopyable.hpp>
26 namespace utf
= boost::unit_test
;
28 //____________________________________________________________________________//
30 #define EXPR_TYPE( expr ) ( assertion::seed() ->* expr )
33 #if !defined(BOOST_TEST_FWD_ITERABLE_CXX03)
34 // some broken compilers do not implement properly decltype on expressions
35 // partial implementation of is_forward_iterable when decltype not available
36 struct not_fwd_iterable_1
{
37 typedef int const_iterator
;
38 typedef int value_type
;
43 struct not_fwd_iterable_2
{
44 typedef int const_iterator
;
45 typedef int value_type
;
50 struct not_fwd_iterable_3
{
51 typedef int value_type
;
56 // this one does not have const_iterator, but should be forward iterable
57 struct fwd_iterable_4
{
58 typedef int value_type
;
60 typedef unsigned int value_type
;
67 struct fwd_iterable_custom
{
68 typedef std::vector
<int>::const_iterator custom_iterator
; // named "exotic" on purpose
70 custom_iterator
begin() const { return values
.begin(); }
71 custom_iterator
end() const { return values
.end(); }
73 #if !defined(BOOST_MSVC) || (BOOST_MSVC_FULL_VER > 180040629)
74 #define MY_TEST_HAS_INIT_LIST
75 fwd_iterable_custom(std::initializer_list
<int> ilist
) : values
{ilist
}
78 fwd_iterable_custom(int v1
, int v2
, int v3
) {
85 std::vector
<int> values
;
88 BOOST_AUTO_TEST_CASE( test_forward_iterable_concept
)
91 typedef std::vector
<int> type
;
92 BOOST_CHECK_MESSAGE(utf::ut_detail::has_member_size
<type
>::value
, "has_member_size failed");
93 BOOST_CHECK_MESSAGE(utf::ut_detail::has_member_begin
<type
>::value
, "has_member_begin failed");
94 BOOST_CHECK_MESSAGE(utf::ut_detail::has_member_end
<type
>::value
, "has_member_end failed");
95 BOOST_CHECK_MESSAGE(utf::is_forward_iterable
< type
>::value
, "is_forward_iterable failed");
96 BOOST_CHECK_MESSAGE(utf::is_container_forward_iterable
< type
>::value
, "is_container_forward_iterable failed");
100 // should also work for references, but from is_forward_iterable
101 typedef std::vector
<int>& type
;
102 BOOST_CHECK_MESSAGE(utf::is_forward_iterable
< type
>::value
, "is_forward_iterable failed");
103 BOOST_CHECK_MESSAGE(utf::is_container_forward_iterable
< type
>::value
, "is_container_forward_iterable failed");
108 typedef std::list
<int> type
;
109 BOOST_CHECK_MESSAGE(utf::ut_detail::has_member_size
<type
>::value
, "has_member_size failed");
110 BOOST_CHECK_MESSAGE(utf::ut_detail::has_member_begin
<type
>::value
, "has_member_begin failed");
111 BOOST_CHECK_MESSAGE(utf::ut_detail::has_member_end
<type
>::value
, "has_member_end failed");
112 BOOST_CHECK_MESSAGE(utf::is_forward_iterable
< type
>::value
, "is_forward_iterable failed");
113 BOOST_CHECK_MESSAGE(utf::is_container_forward_iterable
< type
>::value
, "is_container_forward_iterable failed");
117 typedef std::map
<int, int> type
;
118 BOOST_CHECK_MESSAGE(utf::ut_detail::has_member_size
<type
>::value
, "has_member_size failed");
119 BOOST_CHECK_MESSAGE(utf::ut_detail::has_member_begin
<type
>::value
, "has_member_begin failed");
120 BOOST_CHECK_MESSAGE(utf::ut_detail::has_member_end
<type
>::value
, "has_member_end failed");
121 BOOST_CHECK_MESSAGE(utf::is_forward_iterable
< type
>::value
, "is_forward_iterable failed");
122 BOOST_CHECK_MESSAGE(utf::is_container_forward_iterable
< type
>::value
, "is_container_forward_iterable failed");
126 typedef std::set
<int> type
;
127 BOOST_CHECK_MESSAGE(utf::ut_detail::has_member_size
<type
>::value
, "has_member_size failed");
128 BOOST_CHECK_MESSAGE(utf::ut_detail::has_member_begin
<type
>::value
, "has_member_begin failed");
129 BOOST_CHECK_MESSAGE(utf::ut_detail::has_member_end
<type
>::value
, "has_member_end failed");
130 BOOST_CHECK_MESSAGE(utf::is_forward_iterable
< type
>::value
, "is_forward_iterable failed");
131 BOOST_CHECK_MESSAGE(utf::is_container_forward_iterable
< type
>::value
, "is_container_forward_iterable failed");
137 BOOST_CHECK_MESSAGE(!utf::ut_detail::has_member_size
<type
>::value
, "has_member_size failed");
138 BOOST_CHECK_MESSAGE(!utf::ut_detail::has_member_begin
<type
>::value
, "has_member_begin failed");
139 BOOST_CHECK_MESSAGE(!utf::is_forward_iterable
< type
>::value
, "is_forward_iterable failed");
140 BOOST_CHECK_MESSAGE(!utf::is_container_forward_iterable
< type
>::value
, "is_container_forward_iterable failed");
144 typedef not_fwd_iterable_1 type
;
145 BOOST_CHECK_MESSAGE(utf::ut_detail::has_member_size
<type
>::value
, "has_member_size failed");
146 BOOST_CHECK_MESSAGE(!utf::ut_detail::has_member_begin
<type
>::value
, "has_member_begin failed");
147 BOOST_CHECK_MESSAGE(!utf::ut_detail::has_member_end
<type
>::value
, "has_member_end failed");
148 BOOST_CHECK_MESSAGE(!utf::is_forward_iterable
< type
>::value
, "is_forward_iterable failed");
149 BOOST_CHECK_MESSAGE(!utf::is_container_forward_iterable
< type
>::value
, "is_container_forward_iterable failed");
155 typedef not_fwd_iterable_2 type
;
156 BOOST_CHECK_MESSAGE(!utf::ut_detail::has_member_size
<type
>::value
, "has_member_size failed");
157 BOOST_CHECK_MESSAGE(utf::ut_detail::has_member_begin
<type
>::value
, "has_member_begin failed");
158 BOOST_CHECK_MESSAGE(!utf::ut_detail::has_member_end
<type
>::value
, "has_member_end failed");
159 BOOST_CHECK_MESSAGE(!utf::is_forward_iterable
< type
>::value
, "is_forward_iterable failed");
160 BOOST_CHECK_MESSAGE(!utf::is_container_forward_iterable
< type
>::value
, "is_container_forward_iterable failed");
164 typedef not_fwd_iterable_3 type
;
165 BOOST_CHECK_MESSAGE(utf::ut_detail::has_member_size
<type
>::value
, "has_member_size failed");
166 BOOST_CHECK_MESSAGE(utf::ut_detail::has_member_begin
<type
>::value
, "has_member_begin failed");
167 BOOST_CHECK_MESSAGE(!utf::ut_detail::has_member_end
<type
>::value
, "has_member_end failed");
168 BOOST_CHECK_MESSAGE(!utf::is_forward_iterable
< type
>::value
, "is_forward_iterable failed");
169 BOOST_CHECK_MESSAGE(!utf::is_container_forward_iterable
< type
>::value
, "is_container_forward_iterable failed");
173 typedef fwd_iterable_4 type
;
174 BOOST_CHECK_MESSAGE(utf::ut_detail::has_member_size
<type
>::value
, "has_member_size failed");
175 BOOST_CHECK_MESSAGE(utf::ut_detail::has_member_begin
<type
>::value
, "has_member_begin failed");
176 BOOST_CHECK_MESSAGE(utf::ut_detail::has_member_end
<type
>::value
, "has_member_end failed");
177 BOOST_CHECK_MESSAGE(utf::is_forward_iterable
< type
>::value
, "is_forward_iterable failed");
178 BOOST_CHECK_MESSAGE(!utf::is_container_forward_iterable
< type
>::value
, "is_container_forward_iterable failed");
182 // for this one we should be able to get the size
183 typedef fwd_iterable_custom type
;
184 BOOST_CHECK_MESSAGE(!utf::ut_detail::has_member_size
<type
>::value
, "has_member_size failed");
185 BOOST_CHECK_MESSAGE(utf::ut_detail::has_member_begin
<type
>::value
, "has_member_begin failed");
186 BOOST_CHECK_MESSAGE(utf::ut_detail::has_member_end
<type
>::value
, "has_member_end failed");
187 BOOST_CHECK_MESSAGE(utf::is_forward_iterable
< type
>::value
, "is_forward_iterable failed");
188 BOOST_CHECK_MESSAGE(!utf::is_container_forward_iterable
< type
>::value
, "is_container_forward_iterable failed");
190 #ifdef MY_TEST_HAS_INIT_LIST
191 fwd_iterable_custom a
{3,4,5};
193 fwd_iterable_custom
a(3,4,5);
195 BOOST_TEST( utf::bt_iterator_traits
<fwd_iterable_custom
>::size(a
) == 3 );
199 BOOST_CHECK_MESSAGE(!utf::ut_detail::has_member_size
<type
>::value
, "has_member_size failed");
200 BOOST_CHECK_MESSAGE(!utf::ut_detail::has_member_begin
<type
>::value
, "has_member_begin failed");
201 BOOST_CHECK_MESSAGE(!utf::ut_detail::has_member_end
<type
>::value
, "has_member_end failed");
202 BOOST_CHECK_MESSAGE(!utf::is_forward_iterable
< type
>::value
, "is_forward_iterable failed");
203 BOOST_CHECK_MESSAGE(!utf::is_container_forward_iterable
< type
>::value
, "is_container_forward_iterable failed");
207 // C-tables are in the forward_iterable concept, but are not containers
208 typedef int type
[10];
209 BOOST_CHECK_MESSAGE(!utf::ut_detail::has_member_size
<type
>::value
, "has_member_size failed");
210 BOOST_CHECK_MESSAGE(utf::ut_detail::has_member_begin
<type
>::value
, "has_member_begin failed");
211 BOOST_CHECK_MESSAGE(utf::ut_detail::has_member_end
<type
>::value
, "has_member_end failed");
212 BOOST_CHECK_MESSAGE(utf::is_forward_iterable
< type
>::value
, "is_forward_iterable failed");
213 BOOST_CHECK_MESSAGE(!utf::is_container_forward_iterable
< type
>::value
, "is_container_forward_iterable failed");
217 // basic_cstring should be forward iterable and container
218 typedef boost::unit_test::basic_cstring
<char> type
;
219 BOOST_CHECK_MESSAGE(utf::ut_detail::has_member_size
<type
>::value
, "has_member_size failed");
220 BOOST_CHECK_MESSAGE(utf::ut_detail::has_member_begin
<type
>::value
, "has_member_begin failed");
221 BOOST_CHECK_MESSAGE(utf::ut_detail::has_member_end
<type
>::value
, "has_member_end failed");
222 BOOST_CHECK_MESSAGE(utf::is_forward_iterable
< type
>::value
, "is_forward_iterable failed");
223 BOOST_CHECK_MESSAGE(utf::is_container_forward_iterable
< type
>::value
, "is_container_forward_iterable failed");
225 typedef boost::unit_test::basic_cstring
<const char> type2
;
226 BOOST_CHECK_MESSAGE(utf::ut_detail::has_member_size
<type2
>::value
, "has_member_size failed");
227 BOOST_CHECK_MESSAGE(utf::ut_detail::has_member_begin
<type2
>::value
, "has_member_begin failed");
228 BOOST_CHECK_MESSAGE(utf::ut_detail::has_member_end
<type2
>::value
, "has_member_end failed");
229 BOOST_CHECK_MESSAGE(utf::is_forward_iterable
< type2
>::value
, "is_forward_iterable failed");
230 BOOST_CHECK_MESSAGE(utf::is_container_forward_iterable
< type2
>::value
, "is_container_forward_iterable failed");
235 //is_container_forward_iterable_impl
238 BOOST_AUTO_TEST_CASE( test_basic_value_expression_construction
)
240 using namespace boost::test_tools
;
243 predicate_result
const& res
= EXPR_TYPE( 1 ).evaluate();
245 BOOST_TEST( res
.message().is_empty() );
249 predicate_result
const& res
= EXPR_TYPE( 0 ).evaluate();
251 BOOST_TEST( res
.message() == " ['0' evaluates to false]" );
255 predicate_result
const& res
= EXPR_TYPE( true ).evaluate();
257 BOOST_TEST( res
.message().is_empty() );
261 predicate_result
const& res
= EXPR_TYPE( 1.5 ).evaluate();
266 predicate_result
const& res
= EXPR_TYPE( "abc" ).evaluate();
271 predicate_result
const& res
= EXPR_TYPE( 1>2 ).evaluate();
273 BOOST_TEST( res
.message() == " [1 <= 2]" );
278 //____________________________________________________________________________//
280 BOOST_AUTO_TEST_CASE( test_comparison_expression
)
282 using namespace boost::test_tools
;
285 predicate_result
const& res
= EXPR_TYPE( 1>2 ).evaluate();
287 BOOST_TEST( res
.message() == " [1 <= 2]" );
291 predicate_result
const& res
= EXPR_TYPE( 100 < 50 ).evaluate();
293 BOOST_TEST( res
.message() == " [100 >= 50]" );
297 predicate_result
const& res
= EXPR_TYPE( 5 <= 4 ).evaluate();
299 BOOST_TEST( res
.message() == " [5 > 4]" );
303 predicate_result
const& res
= EXPR_TYPE( 10>=20 ).evaluate();
305 BOOST_TEST( res
.message() == " [10 < 20]" );
310 predicate_result
const& res
= EXPR_TYPE( i
!= 10 ).evaluate();
312 BOOST_TEST( res
.message() == " [10 == 10]" );
317 predicate_result
const& res
= EXPR_TYPE( i
== 3 ).evaluate();
319 BOOST_TEST( res
.message() == " [5 != 3]" );
323 //____________________________________________________________________________//
325 BOOST_AUTO_TEST_CASE( test_arithmetic_ops
)
327 using namespace boost::test_tools
;
332 predicate_result
const& res
= EXPR_TYPE( i
+j
!=8 ).evaluate();
334 BOOST_TEST( res
.message() == " [3 + 5 == 8]" );
340 predicate_result
const& res
= EXPR_TYPE( 2*i
-j
> 1 ).evaluate();
342 BOOST_TEST( res
.message() == " [2 * 3 - 5 <= 1]" );
347 predicate_result
const& res
= EXPR_TYPE( 2<<j
< 30 ).evaluate();
349 BOOST_TEST( res
.message() == " [2 << 5 >= 30]" );
355 predicate_result
const& res
= EXPR_TYPE( i
&j
).evaluate();
357 BOOST_TEST( res
.message() == " [2 & 5]" );
363 predicate_result
const& res
= EXPR_TYPE( i
^j
^6 ).evaluate();
365 BOOST_TEST( res
.message() == " [3 ^ 5 ^ 6]" );
369 // EXPR_TYPE( 99/2 == 48 || 101/2 > 50 );
370 // EXPR_TYPE( a ? 100 < 50 : 25*2 == 50 );
371 // EXPR_TYPE( true,false );
374 //____________________________________________________________________________//
377 static int s_copy_counter
;
379 Testee() : m_value( false ) {}
380 Testee( Testee
const& ) : m_value(false) { s_copy_counter
++; }
381 Testee( Testee
&& ) : m_value(false) {}
382 Testee( Testee
const&& ) : m_value(false) {}
384 bool foo() { return m_value
; }
385 operator bool() const { return m_value
; }
387 friend std::ostream
& operator<<( std::ostream
& ostr
, Testee
const& ) { return ostr
<< "Testee"; }
392 int Testee::s_copy_counter
= 0;
394 Testee
get_obj() { return Testee(); }
395 Testee
const get_const_obj() { return Testee(); }
397 class NC
: boost::noncopyable
{
401 bool operator==(NC
const&) const { return false; }
402 friend std::ostream
& operator<<(std::ostream
& ostr
, NC
const&)
408 BOOST_AUTO_TEST_CASE( test_objects
)
410 using namespace boost::test_tools
;
412 int expected_copy_count
= 0;
416 Testee::s_copy_counter
= 0;
418 predicate_result
const& res
= EXPR_TYPE( obj
).evaluate();
420 BOOST_TEST( res
.message() == " ['Testee' evaluates to false]" );
421 BOOST_TEST( Testee::s_copy_counter
== expected_copy_count
);
426 Testee::s_copy_counter
= 0;
428 predicate_result
const& res
= EXPR_TYPE( obj
).evaluate();
430 BOOST_TEST( res
.message() == " ['Testee' evaluates to false]" );
431 BOOST_TEST( Testee::s_copy_counter
== expected_copy_count
);
435 Testee::s_copy_counter
= 0;
437 predicate_result
const& res
= EXPR_TYPE( get_obj() ).evaluate();
439 BOOST_TEST( res
.message() == " ['Testee' evaluates to false]" );
440 BOOST_TEST( Testee::s_copy_counter
== expected_copy_count
);
444 Testee::s_copy_counter
= 0;
446 predicate_result
const& res
= EXPR_TYPE( get_const_obj() ).evaluate();
448 BOOST_TEST( res
.message() == " ['Testee' evaluates to false]" );
449 BOOST_TEST( Testee::s_copy_counter
== expected_copy_count
);
453 Testee::s_copy_counter
= 0;
458 predicate_result
const& res
= EXPR_TYPE( t1
!= t2
).evaluate();
460 BOOST_TEST( res
.message() == " [Testee == Testee]" );
461 BOOST_TEST( Testee::s_copy_counter
== 0 );
468 predicate_result
const& res
= EXPR_TYPE( nc1
== nc2
).evaluate();
470 BOOST_TEST( res
.message() == " [NC != NC]" );
474 //____________________________________________________________________________//
476 BOOST_AUTO_TEST_CASE( test_pointers
)
478 using namespace boost::test_tools
;
483 predicate_result
const& res
= EXPR_TYPE( ptr
).evaluate();
491 predicate_result
const& res
= EXPR_TYPE( &obj1
== &obj2
).evaluate();
499 predicate_result
const& res
= EXPR_TYPE( *ptr
).evaluate();
501 BOOST_TEST( res
.message() == " ['Testee' evaluates to false]" );
507 bool Testee::* mem_ptr
=&Testee::m_value
;
509 predicate_result
const& res
= EXPR_TYPE( ptr
->*mem_ptr
).evaluate();
515 // bool Testee::* mem_ptr =&Testee::m_value;
516 // EXPR_TYPE( obj.*mem_ptr );
519 //____________________________________________________________________________//
521 BOOST_AUTO_TEST_CASE( test_mutating_ops
)
523 using namespace boost::test_tools
;
528 predicate_result
const& res
= EXPR_TYPE( j
= 0 ).evaluate();
530 BOOST_TEST( res
.message() == " ['0' evaluates to false]" );
531 BOOST_TEST( j
== 0 );
537 predicate_result
const& res
= EXPR_TYPE( j
-= 5 ).evaluate();
539 BOOST_TEST( res
.message() == " ['0' evaluates to false]" );
540 BOOST_TEST( j
== 0 );
546 predicate_result
const& res
= EXPR_TYPE( j
*= 0 ).evaluate();
548 BOOST_TEST( res
.message() == " ['0' evaluates to false]" );
549 BOOST_TEST( j
== 0 );
555 predicate_result
const& res
= EXPR_TYPE( j
/= 10 ).evaluate();
557 BOOST_TEST( res
.message() == " ['0' evaluates to false]" );
558 BOOST_TEST( j
== 0 );
564 predicate_result
const& res
= EXPR_TYPE( j
%= 2 ).evaluate();
566 BOOST_TEST( res
.message() == " ['0' evaluates to false]" );
567 BOOST_TEST( j
== 0 );
573 predicate_result
const& res
= EXPR_TYPE( j
^= j
).evaluate();
575 BOOST_TEST( res
.message() == " ['0' evaluates to false]" );
576 BOOST_TEST( j
== 0 );
580 BOOST_AUTO_TEST_CASE( test_specialized_comparator_string
)
582 using namespace boost::test_tools
;
585 std::string
s("abc");
587 predicate_result
const& res
= EXPR_TYPE( s
== "a" ).evaluate();
589 BOOST_TEST( res
.message() == " [abc != a]" );
590 BOOST_TEST( s
== "abc" );
594 predicate_result
const& res
= EXPR_TYPE( std::string("abc") == "a" ).evaluate();
596 BOOST_TEST( res
.message() == " [abc != a]" );
600 predicate_result
const& res
= EXPR_TYPE( "abc" == std::string("a") ).evaluate();
602 BOOST_TEST( res
.message() == " [abc != a]" );
606 predicate_result
const& res
= EXPR_TYPE( std::string("abc") == std::string("a") ).evaluate();
608 BOOST_TEST( res
.message() == " [abc != a]" );
612 BOOST_AUTO_TEST_CASE( test_comparison_with_arrays
)
614 using namespace boost::test_tools
;
617 char c_string_array
[] = "abc";
619 predicate_result
const& res
= EXPR_TYPE( c_string_array
== "a" ).evaluate();
621 BOOST_TEST( res
.message() == " [abc != a]" );
622 BOOST_TEST( c_string_array
== "abc" );
626 char c_string_array
[] = "abc";
628 predicate_result
const& res
= EXPR_TYPE( "a" == c_string_array
).evaluate();
630 BOOST_TEST( res
.message() == " [a != abc]" );
631 BOOST_TEST( "abc" == c_string_array
);
635 char const c_string_array
[] = "abc";
637 predicate_result
const& res
= EXPR_TYPE( c_string_array
== "a" ).evaluate();
639 BOOST_TEST( res
.message() == " [abc != a]" );
640 BOOST_TEST( c_string_array
== "abc" );
644 char const c_string_array
[] = "abc";
646 predicate_result
const& res
= EXPR_TYPE( "a" == c_string_array
).evaluate();
648 BOOST_TEST( res
.message() == " [a != abc]" );
649 BOOST_TEST( "abc" == c_string_array
);
654 long int c_long_array
[] = {3,4,7};
655 std::vector
<long int> v_long_array(c_long_array
, c_long_array
+ sizeof(c_long_array
)/sizeof(c_long_array
[0]));
656 std::swap(v_long_array
[1], v_long_array
[2]);
658 predicate_result
const& res
= EXPR_TYPE( c_long_array
== v_long_array
).evaluate();
660 BOOST_TEST( res
.message() == ": \n - mismatch at position 1: [4 == 7] is false\n - mismatch at position 2: [7 == 4] is false" );
662 std::swap(v_long_array
[1], v_long_array
[2]);
663 BOOST_TEST( c_long_array
== v_long_array
);
667 long int c_long_array
[] = {3,4,7};
669 std::vector
<long int> v_long_array(c_long_array
, c_long_array
+ sizeof(c_long_array
)/sizeof(c_long_array
[0]));
670 std::swap(v_long_array
[1], v_long_array
[2]);
672 predicate_result
const& res
= EXPR_TYPE( v_long_array
== c_long_array
).evaluate();
674 BOOST_TEST( res
.message() == ": \n - mismatch at position 1: [7 == 4] is false\n - mismatch at position 2: [4 == 7] is false" );
675 std::swap(v_long_array
[1], v_long_array
[2]);
676 BOOST_TEST( c_long_array
== v_long_array
);
680 long int const c_long_array
[] = {3,4,7};
681 std::vector
<long int> v_long_array(c_long_array
, c_long_array
+ sizeof(c_long_array
)/sizeof(c_long_array
[0]));
682 std::swap(v_long_array
[1], v_long_array
[2]);
684 predicate_result
const& res
= EXPR_TYPE( c_long_array
== v_long_array
).evaluate();
686 BOOST_TEST( res
.message() == ": \n - mismatch at position 1: [4 == 7] is false\n - mismatch at position 2: [7 == 4] is false" );
688 std::swap(v_long_array
[1], v_long_array
[2]);
689 BOOST_TEST( c_long_array
== v_long_array
);
693 long int const c_long_array
[] = {3,4,7};
695 std::vector
<long int> v_long_array(c_long_array
, c_long_array
+ sizeof(c_long_array
)/sizeof(c_long_array
[0]));
696 std::swap(v_long_array
[1], v_long_array
[2]);
698 predicate_result
const& res
= EXPR_TYPE( v_long_array
== c_long_array
).evaluate();
700 BOOST_TEST( res
.message() == ": \n - mismatch at position 1: [7 == 4] is false\n - mismatch at position 2: [4 == 7] is false" );
701 std::swap(v_long_array
[1], v_long_array
[2]);
702 BOOST_TEST( c_long_array
== v_long_array
);