mirror of
https://github.com/mat007/turtle.git
synced 2026-06-22 12:13:43 +00:00
Added support for nullptr as constraint
git-svn-id: https://svn.code.sf.net/p/turtle/code/trunk@648 860be788-9bd5-4423-9f1e-828f051e677b
This commit is contained in:
parent
42c2c4e6a4
commit
1320a96179
12 changed files with 96 additions and 10 deletions
|
|
@ -348,6 +348,18 @@ BOOST_FIXTURE_TEST_CASE( triggering_an_expectation_with_failing_custom_constrain
|
|||
// CHECK_CALLS( 1 );
|
||||
//}
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_NULLPTR) && !defined(BOOST_NO_NULLPTR)
|
||||
|
||||
BOOST_FIXTURE_TEST_CASE( nullptr_can_be_used_in_place_of_null_pointers_in_constraints, error_fixture )
|
||||
{
|
||||
mock::detail::function< void( int* ) > f;
|
||||
f.expect().with( nullptr );
|
||||
f( 0 );
|
||||
CHECK_CALLS( 1 );
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// result handling
|
||||
|
||||
BOOST_FIXTURE_TEST_CASE( triggering_an_expectation_with_no_return_set_calls_missing_action, error_fixture )
|
||||
|
|
|
|||
|
|
@ -78,6 +78,12 @@ BOOST_AUTO_TEST_CASE( same )
|
|||
BOOST_CHECK( ! c.c_( j ) );
|
||||
BOOST_CHECK( c.c_( i ) );
|
||||
}
|
||||
#if !defined(BOOST_NO_CXX11_NULLPTR) && !defined(BOOST_NO_NULLPTR)
|
||||
{
|
||||
std::nullptr_t p;
|
||||
BOOST_CHECK( mock::same( p ).c_( p ) );
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE( assign )
|
||||
|
|
@ -205,6 +211,14 @@ BOOST_AUTO_TEST_CASE( retrieve )
|
|||
BOOST_CHECK( mock::retrieve( boost::ref( i ) ).c_( j ) );
|
||||
BOOST_CHECK_EQUAL( i, &j );
|
||||
}
|
||||
#if !defined(BOOST_NO_CXX11_NULLPTR) && !defined(BOOST_NO_NULLPTR)
|
||||
{
|
||||
std::nullptr_t* i = 0;
|
||||
std::nullptr_t j;
|
||||
BOOST_CHECK( mock::retrieve( i ).c_( j ) );
|
||||
BOOST_CHECK_EQUAL( i, &j );
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
namespace
|
||||
|
|
|
|||
|
|
@ -630,3 +630,12 @@ BOOST_AUTO_TEST_CASE( boost_lambda_functor_yields_question_mark_when_serialized
|
|||
BOOST_CHECK_EQUAL( "?", to_string( boost::lambda::bind( &some_function ) ) );
|
||||
BOOST_CHECK_EQUAL( "?", to_string( boost::lambda::_1 < 42 ) );
|
||||
}
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_NULLPTR) && !defined(BOOST_NO_NULLPTR)
|
||||
|
||||
BOOST_AUTO_TEST_CASE( nullptr_is_serialized )
|
||||
{
|
||||
BOOST_CHECK_EQUAL( "nullptr", to_string( nullptr ) );
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue