当尝试使用 google test 模拟一个函数时,我仍然收到一条警告,提示我错过了“覆盖”
MOCK_METHOD(bool, functionName, (), (const override));
我得到的警告状态
xxx.h:31:22: error: 'functionName' overrides a member function but is not marked 'override'
xxx.h:25:17: note: overridden virtual function is here
如何同时使用 override
和 const
标记模拟函数?
最佳答案
关于c++ - 覆盖 const 函数 google mock,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68208912/