mockcpp icon indicating copy to clipboard operation
mockcpp copied to clipboard

Using invoke multiple times for stubbing the same function does not work properly.(同一函数打桩使用多次invoke无法很好工作)

Open WFrame0224 opened this issue 1 year ago • 0 comments

When using the MOCKER in the following way, the expectation is: func1, func1, func2; however, during actual runtime, the second rule for func1 is skipped, and the stubbing effect becomes func1, func2. 下面这种方式MOCKER时,期待:func1,func1,func2;但是实际运行时出现,func1第二次规则会被跳过,打桩效果变为func1,func2

MOCKER(xxx)
    .stubs()
    .will(invoke(func1))
    .then(invoke(func1))
    .then(invoke(func2));

WFrame0224 avatar Jul 17 '24 02:07 WFrame0224