Fix PDB unit tests for the GetSymbolVendor deletion

llvm-svn: 368265
This commit is contained in:
Pavel Labath 2019-08-08 08:22:26 +00:00
parent 7ca980edcd
commit 959e603456
1 changed files with 15 additions and 36 deletions

View File

@ -27,7 +27,6 @@
#include "lldb/Symbol/ClangASTContext.h"
#include "lldb/Symbol/CompileUnit.h"
#include "lldb/Symbol/LineTable.h"
#include "lldb/Symbol/SymbolVendor.h"
#include "lldb/Utility/ArchSpec.h"
#include "lldb/Utility/FileSpec.h"
@ -151,9 +150,7 @@ TEST_F(SymbolFilePDBTests, TestAbilitiesForPDB) {
ArchSpec aspec("i686-pc-windows");
lldb::ModuleSP module = std::make_shared<Module>(fspec, aspec);
SymbolVendor *plugin = module->GetSymbolVendor();
EXPECT_NE(nullptr, plugin);
SymbolFile *symfile = plugin->GetSymbolFile();
SymbolFile *symfile = module->GetSymbolFile();
EXPECT_NE(nullptr, symfile);
EXPECT_EQ(symfile->GetPluginName(), SymbolFilePDB::GetPluginNameStatic());
@ -169,9 +166,7 @@ TEST_F(SymbolFilePDBTests, TestResolveSymbolContextBasename) {
ArchSpec aspec("i686-pc-windows");
lldb::ModuleSP module = std::make_shared<Module>(fspec, aspec);
SymbolVendor *plugin = module->GetSymbolVendor();
EXPECT_NE(nullptr, plugin);
SymbolFile *symfile = plugin->GetSymbolFile();
SymbolFile *symfile = module->GetSymbolFile();
FileSpec header_spec("test-pdb.cpp");
SymbolContextList sc_list;
@ -189,9 +184,7 @@ TEST_F(SymbolFilePDBTests, TestResolveSymbolContextFullPath) {
ArchSpec aspec("i686-pc-windows");
lldb::ModuleSP module = std::make_shared<Module>(fspec, aspec);
SymbolVendor *plugin = module->GetSymbolVendor();
EXPECT_NE(nullptr, plugin);
SymbolFile *symfile = plugin->GetSymbolFile();
SymbolFile *symfile = module->GetSymbolFile();
FileSpec header_spec(
R"spec(D:\src\llvm\tools\lldb\unittests\SymbolFile\PDB\Inputs\test-pdb.cpp)spec");
@ -212,9 +205,7 @@ TEST_F(SymbolFilePDBTests, TestLookupOfHeaderFileWithInlines) {
ArchSpec aspec("i686-pc-windows");
lldb::ModuleSP module = std::make_shared<Module>(fspec, aspec);
SymbolVendor *plugin = module->GetSymbolVendor();
EXPECT_NE(nullptr, plugin);
SymbolFile *symfile = plugin->GetSymbolFile();
SymbolFile *symfile = module->GetSymbolFile();
FileSpec header_specs[] = {FileSpec("test-pdb.h"),
FileSpec("test-pdb-nested.h")};
@ -240,9 +231,7 @@ TEST_F(SymbolFilePDBTests, TestLookupOfHeaderFileWithNoInlines) {
ArchSpec aspec("i686-pc-windows");
lldb::ModuleSP module = std::make_shared<Module>(fspec, aspec);
SymbolVendor *plugin = module->GetSymbolVendor();
EXPECT_NE(nullptr, plugin);
SymbolFile *symfile = plugin->GetSymbolFile();
SymbolFile *symfile = module->GetSymbolFile();
FileSpec header_specs[] = {FileSpec("test-pdb.h"),
FileSpec("test-pdb-nested.h")};
@ -262,8 +251,7 @@ TEST_F(SymbolFilePDBTests, TestLineTablesMatchAll) {
ArchSpec aspec("i686-pc-windows");
lldb::ModuleSP module = std::make_shared<Module>(fspec, aspec);
SymbolVendor *plugin = module->GetSymbolVendor();
SymbolFile *symfile = plugin->GetSymbolFile();
SymbolFile *symfile = module->GetSymbolFile();
FileSpec source_file("test-pdb.cpp");
FileSpec header1("test-pdb.h");
@ -312,8 +300,7 @@ TEST_F(SymbolFilePDBTests, TestLineTablesMatchSpecific) {
ArchSpec aspec("i686-pc-windows");
lldb::ModuleSP module = std::make_shared<Module>(fspec, aspec);
SymbolVendor *plugin = module->GetSymbolVendor();
SymbolFile *symfile = plugin->GetSymbolFile();
SymbolFile *symfile = module->GetSymbolFile();
FileSpec source_file("test-pdb.cpp");
FileSpec header1("test-pdb.h");
@ -362,9 +349,8 @@ TEST_F(SymbolFilePDBTests, TestSimpleClassTypes) {
ArchSpec aspec("i686-pc-windows");
lldb::ModuleSP module = std::make_shared<Module>(fspec, aspec);
SymbolVendor *plugin = module->GetSymbolVendor();
SymbolFilePDB *symfile =
static_cast<SymbolFilePDB *>(plugin->GetSymbolFile());
static_cast<SymbolFilePDB *>(module->GetSymbolFile());
llvm::pdb::IPDBSession &session = symfile->GetPDBSession();
llvm::DenseSet<SymbolFile *> searched_files;
TypeMap results;
@ -384,9 +370,8 @@ TEST_F(SymbolFilePDBTests, TestNestedClassTypes) {
ArchSpec aspec("i686-pc-windows");
lldb::ModuleSP module = std::make_shared<Module>(fspec, aspec);
SymbolVendor *plugin = module->GetSymbolVendor();
SymbolFilePDB *symfile =
static_cast<SymbolFilePDB *>(plugin->GetSymbolFile());
static_cast<SymbolFilePDB *>(module->GetSymbolFile());
llvm::pdb::IPDBSession &session = symfile->GetPDBSession();
llvm::DenseSet<SymbolFile *> searched_files;
TypeMap results;
@ -438,9 +423,8 @@ TEST_F(SymbolFilePDBTests, TestClassInNamespace) {
ArchSpec aspec("i686-pc-windows");
lldb::ModuleSP module = std::make_shared<Module>(fspec, aspec);
SymbolVendor *plugin = module->GetSymbolVendor();
SymbolFilePDB *symfile =
static_cast<SymbolFilePDB *>(plugin->GetSymbolFile());
static_cast<SymbolFilePDB *>(module->GetSymbolFile());
llvm::pdb::IPDBSession &session = symfile->GetPDBSession();
llvm::DenseSet<SymbolFile *> searched_files;
TypeMap results;
@ -484,9 +468,8 @@ TEST_F(SymbolFilePDBTests, TestEnumTypes) {
ArchSpec aspec("i686-pc-windows");
lldb::ModuleSP module = std::make_shared<Module>(fspec, aspec);
SymbolVendor *plugin = module->GetSymbolVendor();
SymbolFilePDB *symfile =
static_cast<SymbolFilePDB *>(plugin->GetSymbolFile());
static_cast<SymbolFilePDB *>(module->GetSymbolFile());
llvm::pdb::IPDBSession &session = symfile->GetPDBSession();
llvm::DenseSet<SymbolFile *> searched_files;
const char *EnumsToCheck[] = {"Enum", "ShortEnum"};
@ -530,9 +513,8 @@ TEST_F(SymbolFilePDBTests, TestTypedefs) {
ArchSpec aspec("i686-pc-windows");
lldb::ModuleSP module = std::make_shared<Module>(fspec, aspec);
SymbolVendor *plugin = module->GetSymbolVendor();
SymbolFilePDB *symfile =
static_cast<SymbolFilePDB *>(plugin->GetSymbolFile());
static_cast<SymbolFilePDB *>(module->GetSymbolFile());
llvm::pdb::IPDBSession &session = symfile->GetPDBSession();
llvm::DenseSet<SymbolFile *> searched_files;
TypeMap results;
@ -565,9 +547,8 @@ TEST_F(SymbolFilePDBTests, TestRegexNameMatch) {
ArchSpec aspec("i686-pc-windows");
lldb::ModuleSP module = std::make_shared<Module>(fspec, aspec);
SymbolVendor *plugin = module->GetSymbolVendor();
SymbolFilePDB *symfile =
static_cast<SymbolFilePDB *>(plugin->GetSymbolFile());
static_cast<SymbolFilePDB *>(module->GetSymbolFile());
TypeMap results;
symfile->FindTypesByRegex(RegularExpression(".*"), 0, results);
@ -584,9 +565,8 @@ TEST_F(SymbolFilePDBTests, TestMaxMatches) {
ArchSpec aspec("i686-pc-windows");
lldb::ModuleSP module = std::make_shared<Module>(fspec, aspec);
SymbolVendor *plugin = module->GetSymbolVendor();
SymbolFilePDB *symfile =
static_cast<SymbolFilePDB *>(plugin->GetSymbolFile());
static_cast<SymbolFilePDB *>(module->GetSymbolFile());
llvm::DenseSet<SymbolFile *> searched_files;
TypeMap results;
const ConstString name("ClassTypedef");
@ -611,9 +591,8 @@ TEST_F(SymbolFilePDBTests, TestNullName) {
ArchSpec aspec("i686-pc-windows");
lldb::ModuleSP module = std::make_shared<Module>(fspec, aspec);
SymbolVendor *plugin = module->GetSymbolVendor();
SymbolFilePDB *symfile =
static_cast<SymbolFilePDB *>(plugin->GetSymbolFile());
static_cast<SymbolFilePDB *>(module->GetSymbolFile());
llvm::DenseSet<SymbolFile *> searched_files;
TypeMap results;
uint32_t num_results = symfile->FindTypes(ConstString(), nullptr, false, 0,