Skip to content

Commit

Permalink
[lldb][test] Fix PythonDataObjectsTest
Browse files Browse the repository at this point in the history
This is using `FileSystem::Instance()` w/o calling `FileSystem::Initialize()`. Use `SubsystemRAII` to do that.

(cherry picked from commit 6757913)
  • Loading branch information
rupprecht authored and JDevlieghere committed May 24, 2024
1 parent fbbe756 commit 681e413
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -27,6 +28,8 @@ using llvm::Error;
using llvm::Expected;

class PythonDataObjectsTest : public PythonTestSuite {
SubsystemRAII<FileSystem> subsystems;

public:
void SetUp() override {
PythonTestSuite::SetUp();
Expand Down Expand Up @@ -210,8 +213,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'.
}

Expand Down Expand Up @@ -809,7 +812,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):
Expand Down

0 comments on commit 681e413

Please sign in to comment.