eranpeer / FakeIt

C++ mocking made easy. A simple yet very expressive, headers only library for c++ mocking.
MIT License
1.24k stars 173 forks source link

Spy on method with more than 1 params causes crash (MinGW) #212

Open Ujifman opened 4 years ago

Ujifman commented 4 years ago

The problem is when I try to use Spy on class's method which has two arguments, it causes application crash. If I delete argument int two, and change call of someMethod like proxy.someMethod(1); it runs successfully. Full test code:

class SomeClass
{
public:
    virtual void someMethod(int one, int two)
    {
    }
};

TEST_CASE("Some")
{
    SECTION("")
    {
        SomeClass object;
        fakeit::Mock<SomeClass> spy(object);
        fakeit::Spy(Method(spy, someMethod));
        SomeClass &proxy = spy.get();
        proxy.someMethod(1, 2);
    }
}

My system: Windows 10 x64, MinGW 7.3 x86 Tried the same on Linux and gcc 7, and problem wasn't occured.

Unfortunately, debugger output isn't informative image