mirror of
https://github.com/mat007/turtle.git
synced 2026-06-22 12:13:43 +00:00
Assume existance of smart pointers
This commit is contained in:
parent
3b3700fda6
commit
f154a1a22a
7 changed files with 0 additions and 33 deletions
|
|
@ -40,12 +40,6 @@
|
|||
# error BOOST_FT_MAX_ARITY must be set to MOCK_MAX_ARGS + 1 or higher
|
||||
#endif
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_SMART_PTR) && !defined(BOOST_NO_SMART_PTR)
|
||||
# ifndef MOCK_NO_SMART_PTR
|
||||
# define MOCK_SMART_PTR
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_HDR_FUNCTIONAL)
|
||||
# ifndef MOCK_NO_HDR_FUNCTIONAL
|
||||
# define MOCK_HDR_FUNCTIONAL
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@
|
|||
#include <boost/preprocessor/comparison/greater.hpp>
|
||||
#include <boost/test/utils/basic_cstring/basic_cstring.hpp>
|
||||
#include <boost/test/utils/lazy_ostream.hpp>
|
||||
#include <boost/enable_shared_from_this.hpp>
|
||||
#include <boost/call_traits.hpp>
|
||||
#include <boost/make_shared.hpp>
|
||||
#include <boost/noncopyable.hpp>
|
||||
|
|
|
|||
|
|
@ -144,7 +144,6 @@ namespace detail
|
|||
return s << boost::none;
|
||||
}
|
||||
|
||||
#ifdef MOCK_SMART_PTR
|
||||
template< typename T >
|
||||
stream& operator<<( stream& s, const std::shared_ptr< T >& t )
|
||||
{
|
||||
|
|
@ -160,7 +159,6 @@ namespace detail
|
|||
{
|
||||
return s << mock::format( p.get() );
|
||||
}
|
||||
#endif
|
||||
|
||||
template< typename T >
|
||||
stream& operator<<( stream& s, const boost::lambda::lambda_functor< T >& )
|
||||
|
|
|
|||
|
|
@ -358,8 +358,6 @@ BOOST_FIXTURE_TEST_CASE( nullptr_can_be_used_in_place_of_null_pointers_in_constr
|
|||
CHECK_CALLS( 1 );
|
||||
}
|
||||
|
||||
#ifdef MOCK_SMART_PTR
|
||||
|
||||
BOOST_FIXTURE_TEST_CASE( unique_ptr_is_supported_as_parameter, mock_error_fixture )
|
||||
{
|
||||
mock::detail::function< void( std::unique_ptr< int > ) > f;
|
||||
|
|
@ -369,8 +367,6 @@ BOOST_FIXTURE_TEST_CASE( unique_ptr_is_supported_as_parameter, mock_error_fixtur
|
|||
CHECK_CALLS( 1 );
|
||||
}
|
||||
|
||||
#endif // MOCK_SMART_PTR
|
||||
|
||||
// result handling
|
||||
|
||||
BOOST_FIXTURE_TEST_CASE( triggering_an_expectation_with_no_return_set_calls_missing_action, mock_error_fixture )
|
||||
|
|
@ -593,8 +589,6 @@ BOOST_FIXTURE_TEST_CASE( triggering_an_expectation_moves_the_set_rvalue, mock_er
|
|||
CHECK_CALLS( 1 );
|
||||
}
|
||||
|
||||
#ifdef MOCK_SMART_PTR
|
||||
|
||||
BOOST_FIXTURE_TEST_CASE( triggering_an_expectation_moves_the_set_unique_ptr_lvalue, mock_error_fixture )
|
||||
{
|
||||
mock::detail::function< std::unique_ptr< int >() > f;
|
||||
|
|
@ -614,8 +608,6 @@ BOOST_FIXTURE_TEST_CASE( triggering_an_expectation_moves_the_set_unique_ptr_rval
|
|||
}
|
||||
}
|
||||
|
||||
#endif // MOCK_SMART_PTR
|
||||
|
||||
BOOST_FIXTURE_TEST_CASE( triggering_an_expectation_returns_the_set_shared_ptr_value, mock_error_fixture )
|
||||
{
|
||||
{
|
||||
|
|
|
|||
|
|
@ -52,7 +52,6 @@ BOOST_AUTO_TEST_CASE( equal_constraint )
|
|||
s = "string";
|
||||
BOOST_CHECK( c.c_( "string" ) );
|
||||
}
|
||||
#ifdef MOCK_SMART_PTR
|
||||
{
|
||||
std::unique_ptr< int > i;
|
||||
std::unique_ptr< int > j( new int( 3 ) );
|
||||
|
|
@ -61,7 +60,6 @@ BOOST_AUTO_TEST_CASE( equal_constraint )
|
|||
BOOST_CHECK( mock::equal( i ).c_( i ) );
|
||||
BOOST_CHECK( mock::equal( j ).c_( j ) );
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE( equal_constraint_deref )
|
||||
|
|
@ -75,14 +73,12 @@ BOOST_AUTO_TEST_CASE( equal_constraint_deref )
|
|||
int* i = 0;
|
||||
BOOST_CHECK( ! mock::equal( 3 ).c_( i ) );
|
||||
}
|
||||
#ifdef MOCK_SMART_PTR
|
||||
{
|
||||
std::unique_ptr< int > j( new int( 3 ) );
|
||||
BOOST_CHECK( mock::equal( 3 ).c_( j ) );
|
||||
std::unique_ptr< int > i;
|
||||
BOOST_CHECK( ! mock::equal( 3 ).c_( i ) );
|
||||
}
|
||||
#endif // MOCK_SMART_PTR
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE( same_constraint )
|
||||
|
|
@ -249,7 +245,6 @@ BOOST_AUTO_TEST_CASE( retrieve_constraint )
|
|||
BOOST_CHECK( mock::retrieve( i ).c_( j ) );
|
||||
BOOST_CHECK_EQUAL( i, &j );
|
||||
}
|
||||
#ifdef MOCK_SMART_PTR
|
||||
{
|
||||
std::unique_ptr< int > i;
|
||||
std::unique_ptr< int > j( new int( 3 ) );
|
||||
|
|
@ -258,7 +253,6 @@ BOOST_AUTO_TEST_CASE( retrieve_constraint )
|
|||
BOOST_CHECK_EQUAL( 3, *i );
|
||||
BOOST_CHECK( !j );
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
namespace
|
||||
|
|
@ -291,12 +285,10 @@ BOOST_AUTO_TEST_CASE( affirm_constraint )
|
|||
BOOST_CHECK( mock::affirm.c_( &j ) );
|
||||
}
|
||||
{
|
||||
#ifdef MOCK_SMART_PTR
|
||||
std::unique_ptr< int > i;
|
||||
std::unique_ptr< int > j( new int( 3 ) );
|
||||
BOOST_CHECK( ! mock::affirm.c_( i ) );
|
||||
BOOST_CHECK( mock::affirm.c_( j ) );
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -705,8 +705,6 @@ BOOST_FIXTURE_TEST_CASE( mock_method_accepts_polymorphic_multi_constraint, mock_
|
|||
CHECK_CALLS( 1 );
|
||||
}
|
||||
|
||||
#ifdef MOCK_SMART_PTR
|
||||
|
||||
BOOST_FIXTURE_TEST_CASE( std_unique_ptr_argument_is_supported_in_action, mock_error_fixture )
|
||||
{
|
||||
MOCK_FUNCTOR( f, void( std::unique_ptr< int > ) );
|
||||
|
|
@ -775,5 +773,3 @@ struct my_unique_ptr_class
|
|||
MOCK_METHOD_EXT( m, 1, void( std::unique_ptr< int > ), m )
|
||||
MOCK_STATIC_METHOD( ms, 1, void( std::unique_ptr< int > ), ms )
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -409,8 +409,6 @@ BOOST_AUTO_TEST_CASE( boost_weak_ptr_are_serialized )
|
|||
BOOST_CHECK_NE( "?", to_string( boost::weak_ptr< int >( boost::shared_ptr< int >( new int( 42 ) ) ) ) );
|
||||
}
|
||||
|
||||
#ifdef MOCK_SMART_PTR
|
||||
|
||||
BOOST_AUTO_TEST_CASE( std_shared_ptr_are_serialized )
|
||||
{
|
||||
BOOST_CHECK_NE( "?", to_string( std::shared_ptr< int >() ) );
|
||||
|
|
@ -429,8 +427,6 @@ BOOST_AUTO_TEST_CASE( std_unique_ptr_are_serialized )
|
|||
BOOST_CHECK_NE( "?", to_string( std::unique_ptr< int >( new int( 42 ) ) ) );
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
BOOST_AUTO_TEST_CASE( std_deques_are_serialized )
|
||||
{
|
||||
std::deque< int > d;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue