mirror of
https://github.com/mat007/turtle.git
synced 2026-06-22 12:13:43 +00:00
Added mock::affirm constraint which is equivalent to !mock::negate
git-svn-id: https://svn.code.sf.net/p/turtle/code/trunk@299 860be788-9bd5-4423-9f1e-828f051e677b
This commit is contained in:
parent
b3954c469c
commit
817334e069
2 changed files with 10 additions and 0 deletions
|
|
@ -44,6 +44,7 @@ namespace mock
|
||||||
const constraint< detail::N > N;
|
const constraint< detail::N > N;
|
||||||
|
|
||||||
MOCK_CONSTRAINT(any, true && &actual)
|
MOCK_CONSTRAINT(any, true && &actual)
|
||||||
|
MOCK_CONSTRAINT(affirm, !! actual)
|
||||||
MOCK_CONSTRAINT(negate, ! actual)
|
MOCK_CONSTRAINT(negate, ! actual)
|
||||||
MOCK_CONSTRAINT(evaluate, actual())
|
MOCK_CONSTRAINT(evaluate, actual())
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ BOOST_AUTO_TEST_CASE( all_comparison_constraints_can_be_instanciated )
|
||||||
BOOST_AUTO_TEST_CASE( constraints_can_be_negated_using_the_not_operator )
|
BOOST_AUTO_TEST_CASE( constraints_can_be_negated_using_the_not_operator )
|
||||||
{
|
{
|
||||||
! mock::any;
|
! mock::any;
|
||||||
|
! mock::affirm;
|
||||||
! mock::negate;
|
! mock::negate;
|
||||||
! mock::evaluate;
|
! mock::evaluate;
|
||||||
! mock::equal( 0 );
|
! mock::equal( 0 );
|
||||||
|
|
@ -231,6 +232,14 @@ BOOST_AUTO_TEST_CASE( retrieve_uses_assignment_operator )
|
||||||
mock::retrieve( b ).f_( a );
|
mock::retrieve( b ).f_( a );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BOOST_AUTO_TEST_CASE( affirm )
|
||||||
|
{
|
||||||
|
int* i = 0;
|
||||||
|
int j;
|
||||||
|
BOOST_CHECK( ! mock::affirm.f_( i ) );
|
||||||
|
BOOST_CHECK( mock::affirm.f_( &j ) );
|
||||||
|
}
|
||||||
|
|
||||||
BOOST_AUTO_TEST_CASE( negate )
|
BOOST_AUTO_TEST_CASE( negate )
|
||||||
{
|
{
|
||||||
int* i = 0;
|
int* i = 0;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue