Added test to ensure that a static method is not reset when resetting an instance of the class

git-svn-id: https://svn.code.sf.net/p/turtle/code/trunk@454 860be788-9bd5-4423-9f1e-828f051e677b
This commit is contained in:
mat007 2012-05-26 05:53:39 +00:00
parent b40fa567a2
commit cc9589f457

View file

@ -518,7 +518,7 @@ BOOST_AUTO_TEST_CASE( a_free_function_can_be_mocked )
namespace namespace
{ {
struct some_class struct some_class : mock::object
{ {
MOCK_STATIC_METHOD( some_static_method, 1, void( int ), some_static_method ) MOCK_STATIC_METHOD( some_static_method, 1, void( int ), some_static_method )
}; };
@ -533,6 +533,15 @@ BOOST_AUTO_TEST_CASE( a_static_method_can_be_mocked )
MOCK_RESET( some_class::some_static_method ); MOCK_RESET( some_class::some_static_method );
} }
BOOST_AUTO_TEST_CASE( a_static_method_is_not_reset_when_resetting_an_instance_of_the_class )
{
MOCK_EXPECT( some_class::some_static_method ).once();
some_class c;
mock::reset( c );
BOOST_CHECK( ! MOCK_VERIFY( some_class::some_static_method ) );
MOCK_RESET( some_class::some_static_method );
}
namespace namespace
{ {
template< typename T > template< typename T >