454 Commits

Author SHA1 Message Date
a7f81e8a04 Merge pull request #172 from pacheco017/UnityPrintFloat-overflow-fixes
UnityPrintFloat overflow fixes. (Thanks pacheco017!)
2016-02-24 20:16:45 -05:00
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
50259a1329 Fix UnityPrintFloat() buffer overflow
UnityPrintFloat() overflowed with some inputs (eg. FLT_MAX)
2016-02-24 19:47:58 -03:00
433ee63575 Added ability to finish test immediately with a pass condition by using TEST_PASS 2016-02-24 16:00:55 -05:00
3a775ccd70 Merge pull request #171 from jsalling/feature/fix-linux-warnings
Fix additional primitive type conversion warnings on Linux
2016-02-24 06:46:29 -05:00
3faa143f21 Fix additional primitive type conversion warnings on Linux
Using gcc 4.8 on Ubuntu 14
2016-02-23 14:46:52 -06:00
7fff3fc034 Merge pull request #170 from jsalling/feature/fix-compiler-warnings
Clean up int conversion warnings in Fixture
2016-02-23 06:38:57 -05:00
4cc964962b Merge pull request #169 from jsalling/feature/remove-wrappers
Delete unused Fixture internals functions for failure, ignore, & test counts
2016-02-22 07:12:49 -05:00
f31667ad18 Merge pull request #166 from jsalling/bugfix/line-numbers
Bugfix - line numbers output by Fixture memory checks
2016-02-18 14:18:20 -05:00
3826b3a1e1 Merge pull request #164 from jsalling/bugfix/conversion-warnings
Clean up int conversion warnings in core Unity using a 32-bit build
2016-02-18 07:02:08 -05:00
05066785e1 Merge pull request #163 from jsalling/feature/move-makefile-output
Move Makefile output to build/ directory in Fixture (Thanks jsalling!)
2016-02-18 06:50:15 -05:00
2337d6e837 Merge pull request #165 from jsalling/cleanup/file-permissions
Permissions changed back from -x for testunity.c (Thanks jsalling!)
2016-02-18 06:47:09 -05:00
2107e7060b Variables used in Fixture tests should be static
Gets rid of warnings about extern with clang's -Weverything
2016-02-17 22:20:56 -06:00
7b0f3cf986 Clean up conversion warnings in Fixture
Turn on -Wconversion in Makefile, fix all warnings
2016-02-17 22:17:05 -06:00
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
773c7f1770 Permissions changed to -x for testunity.c, reverts part of 51af84a7 2016-02-12 13:25:14 -06:00
ad14ccf26b Add strict compiler flags to Makefile and a 'clean' target
Comment out -Wconversion for now, since the build would fail
2016-02-09 14:24:00 -06:00
5e7780fd60 Delete unused internals functions for failure, ignore, & test counts.
These wrapper functions should be in Unity core if warranted.
 Use the Unity struct directly for access, or consider macro functions
2016-02-09 10:55:07 -06:00
943fef8a17 Fix printing the test line number for leak detection failures in Fixture
The old failure would print the line in unity_fixture.c, not very useful.
 Now using CurrentTestLineNumber, which is better.
2016-02-09 10:39:22 -06:00
36ee2d2111 Add test for setting max number of pointers in Fixture 2016-02-09 10:36:33 -06:00
822a537d2e Remove opaque typedef from UnityFixture struct, as done in core Unity 2016-02-08 16:53:10 -06:00
6b664fc803 Pass through correct line info on failures in Fixture pointer setting 2016-02-08 16:52:26 -06:00
4c384658e5 Move makefile output to build/ dir for Fixture testing 2016-02-05 21:48:23 -06:00
189085d03a Check for writes to guard space on malloc'd buffers in Fixture
There was already some space reserved as a guard, added check for writes
 before the beginning of the buffer. Did not change the 'overrun' message.
 Underrun buffer writes are likely to be a more rare case.
2016-02-05 21:31:38 -06:00
7943c766b9 Merge pull request #161 from jsalling/feature/fixture-remove-dependencies
Feature - remove dependencies from Fixture, add internal heap option (Wow! Thanks jsalling!)
2016-02-03 21:00:24 -05:00
955b221218 Add configuration option UNITY_EXCLUDE_STDLIB_MALLOC to Fixture
This feature removes the dependency on malloc/free for constrained
  embedded systems without a heap. It uses a static heap inside
  Unity Fixture. Setting UNITY_INTERNAL_HEAP_SIZE_BYTES sizes the heap.
 Add tests for new option, add targets to makefile for running tests.
 UNITY_FIXTURE_MALLOC for Fixture use only, remove from unity_output_Spy.c.
2016-02-01 23:54:06 -06:00
ed2842fd4d Merge pull request #160 from pmendham/master
Added support for mocks in sub-directories. (Thanks pmendham! This is helpful!)
2016-02-01 18:20:37 -05:00
099b0db22b Updated mock determination code to be more efficient applying the
feedback from @mvandervoord (Thanks).
2016-02-01 22:48:23 +00:00
ccb29e80c2 Add NULL safety checks to Fixture allocation functions
Consistent use of one-liners and NULL
2016-01-31 23:15:00 -06:00
e2ad88b9c0 Add checks for NULL return value to Fixture tests and spy
Help failures in the spy by adding filename and message to output
2016-01-31 22:44:45 -06:00
63a0b98faf Remove atoi() dependency, only need stdlib.h in Fixture for malloc
For redefinition of UNITY_FIXTURE_MALLOC/...FREE use both or replace both.
 Clean up whitespace, remaining void*, and comment.
2016-01-30 22:35:59 -06:00
4ea563e65b Added support for mocks in sub-directories.
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.
2016-01-28 20:45:58 +00:00
f36bd5f521 Merge pull request #159 from pmendham/master
Removed unecessary output when generating a test runner (Thanks pmendham!)
2016-01-27 09:52:01 -05:00
9a9d6c75cf Removed unecessary output when generating a test runner 2016-01-27 14:42:29 +00:00
2179e54d6d Merge pull request #158 from jsalling/bugfix/fixture-rakefile-fails
Fixture rakefile has a conflict defining UNITY_OUTPUT_CHAR
2016-01-24 09:55:50 -05:00
044a1f517d Merge pull request #156 from pmendham/master
Two small changes to runner generation
2016-01-20 09:08:18 -05:00
55a75ded7a Improved header file generation.
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).
2016-01-20 13:48:15 +00:00
2e4799111c Added a command line option to change the name of main.
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.
2016-01-20 13:45:25 +00:00
cd472439bf Fixture rakefile has a conflict defining UNITY_OUTPUT_CHAR
Make core Unity rakefile helper follow Fixture define procedure.
 This commit reverts parts of 36e2ca1.
2016-01-19 23:47:32 -06:00
34a30f8e98 Delete dangling function prototype in Fixture internals 2016-01-19 21:47:40 -06:00
a7b60dfc88 Consistent use of * in types in the Fixture, whitespace only 2016-01-19 21:47:32 -06:00
693417847b Remove unnecessary stdio.h dependency and clean up Fixture
Delete unused variables and empty functions
 Make setUp & tearDown (used in Unity core) optionally defined
  if 'weak' linking is present
2016-01-15 22:35:43 -06:00
10146392c8 Merge pull request #154 from jsalling/bugfix/AssertNumbersWithin-overflow
Bugfix for UnityAssertNumbersWithin()
2016-01-07 20:45:35 -05:00
33325f4a0b More fixes to line endings 2016-01-07 14:20:59 -05:00
d1111d92af Merge pull request #152 from jsalling/feature/fixture-ignore-tests-require-spy
Fixture - require spy or else ignore tests
2016-01-07 07:56:47 -05:00
716f88caca Merge pull request #153 from jsalling/refactor/trailing-whitespace
Fix trailing whitespace CRLF, no code changes
2016-01-06 20:41:34 -05:00
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
8ca3062ad4 Adding tests for overflow when calling UnityAssertNumbersWithin()
32 or 64 bit test will fail if compiled with -m32 or -m64, repectively
  on clang or gcc
 Fixes to the failures will follow
2016-01-06 17:41:02 -06:00
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
edfba3793e Merge pull request #151 from jsalling/bugfix/add-tests-for-printing-numbers
Add tests for printing numbers, interface for spying on output strings (Thanks! I like this idea!)
2016-01-05 19:17:52 -05:00