-
Notifications
You must be signed in to change notification settings - Fork 177
Open
Labels
Description
Hello,
during the upgrade of my project from Visual Studio 2019 to Visual Studio 2022, I encountered a compilation error related to the FakeIt library. Specifically, I’m using the single_header/mstest/fakeit.hpp header. When I enable conformance mode in VS2022, the following error occurs
C2440 'return': cannot convert from 'fakeit::MockingContext<void,const uint8_t [],int32_t,int32_t>' to 'fakeit::MockingContext<void,const uint8_t *,int32_t,int32_t>'
Here is the code :
#include "pch.h"
#include "CppUnitTest.h"
#include "fakeit.hpp"
using namespace fakeit;
using namespace Microsoft::VisualStudio::CppUnitTestFramework;
namespace UnitTest
{
class IClass
{
public:
virtual void TestMethod(const uint8_t buffer[], int32_t offset, int32_t count) = 0;
virtual ~IClass() = default;
};
TEST_CLASS(UnitTest)
{
public:
TEST_METHOD(TestMethod1)
{
Mock<IClass> mock;
Fake(Method(mock, TestMethod));
}
};
}