[llvm][TextAPI] rename test vars, NFC
* Conforms to clang tidy
diff --git a/llvm/unittests/TextAPI/TextStubV1Tests.cpp b/llvm/unittests/TextAPI/TextStubV1Tests.cpp
index 441db0a..a95db01 100644
--- a/llvm/unittests/TextAPI/TextStubV1Tests.cpp
+++ b/llvm/unittests/TextAPI/TextStubV1Tests.cpp
@@ -41,7 +41,7 @@
namespace TBDv1 {
TEST(TBDv1, ReadFile) {
- static const char tbd_v1_file1[] =
+ static const char TBDv1File1[] =
"---\n"
"archs: [ armv7, armv7s, armv7k, arm64 ]\n"
"platform: ios\n"
@@ -66,7 +66,7 @@
" thread-local-symbols: [ _tlv3 ]\n"
"...\n";
- auto Result = TextAPIReader::get(MemoryBufferRef(tbd_v1_file1, "Test.tbd"));
+ auto Result = TextAPIReader::get(MemoryBufferRef(TBDv1File1, "Test.tbd"));
EXPECT_TRUE(!!Result);
auto File = std::move(Result.get());
EXPECT_EQ(FileType::TBD_V1, File->getFileType());
@@ -113,13 +113,13 @@
}
TEST(TBDv1, ReadFile2) {
- static const char tbd_v1_file2[] = "--- !tapi-tbd-v1\n"
- "archs: [ armv7, armv7s, armv7k, arm64 ]\n"
- "platform: ios\n"
- "install-name: Test.dylib\n"
- "...\n";
+ static const char TBDv1File2[] = "--- !tapi-tbd-v1\n"
+ "archs: [ armv7, armv7s, armv7k, arm64 ]\n"
+ "platform: ios\n"
+ "install-name: Test.dylib\n"
+ "...\n";
- auto Result = TextAPIReader::get(MemoryBufferRef(tbd_v1_file2, "Test.tbd"));
+ auto Result = TextAPIReader::get(MemoryBufferRef(TBDv1File2, "Test.tbd"));
EXPECT_TRUE(!!Result);
auto File = std::move(Result.get());
EXPECT_EQ(FileType::TBD_V1, File->getFileType());
@@ -144,7 +144,7 @@
}
TEST(TBDv1, WriteFile) {
- static const char tbd_v1_file3[] =
+ static const char TBDv1File3[] =
"---\n"
"archs: [ i386, x86_64 ]\n"
"platform: macosx\n"
@@ -193,18 +193,18 @@
raw_svector_ostream OS(Buffer);
auto Result = TextAPIWriter::writeToStream(OS, File);
EXPECT_FALSE(Result);
- EXPECT_STREQ(tbd_v1_file3, Buffer.c_str());
+ EXPECT_STREQ(TBDv1File3, Buffer.c_str());
}
TEST(TBDv1, Platform_macOS) {
- static const char tbd_v1_platform_macos[] = "---\n"
- "archs: [ x86_64 ]\n"
- "platform: macosx\n"
- "install-name: Test.dylib\n"
- "...\n";
+ static const char TBDv1PlatformMacOS[] = "---\n"
+ "archs: [ x86_64 ]\n"
+ "platform: macosx\n"
+ "install-name: Test.dylib\n"
+ "...\n";
auto Result =
- TextAPIReader::get(MemoryBufferRef(tbd_v1_platform_macos, "Test.tbd"));
+ TextAPIReader::get(MemoryBufferRef(TBDv1PlatformMacOS, "Test.tbd"));
EXPECT_TRUE(!!Result);
auto Platform = PlatformKind::macOS;
auto File = std::move(Result.get());
@@ -214,14 +214,14 @@
}
TEST(TBDv1, Platform_iOS) {
- static const char tbd_v1_platform_ios[] = "---\n"
- "archs: [ arm64 ]\n"
- "platform: ios\n"
- "install-name: Test.dylib\n"
- "...\n";
+ static const char TBDv1PlatformiOS[] = "---\n"
+ "archs: [ arm64 ]\n"
+ "platform: ios\n"
+ "install-name: Test.dylib\n"
+ "...\n";
auto Result =
- TextAPIReader::get(MemoryBufferRef(tbd_v1_platform_ios, "Test.tbd"));
+ TextAPIReader::get(MemoryBufferRef(TBDv1PlatformiOS, "Test.tbd"));
EXPECT_TRUE(!!Result);
auto Platform = PlatformKind::iOS;
auto File = std::move(Result.get());
@@ -231,14 +231,14 @@
}
TEST(TBDv1, Platform_watchOS) {
- static const char tbd_v1_platform_watchos[] = "---\n"
- "archs: [ armv7k ]\n"
- "platform: watchos\n"
- "install-name: Test.dylib\n"
- "...\n";
+ static const char TBDv1PlatformWatchOS[] = "---\n"
+ "archs: [ armv7k ]\n"
+ "platform: watchos\n"
+ "install-name: Test.dylib\n"
+ "...\n";
auto Result =
- TextAPIReader::get(MemoryBufferRef(tbd_v1_platform_watchos, "Test.tbd"));
+ TextAPIReader::get(MemoryBufferRef(TBDv1PlatformWatchOS, "Test.tbd"));
EXPECT_TRUE(!!Result);
auto Platform = PlatformKind::watchOS;
auto File = std::move(Result.get());
@@ -248,14 +248,14 @@
}
TEST(TBDv1, Platform_tvOS) {
- static const char tbd_v1_platform_tvos[] = "---\n"
- "archs: [ arm64 ]\n"
- "platform: tvos\n"
- "install-name: Test.dylib\n"
- "...\n";
+ static const char TBDv1PlatformtvOS[] = "---\n"
+ "archs: [ arm64 ]\n"
+ "platform: tvos\n"
+ "install-name: Test.dylib\n"
+ "...\n";
auto Result =
- TextAPIReader::get(MemoryBufferRef(tbd_v1_platform_tvos, "Test.tbd"));
+ TextAPIReader::get(MemoryBufferRef(TBDv1PlatformtvOS, "Test.tbd"));
EXPECT_TRUE(!!Result);
auto Platform = PlatformKind::tvOS;
auto File = std::move(Result.get());
@@ -265,14 +265,13 @@
}
TEST(TBDv1, Platform_bridgeOS) {
- static const char tbd_v1_platform_bridgeos[] = "---\n"
- "archs: [ armv7k ]\n"
- "platform: bridgeos\n"
- "install-name: Test.dylib\n"
- "...\n";
+ static const char TBDv1BridgeOS[] = "---\n"
+ "archs: [ armv7k ]\n"
+ "platform: bridgeos\n"
+ "install-name: Test.dylib\n"
+ "...\n";
- auto Result =
- TextAPIReader::get(MemoryBufferRef(tbd_v1_platform_bridgeos, "Test.tbd"));
+ auto Result = TextAPIReader::get(MemoryBufferRef(TBDv1BridgeOS, "Test.tbd"));
EXPECT_TRUE(!!Result);
auto Platform = PlatformKind::bridgeOS;
auto File = std::move(Result.get());
@@ -282,15 +281,14 @@
}
TEST(TBDv1, Swift_1_0) {
- static const char tbd_v1_swift_1_0[] = "---\n"
- "archs: [ arm64 ]\n"
- "platform: ios\n"
- "install-name: Test.dylib\n"
- "swift-version: 1.0\n"
- "...\n";
+ static const char TBDv1Swift1[] = "---\n"
+ "archs: [ arm64 ]\n"
+ "platform: ios\n"
+ "install-name: Test.dylib\n"
+ "swift-version: 1.0\n"
+ "...\n";
- auto Result =
- TextAPIReader::get(MemoryBufferRef(tbd_v1_swift_1_0, "Test.tbd"));
+ auto Result = TextAPIReader::get(MemoryBufferRef(TBDv1Swift1, "Test.tbd"));
EXPECT_TRUE(!!Result);
auto File = std::move(Result.get());
EXPECT_EQ(FileType::TBD_V1, File->getFileType());
@@ -298,15 +296,14 @@
}
TEST(TBDv1, Swift_1_1) {
- static const char tbd_v1_swift_1_1[] = "---\n"
- "archs: [ arm64 ]\n"
- "platform: ios\n"
- "install-name: Test.dylib\n"
- "swift-version: 1.1\n"
- "...\n";
+ static const char TBDv1Swift1dot[] = "---\n"
+ "archs: [ arm64 ]\n"
+ "platform: ios\n"
+ "install-name: Test.dylib\n"
+ "swift-version: 1.1\n"
+ "...\n";
- auto Result =
- TextAPIReader::get(MemoryBufferRef(tbd_v1_swift_1_1, "Test.tbd"));
+ auto Result = TextAPIReader::get(MemoryBufferRef(TBDv1Swift1dot, "Test.tbd"));
EXPECT_TRUE(!!Result);
auto File = std::move(Result.get());
EXPECT_EQ(FileType::TBD_V1, File->getFileType());
@@ -314,15 +311,14 @@
}
TEST(TBDv1, Swift_2_0) {
- static const char tbd_v1_swift_2_0[] = "---\n"
- "archs: [ arm64 ]\n"
- "platform: ios\n"
- "install-name: Test.dylib\n"
- "swift-version: 2.0\n"
- "...\n";
+ static const char TBDv1Swift2[] = "---\n"
+ "archs: [ arm64 ]\n"
+ "platform: ios\n"
+ "install-name: Test.dylib\n"
+ "swift-version: 2.0\n"
+ "...\n";
- auto Result =
- TextAPIReader::get(MemoryBufferRef(tbd_v1_swift_2_0, "Test.tbd"));
+ auto Result = TextAPIReader::get(MemoryBufferRef(TBDv1Swift2, "Test.tbd"));
EXPECT_TRUE(!!Result);
auto File = std::move(Result.get());
EXPECT_EQ(FileType::TBD_V1, File->getFileType());
@@ -330,15 +326,14 @@
}
TEST(TBDv1, Swift_3_0) {
- static const char tbd_v1_swift_3_0[] = "---\n"
- "archs: [ arm64 ]\n"
- "platform: ios\n"
- "install-name: Test.dylib\n"
- "swift-version: 3.0\n"
- "...\n";
+ static const char TBDv1Swift3[] = "---\n"
+ "archs: [ arm64 ]\n"
+ "platform: ios\n"
+ "install-name: Test.dylib\n"
+ "swift-version: 3.0\n"
+ "...\n";
- auto Result =
- TextAPIReader::get(MemoryBufferRef(tbd_v1_swift_3_0, "Test.tbd"));
+ auto Result = TextAPIReader::get(MemoryBufferRef(TBDv1Swift3, "Test.tbd"));
EXPECT_TRUE(!!Result);
auto File = std::move(Result.get());
EXPECT_EQ(FileType::TBD_V1, File->getFileType());
@@ -346,15 +341,14 @@
}
TEST(TBDv1, Swift_4_0) {
- static const char tbd_v1_swift_4_0[] = "---\n"
- "archs: [ arm64 ]\n"
- "platform: ios\n"
- "install-name: Test.dylib\n"
- "swift-version: 4.0\n"
- "...\n";
+ static const char TBDv1Swift4[] = "---\n"
+ "archs: [ arm64 ]\n"
+ "platform: ios\n"
+ "install-name: Test.dylib\n"
+ "swift-version: 4.0\n"
+ "...\n";
- auto Result =
- TextAPIReader::get(MemoryBufferRef(tbd_v1_swift_4_0, "Test.tbd"));
+ auto Result = TextAPIReader::get(MemoryBufferRef(TBDv1Swift4, "Test.tbd"));
EXPECT_FALSE(!!Result);
auto errorMessage = toString(Result.takeError());
EXPECT_EQ("malformed file\nTest.tbd:5:16: error: invalid Swift ABI "
@@ -363,14 +357,14 @@
}
TEST(TBDv1, Swift_5) {
- static const char tbd_v1_swift_5[] = "---\n"
- "archs: [ arm64 ]\n"
- "platform: ios\n"
- "install-name: Test.dylib\n"
- "swift-version: 5\n"
- "...\n";
+ static const char TBDv1Swift5[] = "---\n"
+ "archs: [ arm64 ]\n"
+ "platform: ios\n"
+ "install-name: Test.dylib\n"
+ "swift-version: 5\n"
+ "...\n";
- auto Result = TextAPIReader::get(MemoryBufferRef(tbd_v1_swift_5, "Test.tbd"));
+ auto Result = TextAPIReader::get(MemoryBufferRef(TBDv1Swift5, "Test.tbd"));
EXPECT_TRUE(!!Result);
auto File = std::move(Result.get());
EXPECT_EQ(FileType::TBD_V1, File->getFileType());
@@ -378,15 +372,14 @@
}
TEST(TBDv1, Swift_99) {
- static const char tbd_v1_swift_99[] = "---\n"
- "archs: [ arm64 ]\n"
- "platform: ios\n"
- "install-name: Test.dylib\n"
- "swift-version: 99\n"
- "...\n";
+ static const char TBDv1Swift99[] = "---\n"
+ "archs: [ arm64 ]\n"
+ "platform: ios\n"
+ "install-name: Test.dylib\n"
+ "swift-version: 99\n"
+ "...\n";
- auto Result =
- TextAPIReader::get(MemoryBufferRef(tbd_v1_swift_99, "Test.tbd"));
+ auto Result = TextAPIReader::get(MemoryBufferRef(TBDv1Swift99, "Test.tbd"));
EXPECT_TRUE(!!Result);
auto File = std::move(Result.get());
EXPECT_EQ(FileType::TBD_V1, File->getFileType());
@@ -394,26 +387,25 @@
}
TEST(TBDv1, UnknownArchitecture) {
- static const char tbd_v1_file_unknown_architecture[] =
- "---\n"
- "archs: [ foo ]\n"
- "platform: macosx\n"
- "install-name: Test.dylib\n"
- "...\n";
+ static const char TBDv1FileUnknownArch[] = "---\n"
+ "archs: [ foo ]\n"
+ "platform: macosx\n"
+ "install-name: Test.dylib\n"
+ "...\n";
- auto Result = TextAPIReader::get(
- MemoryBufferRef(tbd_v1_file_unknown_architecture, "Test.tbd"));
+ auto Result =
+ TextAPIReader::get(MemoryBufferRef(TBDv1FileUnknownArch, "Test.tbd"));
EXPECT_TRUE(!!Result);
}
TEST(TBDv1, UnknownPlatform) {
- static const char tbd_v1_file_unknown_platform[] = "---\n"
- "archs: [ i386 ]\n"
- "platform: newOS\n"
- "...\n";
+ static const char TBDv1FileUnknownPlatform[] = "---\n"
+ "archs: [ i386 ]\n"
+ "platform: newOS\n"
+ "...\n";
- auto Result = TextAPIReader::get(
- MemoryBufferRef(tbd_v1_file_unknown_platform, "Test.tbd"));
+ auto Result =
+ TextAPIReader::get(MemoryBufferRef(TBDv1FileUnknownPlatform, "Test.tbd"));
EXPECT_FALSE(!!Result);
auto errorMessage = toString(Result.takeError());
EXPECT_EQ("malformed file\nTest.tbd:3:11: error: unknown platform\nplatform: "
@@ -422,13 +414,13 @@
}
TEST(TBDv1, MalformedFile1) {
- static const char malformed_file1[] = "---\n"
- "archs: [ arm64 ]\n"
- "foobar: \"Unsupported key\"\n"
- "...\n";
+ static const char TBDv1FileMalformed1[] = "---\n"
+ "archs: [ arm64 ]\n"
+ "foobar: \"Unsupported key\"\n"
+ "...\n";
auto Result =
- TextAPIReader::get(MemoryBufferRef(malformed_file1, "Test.tbd"));
+ TextAPIReader::get(MemoryBufferRef(TBDv1FileMalformed1, "Test.tbd"));
EXPECT_FALSE(!!Result);
auto errorMessage = toString(Result.takeError());
ASSERT_EQ("malformed file\nTest.tbd:2:1: error: missing required key "
@@ -437,15 +429,15 @@
}
TEST(TBDv1, MalformedFile2) {
- static const char malformed_file2[] = "---\n"
- "archs: [ arm64 ]\n"
- "platform: ios\n"
- "install-name: Test.dylib\n"
- "foobar: \"Unsupported key\"\n"
- "...\n";
+ static const char TBDv1FileMalformed2[] = "---\n"
+ "archs: [ arm64 ]\n"
+ "platform: ios\n"
+ "install-name: Test.dylib\n"
+ "foobar: \"Unsupported key\"\n"
+ "...\n";
auto Result =
- TextAPIReader::get(MemoryBufferRef(malformed_file2, "Test.tbd"));
+ TextAPIReader::get(MemoryBufferRef(TBDv1FileMalformed2, "Test.tbd"));
EXPECT_FALSE(!!Result);
auto errorMessage = toString(Result.takeError());
ASSERT_EQ(