mirror of
https://github.com/mat007/turtle.git
synced 2026-06-22 12:13:43 +00:00
Added mock functor in namespace test
This commit is contained in:
parent
ed2a22a691
commit
179c26946c
1 changed files with 14 additions and 0 deletions
|
|
@ -146,6 +146,20 @@ BOOST_FIXTURE_TEST_CASE( mock_object_method_with_declared_but_not_defined_parame
|
||||||
MOCK_EXPECT( mock.t );
|
MOCK_EXPECT( mock.t );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace
|
||||||
|
{
|
||||||
|
MOCK_FUNCTOR( gf, int( float, const std::string& ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOST_FIXTURE_TEST_CASE( mock_functor_in_namespace_is_supported, mock_error_fixture )
|
||||||
|
{
|
||||||
|
boost::function< int( float, const std::string& ) > func;
|
||||||
|
MOCK_EXPECT( gf ).once().with( 3, "op" ).returns( 42 );
|
||||||
|
func = gf;
|
||||||
|
BOOST_CHECK_EQUAL( 42, func( 3, "op" ) );
|
||||||
|
CHECK_CALLS( 1 );
|
||||||
|
}
|
||||||
|
|
||||||
BOOST_FIXTURE_TEST_CASE( mock_functor_in_function_is_supported, mock_error_fixture )
|
BOOST_FIXTURE_TEST_CASE( mock_functor_in_function_is_supported, mock_error_fixture )
|
||||||
{
|
{
|
||||||
boost::function< int( float, const std::string& ) > func;
|
boost::function< int( float, const std::string& ) > func;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue