1
0
mirror of https://github.com/ThrowTheSwitch/Unity.git synced 2026-01-23 16:35:58 +01:00

39 Commits

Author SHA1 Message Date
Rehme, Koy
df0b5d90b8 Add unit tests for new switches 2025-01-18 17:45:21 -07:00
Mark VanderVoord
1a29024cc7 It's a New Year 2025-01-01 11:46:30 -05:00
Mark VanderVoord
671f8d25f1 Update all the boilerplates 2024-03-16 23:15:00 -04:00
mvandervoord
fbded74349 Split memory from fixtures and make it's own addon 2019-10-30 07:52:07 -04:00
mvandervoord
8d044e60c6 update fixture tests too 2019-10-25 11:41:27 -04:00
mvandervoord
d16c27b085 - added target for checking ANSI compliance
- fixed ANSI (C89) issues, including #418
2019-10-25 10:17:12 -04:00
jsalling
53bdb6897f Ability to set size of pointer list, smaller default size 2016-12-23 22:53:24 -06: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
jsalling
8beb9715be C89 comment style changes only 2016-08-23 23:10:05 -05:00
jsalling
92f6d5dd08 Verify the tests for Internal Malloc implementation free all the heap
Make it more clear that each test of the internal heap implementation
  should free in LIFO order. Without this check, memory can be stranded
  but still pass.
2016-08-21 11:53:15 -05:00
jsalling
d837342b15 Move free() calls before test asserts, add comments to ReallocFail test 2016-08-21 11:45:54 -05:00
jsalling
03ac71b8c9 Reorder free calls to free all memory
The internal malloc must free in LIFO order
2016-08-21 11:27:47 -05:00
Bryon Gloden, CISSP®
13160e5f1e Update unity_fixture_Test.c
I believe if realloc() returns a pointer to a different location, the old location is freed. However, the pointer 'n1' is not freed if realloc fails to obtain a large enough block of memory and returns NULL. (more details on [StackOverflow](http://stackoverflow.com/a/16676964)).
2016-07-28 17:11:11 -04:00
Bryon Gloden, CISSP®
094c05e904 Update unity_fixture_Test.c
[../Unity-master/extras/fixture/test/unity_fixture_Test.c:530]: (error) Deallocating a deallocated pointer: n1

This solution from Daniel Fischer was helpful in fixing the error because if realloc returns a pointer to a different location, the old location is freed.

Found by https://github.com/bryongloden/cppcheck
2016-07-26 14:40:00 -04:00
jsalling
94fc68942b 100% code coverage for Unity Fixture
Add tests for uncovered lines
2016-02-29 23:39:03 -06:00
Mark VanderVoord
ce6f4737b2 Merge pull request #175 from jsalling/feature/C89-build
Fix C89 warnings about variables at top of scope, enums, variadic macros
2016-02-29 16:59:40 -05: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
jsalling
f8d5f0eee6 Clean up Ignore Test function in Fixture
By removing the call to the Conclude function the code is simplified
  and doesn't depend on global state updates. Tests that are ignored
  after the testBody is called still output the right EOL.
2016-02-25 13:12:22 -06:00
jsalling
f55bed38a6 Delete function call syntax from Spy detect macros
This fixes #168. See that github.com issue for more discussion.
 Allows the tests to build when putchar() is defined as a macro
  with parenthesis around it, as in the ARM embedded gcc compiler.
2016-02-25 10:41:04 -06:00
jsalling
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
jsalling
7b0f3cf986 Clean up conversion warnings in Fixture
Turn on -Wconversion in Makefile, fix all warnings
2016-02-17 22:17:05 -06:00
jsalling
36ee2d2111 Add test for setting max number of pointers in Fixture 2016-02-09 10:36:33 -06:00
jsalling
822a537d2e Remove opaque typedef from UnityFixture struct, as done in core Unity 2016-02-08 16:53:10 -06:00
jsalling
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
jsalling
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
jsalling
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
jsalling
c5bfe0e100 Fixture C99 compliance on tricky macros for Spy & match core Unity version
Add CFLAGS in Fixture Makefile to catch C99 rules with '-pedantic'
2015-12-22 12:40:31 -06:00
jsalling
5cc5e3473d Add MACROs to check if tests are built using the Output Spy
Ignore tests that need the Spy if we are not building with it
2015-12-21 14:37:23 -06:00
jsalling
c629e120e1 Fix Leak Detection always passing, but printing a fail message
Don't set CurrentTestFailed = 0 at end, move before last check
 These tests now fail if the output_Spy is not used instead of putchar()
2015-12-16 17:21:09 -06:00
jsalling
81cf5eb626 Do not add EOL after every ignored test using Unity Fixture
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
2015-12-15 20:57:22 -06:00
Gergely Nagy
1affe544d2 unity_fixture: Make unity_free() NULL-safe
At the start of unity_free(), check mem for NULL, and return immediately
if it is, so we don't crash in this case. This mimics the behaviour of
most free() implementations. Closes #135.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
2015-10-06 10:44:44 +02:00
nimrodz
b389c71e71 Added stricter error checks by the compiler, and adapted all impacted code.
Primarily -
* Added "static" to static functions.
* Added proper signature with "void" to functions without arguments.
* Marked unused arguments with "(void)".
* Removed entirely unused static functions.
* Added "const" to preserve const-correctness.
* Added function prototypes for external functions.
2015-01-18 00:39:05 +02:00
kotofos
c1379802eb no arguments for UnityPointer_Init 2014-12-03 11:58:08 +06:00
James Hood
5e401afa83 updating CLI for unity_fixture.h to handle unknown command line arguments (instead of entering an infinite loop) 2013-03-04 14:35:18 -06:00
Bryan A. Jones
4817d78de3 Fix: Declare all variables before statements in a function.
Likewise, place all function prototypes before statements.
     These changes support Microsoft Visual Studio 2008 Express Edition,
       which follows C89-style rules.
2013-01-11 12:56:15 -06:00
mvandervoord
3d61357343 - updated fixture to match James' suggestions.
git-svn-id: http://unity.svn.sourceforge.net/svnroot/unity/trunk@124 e7d17a6e-8845-0410-bbbc-c8efb4fdad7e
2011-03-09 02:05:05 +00:00
mvandervoord
e067b442a3 - updates to fixture in extras (submitted by James Grenning)
git-svn-id: http://unity.svn.sourceforge.net/svnroot/unity/trunk@111 e7d17a6e-8845-0410-bbbc-c8efb4fdad7e
2011-01-04 20:08:32 +00:00
mvandervoord
57178b9295 - tweaked parameterized tests to be C99 standards compliant
- fixed a few bugs in fixtures to get it to pass against our standard compilers
- added extern of OUTPUT_CHAR method to keep compilers from complaining

git-svn-id: http://unity.svn.sourceforge.net/svnroot/unity/trunk@107 e7d17a6e-8845-0410-bbbc-c8efb4fdad7e
2010-12-01 01:56:24 +00:00
mvandervoord
5a6b8c405b - added a tweaked version of James Grenning's unity_fixture to extras
git-svn-id: http://unity.svn.sourceforge.net/svnroot/unity/trunk@106 e7d17a6e-8845-0410-bbbc-c8efb4fdad7e
2010-11-29 22:53:57 +00:00