1
0
mirror of https://github.com/ThrowTheSwitch/Unity synced 2025-05-21 02:09:34 -04:00

101 Commits

Author SHA1 Message Date
Mark VanderVoord
2a5b24f7bf Finished updating all Ruby scripts to match our coding standard. Woo! 2017-03-28 20:02:53 -04:00
Mark VanderVoord
23f9c16aaa Another round of fixing things that the stylizer “corrected” for me. 2017-03-28 08:59:58 -04:00
Mark VanderVoord
3062c39725 Starting to enforce our coding style. The first step is that we’ve pulled in Rubocop to check out Ruby syntax. There is likely a bit of customization to do yet AND there is definitely that backlog of todo’s that we just told it to ignore. 2017-03-28 08:44:32 -04:00
Mark VanderVoord
43c751173d stdlib.h explicitly called in fixtures when malloc used, now. (Fixes issue ) 2017-03-20 14:09:26 -04:00
Mark VanderVoord
a15f0da0d0 Merge pull request from jsalling/feature/cpputest-macros
Option to exclude CppUTest compatibility asserts (Thanks!)
2017-01-19 06:57:28 -05:00
jsalling
97e4bd252a Ran Unity into a source code formatter, no code changes
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.
2017-01-18 19:48:40 -06:00
jsalling
9cdc3d678b Option to exclude CppUTest compatibility asserts 2017-01-18 08:43:29 -06:00
jsalling
01ca3899c2 Fix bug in DOUBLES_EQUAL in unity_fixture.h 2017-01-14 12:22:00 -06:00
Mark VanderVoord
6695e9e975 Merge pull request from jsalling/feature/fixture-test-name
Fixture - Remove duplicate output of test name in verbose mode
2017-01-13 16:38:10 -05:00
jsalling
5f33721924 Remove duplicate output of test name, Fixture verbose mode
Remove UNITY_FIXTURES option, which was probably not doing what was
originally indended. It was suppressing the test name even in quiet mode.
2016-12-28 21:18:50 -06: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
3e30290367 Remove extra newline in verbose output format of fixture 2016-10-10 23:10:40 -05:00
Max Payne
a8e799b066
Fix fixture using from C++ sources
Mangling issues, as always.
2016-09-25 22:25:32 +03:00
jsalling
da7e375cf9 Start building Unity & Fixture with C89 flags in continuous integration
Remove stdint.h from the C89 build due to -pedantic warnings from type
  'long long' and constants like UINTPTR_MAX = 18446744073709551615ULL
2016-08-30 19:57:55 -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
jsalling
06bae56d30 Revert "Merge pull request from bryongloden/patch-2"
This reverts commit 783fcaea97cf11975d75254742e800d7759fdbd0
 The guard memory bytes should never be freed inside unity_malloc()
2016-08-09 00:51:38 -05:00
Mark VanderVoord
783fcaea97 Merge pull request from bryongloden/patch-2
Update unity_fixture.c (Thanks, Bryon!)
2016-08-02 14:55:42 -04: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®
4fd5f79f28 Update unity_fixture.c
Sorry @mvandervoord -- not your code, your repository 😁

Regarding the double free, cppcheck has a check for that too (just saying) 👍
2016-07-26 19:41:30 -04:00
Bryon Gloden, CISSP®
0737b4117f Update unity_fixture.c
Free guard if UNITY_EXCLUDE_STDLIB_MALLOC is not defined. 👍

Thanks @ for the hint.
2016-07-26 16:02:41 -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
Bryon Gloden, CISSP®
b1d8388ab8 Update unity_fixture.c
[../Unity-master/extras/fixture/src/unity_fixture.c:210]: (error) Memory leak: guard

Found by https://github.com/bryongloden/cppcheck
2016-07-26 14:19:41 -04:00
Mark VanderVoord
e3612e9a10 Update Fixtures too. 2016-05-06 10:55:41 -04:00
jsalling
94fc68942b 100% code coverage for Unity Fixture
Add tests for uncovered lines
2016-02-29 23:39:03 -06:00
jsalling
cc0f58cfbc Create coverage target in Makefile to output statement coverage with gcov 2016-02-29 23:25:39 -06:00
Mark VanderVoord
ce6f4737b2 Merge pull request 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 . 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
862d5d7d3d Rename template for testing to be more fitting 2016-02-24 20:24:14 -06: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
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
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
jsalling
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
jsalling
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
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
6b664fc803 Pass through correct line info on failures in Fixture pointer setting 2016-02-08 16:52:26 -06:00
jsalling
4c384658e5 Move makefile output to build/ dir for Fixture testing 2016-02-05 21:48:23 -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
ccb29e80c2 Add NULL safety checks to Fixture allocation functions
Consistent use of one-liners and NULL
2016-01-31 23:15:00 -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
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
jsalling
34a30f8e98 Delete dangling function prototype in Fixture internals 2016-01-19 21:47:40 -06:00