mirror of
https://github.com/boostorg/utility.git
synced 2025-05-09 02:44:10 +00:00
Fixed CW problems and refactored fail cases
[SVN r24870]
This commit is contained in:
parent
0c3199f72d
commit
51077e49f5
@ -76,23 +76,14 @@ void test ( T const& y, T const& z )
|
||||
T& x_c_ref = x_c ;
|
||||
x_c_ref = z ;
|
||||
BOOST_TEST ( x_c == z ) ;
|
||||
#ifdef PRODUCE_ERROR_1
|
||||
get(x_c) = z ; // this should produce an ERROR
|
||||
#endif
|
||||
|
||||
boost::value_initialized<T const> cx ;
|
||||
BOOST_TEST ( y == cx ) ;
|
||||
BOOST_TEST ( y == get(cx) ) ;
|
||||
#ifdef PRODUCE_ERROR_2
|
||||
get(cx) = z ; // this should produce an ERROR
|
||||
#endif
|
||||
|
||||
boost::value_initialized<T const> const cx_c ;
|
||||
BOOST_TEST ( y == cx_c ) ;
|
||||
BOOST_TEST ( y == get(cx_c) ) ;
|
||||
#ifdef PRODUCE_ERROR_3
|
||||
get(cx_c) = z ; // this should produce an ERROR
|
||||
#endif
|
||||
}
|
||||
|
||||
int test_main(int, char **)
|
||||
|
37
value_init_test_fail1.cpp
Normal file
37
value_init_test_fail1.cpp
Normal file
@ -0,0 +1,37 @@
|
||||
// (C) 2002, Fernando Luis Cacciola Carballal.
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
// Test program for "boost/utility/value_init.hpp"
|
||||
//
|
||||
// Initial: 21 Agu 2002
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
#include "boost/utility/value_init.hpp"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#include "boost/test/minimal.hpp"
|
||||
|
||||
int test_main(int, char **)
|
||||
{
|
||||
boost::value_initialized<int> const x_c ;
|
||||
|
||||
get(x_c) = 1234 ; // this should produce an ERROR
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
unsigned int expected_failures = 0;
|
||||
|
||||
|
||||
|
||||
|
||||
|
36
value_init_test_fail2.cpp
Normal file
36
value_init_test_fail2.cpp
Normal file
@ -0,0 +1,36 @@
|
||||
// (C) 2002, Fernando Luis Cacciola Carballal.
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
// Test program for "boost/utility/value_init.hpp"
|
||||
//
|
||||
// Initial: 21 Agu 2002
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
#include "boost/utility/value_init.hpp"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#include "boost/test/minimal.hpp"
|
||||
|
||||
int test_main(int, char **)
|
||||
{
|
||||
boost::value_initialized<int const> cx ;
|
||||
|
||||
get(cx) = 1234 ; // this should produce an ERROR
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
unsigned int expected_failures = 0;
|
||||
|
||||
|
||||
|
||||
|
||||
|
37
value_init_test_fail3.cpp
Normal file
37
value_init_test_fail3.cpp
Normal file
@ -0,0 +1,37 @@
|
||||
// (C) 2002, Fernando Luis Cacciola Carballal.
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
// Test program for "boost/utility/value_init.hpp"
|
||||
//
|
||||
// Initial: 21 Agu 2002
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
#include "boost/utility/value_init.hpp"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#include "boost/test/minimal.hpp"
|
||||
|
||||
int test_main(int, char **)
|
||||
{
|
||||
boost::value_initialized<int const> const cx_c ;
|
||||
|
||||
get(cx_c) = 1234 ; // this should produce an ERROR
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
unsigned int expected_failures = 0;
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user