diff --git a/lib/cmock_generator_plugin_ignore.rb b/lib/cmock_generator_plugin_ignore.rb index 6093841..98a640d 100644 --- a/lib/cmock_generator_plugin_ignore.rb +++ b/lib/cmock_generator_plugin_ignore.rb @@ -13,8 +13,10 @@ class CMockGeneratorPluginIgnore @config = config if (@config.ignore == :args_and_calls) alias :mock_implementation_precheck :mock_implementation_for_ignores + alias :mock_implementation :nothing else alias :mock_implementation :mock_implementation_for_ignores + alias :mock_implementation_precheck :nothing end @utils = utils @priority = 2 @@ -74,4 +76,8 @@ class CMockGeneratorPluginIgnore func_name = function[:name] " if (Mock.#{func_name}_IgnoreBool)\n Mock.#{func_name}_CallInstance = NULL;\n" end + + def nothing(function) + return "" + end end diff --git a/rakefile_helper.rb b/rakefile_helper.rb index 2d2f521..0349059 100644 --- a/rakefile_helper.rb +++ b/rakefile_helper.rb @@ -260,11 +260,9 @@ module RakefileHelpers total_failures += 1 test_results[index] =~ /test#{index+1}:(.+)/ failure_messages << "#{test_file}:test#{index+1}:should #{test[:should]}:#{$1}" - print "FAIL1" elsif (test[:verify_error]) and not (test_results[index] =~ /test#{index+1}:.*#{test[:verify_error]}/) total_failures += 1 failure_messages << "#{test_file}:test#{index+1}:should #{test[:should]}:should have output matching '#{test[:verify_error]}'" - print "FAIL2" end end end diff --git a/test/system/test_interactions/all_plugins_but_other_limits.yml b/test/system/test_interactions/all_plugins_but_other_limits.yml index 052f883..6f70ea8 100644 --- a/test/system/test_interactions/all_plugins_but_other_limits.yml +++ b/test/system/test_interactions/all_plugins_but_other_limits.yml @@ -291,7 +291,7 @@ TEST_ASSERT_EQUAL(13, function_d()); } - - :pass: TRUE + - :pass: TRUE ############ :should: 'properly ignore first function but the other will work properly' :code: | test() @@ -326,7 +326,7 @@ function_e(); } - - :pass: FALSE + - :pass: FALSE ############## :should: 'fail if we do not ignore a call once because we are counting calls' :code: | test() diff --git a/test/unit/cmock_generator_plugin_ignore_test.rb b/test/unit/cmock_generator_plugin_ignore_test.rb index 39ad52d..62f398e 100644 --- a/test/unit/cmock_generator_plugin_ignore_test.rb +++ b/test/unit/cmock_generator_plugin_ignore_test.rb @@ -64,7 +64,7 @@ class CMockGeneratorPluginIgnoreTest < Test::Unit::TestCase " return;\n", " }\n" ].join - returned = @cmock_generator_plugin_ignore.mock_implementation_precheck(function) + returned = @cmock_generator_plugin_ignore.mock_implementation_for_ignores(function) assert_equal(expected, returned) end @@ -80,12 +80,16 @@ class CMockGeneratorPluginIgnoreTest < Test::Unit::TestCase " return cmock_call_instance->ReturnVal;\n", " }\n" ].join - returned = @cmock_generator_plugin_ignore.mock_implementation_precheck(function) + returned = @cmock_generator_plugin_ignore.mock_implementation_for_ignores(function) assert_equal(expected, returned) end should "not add code to implementation prefix (when :args_only)" do - assert(! @cmock_generator_plugin_ignore_just_args.methods.include?(:mock_implementation_precheck)) + function = {:name => "Fungus", :args_string => "void", :return => test_return[:int]} + retval = test_return[:int].merge({ :name => "cmock_call_instance->ReturnVal"}) + expected = "" + returned = @cmock_generator_plugin_ignore.mock_implementation_precheck(function) + assert_equal(expected, returned) end should "add required code to implementation with void function (when :args_only)" do