[clang-tidy][NFC] Remove the ObjCModuleTest.cpp unit test (#185832)

These unit tests only duplicate the tests in
`clang-tools-extra/test/clang-tidy/checkers/objc/forbidden-subclassing.m`.
This commit is contained in:
Victor Chernyakin 2026-04-01 07:19:42 -07:00 committed by GitHub
parent 9b00518419
commit 5d393aee10
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 0 additions and 51 deletions

View File

@ -120,7 +120,6 @@ The Directory Structure
|-- ClangTidyTest.h
|-- GoogleModuleTest.cpp
|-- LLVMModuleTest.cpp
|-- ObjCModuleTest.cpp
...

View File

@ -30,7 +30,6 @@ add_extra_unittest(ClangTidyTests
LLVMModuleTest.cpp
ModernizeModuleTest.cpp
NamespaceAliaserTest.cpp
ObjCModuleTest.cpp
OptionsProviderTest.cpp
OverlappingReplacementsTest.cpp
UsingInserterTest.cpp

View File

@ -1,48 +0,0 @@
//===---- ObjCModuleTest.cpp - clang-tidy ---------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#include "ClangTidyTest.h"
#include "gtest/gtest.h"
#include "objc/ForbiddenSubclassingCheck.h"
using namespace clang::tidy::objc;
namespace clang {
namespace tidy {
namespace test {
TEST(ObjCForbiddenSubclassing, AllowedSubclass) {
std::vector<ClangTidyError> Errors;
runCheckOnCode<ForbiddenSubclassingCheck>(
"@interface Foo\n"
"@end\n"
"@interface Bar : Foo\n"
"@end\n",
&Errors,
"input.m");
EXPECT_EQ(0ul, Errors.size());
}
TEST(ObjCForbiddenSubclassing, ForbiddenSubclass) {
std::vector<ClangTidyError> Errors;
runCheckOnCode<ForbiddenSubclassingCheck>(
"@interface UIImagePickerController\n"
"@end\n"
"@interface Foo : UIImagePickerController\n"
"@end\n",
&Errors,
"input.m");
EXPECT_EQ(1ul, Errors.size());
EXPECT_EQ(
"Objective-C interface 'Foo' subclasses 'UIImagePickerController', which is not intended to be subclassed",
Errors[0].Message.Message);
}
} // namespace test
} // namespace tidy
} // namespace clang

View File

@ -43,7 +43,6 @@ unittest("ClangTidyTests") {
"LexerUtilsTest.cpp",
"ModernizeModuleTest.cpp",
"NamespaceAliaserTest.cpp",
"ObjCModuleTest.cpp",
"OptionsProviderTest.cpp",
"OverlappingReplacementsTest.cpp",
"ReadabilityModuleTest.cpp",