This supports mock headers of the form:
#include "some/dir/MockMyCode.h"
Where the mock name is actually MockMyCode.
I *think* this is the most common scenario when working with mocks
in subdirectories but if not this could be modified to support
alternate schemes.
Changed the guard syntax as it was cumbersome for header files in deep
sub-directories. Added framework/mock includes to make the header file
stand alone. Made sure that a valid prototype was generated in the case of
no arguments (void).
This allows alternative entry points. This is intended for the
integration of the unit test into a larger system or for it to be used with
a platform/OS which requires an application entry point other than main. At
the moment there is no way to change the type signature.
Make subtraction result unsigned, change prototype & casts in internals.
If "actual - expected" overflowed, it wrapped to a negative number,
but would fit in an unsigned type, example is INT_MAX - (-1) = INT_MIN
For correctness, 'delta' should be unsigned too. Passing in a negative
number always passed. The delta can be between INT_MAX & UINT_MAX.
Updated clang and gcc targets. Fixed spelling of LIMITS, which breaks the
gcc_auto_sizeof.yml build.
Commented -Wunreachable-code, Unity won't build on OSX clang with it,
error in unity.c:769 & 932: 'default: break;' case.
If Unity core is compiled with UNITY_OUTPUT_CHAR = putcharSpy, these tests
will run, otherwise they are ignored and print a message
Includes an implementation of putcharSpy, which allows checking the I/O
from Unity during a test. Follows closely from the Fixture spy
Tricky macros determine if putcharSpy is injected
Revert part of commit 77af37ad, code looked like a temporary change
The behavior is back to the original, printing "....!..." in quiet mode
Added an ignored test to Fixture for visual inspection
'divisor' ranges from 1 to 1e18, representable by a long or unsigned long
'number' becomes negative when cast as signed, so remove the cast and
keep conversion warnings quiet by turning 'divisor' unsigned
Delete the { ;} braces and semicolon from UNITY_PRINT_EOL to give it expected
behavior: 1) requires a semicolon 2) works in one-liner if-else statements
If you need "\r\n" for EOL, define as the following to get the same behavior:
do{UNITY_OUTPUT_CHAR('\r'); UNITY_OUTPUT_CHAR('\n');}while(0)
The intent of UNITY_WEAK_PRAGMA is that we have weak symbols for setUp
and tearDown in unity.o, so that developers can override these symbols
if needed but the link works right if they are not defined.
In order to do this using #pragma, the pragma and the definition of the
function (not the declaration) need to be present in the same translation
unit (source code file).
Previously, the UNITY_WEAK_PRAGMA code was just declaring the setUp
function, but not defining it, which means that developers had to add an
empty setUp function to their tests in order to link.