[NFC][Coroutines] Use structured binding with llvm::enumerate in CoroSplit (#116879)
[llvm-project.git] / lldb / unittests / Symbol / LocateSymbolFileTest.cpp
blob87f358b88eae75c5cb6ce1908e10de269e52b597
1 //===-- SymbolsTest.cpp ---------------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 #include "gtest/gtest.h"
11 #include "TestingSupport/SubsystemRAII.h"
12 #include "lldb/Core/ModuleSpec.h"
13 #include "lldb/Core/PluginManager.h"
14 #include "lldb/Host/FileSystem.h"
15 #include "lldb/Host/HostInfo.h"
16 #include "lldb/Target/Target.h"
18 using namespace lldb_private;
20 namespace {
21 class SymbolsTest : public ::testing::Test {
22 public:
23 SubsystemRAII<FileSystem, HostInfo> subsystems;
25 } // namespace
27 TEST_F(
28 SymbolsTest,
29 TerminateLocateExecutableSymbolFileForUnknownExecutableAndUnknownSymbolFile) {
30 ModuleSpec module_spec;
31 FileSpecList search_paths = Target::GetDefaultDebugFileSearchPaths();
32 FileSpec symbol_file_spec =
33 PluginManager::LocateExecutableSymbolFile(module_spec, search_paths);
34 EXPECT_TRUE(symbol_file_spec.GetFilename().IsEmpty());
37 TEST_F(SymbolsTest,
38 LocateExecutableSymbolFileForUnknownExecutableAndMissingSymbolFile) {
39 ModuleSpec module_spec;
40 // using a GUID here because the symbol file shouldn't actually exist on disk
41 module_spec.GetSymbolFileSpec().SetFile(
42 "4A524676-B24B-4F4E-968A-551D465EBAF1.so", FileSpec::Style::native);
43 FileSpecList search_paths = Target::GetDefaultDebugFileSearchPaths();
44 FileSpec symbol_file_spec =
45 PluginManager::LocateExecutableSymbolFile(module_spec, search_paths);
46 EXPECT_TRUE(symbol_file_spec.GetFilename().IsEmpty());