[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:
parent
9b00518419
commit
5d393aee10
@ -120,7 +120,6 @@ The Directory Structure
|
||||
|-- ClangTidyTest.h
|
||||
|-- GoogleModuleTest.cpp
|
||||
|-- LLVMModuleTest.cpp
|
||||
|-- ObjCModuleTest.cpp
|
||||
...
|
||||
|
||||
|
||||
|
||||
@ -30,7 +30,6 @@ add_extra_unittest(ClangTidyTests
|
||||
LLVMModuleTest.cpp
|
||||
ModernizeModuleTest.cpp
|
||||
NamespaceAliaserTest.cpp
|
||||
ObjCModuleTest.cpp
|
||||
OptionsProviderTest.cpp
|
||||
OverlappingReplacementsTest.cpp
|
||||
UsingInserterTest.cpp
|
||||
|
||||
@ -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
|
||||
@ -43,7 +43,6 @@ unittest("ClangTidyTests") {
|
||||
"LexerUtilsTest.cpp",
|
||||
"ModernizeModuleTest.cpp",
|
||||
"NamespaceAliaserTest.cpp",
|
||||
"ObjCModuleTest.cpp",
|
||||
"OptionsProviderTest.cpp",
|
||||
"OverlappingReplacementsTest.cpp",
|
||||
"ReadabilityModuleTest.cpp",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user