mirror of
https://github.com/ThrowTheSwitch/Unity
synced 2025-05-17 01:49:33 -04:00
Add correct masking behavior on unsigned values
This commit is contained in:
parent
5f386a42ff
commit
46560a8030
@ -620,6 +620,13 @@ void UnityAssertEqualIntArray(UNITY_INTERNAL_PTR expected,
|
||||
|
||||
if (expect_val != actual_val)
|
||||
{
|
||||
if (style & UNITY_DISPLAY_RANGE_UINT && length < sizeof expect_val)
|
||||
{ /* For UINT, remove sign extension (padding 1's) from signed type casts above */
|
||||
UNITY_INT mask = 1;
|
||||
mask = (mask << 8 * length) - 1;
|
||||
expect_val &= mask;
|
||||
actual_val &= mask;
|
||||
}
|
||||
UnityTestResultsFailBegin(lineNumber);
|
||||
UnityPrint(UnityStrElement);
|
||||
UnityPrintNumberUnsigned(num_elements - elements - 1);
|
||||
|
Loading…
x
Reference in New Issue
Block a user