Open f-zl opened 3 months ago
The current solution (which unfortunately doesn't cover your problem) was added in https://github.com/cpputest/cpputest/commit/97576dc71dae6ee70fca30721ed226963f39bc63.
I would guess that the reasoning behind this implementation was the fact that decltype
is not supported in language standards prior C++11. Maybe @basvodde knows more on the background of this decision back then.
In fact, I'd say, there's one central question: does CppUTest want to stay compatible with older C++-standards (if it's still compatible with older standards, at all), or does it address modern C++? I don't know if there is any statement, which language standard is officially supported/targeted?
Edit: I quickly checked it, CppUTest is still C++98-compatible (tested using w64devkit 1.17.0, which includes GCC )
The test
OneTest
callsdependency_function
only once by callingfunction_under_test
. The expect value and the actual value is different. The error message isMock Failure: Unexpected additional (2nd) call to function: dependency_function
. It should beCHECK_EQUAL error, expect=6, actual=5
.Maybe the test macro should evaluate the argument only once to avoid repeating the side effect of the argument function. For example: