Skip to content

Commit cd20c71

Browse files
committed
[lldb] Use SubsystemRAII in TestSwiftASTContext
1 parent fcdb379 commit cd20c71

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

lldb/unittests/Symbol/TestSwiftASTContext.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13+
#include "TestingSupport/SubsystemRAII.h"
1314
#include "gtest/gtest.h"
1415

1516
#include "Plugins/TypeSystem/Swift/SwiftASTContext.h"
@@ -31,15 +32,14 @@ using namespace lldb_private;
3132
} else { \
3233
}
3334

34-
struct TestSwiftASTContext : public testing::Test {
35-
static void SetUpTestCase() {
36-
FileSystem::Initialize();
37-
HostInfo::Initialize(); }
35+
class TestSwiftASTContext : public testing::Test {
36+
public:
37+
SubsystemRAII<FileSystem, HostInfo> subsystems;
38+
};
3839

39-
static void TearDownTestCase() {
40-
HostInfo::Terminate();
41-
FileSystem::Terminate();
42-
}
40+
class ClangArgs : public testing::Test {
41+
public:
42+
SubsystemRAII<FileSystem, HostInfo> subsystems;
4343
};
4444

4545
struct SwiftASTContextTester : public SwiftASTContext {
@@ -231,23 +231,23 @@ const std::vector<std::string> uniqued_flags = {
231231
};
232232
} // namespace
233233

234-
TEST(ClangArgs, UniquingCollisionWithExistingFlags) {
234+
TEST_F(ClangArgs, UniquingCollisionWithExistingFlags) {
235235
const std::vector<std::string> source = duplicated_flags;
236236
std::vector<std::string> dest = uniqued_flags;
237237
SwiftASTContext::AddExtraClangArgs(source, dest);
238238

239239
EXPECT_EQ(dest, uniqued_flags);
240240
}
241241

242-
TEST(ClangArgs, UniquingCollisionWithAddedFlags) {
242+
TEST_F(ClangArgs, UniquingCollisionWithAddedFlags) {
243243
const std::vector<std::string> source = duplicated_flags;
244244
std::vector<std::string> dest;
245245
SwiftASTContext::AddExtraClangArgs(source, dest);
246246

247247
EXPECT_EQ(dest, uniqued_flags);
248248
}
249249

250-
TEST(ClangArgs, DoubleDash) {
250+
TEST_F(ClangArgs, DoubleDash) {
251251
// -v with all currently ignored arguments following.
252252
const std::vector<std::string> source{"-v", "--", "-Werror", ""};
253253
std::vector<std::string> dest;

0 commit comments

Comments
 (0)