Mark VanderVoord
0bc0fed904
Merge pull request #784 from burakutkuc/fix-assert-uint-overflow
...
fix: Correct UINT max value handling (thanks @burakutkuc!)
2025-07-10 08:35:42 -04:00
burakutkuc
f96b64f552
fix: fixed error from regression test results; removed the unnecessary int-uint distinction for hex values in the "array within" feature.
2025-07-10 13:35:15 +03:00
Mark VanderVoord
fa03368cae
Merge pull request #775 from ml-physec/more-details
...
Detail-Stack API
2025-07-09 15:23:44 -04:00
burakutkuc
6a3fc440e3
fix: Add casts in function-like macros for type safety
2025-06-13 16:43:35 +03:00
burakutkuc
ac52c4182a
fix: Fail when values are equal but equality is not allowed. Handled HEX asserts as unsigned; applied the same unsigned logic across all integer-based comparisons.
2025-06-13 16:25:22 +03:00
Buccno
bcb0746186
fix: Correct UINT max value handling
2025-06-05 11:00:57 +03:00
Roland Stahn
50c37200b9
Fix definition of UNITY_NOT_EQUAL in unity_internals.h
2025-05-28 10:07:04 +02:00
Roland Stahn
5edda03c78
Cleanup definition of UNITY_COMPARISON_T in unity_internals.h
...
remove unused values UNITY_WITHIN and UNITY_UNKNOWN
update value UNITY_NOT_EQUAL
2025-05-28 09:55:17 +02:00
Roland Stahn
3fb2484313
Add IAR specific mapping for UNITY_NORETURN
2025-05-27 14:33:15 +02:00
ml-physec
c359bf37b0
Initial implementation
2025-04-16 19:21:33 +02:00
Mark VanderVoord
1a29024cc7
It's a New Year
2025-01-01 11:46:30 -05:00
Mark VanderVoord
c546414657
- Protect against people not defining UNITY_USE_COMMAND)LINES_ARGS but enabling cmd_lines in test runner generator. (Cherry-pick PR 739)
...
- Fix UNITY_NORETURN usage (Cherry-pick PR 742)
- Other standards and formatting tweaks.
2024-08-01 16:01:09 -04:00
sdimovv
9b77170349
Remove redundant line casts from UNITY_TEST_ASSERT_* macros
2024-04-18 14:25:55 +01:00
Mark VanderVoord
671f8d25f1
Update all the boilerplates
2024-03-16 23:15:00 -04:00
Mark VanderVoord
a1b1600e43
Update change log and known issues.
...
Fix bug with infinity and NaN handling.
2023-11-13 17:03:07 -05:00
Filip Jagodzinski
710bb58c6a
Allow user-defined TEST_PROTECT & TEST_ABORT macros
...
However rare, this update covers real-world use cases where:
- Unity is used to provide the assertion macros only, and an external
test harness/runner is used for test orchestration/reporting.
- Calling longjmp on a given platform is possible, but has a
platform-specific (or implementation-specific) set of prerequisites,
e.g. privileged access level.
Enable project-specific customisation of TEST_PROTECT and TEST_ABORT
macros.
- Use the user-defined UNITY_TEST_ABORT if available; fall back to
default behaviour otherwise.
- Use the user-defined UNITY_TEST_PROTECT if available; fall back to
default behaviour otherwise.
- These may be defined independently.
2023-09-04 13:36:00 +02:00
Jon Hanghøj Henneberg
d593817630
Add TEST_MATIX option for parameterization
...
Added matrix option for parameterization that generates cases based on
the product of the given arguments.
2023-07-13 22:39:58 +02:00
Torgny Lyon
91ff8c3ee8
Fix delta cast for UINT8_ARRAY_WITHIN
2023-03-15 19:29:58 +01:00
Dave Hart
40b573a784
Use __attribute__((__noreturn__)) instead of __attribute__((noreturn)) to avoid issue with FreeBSD #define noreturn _Noreturn
2023-03-15 09:11:08 -04:00
Henrik Nilsson
3fe84580c8
Avoid cast-qual warnings with const float and double arrays
2023-02-01 08:02:50 +01:00
Mark VanderVoord
5a36b197fb
Merge pull request #644 from AJIOB/implement_array_within_check
...
Adding within API support for float & double arrays
2022-12-29 19:43:58 -05:00
AJIOB
7d2a927082
Adding lost float & double assert entries
...
when they were previously disabled
2022-11-28 18:45:58 +03:00
AJIOB
9c45c7861b
Adding support for floating point arrays within.
...
Testing newly created API.
2022-11-28 18:28:31 +03:00
AJIOB
6567f07f47
Adding possibility for setting relative & absolute
...
floating difference
2022-11-28 18:08:37 +03:00
Alex Overchenko
e4085eb8e6
Using default macro for TEST_CASEs define.
...
Improving docs about manual definition.
2022-11-27 14:36:22 +03:00
Alex Overchenko
4d5ed3d68b
Adding possibility for automatically defining
...
TEST_CASE & TEST_RANGE macros
2022-11-27 13:05:13 +03:00
Mark VanderVoord
e54c9787b7
Merge pull request #560 from jonathangjertsen/more-float
...
Add macros for testing inequalities between floats, doubles
2022-05-25 11:04:56 -04:00
Mark VanderVoord
4389bab82e
Support option to specify array length of zero to force pointer comparison.
2022-04-19 17:27:31 -04:00
Alex Overchenko
79644b6242
Fixing noreturn usage on old Windows SDKs with new MSVC
2022-03-04 16:20:55 +03:00
Jonathan Reichelt Gjertsen
b732fbf1ca
Add LESS_OR_EQUAL and GREATER_OR_EQUAL assertions for doubles and floats
2021-12-03 20:39:55 +01:00
Jonathan Reichelt Gjertsen
244edf6c16
Add NOT_EQUAL* and NOT_WITHIN* checks for floats and doubles
2021-12-03 19:53:31 +01:00
Jonathan Reichelt Gjertsen
5a3d82bda6
Merge branch 'master' into more-float
2021-12-03 18:23:22 +01:00
Mark VanderVoord
8ba0138600
Merge pull request #544 from farrrb/bugfix/fix-issue-510
...
Bugfix/fix issue 510
2021-12-03 10:58:29 -05:00
Jonathan Reichelt Gjertsen
d06ac64852
Merge remote-tracking branch 'upstream/master' into more-float
...
# Conflicts:
# README.md
# docs/UnityAssertionsReference.md
2021-07-27 01:54:26 +02:00
Mark VanderVoord
e44c3b56f7
Adjust how decimal tracking handles to avoid warnings.
2021-06-03 08:51:24 -04:00
Bernhard Breuß
f944b08878
Use stdnoreturn.h for c11 and [[ noreturn ]] for c++11. ThrowTheSwitch#563
2021-06-02 16:56:14 +02:00
druckdev
edfc5ae355
Support UNITY_INCLUDE_EXEC_TIME under Apples OSX
...
The unix way of getting the time works under OSX as well and can be
used.
2021-05-31 12:55:37 +02:00
Jonathan Reichelt Gjertsen
410de1a02b
Add macros for testing inequalities between floats, doubles
2021-05-24 17:02:58 +02:00
Fabian Zahn
7edf9d9ac5
Fix #510 (-Wextra-semi-stmt with clang compiler)
2021-02-27 08:53:53 +01:00
Fabian Zahn
0168ea1541
Enable __attribute__ when __clang__ is definedgit
2021-02-26 18:46:27 +01:00
Mark VanderVoord
ffb51ecb7e
Switch from Travis to Github Actions.
...
Update year in docs.
2021-01-16 20:05:20 -05:00
Alessio Centazzo
8bbfe1f5ac
Fix warning from issue #507
...
UnityFail() and UnityIgnore had the noreturn attribute with long jumps disabled
2020-06-06 08:07:57 -07:00
André Draszik
a6a4e9766d
unity: annotate noreturn APIs (fix Wsuggest-attribute=noreturn warnings)
...
GCC (& Clang) have the notion of pure and const functions [1],
where those attributes are intended to help the optimiser.
Annotate a few APIs here with the appropriate key words, which
also fixes Wsuggest-attribute=noreturn warning, which a
source base might have enabled:
Compiling unity.c...
.../src/unity.c: In function ‘UnityFail’:
.../src/unity.c:1759:6: warning: function might be candidate for attribute ‘noreturn’ [-Wsuggest-attribute=noreturn]
1759 | void UnityFail(const char* msg, const UNITY_LINE_TYPE line)
| ^~~~~~~~~
.../src/unity.c: In function ‘UnityIgnore’:
.../src/unity.c:1796:6: warning: function might be candidate for attribute ‘noreturn’ [-Wsuggest-attribute=noreturn]
1796 | void UnityIgnore(const char* msg, const UNITY_LINE_TYPE line)
| ^~~~~~~~~~~
[1] https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html
Signed-off-by: André Draszik <git@andred.net >
2020-05-25 15:49:47 +01:00
Alari Õis
97f6d55256
c99 support for new RUN_TEST macro
2020-05-04 08:20:19 +03:00
Alari Õis
cdfb7e092c
More elegant RUN_TEST macro
2020-05-01 08:18:09 +03:00
John Lindgren
2485d49d13
Wrap UNITY_TEST_ASSERT in a do ... while(0) block
...
This ensures that constructions like the following work correctly:
if(condition)
TEST_ASSERT(a);
else
TEST_ASSERT(b);
2020-04-09 13:03:16 -04:00
mvandervoord
99199515fd
Update documentation.
...
Add UNITY_PRINT_TEST_CONTEXT (thanks @jlindgren90 !)
Replaces PR #473
2020-03-17 15:01:46 -04:00
mvandervoord
71e77ce6fb
Added NOT-EQUAL int variants.
...
Organized Unit Tests
2020-03-16 18:45:40 -04:00
mvandervoord
bad429428d
Add assertion for checking empty null-terminated arrays. This is particularly useful for check c strings.
2020-03-16 15:04:40 -04:00
Jørn Villesen Christensen
3da0b4652c
Implement macro TEST_PRINTF: Works like TEST_MESSAGE, but with a format-string.
...
Depends on UnityPrintFormatted (define UNITY_INCLUDE_PRINT_FORMATTED).
UnityPrintFormatted has been renamed to UnityPrintF due to changes below.
API of UnityPrintFormatted has been changed (hence the rename), but end users
(developers) can use the TEST_PRINTF as an almost-drop-in replacement TEST_PRINTF
is compatible with the old UnityPrintFormatted API (see below).
The behaviour of UnityPrintF has also been changed:
- Now it prefixes the outout with test location information Output is marked
as INFO.
- It adds an EOL.
Both behaviours adopted from other output functions.
2020-02-14 22:43:51 +01:00