You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When myFunc gets mocked it results in the following code being generated:
// MockMyHeader.c
...
voidCMockExpectParameters_MyFunc(CMOCK_MyFunc_CALL_INSTANCE*cmock_call_instance, constMyType_tt_MyType)
{
memcpy((void*)(&cmock_call_instance->Expected_t_MyType), (void*)(&t_MyType), // <---- NO CONST WHEN CASTINGsizeof(MyType_t[sizeof(t_MyType) ==sizeof(MyType_t) ? 1 : -1])); /* add MyType_t to :treat_as_array if this causes an error */cmock_call_instance->IgnoreArg_t_MyType=0;
}
ITC_Status_tMyFunc(constMyType_tt_MyType)
{
...
if (!cmock_call_instance->IgnoreArg_t_MyType)
{
UNITY_SET_DETAILS(CMockString_MyFunc,CMockString_t_MyType);
// v AGAIN NO CONST WHEN CASTING vUNITY_TEST_ASSERT_EQUAL_MEMORY((void*)(&cmock_call_instance->Expected_t_MyType), (void*)(&t_MyType), sizeof(MyType_t), cmock_line, CMockStringMismatch);
}
}
...
}
The text was updated successfully, but these errors were encountered:
Consider the following example:
When
myFunc
gets mocked it results in the following code being generated:The text was updated successfully, but these errors were encountered: