使用EXPECT_CALL时VS2015出现gmock错误?

时间:2019-04-13 15:21:26

标签: c++

这是我的代码和错误消息,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
}

enter image description here enter image description here

0 个答案:

没有答案