Open Xunnamius opened 6 years ago
If you don't mind, can you post a copy of the struct that is getting produce in the mock complained about? I'd like to see what its contents look like.
The alignment options effect the way data is stuffed into the data queue as CMock runs, but I'd not considered that we might have to force padding on the structs themselves (I honestly thought the compiler would always handle that for us). Clearly there are situations where that is not true, though. I'd like to see what that looks like. :)
@mvandervoord It's these two structs:
typedef struct _CMOCK_blfs_backstore_read_CALL_INSTANCE
{
UNITY_LINE_TYPE LineNumber;
CMOCK_ARG_MODE IgnoreMode;
blfs_backstore_t* Expected_backstore;
uint8_t* Expected_buffer;
uint32_t Expected_length;
uint64_t Expected_offset;
CEXCEPTION_T ExceptionToThrow;
int Expected_backstore_Depth;
int Expected_buffer_Depth;
int ReturnThruPtr_backstore_Used;
blfs_backstore_t* ReturnThruPtr_backstore_Val;
int ReturnThruPtr_backstore_Size;
int ReturnThruPtr_buffer_Used;
uint8_t* ReturnThruPtr_buffer_Val;
int ReturnThruPtr_buffer_Size;
int IgnoreArg_backstore;
int IgnoreArg_buffer;
int IgnoreArg_length;
int IgnoreArg_offset;
} CMOCK_blfs_backstore_read_CALL_INSTANCE;
typedef struct _CMOCK_blfs_backstore_write_body_CALL_INSTANCE
{
UNITY_LINE_TYPE LineNumber;
CMOCK_ARG_MODE IgnoreMode;
blfs_backstore_t* Expected_backstore;
uint8_t* Expected_buffer;
uint32_t Expected_length;
uint64_t Expected_offset;
CEXCEPTION_T ExceptionToThrow;
int Expected_backstore_Depth;
int Expected_buffer_Depth;
int ReturnThruPtr_backstore_Used;
blfs_backstore_t* ReturnThruPtr_backstore_Val;
int ReturnThruPtr_backstore_Size;
int IgnoreArg_backstore;
int IgnoreArg_buffer;
int IgnoreArg_length;
int IgnoreArg_offset;
} CMOCK_blfs_backstore_write_body_CALL_INSTANCE;
For these two function headers:
void blfs_backstore_read_body(blfs_backstore_t * backstore, uint8_t * buffer, uint32_t length, uint64_t offset);
void blfs_backstore_write_body(blfs_backstore_t * backstore, const uint8_t * buffer, uint32_t length, uint64_t offset);
First off, let me say THANK YOU for this fantastic suite of tools. You guys have made my life categorically easier with your efforts.
Anyhoo, I've been encountering a small almost-issue for a year or two now with some of my mocks. See the attached picture below. It happens no matter which memory mode I have defined (static vs dynamic). Also, it doesn't care what I define CMOCK_MEM_ALIGN to be (I've tried 2 and 3). The error doesn't seem to affect the results of my tests, however.
The expected behavior here would be these error messages not appearing. I suspect it's ultimately a non-issue or perhaps some small misconfiguration, but I thought I'd report it anyway.
gcc -v
:uname -a
:The small MWE I came up with isn't sufficient to reproduce the behavior, but if you'd like I can come up with an example that should (at least on my system).