Make sure *_IgnoreBool is (re)set to 0 when adding base expectations.

This way, a call to *_IgnoreAndReturn() followed by a call to *_ExpectAndReturn() is properly handled (i.e. the function will not be ignored, as instructed by the last statement).
This commit is contained in:
Jocelyn Le Sage
2014-05-22 06:49:07 -04:00
parent f357e19765
commit 19f0bb89b6
2 changed files with 11 additions and 5 deletions
+2
View File
@@ -17,6 +17,7 @@ class CMockGeneratorUtils
@expect_any = @config.plugins.include? :expect_any_args
@return_thru_ptr = @config.plugins.include? :return_thru_ptr
@ignore_arg = @config.plugins.include? :ignore_arg
@ignore = @config.plugins.include? :ignore
@treat_as = @config.treat_as
@helpers = helpers
end
@@ -38,6 +39,7 @@ class CMockGeneratorUtils
lines << " CMOCK_#{func_name}_CALL_INSTANCE* cmock_call_instance = (CMOCK_#{func_name}_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index);\n"
lines << " UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, \"CMock has run out of memory. Please allocate more.\");\n"
lines << " Mock.#{func_name}_CallInstance = CMock_Guts_MemChain(Mock.#{func_name}_CallInstance, cmock_guts_index);\n"
lines << " Mock.#{func_name}_IgnoreBool = (int)0;\n" if (@ignore)
lines << " cmock_call_instance->LineNumber = cmock_line;\n"
lines << " cmock_call_instance->CallOrder = ++GlobalExpectCount;\n" if (@ordered and global_ordering_supported)
lines << " cmock_call_instance->ExceptionToThrow = CEXCEPTION_NONE;\n" if (@cexception)