mirror of
https://github.com/mat007/turtle.git
synced 2026-06-22 12:13:43 +00:00
Fixed ambiguous function call with gcc
This commit is contained in:
parent
c4c6edd010
commit
f4efa9b02e
1 changed files with 8 additions and 7 deletions
|
|
@ -35,15 +35,16 @@ namespace
|
|||
namespace
|
||||
{
|
||||
template< typename F >
|
||||
void wait( bool& condition, F flush, int timeout = 100, int sleep = 100 )
|
||||
void check( bool& condition, F flush, int attempts = 100, int sleep = 100 )
|
||||
{
|
||||
while( !condition && timeout > 0 )
|
||||
while( !condition && attempts > 0 )
|
||||
{
|
||||
--timeout;
|
||||
--attempts;
|
||||
boost::this_thread::sleep( boost::posix_time::milliseconds( sleep ) );
|
||||
flush();
|
||||
}
|
||||
}
|
||||
|
||||
MOCK_BASE_CLASS( mock_base_class, base_class )
|
||||
{
|
||||
MOCK_METHOD( method, 0 )
|
||||
|
|
@ -52,10 +53,10 @@ namespace
|
|||
|
||||
BOOST_AUTO_TEST_CASE( method_is_called )
|
||||
{
|
||||
mock_base_class mock;
|
||||
my_class c( mock );
|
||||
mock_base_class m;
|
||||
my_class c( m );
|
||||
bool done = false;
|
||||
MOCK_EXPECT( mock.method ).once().calls( boost::lambda::var( done ) = true ); // when method is called it will set done to true
|
||||
wait( done, boost::bind( &my_class::flush, &c ) ); // just wait on done, flushing from time to time
|
||||
MOCK_EXPECT( m.method ).once().calls( boost::lambda::var( done ) = true ); // when method is called it will set done to true
|
||||
check( done, boost::bind( &my_class::flush, &c ) ); // just wait on done, flushing from time to time
|
||||
}
|
||||
//]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue