Skip to content

Commit 681e413

Browse files
rupprechtJDevlieghere
authored andcommitted
[lldb][test] Fix PythonDataObjectsTest
This is using `FileSystem::Instance()` w/o calling `FileSystem::Initialize()`. Use `SubsystemRAII` to do that. (cherry picked from commit 6757913)
1 parent fbbe756 commit 681e413

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lldb/unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp

+7-3
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
#include "Plugins/ScriptInterpreter/Python/PythonDataObjects.h"
1313
#include "Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h"
14+
#include "TestingSupport/SubsystemRAII.h"
1415
#include "lldb/Host/File.h"
1516
#include "lldb/Host/FileSystem.h"
1617
#include "lldb/Host/HostInfo.h"
@@ -27,6 +28,8 @@ using llvm::Error;
2728
using llvm::Expected;
2829

2930
class PythonDataObjectsTest : public PythonTestSuite {
31+
SubsystemRAII<FileSystem> subsystems;
32+
3033
public:
3134
void SetUp() override {
3235
PythonTestSuite::SetUp();
@@ -210,8 +213,8 @@ TEST_F(PythonDataObjectsTest, TestPythonBoolean) {
210213
};
211214

212215
// Test PythonBoolean constructed from long integer values.
213-
test_from_long(0); // Test 'false' value.
214-
test_from_long(1); // Test 'true' value.
216+
test_from_long(0); // Test 'false' value.
217+
test_from_long(1); // Test 'true' value.
215218
test_from_long(~0); // Any value != 0 is 'true'.
216219
}
217220

@@ -809,7 +812,8 @@ main = foo
809812
testing::ContainsRegex("line 7, in baz"),
810813
testing::ContainsRegex("ZeroDivisionError")))));
811814

812-
#if !((defined(_WIN32) || defined(_WIN64)) && (defined(__aarch64__) || defined(_M_ARM64)))
815+
#if !((defined(_WIN32) || defined(_WIN64)) && \
816+
(defined(__aarch64__) || defined(_M_ARM64)))
813817

814818
static const char script2[] = R"(
815819
class MyError(Exception):

0 commit comments

Comments
 (0)