Skip to content

fix: Correct UINT max value handling #784

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

burakutkuc
Copy link

@burakutkuc burakutkuc commented Jun 5, 2025

Related to ThrowTheSwitch/CMock#509

In addition:

The following guard clause:

if ((threshold == actual) && (compare & UNITY_EQUAL_TO)) { return; }
if ((threshold == actual))                               { failed = 1; }

was replaced with:

if ((threshold == actual) && !(compare & UNITY_EQUAL_TO)) { failed = 1; }

The goal was to align the behavior of the UnityAssertGreaterOrLessOrEqualNumber function with its name.
In the previous implementation, the function would return early without handling "greater or equal" or "less or equal" cases.
With this update, the function properly allows those comparisons when no failure condition is met.

…HEX asserts as unsigned; applied the same unsigned logic across all integer-based comparisons.
@burakutkuc burakutkuc force-pushed the fix-assert-uint-overflow branch from dd48114 to ac52c41 Compare June 13, 2025 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant