[all-commits] [llvm/llvm-project] aba8f3: [clang-tidy][objc] Finds and fixes improper usages...

Vy Nguyen via All-commits all-commits at lists.llvm.org
Thu Dec 2 15:32:39 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: aba8f320cc139a177ba5f549d7e7bf9a6350aa58
      https://github.com/llvm/llvm-project/commit/aba8f320cc139a177ba5f549d7e7bf9a6350aa58
  Author: Vy Nguyen <vyng at google.com>
  Date:   2021-12-02 (Thu, 02 Dec 2021)

  Changed paths:
    A clang-tools-extra/clang-tidy/objc/AssertEquals.cpp
    A clang-tools-extra/clang-tidy/objc/AssertEquals.h
    M clang-tools-extra/clang-tidy/objc/CMakeLists.txt
    M clang-tools-extra/clang-tidy/objc/ObjCTidyModule.cpp
    M clang-tools-extra/docs/clang-tidy/checks/list.rst
    A clang-tools-extra/docs/clang-tidy/checks/objc-assert-equals.rst
    A clang-tools-extra/test/clang-tidy/checkers/Inputs/objc-assert/XCTestAssertions.h
    A clang-tools-extra/test/clang-tidy/checkers/objc-assert-equals.m

  Log Message:
  -----------
  [clang-tidy][objc] Finds and fixes improper usages of XCTAssertEquals and XCTAssertNotEquals.

Using XCTAssertEqual on NSString* objects is 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.

Differential Revision: https://reviews.llvm.org/D114975




More information about the All-commits mailing list