Hi all,
I'm having compilation issue in a new project (I'm using it successfully in another project),
even following the guide is not helping:
class Turtle {
public:
Turtle() { }
virtual ~Turtle() {}
virtual void PenUp() = 0;
virtual void PenDown() = 0;
virtual void Forward(int distance) = 0;
virtual void Turn(int degrees) = 0;
virtual void GoTo(int x, int y) = 0;
virtual int GetX() const = 0;
virtual int GetY() const = 0;
};
class MockTurtle : public Turtle {
public:
MockTurtle() { }
~MockTurtle() { }
MOCK_METHOD0(PenUp, void());
MOCK_METHOD0(PenDown, void());
MOCK_METHOD1(Forward, void(int distance));
MOCK_METHOD1(Turn, void(int degrees));
MOCK_METHOD2(GoTo, void(int x, int y));
MOCK_CONST_METHOD0(GetX, int());
MOCK_CONST_METHOD0(GetY, int());
};
TEST(Turtle, ctor) {
MockTurtle myTurtle;
EXPECT_CALL(myTurtle, PendDown()).Times(AtLeast(1));
}
It seems all in place to me, but this is the error when compiling:
turtle_test.cpp: In member function ‘virtual void Turtle_ctor_Test::TestBody()’:
/home/kalman/gmock-1.7.0/include/gmock/gmock-spec-builders.h:1788:12: error: ‘class MockTurtle’ has no member named ‘gmock_PendDown’
((obj).gmock_##call).InternalExpectedAt(__FILE__, __LINE__, #obj, #call)
^
/home/kalman/gmock-1.7.0/include/gmock/gmock-spec-builders.h:1789:32: note: in expansion of macro ‘GMOCK_EXPECT_CALL_IMPL_’
#define EXPECT_CALL(obj, call) GMOCK_EXPECT_CALL_IMPL_(obj, call)
^
/home/kalman/bowling2/turtle_test.cpp:10:3: note: in expansion of macro ‘EXPECT_CALL’
EXPECT_CALL(myTurtle, PendDown()).Times(AtLeast(1));
Anyone is spotting what I'm doing wrong here ?
Regards
Gaetano Mendola