From 179c26946c23ea954b3061ec5363f81a8de288e7 Mon Sep 17 00:00:00 2001 From: Mathieu Champlon Date: Wed, 14 Oct 2015 13:28:02 +0200 Subject: [PATCH] Added mock functor in namespace test --- test/test_integration.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/test_integration.cpp b/test/test_integration.cpp index 71ed0c6..d212b8c 100644 --- a/test/test_integration.cpp +++ b/test/test_integration.cpp @@ -146,6 +146,20 @@ BOOST_FIXTURE_TEST_CASE( mock_object_method_with_declared_but_not_defined_parame MOCK_EXPECT( mock.t ); } +namespace +{ + MOCK_FUNCTOR( gf, int( float, const std::string& ) ); +} + +BOOST_FIXTURE_TEST_CASE( mock_functor_in_namespace_is_supported, mock_error_fixture ) +{ + boost::function< int( float, const std::string& ) > func; + MOCK_EXPECT( gf ).once().with( 3, "op" ).returns( 42 ); + func = gf; + BOOST_CHECK_EQUAL( 42, func( 3, "op" ) ); + CHECK_CALLS( 1 ); +} + BOOST_FIXTURE_TEST_CASE( mock_functor_in_function_is_supported, mock_error_fixture ) { boost::function< int( float, const std::string& ) > func;