1
0
mirror of https://github.com/ThrowTheSwitch/Unity.git synced 2026-01-23 08:25:58 +01:00

use null check instead of pointer compar

This commit is contained in:
SteveBroshar
2023-10-08 15:47:22 -05:00
parent dcef17bf43
commit 7d0bcc892e

View File

@@ -1609,8 +1609,8 @@ void UnityAssertEqualString(const char* expected,
}
}
else
{ /* handle case of one pointers being null (if both null, test should pass) */
if (expected != actual)
{ /* fail if either null but not if both */
if (expected || actual)
{
Unity.CurrentTestFailed = 1;
}
@@ -1649,8 +1649,8 @@ void UnityAssertEqualStringLen(const char* expected,
}
}
else
{ /* handle case of one pointers being null (if both null, test should pass) */
if (expected != actual)
{ /* fail if either null but not if both */
if (expected || actual)
{
Unity.CurrentTestFailed = 1;
}