Skip to content

Commit ef76686

Browse files
committed
[lldb] Initialize reproducers in LocateSymbolFileTest
Since a842950 this test started using the reproducer subsystem but we never initialized it in the test. The Subsystem takes an argument, so we can't use the usual SubsystemRAII at the moment to do this for us. This just adds the initialize/terminate calls to get the test passing again.
1 parent 7de7fe5 commit ef76686

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

‎lldb/unittests/Symbol/LocateSymbolFileTest.cpp‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include "lldb/Host/HostInfo.h"
1515
#include "lldb/Symbol/LocateSymbolFile.h"
1616
#include "lldb/Target/Target.h"
17+
#include "lldb/Utility/Reproducer.h"
1718

1819
using namespace lldb_private;
1920

@@ -27,15 +28,22 @@ class SymbolsTest : public ::testing::Test {
2728
TEST_F(
2829
SymbolsTest,
2930
TerminateLocateExecutableSymbolFileForUnknownExecutableAndUnknownSymbolFile) {
31+
EXPECT_THAT_ERROR(
32+
repro::Reproducer::Initialize(repro::ReproducerMode::Off, llvm::None),
33+
llvm::Succeeded());
3034
ModuleSpec module_spec;
3135
FileSpecList search_paths = Target::GetDefaultDebugFileSearchPaths();
3236
FileSpec symbol_file_spec =
3337
Symbols::LocateExecutableSymbolFile(module_spec, search_paths);
3438
EXPECT_TRUE(symbol_file_spec.GetFilename().IsEmpty());
39+
repro::Reproducer::Terminate();
3540
}
3641

3742
TEST_F(SymbolsTest,
3843
LocateExecutableSymbolFileForUnknownExecutableAndMissingSymbolFile) {
44+
EXPECT_THAT_ERROR(
45+
repro::Reproducer::Initialize(repro::ReproducerMode::Off, llvm::None),
46+
llvm::Succeeded());
3947
ModuleSpec module_spec;
4048
// using a GUID here because the symbol file shouldn't actually exist on disk
4149
module_spec.GetSymbolFileSpec().SetFile(
@@ -44,4 +52,5 @@ TEST_F(SymbolsTest,
4452
FileSpec symbol_file_spec =
4553
Symbols::LocateExecutableSymbolFile(module_spec, search_paths);
4654
EXPECT_TRUE(symbol_file_spec.GetFilename().IsEmpty());
55+
repro::Reproducer::Terminate();
4756
}

0 commit comments

Comments
 (0)