mirror of
https://github.com/mat007/turtle.git
synced 2026-06-22 12:13:43 +00:00
Added test for mocking a conversion operator in a template class
git-svn-id: https://svn.code.sf.net/p/turtle/code/trunk@453 860be788-9bd5-4423-9f1e-828f051e677b
This commit is contained in:
parent
044d5843e7
commit
b40fa567a2
1 changed files with 16 additions and 0 deletions
|
|
@ -187,6 +187,22 @@ BOOST_AUTO_TEST_CASE( mocking_a_template_class_method_is_supported )
|
|||
BOOST_CHECK( MOCK_VERIFY( m.my_method_t ) );
|
||||
}
|
||||
|
||||
namespace
|
||||
{
|
||||
template< typename T >
|
||||
struct my_template_converter_mock
|
||||
{
|
||||
MOCK_CONVERSION_OPERATOR( T, to_t )
|
||||
};
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE( mocking_a_template_class_conversion_operator_is_supported )
|
||||
{
|
||||
my_template_converter_mock< int > m;
|
||||
MOCK_EXPECT( m.to_t ).returns( 42 );
|
||||
BOOST_CHECK_EQUAL( 42, m );
|
||||
}
|
||||
|
||||
namespace
|
||||
{
|
||||
template< typename T >
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue