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:
mat007 2012-05-12 17:37:07 +00:00
parent 044d5843e7
commit b40fa567a2

View file

@ -187,6 +187,22 @@ BOOST_AUTO_TEST_CASE( mocking_a_template_class_method_is_supported )
BOOST_CHECK( MOCK_VERIFY( m.my_method_t ) ); 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 namespace
{ {
template< typename T > template< typename T >