mirror of
https://github.com/mat007/turtle.git
synced 2026-06-22 12:13:43 +00:00
Fixed perfect forwarding bug
This commit is contained in:
parent
062d465ba5
commit
860e072439
4 changed files with 64 additions and 7 deletions
|
|
@ -84,11 +84,46 @@ BOOST_FIXTURE_TEST_CASE( triggering_an_unlimited_expectation_is_valid, mock_erro
|
|||
f();
|
||||
CHECK_CALLS( 2 );
|
||||
}
|
||||
{
|
||||
mock::detail::function< void( int, std::string ) > f;
|
||||
f.expect();
|
||||
f( 1, "s1" );
|
||||
f( 2, "s2" );
|
||||
CHECK_CALLS( 2 );
|
||||
}
|
||||
{
|
||||
mock::detail::function< void( int, const std::string& ) > f;
|
||||
f.expect();
|
||||
f( 1, "s" );
|
||||
f( 1, "s" );
|
||||
f( 1, "s1" );
|
||||
f( 2, "s2" );
|
||||
CHECK_CALLS( 2 );
|
||||
}
|
||||
}
|
||||
|
||||
BOOST_FIXTURE_TEST_CASE( triggering_several_once_expectations_is_valid, mock_error_fixture )
|
||||
{
|
||||
{
|
||||
mock::detail::function< void() > f;
|
||||
f.expect().once();
|
||||
f.expect().once();
|
||||
f();
|
||||
f();
|
||||
CHECK_CALLS( 2 );
|
||||
}
|
||||
{
|
||||
mock::detail::function< void( int, std::string ) > f;
|
||||
f.expect().once().with( 1, "s1" );
|
||||
f.expect().once().with( 2, "s2" );
|
||||
f( 1, "s1" );
|
||||
f( 2, "s2" );
|
||||
CHECK_CALLS( 2 );
|
||||
}
|
||||
{
|
||||
mock::detail::function< void( int, const std::string& ) > f;
|
||||
f.expect().once().with( 1, "s1" );
|
||||
f.expect().once().with( 2, "s2" );
|
||||
f( 1, "s1" );
|
||||
f( 2, "s2" );
|
||||
CHECK_CALLS( 2 );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue