Top "Googlemock" questions

Designed with C++'s specifics in mind, Google C++ Mocking Framework (or Google Mock for short) is a library for writing and using C++ mock classes.

How to mock templated methods using Google Mock?

I am trying to mock a templated method. Here is the class containing the method to mock : class myClass { public: …

c++ templates mocking googlemock
Why is GoogleMock leaking my shared_ptr?

I use GoogleMock/GoogleTest for testing, and I'm seeing some strange behavior when a matcher has a shared_ptr to …

c++ boost shared-ptr googletest googlemock
C++ Unit Testing: Stubs (not mocks)?

Just getting into Unit Testing with C++. It looks like I will need to write several stub classes as I …

c++ unit-testing mocking stub googlemock
Compare containers with GoogleTest

I'm trying to get a working googletest test that compares two vectors. For this I'm using google mock with its …

c++ googletest googlemock
Using googlemock EXPECT_CALL with shared_ptr?

I have a test that works fine with a raw pointer, but I'm having trouble getting it work with a …

c++ shared-ptr googlemock
How to specify consecutive returns in gmock?

In Mockito we can specify multiple returns like (taken from here): //you can set different behavior for consecutive method calls. //…

c++ mockito googletest googlemock gmock
What is the difference of saveArg and saveArgPointee in gmock?

I am studying in the gmock. Now Im trying to mock the class named "task", like this: class MockTask : public …

c++ googlemock
GoogleMock: how to expect precisely one call with a certain argument, and see diagnostic on failure?

Maybe a finesse question, my problem is that if I write: EXPECT_CALL(mock, handleMessage(_)).Times(0); // expectation #1 EXPECT_CALL(mock, …

c++ matcher googlemock expectations
GMock: How to return mock class variable as the return value

I am trying to use GMock (google mocking framework for c++) for the first time. I have the following class: …

c++ unit-testing googletest googlemock gmock
Why does Google Mocks find this function call ambiguous?

I've run into an issue while attempting to start using Google Mocks - for some reason it can't tell the …

c++ templates compilation cppunit googlemock