Hi, I've been exploring Isolator++ for the past few weeks and I've come across an issue with faking virtual functions that are templated. Here's some test code that I added to the Isolator++ examples to reproduce the problem:
#pragma once
template <class V>
class MyClass {
public:
V* testType(V p) { return nullptr; };
virtual int testVirtual() = 0;
};
TEST_METHOD(MyTest) {
MyClass<Person>* fake = FAKE<MyClass<Person>>();
Person* f = FAKE<Person>();
WHEN_CALLED(fake->testType(*f)).Return(f); // <- Works fine
WHEN_CALLED(fake->testVirtual()).Return(5); // <- Crash
}
The above test will work fine if testVirtual is not faked. As soon as you attempt to fake testVirtual the program will have a SEH crash (access memory violation).
Isolator++ version 4.1.1.24
Visual Studio 2019 version 16.3.9
MSVC version 14.23.28105