diff options
author | Jordan Rupprecht <rupprecht@google.com> | 2024-02-21 22:59:03 -0800 |
---|---|---|
committer | Jordan Rupprecht <rupprecht@google.com> | 2024-02-21 22:59:03 -0800 |
commit | 675791335285fa86434dc46e5c92f543e0e79d19 (patch) | |
tree | 4b2b9a1635f1f866e90b1c83fcd8d4d0a270aa19 /lldb/unittests/ScriptInterpreter/Python | |
parent | 386aa7b16977150da917a78423fd05cb19609850 (diff) | |
download | llvm-675791335285fa86434dc46e5c92f543e0e79d19.zip llvm-675791335285fa86434dc46e5c92f543e0e79d19.tar.gz llvm-675791335285fa86434dc46e5c92f543e0e79d19.tar.bz2 |
[lldb][test] Fix PythonDataObjectsTest
This is using `FileSystem::Instance()` w/o calling `FileSystem::Initialize()`. Use `SubsystemRAII` to do that.
Diffstat (limited to 'lldb/unittests/ScriptInterpreter/Python')
-rw-r--r-- | lldb/unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lldb/unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp b/lldb/unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp index a4db4627f..b90fbb7 100644 --- a/lldb/unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp +++ b/lldb/unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp @@ -11,6 +11,7 @@ #include "Plugins/ScriptInterpreter/Python/PythonDataObjects.h" #include "Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h" +#include "TestingSupport/SubsystemRAII.h" #include "lldb/Host/File.h" #include "lldb/Host/FileSystem.h" #include "lldb/Host/HostInfo.h" @@ -26,6 +27,8 @@ using namespace lldb_private::python; using llvm::Expected; class PythonDataObjectsTest : public PythonTestSuite { + SubsystemRAII<FileSystem> subsystems; + public: void SetUp() override { PythonTestSuite::SetUp(); @@ -209,8 +212,8 @@ TEST_F(PythonDataObjectsTest, TestPythonBoolean) { }; // Test PythonBoolean constructed from long integer values. - test_from_long(0); // Test 'false' value. - test_from_long(1); // Test 'true' value. + test_from_long(0); // Test 'false' value. + test_from_long(1); // Test 'true' value. test_from_long(~0); // Any value != 0 is 'true'. } @@ -811,7 +814,8 @@ main = foo testing::ContainsRegex("line 7, in baz"), testing::ContainsRegex("ZeroDivisionError"))))); -#if !((defined(_WIN32) || defined(_WIN64)) && (defined(__aarch64__) || defined(_M_ARM64))) +#if !((defined(_WIN32) || defined(_WIN64)) && \ + (defined(__aarch64__) || defined(_M_ARM64))) static const char script2[] = R"( class MyError(Exception): |