jsalling
46560a8030
Add correct masking behavior on unsigned values
2016-12-23 22:28:37 -06:00
jsalling
5f386a42ff
Refactor of IntArray function with switch inside loop, remove repeated code
2016-12-23 22:19:42 -06:00
Mark VanderVoord
0603c1cf1e
Merge pull request #231 from jsalling/feature/print-floats
...
Unity prints float (and double) by default
2016-12-21 21:18:43 -05:00
jsalling
b0870ec8b9
Merge branch 'feature/print-floats'
...
Fix new type name conflicts
Conflicts:
src/unity.c
src/unity_internals.h
2016-12-15 21:15:30 -06:00
Mark VanderVoord
ee02e3885f
Merge pull request #233 from mchernosky/generate-partial-triads
...
Module generator finishes for partially existing files
2016-12-12 18:29:25 -05:00
Matt Chernosky
df2d37459b
Try manually installing rspec in Travis CI.
2016-12-02 22:57:10 -07:00
Matt Chernosky
7b51355e5a
Module generator finishes for partially existing files
...
This resolves #219 . When generating a new module, if all the files to
generate already exist then it fails as before. If some of the files
already exist, then the files that need to be created are created. Any
existing files are not changed.
Also added a bunch of tests for this feature via rspec. Run them from
the test folder with `rake spec`.
2016-12-02 13:49:07 -07:00
Mark VanderVoord
8e31f5d869
Revised internal type naming scheme to better sandbox Unity away from everything else. Sure, short was nice, but not at the expense of naming collisions.
2016-11-29 08:38:51 -05:00
Mark VanderVoord
b77c6b833f
Merge pull request #232 from mchernosky/module-create-with-subdir
...
Fixed error when path provided in module name.
2016-11-29 06:50:54 -05:00
Matt Chernosky
37049a3a20
Fixed error when path provided with module name.
2016-11-28 23:57:17 -07:00
Mark VanderVoord
4386cf356f
Added to Module Generator:
...
- configurable case.
- better passing of includes and boilerplate information
- test only pattern
- optional naming conventions for case
2016-11-22 14:24:24 -05:00
Mark VanderVoord
4e2f0381cc
Add ability to inject correct mock prefix
2016-11-21 15:19:16 -05:00
jsalling
aa4d773df2
Tests for Printing All float values
...
Takes about 10 minutes to run all floats, so split into 3 tests for parallel
running later. This was useful during development for finding hard corner cases
and getting the routine to high quality. Off by default.
Note that all floats 16.0 and up can be represented uniquely (in this format) and will
round-trip back to the exact same float with sscanf(). This property is true for
UnityPrintFloat, despite a few rounding error cases, it will produce output identity.
Better comments and refactor on round ties to even
Add upper threshold value on round to even feature since numerical precision issues
start to give approximations when dividing one large double by another. When tested
on float values, using 1e22 gave the fewest rounding errors.
Fix warnings from gcc. Some float constants do not behave well in existing tests.
Add casts where conversions could be imprecise.
2016-11-19 13:59:19 -06:00
jsalling
25f6417351
Refactor repeated code to print float expected and actual
...
Move double tests down in the file
2016-11-19 13:52:24 -06:00
jsalling
9f4b1a332f
Tests for Printing Floating Point numbers
2016-11-19 13:52:24 -06:00
jsalling
47f6a85b8c
Make UnityPrintFloat on by default
...
Remove UNITY_FLOAT_VERBOSE entirely, add option UNITY_EXCLUDE_FLOAT_PRINT
Remove some questionable float casts from doubles
Default to Round Ties to Even behavior, add option to Round Ties Away from Zero
2016-11-19 13:52:24 -06:00
jsalling
54fe786fae
Round ties to even by default, many C libraries follow this
...
Linux gcc & clang and OSX clang produce output with ties round to even
Windows mingw gcc does not
Example 0.0078125 prints '0.007812'
2016-11-19 13:52:24 -06:00
jsalling
4a27d14734
Correct boundary conditions and add tests
2016-11-19 13:52:24 -06:00
jsalling
1dfcb54491
Start adding tests. Add const and simplify code.
2016-11-19 13:52:24 -06:00
jsalling
393f2cb544
Refactor printing after the decimal point, signed types, small numbers...
...
Change some types to signed for simpler code and speed
Added format to distinguish small numbers
2016-11-19 13:52:24 -06:00
jsalling
2de0e8285d
Key idea is using double precision calculations makes everything better
...
Print 9 digits
2016-11-19 13:52:24 -06:00
jsalling
e48fe0a07c
Reorganize NaN and Inf printing into if-else blocks
2016-11-19 13:51:59 -06:00
jsalling
30ba118c47
Add printing for large numbers in exponential format
...
Delete old method for printing
2016-11-16 23:00:01 -06:00
jsalling
9653fbf7ac
Use an integer cast to print floating point numbers more precisely
...
Improve printing six decimal places, remove trailing 0's, fix the carry when
numbers like 0.9999999 round up and print leading zeros in the decimal
The first attempt at printing floats had precision issues where the last few
digits would often be wrong. This next approach may yield a better algorithm
for numbers less than 4.29 billion, those that fit in 32 bits.
2016-11-16 20:37:12 -06:00
Mark VanderVoord
012064eaea
Merge pull request #228 from jeanCarloMachado/test_failure
...
removed duplicated declaration of putcharSpy
2016-11-16 20:31:40 -05:00
Jean Carlo Machado
4faae4435d
removed duplicated declaration of putcharSpy
2016-11-16 21:37:51 -02:00
Mark VanderVoord
ac455f2798
We can’t guarantee that the built-in function insane will return 1. It might return any other non-negative value. Therefore we need to force it to be 1 so we can use the comparison operator later.
2016-11-15 09:29:08 -05:00
jsalling
d4a35f0949
Refactor to delete smaller number decimal format
...
Generalize loop to print decimal format and exponential
Add '+' to exponent when printing larger floats
2016-11-12 23:08:54 -06:00
jsalling
6ec7c78b66
Writing a float printing routine
2016-11-12 23:08:54 -06:00
Mark VanderVoord
ae5b4c5799
Added ability to inject defines, much like what was built into Ceedling before Ceedling switched to just using this generator.
2016-11-10 10:10:13 -05:00
Mark VanderVoord
661c1b2d56
Boost version and remove some debug puts statements
v2.4.0
2016-10-27 23:06:18 -04:00
Mark VanderVoord
2ce8618014
refactor generate_module so that it can be called as a class from within Ceedling (much like the test runner generator)
2016-10-27 17:33:13 -04:00
Mark VanderVoord
bbf2fe3a93
Merge pull request #227 from jsalling/bugfix/fixture-verbose-eol
...
Remove extra newline in verbose output format of Fixture
2016-10-12 06:55:43 -04:00
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
3e30290367
Remove extra newline in verbose output format of fixture
2016-10-10 23:10:40 -05:00
jsalling
933cc97364
Add option to set NaN != NaN for floating point assertions
2016-10-10 21:20:10 -05:00
Mark VanderVoord
1129b18ced
Merge pull request #225 from kykrueger/master
...
Fix bug, makefiles for example do not clean on windows
2016-10-06 06:54:36 -04:00
kykrueger
03b9eaa9ba
Fix bug, makefiles for example do not clean on windows
2016-10-06 11:00:22 +02:00
Mark VanderVoord
a912ee364e
Merge pull request #223 from jeremyhannon/checkLimitBeforeUsingIndex
...
check 'i' limit before using it as an array index.
2016-09-26 23:09:35 -04: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
3581ebb69e
Merge pull request #222 from forGGe/missing_c_linkage
...
Fix fixture using from C++ sources
2016-09-26 08:43:53 -04:00
Max Payne
a8e799b066
Fix fixture using from C++ sources
...
Mangling issues, as always.
2016-09-25 22:25:32 +03: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
Mark VanderVoord
71f2e0e6b3
Merge pull request #221 from robobrobro/master
...
Test generator: scrub strings after comments
2016-09-21 15:55:41 -04:00
L.J. Hill
bc4da247b5
Do not match strings across newlines
2016-09-21 15:10:43 -04:00
L.J. Hill
9caae856c4
Test generator: scrub strings after comments
...
This fixes #220 .
Removing strings from test files is still dangerous, but much
less likely to cause problems after this change to do the
removal after removing comments.
The bug could still manifest if a test file contains defines two
macros, one that contains a single quotation mark and then another
defined somewhere after it that contains a single quotation mark.
Everything in between the aforementioned quotation marks would
still be ignored after this commit, but that is an unlikely
scenario.
2016-09-21 14:20:29 -04:00
Mark VanderVoord
693169eddf
Merge pull request #218 from 2trill2spill/master
...
Add OSX to travis-ci build.
2016-09-20 14:31:45 -04:00
Mark VanderVoord
95435afa4e
Merge pull request #214 from jsalling/feature/c-strings
...
Print escapes for C strings
2016-09-07 07:48:09 -04:00