I'm using CMock to generate some mock functions but I believe that there's a problem when checking expected arrays. It seems like the generated mock is only checking the value of the first element of the array. I'll try to point out where I the problem is in the hope that someone has seen this before and knows how to bypass it. I couldn't find any known issues highlighting this problem so I apologise in advance if this is known already.
Cmock is generating a mock with the following signature as expected (notice the data pointer and size arguments):
HAL_StatusTypeDef HAL_I2C_Mem_Write(I2C_HandleTypeDef* hi2c, uint16_t DevAddress, uint16_t MemAddress, uint16_t MemAddSize, uint8_t* pData, uint16_t Size, uint32_t Timeout)
At some point down the line within this mock, there's the following code:
In this area, notice that the generated mock is trying to test all elements of the array, but a size of 1 is used, when I was expecting the size to be the same as the argument uint16_t Size.
So, what happens is that only the first element of the array is checked. Is there any way of bypassing this? Or a quick fix?
Hi,
I'm using CMock to generate some mock functions but I believe that there's a problem when checking expected arrays. It seems like the generated mock is only checking the value of the first element of the array. I'll try to point out where I the problem is in the hope that someone has seen this before and knows how to bypass it. I couldn't find any known issues highlighting this problem so I apologise in advance if this is known already.
Here's my environment: Ceedling:: 0.31.1 CMock:: 2.5.4 Unity:: 2.5.4 CException:: 1.3.3
Cmock is generating a mock with the following signature as expected (notice the data pointer and size arguments):
HAL_StatusTypeDef HAL_I2C_Mem_Write(I2C_HandleTypeDef* hi2c, uint16_t DevAddress, uint16_t MemAddress, uint16_t MemAddSize, uint8_t* pData, uint16_t Size, uint32_t Timeout)
At some point down the line within this mock, there's the following code:
In this area, notice that the generated mock is trying to test all elements of the array, but a size of 1 is used, when I was expecting the size to be the same as the argument uint16_t Size.
So, what happens is that only the first element of the array is checked. Is there any way of bypassing this? Or a quick fix?