mirror of
https://github.com/ThrowTheSwitch/CMock.git
synced 2026-08-23 19:49:56 +00:00
expect: Optimize mock_verify() for the successful case.
Remove unconditional UNITY_SET_DETAIL/UNITY_CLEAR_DETAILS pair and only call UNITY_SET_DETAIL if we are failing.
This commit is contained in:
@@ -95,9 +95,10 @@ class CMockGeneratorPluginExpect
|
||||
end
|
||||
|
||||
def mock_verify(function)
|
||||
" UNITY_SET_DETAIL(CMockString_#{function[:name]});\n" +
|
||||
" UNITY_TEST_ASSERT(CMOCK_GUTS_NONE == call_instance, cmock_line, CMockStringCalledLess);\n" +
|
||||
" UNITY_CLR_DETAILS();\n"
|
||||
" if (CMOCK_GUTS_NONE != call_instance)\n" \
|
||||
" {\n" \
|
||||
" UNITY_SET_DETAIL(CMockString_#{function[:name]});\n" \
|
||||
" UNITY_TEST_FAIL(cmock_line, CMockStringCalledLess);\n" \
|
||||
" }\n"
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user