This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy][objc] Finds and fixes improper usages of XCTAssertEquals and XCTAssertNotEquals.
ClosedPublic

Authored by oontvoo on Dec 2 2021, 11:12 AM.

Details

Summary

Using XCTAssertEqual on NSString* objects are almost always wrong.

Unfortunately, we have seen a lot of tests doing this and reyling on pointer equality for strings with the same values (which happens to work sometimes - depending on the linker, but this assumption is not guaranteed by the language)

These fixes would make tests less brittle.

Diff Detail

Event Timeline

oontvoo created this revision.Dec 2 2021, 11:12 AM
oontvoo requested review of this revision.Dec 2 2021, 11:12 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 2 2021, 11:12 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
oontvoo edited the summary of this revision. (Show Details)Dec 2 2021, 11:14 AM
oontvoo updated this revision to Diff 391451.Dec 2 2021, 1:51 PM

updated diff

gribozavr2 accepted this revision.Dec 2 2021, 3:29 PM
This revision is now accepted and ready to land.Dec 2 2021, 3:29 PM