Skip to content

Commit 5690027

Browse files
[lldb][unittest] Use shared once_flag in DiagnosticEventTest (#80788)
Incorporates the changes from #80786 to use a once_flag from `TestUtilities` instead of a local flag in order to prevent hitting an assertion that the debugger was initialized again in another test.
1 parent 93a2a8c commit 5690027

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lldb/unittests/Core/DiagnosticEventTest.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include "Plugins/Platform/MacOSX/PlatformMacOSX.h"
1212
#include "Plugins/Platform/MacOSX/PlatformRemoteMacOSX.h"
1313
#include "TestingSupport/SubsystemRAII.h"
14+
#include "TestingSupport/TestUtilities.h"
1415
#include "lldb/Core/Debugger.h"
1516
#include "lldb/Core/DebuggerEvents.h"
1617
#include "lldb/Host/FileSystem.h"
@@ -26,16 +27,14 @@ using namespace lldb_private::repro;
2627
static const constexpr std::chrono::seconds TIMEOUT(0);
2728
static const constexpr size_t DEBUGGERS = 3;
2829

29-
static std::once_flag debugger_initialize_flag;
30-
3130
namespace {
3231
class DiagnosticEventTest : public ::testing::Test {
3332
public:
3433
void SetUp() override {
3534
FileSystem::Initialize();
3635
HostInfo::Initialize();
3736
PlatformMacOSX::Initialize();
38-
std::call_once(debugger_initialize_flag,
37+
std::call_once(TestUtilities::g_debugger_initialize_flag,
3938
[]() { Debugger::Initialize(nullptr); });
4039
ArchSpec arch("x86_64-apple-macosx-");
4140
Platform::SetHostPlatform(

0 commit comments

Comments
 (0)