Open GlebPlekhotko opened 2 years ago
You bring up a good point. I'm not sure what the best default is for void*
(they all kinda stink), but I suspect it might be a pointer comparison. At least when that fails, it fails in a way that users can understand more easily without digging into code, right?
Hello.
Here is the case I met. I have a file named "Device.h". And there is a function:
If I feed this header file to the CMock then generated mock function checks only first byte of the void pointers sendBuffer and receiveBuffer. Here is a snippet:
Argument number 3 in the _UNITY_TEST_ASSERT_EQUAL_HEX8ARRAY specifies number of elements to check. Let's check what hides behind it:
Finally, in the UnityAssertEqualIntArray original void pointers are cast to the pointer to a byte:
It is easy to fix it by using "_treatas" option:
But it is still quite confusing.
Thank you for your attention!