mirror of
https://github.com/ThrowTheSwitch/CMock.git
synced 2026-10-10 02:47:37 +00:00
Expect plugin should call UNITY_SET/CLR_DETAILS in pairs.
The generated _Expect() functions called UNITY_CLR_DETAILS, which was unnecessary because they did not call UNITY_SET_DETAIL. The generated _Verify() functions called UNITY_SET_DETAIL but never called UNITY_CLR_DETAILS to clean up after themselves.
This commit is contained in:
@@ -91,14 +91,14 @@ class CMockGeneratorPluginExpect
|
||||
lines << @utils.code_add_base_expectation(func_name)
|
||||
lines << @utils.code_call_argument_loader(function)
|
||||
lines << @utils.code_assign_argument_quickly("cmock_call_instance->ReturnVal", function[:return]) unless (function[:return][:void?])
|
||||
lines << " UNITY_CLR_DETAILS();\n"
|
||||
lines << "}\n\n"
|
||||
end
|
||||
|
||||
def mock_verify(function)
|
||||
func_name = function[:name]
|
||||
" UNITY_SET_DETAIL(CMockString_#{function[:name]});\n" +
|
||||
" UNITY_TEST_ASSERT(CMOCK_GUTS_NONE == call_instance, cmock_line, CMockStringCalledLess);\n"
|
||||
" UNITY_TEST_ASSERT(CMOCK_GUTS_NONE == call_instance, cmock_line, CMockStringCalledLess);\n" +
|
||||
" UNITY_CLR_DETAILS();\n"
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user