mirror of
https://github.com/ThrowTheSwitch/CMock.git
synced 2026-10-10 02:47:37 +00:00
Merge pull request #43 from jlesage/call_instance_init
Issue #40: Initialize newly allocated call instances. (Thanks Jocelyn - I found the message thread that this was in response to.)
This commit is contained in:
@@ -38,6 +38,7 @@ class CMockGeneratorUtils
|
||||
lines = " CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_#{func_name}_CALL_INSTANCE));\n"
|
||||
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 << " memset(cmock_call_instance, 0, sizeof(*cmock_call_instance));\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"
|
||||
|
||||
Reference in New Issue
Block a user