Jeremy Hannon
91a2353526
MISRA 16.4: param names match func decl & defn
...
parameter names should match between declaration and definition.
(MISRA 2004 rule 16.4)
2018-02-10 13:15:34 -06:00
Mark VanderVoord
43c751173d
stdlib.h explicitly called in fixtures when malloc used, now. (Fixes issue #268 )
2017-03-20 14:09:26 -04:00
Mark VanderVoord
a15f0da0d0
Merge pull request #253 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 #242 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
8beb9715be
C89 comment style changes only
2016-08-23 23:10:05 -05:00
jsalling
06bae56d30
Revert "Merge pull request #205 from bryongloden/patch-2"
...
This reverts commit 783fcaea97
The guard memory bytes should never be freed inside unity_malloc()
2016-08-09 00:51:38 -05: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®
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
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
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
7b0f3cf986
Clean up conversion warnings in Fixture
...
Turn on -Wconversion in Makefile, fix all warnings
2016-02-17 22:17:05 -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
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
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
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
jsalling
a7b60dfc88
Consistent use of * in types in the Fixture, whitespace only
2016-01-19 21:47:32 -06:00
jsalling
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
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
jsalling
1703bd1a5e
Reduce stack usage by removing unnecessary call from group runner in Fixture
...
Defining a group_runner which calls group_runner_runAll() is redundant
2015-12-15 12:05:38 -06:00
jsalling
f75f489b6e
Get rid of magic numbers and strlen call for 'end' string in Fixture
...
Using sizeof() instead of constant 4, makes code less fragile to change
Change name of 'guard' in Guard struct to 'guard_space'
2015-12-15 12:05:38 -06:00
Mark VanderVoord
9aeaee26c9
- Cleaned up UnitPointer_Set (thanks Eric)
...
- Cleaned up a casting warning error
- Removed a couple semicolons from the end of macros SHAME!
2015-12-07 21:41:44 -05:00
jsalling
de7cf8335e
Transform plain macro into a function macro, UNITY_PRINT_EOL()
...
This helps clarity and is more obvious, it looks like a print function
2015-11-23 21:03:46 -06:00
jsalling
d4353166d2
Replace all hard-coded '\n' with UNITY_PRINT_EOL macro in fixture
...
Delete the { ;} braces and semicolon from UNITY_PRINT_EOL to give it expected
behavior: 1) requires a semicolon 2) works in one-liner if-else statements
If you need "\r\n" for EOL, define as the following to get the same behavior:
do{UNITY_OUTPUT_CHAR('\r'); UNITY_OUTPUT_CHAR('\n');}while(0)
2015-11-23 17:09:30 -06:00
Jeremy Hannon
1273112a05
MISRA rule 19.10: parentheses around macro params
...
Added parentheses around all macro parameters to resolve MISRA 2004
rule 19.10, "in the definition of a function-like macro, each instance
of a parameter shall be enclosed in parenthesis" as tested with the
IAR EW for 8051 compiler, version 9.20.2.
The only questionable change is in "unity_fixture.h" where the nested
macro DECLARE_TEST_CASE in RUN_TEST_CASE prevents surrounding params
"group" and "name" with parentheses.
However, it appears that macro DECLARE_TEST_CASE isn't used elsewhere,
so I eliminated DECLARE_TEST_CASE and put its expansion directly in
RUN_TEST_CASE. Now the following header files pass rule 19.10:
* unity.h
* unity_internals.h
* unity_fixture.h
For my own project, this change to the Unity test framework allows me
to include my unit test code to be tested against MISRA rules as well,
instead of just production code, to help enforce style and team
guidelines.
2015-10-14 17:19:26 -05: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
Mark VanderVoord
98e8590fce
Use correct macro for unity_fixture's FAIL.
...
Output used headers from test runner generator
2015-08-18 08:03:50 -04:00
Mark VanderVoord
6f119a8ebd
Merge pull request #122 from trianglee/get_tests_counts
...
Added ability to get number of ignored tests and total number of tests.
2015-07-14 16:45:55 -04:00
Nimrod Zimerman
8a5e7cce24
Added ability to get number of ignored tests and total number of tests.
2015-07-14 19:49:09 +03:00
Nimrod Zimerman
9e9adc050c
Bug fix - ignored tests were incorrectly counted when not selected for running.
...
Ignored tests are now correctly skipped if not selected by test name or
by group name.
2015-07-14 19:29:16 +03:00
Andrew Burks
7737fee444
Fixes #116 : Allow overrides of the Unity Fixture's memory functions. This enables custom heap implementations to be used with the Unity Fixture.
2015-06-30 15:32:57 -07:00
Andrew Burks
31b1255663
Fixes #3 : unity_fixture tests don't build. unity.c and unity_fixture_malloc_overrides.h neglected to include <stddef.h> even though the reference 'size_t' and 'NULL'.
2015-06-30 15:24:39 -07:00
ThingamaByte, LLC
77af37add0
- catch optional fixtures plugin up to mainline unity (somewhat. like fixing line endings)
2015-06-18 17:16:01 -04:00
@gageas
975e222aae
Move announceTestRun() after UnityBegin()
2015-02-03 00:19:30 +09:00
@gageas
1c5986bd30
undef defined callc/realloc macros
2015-02-02 23:57:07 +09:00