@ -62,6 +62,15 @@ using testing::Return;
using testing : : ReturnRef ;
using testing : : ReturnRef ;
using testing : : TypedEq ;
using testing : : TypedEq ;
template < typename T >
class TemplatedCopyable {
public :
TemplatedCopyable ( ) { }
template < typename U >
TemplatedCopyable ( const U & other ) { } // NOLINT
} ;
class FooInterface {
class FooInterface {
public :
public :
virtual ~ FooInterface ( ) { }
virtual ~ FooInterface ( ) { }
@ -90,6 +99,7 @@ class FooInterface {
virtual int TypeWithHole ( int ( * func ) ( ) ) = 0 ;
virtual int TypeWithHole ( int ( * func ) ( ) ) = 0 ;
virtual int TypeWithComma ( const std : : map < int , std : : string > & a_map ) = 0 ;
virtual int TypeWithComma ( const std : : map < int , std : : string > & a_map ) = 0 ;
virtual int TypeWithTemplatedCopyCtor ( const TemplatedCopyable < int > & ) = 0 ;
# if GTEST_OS_WINDOWS
# if GTEST_OS_WINDOWS
STDMETHOD_ ( int , CTNullary ) ( ) = 0 ;
STDMETHOD_ ( int , CTNullary ) ( ) = 0 ;
@ -146,6 +156,8 @@ class MockFoo : public FooInterface {
MOCK_METHOD ( int , TypeWithHole , ( int ( * ) ( ) ) , ( ) ) ; // NOLINT
MOCK_METHOD ( int , TypeWithHole , ( int ( * ) ( ) ) , ( ) ) ; // NOLINT
MOCK_METHOD ( int , TypeWithComma , ( ( const std : : map < int , std : : string > & ) ) ) ;
MOCK_METHOD ( int , TypeWithComma , ( ( const std : : map < int , std : : string > & ) ) ) ;
MOCK_METHOD ( int , TypeWithTemplatedCopyCtor ,
( const TemplatedCopyable < int > & ) ) ; // NOLINT
# if GTEST_OS_WINDOWS
# if GTEST_OS_WINDOWS
MOCK_METHOD ( int , CTNullary , ( ) , ( Calltype ( STDMETHODCALLTYPE ) ) ) ;
MOCK_METHOD ( int , CTNullary , ( ) , ( Calltype ( STDMETHODCALLTYPE ) ) ) ;
@ -288,6 +300,11 @@ TEST_F(MockMethodFunctionMockerTest, MocksReturnTypeWithComma) {
EXPECT_EQ ( a_map , mock_foo_ . ReturnTypeWithComma ( 42 ) ) ;
EXPECT_EQ ( a_map , mock_foo_ . ReturnTypeWithComma ( 42 ) ) ;
}
}
TEST_F ( MockMethodFunctionMockerTest , MocksTypeWithTemplatedCopyCtor ) {
EXPECT_CALL ( mock_foo_ , TypeWithTemplatedCopyCtor ( _ ) ) . WillOnce ( Return ( true ) ) ;
EXPECT_TRUE ( foo_ - > TypeWithTemplatedCopyCtor ( TemplatedCopyable < int > ( ) ) ) ;
}
# if GTEST_OS_WINDOWS
# if GTEST_OS_WINDOWS
// Tests mocking a nullary function with calltype.
// Tests mocking a nullary function with calltype.
TEST_F ( MockMethodFunctionMockerTest , MocksNullaryFunctionWithCallType ) {
TEST_F ( MockMethodFunctionMockerTest , MocksNullaryFunctionWithCallType ) {