Fix system test

Generator for callback plugin now checks for existence of ignore plugin
to know what code to generate
This commit is contained in:
Tim Bates
2017-02-13 17:36:20 +10:30
parent 30064aa63c
commit 39e99e9803
2 changed files with 7 additions and 3 deletions
+6 -3
View File
@@ -79,9 +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}_IgnoreBool = (int)0;\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