mirror of
https://github.com/ThrowTheSwitch/Unity.git
synced 2025-12-17 14:00:03 +08:00
use null check instead of pointer compar
This commit is contained in:
@@ -1609,8 +1609,8 @@ void UnityAssertEqualString(const char* expected,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ /* handle case of one pointers being null (if both null, test should pass) */
|
{ /* fail if either null but not if both */
|
||||||
if (expected != actual)
|
if (expected || actual)
|
||||||
{
|
{
|
||||||
Unity.CurrentTestFailed = 1;
|
Unity.CurrentTestFailed = 1;
|
||||||
}
|
}
|
||||||
@@ -1649,8 +1649,8 @@ void UnityAssertEqualStringLen(const char* expected,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ /* handle case of one pointers being null (if both null, test should pass) */
|
{ /* fail if either null but not if both */
|
||||||
if (expected != actual)
|
if (expected || actual)
|
||||||
{
|
{
|
||||||
Unity.CurrentTestFailed = 1;
|
Unity.CurrentTestFailed = 1;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user