提交 46560a80 编写于 作者: J jsalling

Add correct masking behavior on unsigned values

上级 5f386a42
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册