Skip to content

Commit 6757913

Browse files
committed
[lldb][test] Fix PythonDataObjectsTest
This is using `FileSystem::Instance()` w/o calling `FileSystem::Initialize()`. Use `SubsystemRAII` to do that.
1 parent 386aa7b commit 6757913

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lldb/unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp

Lines changed: 7 additions & 3 deletions
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"
@@ -26,6 +27,8 @@ using namespace lldb_private::python;
2627
using llvm::Expected;
2728

2829
class PythonDataObjectsTest : public PythonTestSuite {
30+
SubsystemRAII<FileSystem> subsystems;
31+
2932
public:
3033
void SetUp() override {
3134
PythonTestSuite::SetUp();
@@ -209,8 +212,8 @@ TEST_F(PythonDataObjectsTest, TestPythonBoolean) {
209212
};
210213

211214
// Test PythonBoolean constructed from long integer values.
212-
test_from_long(0); // Test 'false' value.
213-
test_from_long(1); // Test 'true' value.
215+
test_from_long(0); // Test 'false' value.
216+
test_from_long(1); // Test 'true' value.
214217
test_from_long(~0); // Any value != 0 is 'true'.
215218
}
216219

@@ -811,7 +814,8 @@ main = foo
811814
testing::ContainsRegex("line 7, in baz"),
812815
testing::ContainsRegex("ZeroDivisionError")))));
813816

814-
#if !((defined(_WIN32) || defined(_WIN64)) && (defined(__aarch64__) || defined(_M_ARM64)))
817+
#if !((defined(_WIN32) || defined(_WIN64)) && \
818+
(defined(__aarch64__) || defined(_M_ARM64)))
815819

816820
static const char script2[] = R"(
817821
class MyError(Exception):

0 commit comments

Comments
 (0)