Mark VanderVoord
4ce86fd1c0
Merge pull request #226 from jsalling/feature/nan-not-eq-nan
...
Add option to set NaN not equal NaN for floating point assertions
2016-10-12 06:54:38 -04:00
jsalling
933cc97364
Add option to set NaN != NaN for floating point assertions
2016-10-10 21:20:10 -05:00
Jeremy Hannon
148b4977cf
check 'i' limit before using it as an array index.
...
fix cppcheck "Array index 'i' is used before limits check."
2016-09-26 16:01:03 -05:00
Mark VanderVoord
dce6d329ff
Finished fixing floating point comparisons. We have streamlined how floats and doubles are checked, but we still can't compare them for equality directly. So we're directly testing for infinite and NaN before checking diffs. Also, we've officially decided that for testing purposes NaN shall equal NaN, +Inf shall equal +Inf, and -Inf shall equal -Inf. It's what most people expect during a test.
2016-09-22 08:35:22 -04:00
Mark VanderVoord
0f07adfa00
Merge pull request #202 from kroesche/feature/fix_exclude_fp_warnings
...
Fix warnings if you use UNITY_EXCLUDE_FLOAT
2016-09-21 20:53:45 -04:00
Mark VanderVoord
7dc17efbb3
Merge pull request #215 from jsalling/bugfix/inf-equals-inf
...
Bugfix Inf equals Inf
2016-09-21 20:52:58 -04:00
jsalling
af590028fa
Unity to print C-style escaped strings as "\x16"
...
Changes from "\0x16" before, makes it easier to copy strings from output
2016-09-01 01:18:03 -05:00
jsalling
6d54ec2ff7
Get rid of conversion warning when using UNITY_FLOAT_VERBOSE with doubles
...
Change the parameter of UnityPrintFloat from float to double (_UD)
The call to snprintf uses implict default promotion to a double anyway
2016-08-27 15:34:10 -05:00
jsalling
54aa838c8a
Change the fallback isinf() macro to NOT need f_zero defined
...
Delete old comments from before math.h was the default isinf() method
2016-08-27 15:27:52 -05:00
jsalling
028ca953d7
Finish checking for equal floats in Arrays functions
...
Refactor to use the same code everywhere for FloatWithin check
Rename and fix a few tests for new behavior, infinity == infinity
2016-08-27 15:12:45 -05:00
Mark VanderVoord
a74920d112
Merge pull request #210 from jsalling/feature/int-detection
...
Int width detection without sizeof
2016-08-26 15:03:44 -04:00
jsalling
28c94bd403
Remove references to UNITY_EXCLUDE_SIZEOF, rework config header
2016-08-25 08:48:29 -05:00
jsalling
e4e2210eb6
Improving integer width detection
...
The C preprocessor cannot use sizeof in #if etc.
2016-08-25 08:32:42 -05:00
jsalling
3108aba5c7
If two floats happen to be equal, return right away
...
Covers the cases where infinity == infinity
2016-08-23 22:36:02 -05:00
Mark VanderVoord
daad2bc82b
removed some newer style comments that crept into the codebase.
2016-08-23 06:46:51 -04:00
Mark VanderVoord
f276c79f9b
Merge branch 'feature/cmd_line_args'
2016-08-11 13:37:51 -04:00
Mark VanderVoord
57676b5edc
- Fixed cases with wildcards in file handling.
2016-07-17 19:11:09 -04:00
Daniel Murdin
f1a4a5e652
Weak attribute fix for TMS470 Compilers.
...
Change-Id: I901bf192d3c06457d67c6d3a64bdb9aea22c53c2
2016-07-13 10:36:43 +02:00
Joe Kroesche
f2f073d533
Fix warnings if you use UNITY_EXCLUDE_FLOAT
2016-07-10 20:36:08 -05:00
Mark VanderVoord
1cecab30e8
- Added alias for filter -n of -f
...
- Added ability to surround filter strings in either type of quotes
- Added ability to filter on multiple test strings as a comma delimited list
- Added ability to filter on test_file:test_name
- Added ability to use alternate syntax for filter of -f="blah"
2016-07-08 17:35:37 -04:00
Mark VanderVoord
f05385250c
- Document new define in unity.h. Will still need to be added to real docs
2016-07-08 16:10:14 -04:00
Mark VanderVoord
eba387fa3e
- Add tests which prove command line arguments now work with runner. Fixed a few bugs in this area.
2016-06-27 08:41:58 -04:00
Mark VanderVoord
96f51e8530
Updated method of testing generate_test_runner script to be a FUNCTIONAL test instead of a perfect code match. Backfilled most tests and added some coverage not previously present. Still need to test new command line args and a few cmock details.
2016-06-22 20:57:11 -04:00
Mark VanderVoord
4d3d062b56
Adding command line support. Started with -n (test name matching) -x (test name exclusion).
...
Script verification hasn't been added yet.
2016-06-21 16:07:10 -04:00
Mark VanderVoord
b3bc196ab3
making new flush routines work under all defined conditions.
2016-06-21 10:01:34 -04:00
Andrzej Bieniek
61dd3f181b
Change comments style in unity and test runner to compile with std=c89
2016-05-15 14:35:50 +01:00
Mark VanderVoord
c5c392b18a
update UNITY_OUTPUT_CHAR to not return a value (because we never check it anyway).
...
add UNITY_OUTPUT_FLUSH to make sure we get the output we need on aborted tests and whatnot.
2016-05-06 10:47:39 -04:00
jsalling
c5238adab2
100% code coverage for Unity project
...
Add test for failure count and UnityEnd return value
Cover printing escape codes with length parameter
Full statement coverage
2016-05-03 21:58:29 -05:00
jsalling
b971ec921f
Simplify printing StrPointless into a single macro, remove repeated code
2016-05-03 19:52:32 -05:00
jsalling
67a37a4db7
Refactor UnityPrintNumber(), remove unreachable code
...
Remove what looks like an overflow check. 'divisor' cannot overflow
since it is the same type as 'number' and cannot be greater.
2016-05-02 23:50:28 -05:00
jsalling
0137f4a8c2
Add option to print FAILED instead of FAIL during the summary
...
For easier automation and searching for a test suite failure
2016-04-27 21:00:04 -05:00
Rik van der Heijden
23271e81a6
also check for isinf
2016-04-27 10:25:11 +02:00
Rik van der Heijden
74581c357e
use isnan instead of comparing floats, fixes #188
2016-04-27 10:17:43 +02:00
Mark VanderVoord
4f2cdb03fc
Merge pull request #185 from jsalling/feature/output-declaration
...
Add Unity Fixture to the travisCI build and restore header declaration of UNITY_OUTPUT_CHAR
2016-04-26 22:53:41 -04:00
Jerry Jacobs
6a02f7e51c
Fixup issues when compiling with clang -Wmissing-variable-declarations
2016-04-26 14:17:10 +02:00
jsalling
593a03462e
Add an option to omit UNITY_OUTPUT_CHAR declaration from the header
...
This solves the warnings from -Wredundant-decls when overriding the
OUTPUT function with a function declared in another header.
It's better this is the non-default option, since using it requires either
a declaration of the new function OR a preprocessor guard on declaring
UNITY_OUTPUT_CHAR (as in unity.c here), in every file using the function.
See Pull Request #185 for more.
2016-04-24 23:30:19 -05:00
jsalling
573481729b
Revert commits 720ea42 and a27b03c which broke the Fixture build
...
These were aimed at preventing the internals header from declaring
a prototype for 'int UNITY_OUTPUT_CHAR(int);'. The second part fixed
an omitted declaration in the tests caused by the first commit.
Will replace the default behavior & add an option for this in next commit
2016-04-24 23:30:01 -05:00
Jerry Jacobs
a27b03c79a
UNITY_OUTPUT_CHAR can emit a redundant declaration, we scope the extern declartion to the unity.c
2016-04-13 12:19:04 +02:00
Jerry Jacobs
8c37d7b98a
Fix #182 , remove redundant function declarations
2016-04-13 11:33:57 +02:00
jsalling
13c99601a7
Add a value to FLOAT_TRAIT enum to enforce use of default case in switches
...
Revert the previous commit. Add tests for extended enum cases.
Fix crash due to accessing 'trait_names' array out of bounds.
Adding an extra invalid value to the end of an enum causes '-Wswitch' flag
to warn unless there is a switch default case - also enabled by '-Wall'.
2016-03-02 14:56:09 -06:00
jsalling
7a0875f4f3
Fix unreachable code in Unity on fully covered switch statements
...
The clang compiler warns here with -Wunreachable-code
The enum's switch statement covers all cases, so default is unused
Leave the break in the code as a comment, to be more clear
The history is this default case was added in f6bb7162 - compiler warning.
Then the break was added in c6dc96f3 .
2016-03-02 14:22:01 -06:00
jsalling
3bb51bd740
Fix C89 warnings about variables at top of scope, enums, variadic macros
...
Add extern UnityFixture in internals header. Add C89 target in Makefile
clang will show these warnings but can suppress "//" with -Wno-comment.
2016-02-26 20:51:04 -06:00
Mark VanderVoord
a7f81e8a04
Merge pull request #172 from pacheco017/UnityPrintFloat-overflow-fixes
...
UnityPrintFloat overflow fixes. (Thanks pacheco017!)
2016-02-24 20:16:45 -05:00
Matias Devenuta
c17705358f
UnityPrintFloat(): bigger temporal buffer
...
With a buffer long enough, no truncation should be neccesary to format floats.
Buffer length is user settable by defining UNITY_VERBOSE_NUMBER_MAX_LENGTH,
otherwise a sensible default is used based on desired precision.
See: http://stackoverflow.com/a/7235717
2016-02-24 19:58:54 -03:00
Matias Devenuta
50259a1329
Fix UnityPrintFloat() buffer overflow
...
UnityPrintFloat() overflowed with some inputs (eg. FLT_MAX)
2016-02-24 19:47:58 -03:00
Mark VanderVoord
433ee63575
Added ability to finish test immediately with a pass condition by using TEST_PASS
2016-02-24 16:00:55 -05:00
jsalling
3faa143f21
Fix additional primitive type conversion warnings on Linux
...
Using gcc 4.8 on Ubuntu 14
2016-02-23 14:46:52 -06:00
jsalling
c3371664ba
Clean up int conversion warnings in core Unity using a 32-bit build
...
To expose warnings use -Wconversion -m32, and *not* -D UNITY_SUPPORT_64
In 32-bit mode, the variable and parameter are the same width, so sign
conversion is implicit. In 64-bit, implicit conversion is clean.
2016-02-12 15:59:46 -06:00
jsalling
4108319007
Fix for overflow issue in UnityAssertNumbersWithin()
...
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.
2016-01-06 17:41:06 -06:00
jsalling
04adb2d2c9
Fix trailing whitespace CRLF, no code changes
...
Now that the project is using .gitattributes, get rid of CRLF in the repo.
2016-01-06 17:23:43 -06:00