Closed JohannesLichtenberger closed 5 months ago
Hi. I believe all you need to do is correct your yaml file and this should fix the issue up.
# Treat pointers to arrays as arrays for mocking
:treat_as:
int8_t*: INT8_ARRAY
int16_t*: INT16_ARRAY
int32_t*: INT32_ARRAY
uint8_t*: UINT8_ARRAY
uint16_t*: UINT16_ARRAY
uint32_t*: UINT32_ARRAY
char*: STRING
The :treat_as
needs to tell CMock which handler it is using. There isn't a handler for :int8_array
but there is a handler for INT8_ARRAY
:)
Oh, thanks :)
Hello,
I have a small config file:
However, with the array functions generated it seems that these calls are generated:
UNITY_TEST_ASSERT_EQUAL_uint8_array(cmock_call_instance->Expected_bytes, bytes, cmock_line, CMockStringMismatch);
However, in my Unity it seems to be the right thing would be (with an additional size param and uppercase UINT8_ARRAY):
UNITY_TEST_ASSERT_EQUAL_UINT8_ARRAY(cmock_call_instance->Expected_bytes, bytes, size, cmock_line, CMockStringMismatch);
I've changed the calls manually though, and it seems to be OK then :-)
kind regards Johannes