This fixes a compiler warning about a lossy conversion from long
unsigned int to int when compiling unity with gcc 6.3.1 and
the options -std=c89 -Wconversion -fsanitize=undefined
This fixes compiler warnings that clang produces with the
-Wdouble-promotion compiler option.
This only happens if double precision floating point numbers are
enabled.
The implicit double promotion occurs because numbers of type UNITY_FLOAT
are passed into UnityPrintFloat, which expects const UNITY_DOUBLE.
This commit fixes it by explicitly casting to UNITY_DOUBLE.
`setjmp` returns 0 on direct invocation, and non-zero when returned to from `longjmp`. Because `TEST_PROTECT` checks the return value of `setjmp` against 0, checking the return value of `TEST_PROTECT` against 0 is incorrect in the readme.
unity.h and unity_fixture.h output their results in different string formats. This parseOutput.rb script already parsed the unity.h output to generate a JUnit-style XML summary which could be parsed by CI servers to graph the history of test pass/fail results. The changes in this commit allow the script to also handle the output format of unity_fixture.h which utilizes groups to add a layer of organization for tests.
The changes in this commit were authored by Justin Seifi, my coworker, who has approved of me submitting his work back to this open source framework repo.
There was a mismatch of definition and declaration of UnityPrintFloat
and this commit aligns both on const UNITY_DOUBLE, but then inside it
actually uses a positive version of the variable only.
If, longer term, the Travis-CI support for 32-bit is inconsistent
the lines that failed are:
- make -s DEBUG=-m32
- cd ../example_3 && rake
Add target 'ci' for building examples with -Werror
Used clang-format, which produces noise on stuff you don't care about
and requires setting it up to match the existing code base. Kept the
potentially useful changes, discarded the rest, some manual tweaking
required. It did catch lots of pesky indentation mistakes.
Altered the rake build so that it passes. The example_3 shows off
some failing tests, so the rake build has to ignore those.
Update .gitignore file with executables from examples
With a wider integer width than a pointer, gcc can still warn
when you cast a pointer. Strange but true. To see these warnings
compile with gcc -m32, 32-bit target, and enable UNITY_SUPPORT_64
Using this option changes the control flow of Unity, but is useful on
constrained embedded systems. You can't fully simulate the power of
'longjmp' with just 'return', but Unity still works well, all tests pass.