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
#ifndefREAD_INTERFACE_H#defineREAD_INTERFACE_H#include<stddef.h>/** * @brief Allow to read from a file. * * @param[in,out] bytes_to_read Pointer to the destination indicating how many bytes at most should * be read, 0 means to read all bytes up to the end of the file. * On success, returns how many bytes were actually read and loaded in the **buffer. * On failure, the returned value is not defined. * @param[in] buff_size Indicates the size (in bytes) of the **buffer. * @param[in,out] buffer Pointer to the destination in which to load the data, if *buffer is NULL * then a new buffer is allocated. */voidread_interface(size_t*bytes_to_read, size_tbuff_size, char**buffer);
#endif// READ_INTERFACE_H
[test_read.c]
Test: test_1
At line (10): "You Asked Me To Compare Nothing, Which Was Pointless.. Function read_interface Argument bytes_to_read. Function called with unexpected argument value."
The problem seems to be the CMockExpectParameters_read_interface(cmock_call_instance, bytes_to_read, buff_size, buff_size, buffer, 1); call where the argument buff_size is passed as bytes_to_read_Depth parameter instead of just 1, the right call should be CMockExpectParameters_read_interface(cmock_call_instance, bytes_to_read, 1, buff_size, buffer, 1);
I noticed that if I change the name of the buff_size parameter in foo the problem is solved, it seems that this problem occurs only when in the name of the parameter there is the sub-string size or length, so this works void read_interface(size_t *bytes_to_read, size_t foo, char **buffer);
I'm not sure but I think this behavior is due because of this functionality: #189
How can I solve the problem without having to change the name of the parameter?
The text was updated successfully, but these errors were encountered:
I temporarily solved the problem by adding this parameter in the project.yml file, but I think it is not the correct way to disable this functionality as array_size_name should be a regular expression.
read_interface.h:
read.h
read.c
test_read.c
mock_read_interface.c
Ceedling Output:
The problem seems to be the
CMockExpectParameters_read_interface(cmock_call_instance, bytes_to_read, buff_size, buff_size, buffer, 1);
call where the argumentbuff_size
is passed asbytes_to_read_Depth
parameter instead of just1
, the right call should beCMockExpectParameters_read_interface(cmock_call_instance, bytes_to_read, 1, buff_size, buffer, 1);
I noticed that if I change the name of the
buff_size
parameter infoo
the problem is solved, it seems that this problem occurs only when in the name of the parameter there is the sub-stringsize
orlength
, so this worksvoid read_interface(size_t *bytes_to_read, size_t foo, char **buffer);
I'm not sure but I think this behavior is due because of this functionality: #189
How can I solve the problem without having to change the name of the parameter?
The text was updated successfully, but these errors were encountered: