Merge pull request #109 from redarc-tech/ignore-bool

Clear Ignore flag when StubWithCallback is called (Thanks!)
This commit is contained in:
Mark VanderVoord
2017-02-13 06:54:42 -05:00
committed by GitHub
2 changed files with 8 additions and 2 deletions
+6 -2
View File
@@ -79,8 +79,12 @@ class CMockGeneratorPluginCallback
def mock_interfaces(function)
func_name = function[:name]
"void #{func_name}_StubWithCallback(CMOCK_#{func_name}_CALLBACK Callback)\n{\n" +
" Mock.#{func_name}_CallbackFunctionPointer = Callback;\n}\n\n"
lines = ""
lines << "void #{func_name}_StubWithCallback(CMOCK_#{func_name}_CALLBACK Callback)\n{\n"
if @config.plugins.include? :ignore
lines << " Mock.#{func_name}_IgnoreBool = (int)0;\n"
end
lines << " Mock.#{func_name}_CallbackFunctionPointer = Callback;\n}\n\n"
end
def mock_destroy(function)
@@ -14,6 +14,7 @@ describe CMockGeneratorPluginCallback, "Verify CMockGeneratorPluginCallback Modu
@config.expect :callback_include_count, true
@config.expect :callback_after_arg_check, false
@config.expect :plugins, [:ignore]
@cmock_generator_plugin_callback = CMockGeneratorPluginCallback.new(@config, @utils)
end
@@ -240,6 +241,7 @@ describe CMockGeneratorPluginCallback, "Verify CMockGeneratorPluginCallback Modu
expected = ["void Lemon_StubWithCallback(CMOCK_Lemon_CALLBACK Callback)\n",
"{\n",
" Mock.Lemon_IgnoreBool = (int)0;\n",
" Mock.Lemon_CallbackFunctionPointer = Callback;\n",
"}\n\n"
].join