Hi mates. So I have two classes placed in separated files:
UCLASS()
class UFirst : public UObject
{
GENERATED_BODY()
public:
UFUNCTION()
virtual void function(const UObject* obj)
PURE_VIRTUAL(UFirst::function);
}
UCLASS()
class UFirstMock : public UFirst
{
GENERATED_BODY()
public:
MOCK_METHOD(void, function, (const UObject*), (override));
}
but when I’m using UFirstMock in test file like this:
UFirstMock* fMock = NewObject<UFirstMock>();
EXPECT_CALL(*fMock , function(testing::_)).Times(1);
I got this error: “unknown file: error: SEH exception with code 0xc0000005 thrown in the test body.”
Could somebody tell me please what I do wrong to mock a UObject?