This reverts commit 7fbeb40965.
This causes compilation warnings / errors when a project uses
-Wmissing-prototypes compilation flags for safety reasons:
.../test/mocks/mock_logMessages.c:685:6: warning: no previous prototype for ‘CMockExpectParameters_log_message’ [-Wmissing-prototypes]
685 | void CMockExpectParameters_log_message(CMOCK_log_message_CALL_INSTANCE* cmock_call_instance, const char* logMessage, int messageID, severity_t severityIn)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
etc.
Signed-off-by: André Draszik <git@andred.net>
It didn't add direct comparisons only for pointer arguments, but
also other types of arguments like structs, which can't be compared
with '==' and cause a compiler error instead.
To reproduce, just enable the :array plugin in
system/test_interactions/expect_and_return_custom_types.yml:
In function ‘foo’:
error: invalid operands to binary != (have ‘EXAMPLE_STRUCT_T’ {aka
‘struct _EXAMPLE_STRUCT_T’} and ‘EXAMPLE_STRUCT_T’ {aka ‘struct
_EXAMPLE_STRUCT_T’})
59 | if (cmock_call_instance->Expected_a != a) {
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^~
This reverts commit 4df532afcc.
IgnoreMode was used only for the ExpectAnyArgs plugin, and the
semantics of it were backwards:
- IgnoreMode = CMOCK_ARG_NONE means to ignore all arguments
- IgnoreMode = CMOCK_ARG_ALL means to verify all arguments
ExpectAnyArgsBool should make the purpose and semantics of this
field clearer.
Additionally, ExpectAnyArgs doesn't use FinalReturn for anything.
1. Update treat_as table to include pointer-to-constant types.
2. Remove unnecessary casts in assignments and return statements.
3. Improve logic for adding "const" to types of function arguments.
4. It's no longer necessary to prepend "const" to function return type.
- Made use of the new UNITY_SET_DETAILS feature to background set up function & argument details for messages
- CMock now takes up a lot less memory! woo!
This way, a call to *_IgnoreAndReturn() followed by a call to *_ExpectAndReturn() is properly handled (i.e. the function will not be ignored, as instructed by the last statement).
- the pointer size can now be specified (particularly for systems which need 64 bit pointers)
- removed a redundant parsing step
git-svn-id: http://cmock.svn.sourceforge.net/svnroot/cmock/trunk@180 bf332499-1b4d-0410-844d-d2d48d5cc64c
- Fixed ignore-when-ignoring-args-only
- Fixed error in memory comparisons when pointers used
- Fixed system testing of CMock(!)
git-svn-id: http://cmock.svn.sourceforge.net/svnroot/cmock/trunk@167 bf332499-1b4d-0410-844d-d2d48d5cc64c
- can use array assertions for non-arrays
- can sometimes get away with normal assertions for arrays (doesn't yet go through array, just first element)
- made parsing_challenges test better
git-svn-id: http://cmock.svn.sourceforge.net/svnroot/cmock/trunk@159 bf332499-1b4d-0410-844d-d2d48d5cc64c