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
Unfortunately I have to work in a lot of legacy code which contains 100s of global variables. If cmock could define these things would be much easier, also preventing the case where a data type changes such that an old test (declaring variable as old type) still seems to pass.
Suggestion; when cmock reads the header file any "Extern" or "Extern const" parameters get included as real parameters into the mock_file.c (both cases would be a normal changeable variable, const is ignored). This would be a feature normally turned off, but could be enabled through the configuration.
NOTE: Only extern in the header file are to be processed in this way (i.e. if header includes another header (which is bad) that header is ignored for this process)
Unfortunately I have to work in a lot of legacy code which contains 100s of global variables. If cmock could define these things would be much easier, also preventing the case where a data type changes such that an old test (declaring variable as old type) still seems to pass.
Suggestion; when cmock reads the header file any "Extern" or "Extern const" parameters get included as real parameters into the mock_file.c (both cases would be a normal changeable variable, const is ignored). This would be a feature normally turned off, but could be enabled through the configuration.
NOTE: Only extern in the header file are to be processed in this way (i.e. if header includes another header (which is bad) that header is ignored for this process)
Header file example:
extern U8 myParameter[PARAM_ARRAY_SIZE];
extern const uint8 whatEver;
mock_.c:
U8 myParameter[PARAM_ARRAY_SIZE];
uint8 whatEver;
The text was updated successfully, but these errors were encountered: