这是我的代码和错误消息,gmock版本是1.8.1
我发现如果我在第22行EXPECT_CALL注释,它将可以运行
我发现gmock-1.8.0可以与vs2015一起使用。
#include "gtest/gtest.h"
#include "gmock/gmock.h"
using namespace ::testing;
using ::testing::Return;
class SomefunctionInterface {
public:
virtual ~SomefunctionInterface() {}
virtual int somefunction() = 0;
};
class SomefunctionMock : public SomefunctionInterface {
public:
virtual ~SomefunctionMock() {}
MOCK_METHOD0(somefunction, int());
};
TEST(a, b)
{
SomefunctionMock somefunctionObj;
EXPECT_CALL(somefunctionObj, somefunction()).WillRepeatedly(Return(5)); //Line 22
}