Compiling a source base / test with Wswitch-enum enabled, gives
the following warning:
../src/unity.c: In function ‘UnityAssertFloatSpecial’:
../src/unity.c:1092:5: warning: enumeration value ‘UNITY_FLOAT_INVALID_TRAIT’ not handled in switch [-Wswitch-enum]
1092 | switch (style)
| ^~~~~~
Fix by adding the missing value to the default (unhandled) case.
Signed-off-by: André Draszik <git@andred.net>
Depends on UnityPrintFormatted (define UNITY_INCLUDE_PRINT_FORMATTED).
UnityPrintFormatted has been renamed to UnityPrintF due to changes below.
API of UnityPrintFormatted has been changed (hence the rename), but end users
(developers) can use the TEST_PRINTF as an almost-drop-in replacement TEST_PRINTF
is compatible with the old UnityPrintFormatted API (see below).
The behaviour of UnityPrintF has also been changed:
- Now it prefixes the outout with test location information Output is marked
as INFO.
- It adds an EOL.
Both behaviours adopted from other output functions.
By passing --omit_begin_end=1 to generate_test_runner.rb, the script
will now omit calls to UnityBegin and UnityEnd when running tests in a
suite.
This allows multiple suites to be executed in a row, and then have an overall
summary of the tests which were executed across all suites.
- Running time macros have been made more portable, previously it was not
possible to override all macros
- Running time macros will be executed by default test runner, and auto test
runners
- Adds a default execution time implementation for unix. (Previous default
implementation only worked on Windows)
- For embedded platforms there is a simple method of getting a default
implementation by defining a single macro UNITY_CLOCK_MS()
- Removed need for UNITY_EXEC_TIME_RESET. This was not being used for the default
implementations, if anything ever did need reset-like functionality it could
simply be wrapped up with the start or stop macros for that platform
Avoid declaring the loop variable inside the for statement to keep
compatibility with c90:
unity.c:1408: error: for' loop initial declaration used outside C99 mode
Negating the most-negative signed integer results in overflow, which
is undefined behavior. Fix this by casting to an unsigned type first
(unsigned overflow is well-defined as it uses modular arithmetic).