Adress review comments

This commit is contained in:
Alexander Grund 2020-09-24 22:50:22 +02:00
parent 279bb2c767
commit c7873cde4b
No known key found for this signature in database
GPG key ID: AA48A0760367A42B
13 changed files with 36 additions and 48 deletions

View file

@ -31,8 +31,8 @@ namespace mock_test
my_class::my_class( base_class& b): b(b){}
void my_class::flush()
{
static int secret_value = 7;
if(--secret_value == 0)
static int counter = 7;
if(--counter == 0)
b.method();
}
}
@ -59,15 +59,16 @@ namespace mock_test
{
MOCK_METHOD( method, 0 )
};
}
BOOST_AUTO_TEST_CASE( method_is_called )
{
using namespace mock_test;
mock_base_class m;
my_class c( m );
bool done = false;
MOCK_EXPECT( m.method ).once().calls( [&done](){ done = true; } );
check( done, [&c](){ c.flush(); } ); // just wait on done, flushing from time to time
}
}
//]