I'm using Google Mock 1.6.0. When using the MOCK_METHODN
macros, it seems to think I'm passing 3 arguments for methods that return a std::pair
:
#include <gmock/gmock.h>
#include <utility>
class IFoo {
public:
virtual std::pair<int, int> bar() = 0;
};
class MockFoo {
public:
MOCK_METHOD0(bar, std::pair<int, int>());
};
int main() {
MockFoo f;
return 0;
}
Compiler output (GCC 4.6.3):
main.cpp:9:44: error: macro "MOCK_METHOD0" passed 3 arguments, but takes just 2
main.cpp:9:5: error: ‘MOCK_METHOD0’ does not name a type
This error doesn't appear if I:
- Replace
std::pair<int, int>
with a simple type likeint
orvoid
- Use on a method that has a
std::pair
argument, instead of returning it