|
109 | 109 | expected3 = " cmock_call_instance->Expected_Kiwi = Kiwi;\n"
|
110 | 110 |
|
111 | 111 | arg4 = { :name => "Lime", :const? => false, :type => 'LIME_T', :ptr? => false }
|
112 |
| - expected4 = " memcpy((void*)(&cmock_call_instance->Expected_Lime), (void*)(&Lime),\n" + |
| 112 | + expected4 = " memcpy((void*)(&cmock_call_instance->Expected_Lime), (const void*)(&Lime),\n" + |
113 | 113 | " sizeof(LIME_T[sizeof(Lime) == sizeof(LIME_T) ? 1 : -1])); /* add LIME_T to :treat_as_array if this causes an error */\n"
|
114 | 114 |
|
115 | 115 | assert_equal(expected1, @cmock_generator_utils_simple.code_add_an_arg_expectation(arg1))
|
|
135 | 135 | " cmock_call_instance->ReturnThruPtr_Kiwi_Used = 0;\n"
|
136 | 136 |
|
137 | 137 | arg4 = { :name => "Lime", :const? => false, :type => 'LIME_T', :ptr? => false }
|
138 |
| - expected4 = " memcpy((void*)(&cmock_call_instance->Expected_Lime), (void*)(&Lime),\n" + |
| 138 | + expected4 = " memcpy((void*)(&cmock_call_instance->Expected_Lime), (const void*)(&Lime),\n" + |
139 | 139 | " sizeof(LIME_T[sizeof(Lime) == sizeof(LIME_T) ? 1 : -1])); /* add LIME_T to :treat_as_array if this causes an error */\n" +
|
140 | 140 | " cmock_call_instance->IgnoreArg_Lime = 0;\n"
|
141 | 141 |
|
|
159 | 159 | expected = "void CMockExpectParameters_Melon(CMOCK_Melon_CALL_INSTANCE* cmock_call_instance, stuff);\n" +
|
160 | 160 | "void CMockExpectParameters_Melon(CMOCK_Melon_CALL_INSTANCE* cmock_call_instance, stuff)\n{\n" +
|
161 | 161 | " cmock_call_instance->Expected_MyIntPtr = MyIntPtr;\n" +
|
162 |
| - " memcpy((void*)(&cmock_call_instance->Expected_MyMyType), (void*)(&MyMyType),\n" + |
| 162 | + " memcpy((void*)(&cmock_call_instance->Expected_MyMyType), (const void*)(&MyMyType),\n" + |
163 | 163 | " sizeof(MY_TYPE[sizeof(MyMyType) == sizeof(MY_TYPE) ? 1 : -1])); /* add MY_TYPE to :treat_as_array if this causes an error */\n" +
|
164 | 164 | " cmock_call_instance->Expected_MyStr = MyStr;\n" +
|
165 | 165 | "}\n\n"
|
|
177 | 177 | " cmock_call_instance->Expected_MyIntPtr_Depth = MyIntPtr_Depth;\n" +
|
178 | 178 | " cmock_call_instance->IgnoreArg_MyIntPtr = 0;\n" +
|
179 | 179 | " cmock_call_instance->ReturnThruPtr_MyIntPtr_Used = 0;\n" +
|
180 |
| - " memcpy((void*)(&cmock_call_instance->Expected_MyMyType), (void*)(&MyMyType),\n" + |
| 180 | + " memcpy((void*)(&cmock_call_instance->Expected_MyMyType), (const void*)(&MyMyType),\n" + |
181 | 181 | " sizeof(MY_TYPE[sizeof(MyMyType) == sizeof(MY_TYPE) ? 1 : -1])); /* add MY_TYPE to :treat_as_array if this causes an error */\n" +
|
182 | 182 | " cmock_call_instance->IgnoreArg_MyMyType = 0;\n" +
|
183 | 183 | " cmock_call_instance->Expected_MyStr = MyStr;\n" +
|
|
0 commit comments