-----------------------------------------------*/
| 1589 | |
| 1590 | /*-----------------------------------------------*/ |
| 1591 | void UnityAssertEqualString(const char* expected, |
| 1592 | const char* actual, |
| 1593 | const char* msg, |
| 1594 | const UNITY_LINE_TYPE lineNumber) |
| 1595 | { |
| 1596 | UNITY_UINT32 i; |
| 1597 | |
| 1598 | RETURN_IF_FAIL_OR_IGNORE; |
| 1599 | |
| 1600 | /* if both pointers not null compare the strings */ |
| 1601 | if (expected && actual) |
| 1602 | { |
| 1603 | for (i = 0; expected[i] || actual[i]; i++) |
| 1604 | { |
| 1605 | if (expected[i] != actual[i]) |
| 1606 | { |
| 1607 | Unity.CurrentTestFailed = 1; |
| 1608 | break; |
| 1609 | } |
| 1610 | } |
| 1611 | } |
| 1612 | else |
| 1613 | { /* fail if either null but not if both */ |
| 1614 | if (expected || actual) |
| 1615 | { |
| 1616 | Unity.CurrentTestFailed = 1; |
| 1617 | } |
| 1618 | } |
| 1619 | |
| 1620 | if (Unity.CurrentTestFailed) |
| 1621 | { |
| 1622 | UnityTestResultsFailBegin(lineNumber); |
| 1623 | UnityPrintExpectedAndActualStrings(expected, actual); |
| 1624 | UnityAddMsgIfSpecified(msg); |
| 1625 | UNITY_FAIL_AND_BAIL; |
| 1626 | } |
| 1627 | } |
| 1628 | |
| 1629 | /*-----------------------------------------------*/ |
| 1630 | void UnityAssertEqualStringLen(const char* expected, |
nothing calls this directly
no test coverage detected