summaryrefslogtreecommitdiffstats
path: root/lldb/unittests/Host
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/unittests/Host')
-rw-r--r--lldb/unittests/Host/CMakeLists.txt1
-rw-r--r--lldb/unittests/Host/SymbolsTest.cpp30
2 files changed, 31 insertions, 0 deletions
diff --git a/lldb/unittests/Host/CMakeLists.txt b/lldb/unittests/Host/CMakeLists.txt
index b03f8309ab6..b4739e113f4 100644
--- a/lldb/unittests/Host/CMakeLists.txt
+++ b/lldb/unittests/Host/CMakeLists.txt
@@ -1,4 +1,5 @@
add_lldb_unittest(HostTests
SocketAddressTest.cpp
SocketTest.cpp
+ SymbolsTest.cpp
)
diff --git a/lldb/unittests/Host/SymbolsTest.cpp b/lldb/unittests/Host/SymbolsTest.cpp
new file mode 100644
index 00000000000..cb59b2c5653
--- /dev/null
+++ b/lldb/unittests/Host/SymbolsTest.cpp
@@ -0,0 +1,30 @@
+//===-- SymbolsTest.cpp -----------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "gtest/gtest.h"
+#include "lldb/Host/Symbols.h"
+#include "lldb/Core/ModuleSpec.h"
+
+using namespace lldb_private;
+
+TEST(SymbolsTest, LocateExecutableSymbolFileForUnknownExecutableAndUnknownSymbolFile)
+{
+ ModuleSpec module_spec;
+ FileSpec symbol_file_spec = Symbols::LocateExecutableSymbolFile(module_spec);
+ EXPECT_TRUE(symbol_file_spec.GetFilename().IsEmpty());
+}
+
+TEST(SymbolsTest, LocateExecutableSymbolFileForUnknownExecutableAndMissingSymbolFile)
+{
+ ModuleSpec module_spec;
+ // using a GUID here because the symbol file shouldn't actually exist on disk
+ module_spec.GetSymbolFileSpec().SetFile("4A524676-B24B-4F4E-968A-551D465EBAF1.so", false);
+ FileSpec symbol_file_spec = Symbols::LocateExecutableSymbolFile(module_spec);
+ EXPECT_TRUE(symbol_file_spec.GetFilename().IsEmpty());
+}
OpenPOWER on IntegriCloud