mirror of
https://github.com/mat007/turtle.git
synced 2026-06-22 12:13:43 +00:00
Cleanup
git-svn-id: https://svn.code.sf.net/p/turtle/code/trunk@322 860be788-9bd5-4423-9f1e-828f051e677b
This commit is contained in:
parent
989830855c
commit
4f918457bc
1 changed files with 7 additions and 7 deletions
|
|
@ -17,27 +17,27 @@
|
||||||
#define BOOST_LIB_NAME boost_unit_test_framework
|
#define BOOST_LIB_NAME boost_unit_test_framework
|
||||||
#include <boost/config/auto_link.hpp>
|
#include <boost/config/auto_link.hpp>
|
||||||
|
|
||||||
#define TEXT(z, n, text) text
|
#define IDENTITY(z, n, d) d
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
struct my_custom_mock
|
struct my_custom_mock
|
||||||
{
|
{
|
||||||
MOCK_METHOD_EXT( method, MOCK_MAX_ARGS, void( BOOST_PP_ENUM(MOCK_MAX_ARGS, TEXT, int) ), method )
|
MOCK_METHOD_EXT( method, MOCK_MAX_ARGS, void( BOOST_PP_ENUM(MOCK_MAX_ARGS, IDENTITY, int) ), method )
|
||||||
MOCK_METHOD_EXT( method2, MOCK_MAX_ARGS, int( BOOST_PP_ENUM(MOCK_MAX_ARGS, TEXT, int) ), method2 )
|
MOCK_METHOD_EXT( method2, MOCK_MAX_ARGS, int( BOOST_PP_ENUM(MOCK_MAX_ARGS, IDENTITY, int) ), method2 )
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOST_AUTO_TEST_CASE( call_mock_method_with_max_number_of_args )
|
BOOST_AUTO_TEST_CASE( call_mock_method_with_max_number_of_args )
|
||||||
{
|
{
|
||||||
my_custom_mock m;
|
my_custom_mock m;
|
||||||
MOCK_EXPECT( m, method ).once().with( BOOST_PP_ENUM(MOCK_MAX_ARGS, TEXT, 0) );
|
MOCK_EXPECT( m, method ).once().with( BOOST_PP_ENUM(MOCK_MAX_ARGS, IDENTITY, 0) );
|
||||||
m.method( BOOST_PP_ENUM(MOCK_MAX_ARGS, TEXT, 0) );
|
m.method( BOOST_PP_ENUM(MOCK_MAX_ARGS, IDENTITY, 0) );
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOST_AUTO_TEST_CASE( call_mock_method_with_max_number_of_args_and_returning_something )
|
BOOST_AUTO_TEST_CASE( call_mock_method_with_max_number_of_args_and_returning_something )
|
||||||
{
|
{
|
||||||
my_custom_mock m;
|
my_custom_mock m;
|
||||||
MOCK_EXPECT( m, method2 ).once().with( BOOST_PP_ENUM(MOCK_MAX_ARGS, TEXT, 0) ).returns( 42 );
|
MOCK_EXPECT( m, method2 ).once().with( BOOST_PP_ENUM(MOCK_MAX_ARGS, IDENTITY, 0) ).returns( 42 );
|
||||||
BOOST_CHECK_EQUAL( 42, m.method2( BOOST_PP_ENUM(MOCK_MAX_ARGS, TEXT, 0) ) );
|
BOOST_CHECK_EQUAL( 42, m.method2( BOOST_PP_ENUM(MOCK_MAX_ARGS, IDENTITY, 0) ) );
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue