mirror of
https://github.com/mat007/turtle.git
synced 2026-06-22 12:13:43 +00:00
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:
parent
b40fa567a2
commit
cc9589f457
1 changed files with 10 additions and 1 deletions
|
|
@ -518,7 +518,7 @@ BOOST_AUTO_TEST_CASE( a_free_function_can_be_mocked )
|
|||
|
||||
namespace
|
||||
{
|
||||
struct some_class
|
||||
struct some_class : mock::object
|
||||
{
|
||||
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 );
|
||||
}
|
||||
|
||||
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
|
||||
{
|
||||
template< typename T >
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue