mirror of
https://github.com/ThrowTheSwitch/CMock.git
synced 2026-10-09 02:17:33 +00:00
Call UNITY_CLR_DETAILS() before returning from mock
This commit is contained in:
@@ -57,9 +57,13 @@ class CMockGeneratorPluginCallback
|
|||||||
def mock_implementation_for_callbacks_without_arg_check(function)
|
def mock_implementation_for_callbacks_without_arg_check(function)
|
||||||
" if (Mock.#{function[:name]}_CallbackFunctionPointer != NULL)\n {\n" +
|
" if (Mock.#{function[:name]}_CallbackFunctionPointer != NULL)\n {\n" +
|
||||||
if function[:return][:void?]
|
if function[:return][:void?]
|
||||||
" #{generate_call(function)};\n return;\n }\n"
|
" #{generate_call(function)};\n" \
|
||||||
|
" UNITY_CLR_DETAILS();\n" \
|
||||||
|
" return;\n }\n"
|
||||||
else
|
else
|
||||||
" return #{generate_call(function)};\n }\n"
|
" #{function[:return][:type]} ret = #{generate_call(function)};\n" \
|
||||||
|
" UNITY_CLR_DETAILS();\n" \
|
||||||
|
" return ret;\n }\n"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -165,6 +165,7 @@ describe CMockGeneratorPluginCallback, "Verify CMockGeneratorPluginCallback Modu
|
|||||||
expected = [" if (Mock.Apple_CallbackFunctionPointer != NULL)\n",
|
expected = [" if (Mock.Apple_CallbackFunctionPointer != NULL)\n",
|
||||||
" {\n",
|
" {\n",
|
||||||
" Mock.Apple_CallbackFunctionPointer();\n",
|
" Mock.Apple_CallbackFunctionPointer();\n",
|
||||||
|
" UNITY_CLR_DETAILS();\n",
|
||||||
" return;\n",
|
" return;\n",
|
||||||
" }\n"
|
" }\n"
|
||||||
].join
|
].join
|
||||||
@@ -177,7 +178,9 @@ describe CMockGeneratorPluginCallback, "Verify CMockGeneratorPluginCallback Modu
|
|||||||
function = {:name => "Apple", :args => [], :args_string => "void", :return => test_return[:int]}
|
function = {:name => "Apple", :args => [], :args_string => "void", :return => test_return[:int]}
|
||||||
expected = [" if (Mock.Apple_CallbackFunctionPointer != NULL)\n",
|
expected = [" if (Mock.Apple_CallbackFunctionPointer != NULL)\n",
|
||||||
" {\n",
|
" {\n",
|
||||||
" return Mock.Apple_CallbackFunctionPointer(Mock.Apple_CallbackCalls++);\n",
|
" int ret = Mock.Apple_CallbackFunctionPointer(Mock.Apple_CallbackCalls++);\n",
|
||||||
|
" UNITY_CLR_DETAILS();\n",
|
||||||
|
" return ret;\n",
|
||||||
" }\n"
|
" }\n"
|
||||||
].join
|
].join
|
||||||
returned = @cmock_generator_plugin_callback.mock_implementation_for_callbacks_without_arg_check(function)
|
returned = @cmock_generator_plugin_callback.mock_implementation_for_callbacks_without_arg_check(function)
|
||||||
@@ -193,6 +196,7 @@ describe CMockGeneratorPluginCallback, "Verify CMockGeneratorPluginCallback Modu
|
|||||||
expected = [" if (Mock.Apple_CallbackFunctionPointer != NULL)\n",
|
expected = [" if (Mock.Apple_CallbackFunctionPointer != NULL)\n",
|
||||||
" {\n",
|
" {\n",
|
||||||
" Mock.Apple_CallbackFunctionPointer(steak, flag, Mock.Apple_CallbackCalls++);\n",
|
" Mock.Apple_CallbackFunctionPointer(steak, flag, Mock.Apple_CallbackCalls++);\n",
|
||||||
|
" UNITY_CLR_DETAILS();\n",
|
||||||
" return;\n",
|
" return;\n",
|
||||||
" }\n"
|
" }\n"
|
||||||
].join
|
].join
|
||||||
@@ -209,6 +213,7 @@ describe CMockGeneratorPluginCallback, "Verify CMockGeneratorPluginCallback Modu
|
|||||||
expected = [" if (Mock.Apple_CallbackFunctionPointer != NULL)\n",
|
expected = [" if (Mock.Apple_CallbackFunctionPointer != NULL)\n",
|
||||||
" {\n",
|
" {\n",
|
||||||
" Mock.Apple_CallbackFunctionPointer(steak, flag);\n",
|
" Mock.Apple_CallbackFunctionPointer(steak, flag);\n",
|
||||||
|
" UNITY_CLR_DETAILS();\n",
|
||||||
" return;\n",
|
" return;\n",
|
||||||
" }\n"
|
" }\n"
|
||||||
].join
|
].join
|
||||||
@@ -225,7 +230,9 @@ describe CMockGeneratorPluginCallback, "Verify CMockGeneratorPluginCallback Modu
|
|||||||
:return => test_return[:int]}
|
:return => test_return[:int]}
|
||||||
expected = [" if (Mock.Apple_CallbackFunctionPointer != NULL)\n",
|
expected = [" if (Mock.Apple_CallbackFunctionPointer != NULL)\n",
|
||||||
" {\n",
|
" {\n",
|
||||||
" return Mock.Apple_CallbackFunctionPointer(steak, flag, Mock.Apple_CallbackCalls++);\n",
|
" int ret = Mock.Apple_CallbackFunctionPointer(steak, flag, Mock.Apple_CallbackCalls++);\n",
|
||||||
|
" UNITY_CLR_DETAILS();\n",
|
||||||
|
" return ret;\n",
|
||||||
" }\n"
|
" }\n"
|
||||||
].join
|
].join
|
||||||
returned = @cmock_generator_plugin_callback.mock_implementation_for_callbacks_without_arg_check(function)
|
returned = @cmock_generator_plugin_callback.mock_implementation_for_callbacks_without_arg_check(function)
|
||||||
|
|||||||
Reference in New Issue
Block a user