From be891a6480bf3380cdbf697702fcca54eae6dfa4 Mon Sep 17 00:00:00 2001 From: mat007 Date: Tue, 11 Jan 2011 07:49:56 +0000 Subject: [PATCH] Refactoring git-svn-id: https://svn.code.sf.net/p/turtle/code/trunk@182 860be788-9bd5-4423-9f1e-828f051e677b --- src/tests/turtle_test/integration_test.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/tests/turtle_test/integration_test.cpp b/src/tests/turtle_test/integration_test.cpp index e4bbde8..4eb149b 100644 --- a/src/tests/turtle_test/integration_test.cpp +++ b/src/tests/turtle_test/integration_test.cpp @@ -346,16 +346,14 @@ namespace { return near_constraint< Expected >( expected, threshold ); } - - MOCK_CLASS( custom_constraint_mock ) - { - MOCK_METHOD_EXT( method, 1, void( float ), method ) - }; } BOOST_AUTO_TEST_CASE( writing_custom_constraint ) { - custom_constraint_mock m; - MOCK_EXPECT( m, method ).with( near( 3.f, 0.01f ) ); - m.method( 3.f ); + MOCK_FUNCTOR( void( float ) ) f; + MOCK_EXPECT( f, _ ).with( near( 3.f, 0.01f ) ); + f( 3.f ); + const std::string expected = "f\n" + ". unlimited().with( std::abs( _ - 3 ) < 0.01 )"; + BOOST_CHECK_EQUAL( expected, mock::format( f ) ); }