summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2019-10-02 00:06:27 +0000
committerAdrian Prantl <aprantl@apple.com>2019-10-02 00:06:27 +0000
commite2385e089d838d9320303378570751e40bbad6e2 (patch)
tree9d46852532a9a576f2db625a329942b6d21379bd
parent8c19925f42901db51dbbf3e3a7b1a789cd2bc646 (diff)
downloadbcm5719-llvm-e2385e089d838d9320303378570751e40bbad6e2.tar.gz
bcm5719-llvm-e2385e089d838d9320303378570751e40bbad6e2.zip
Make yet another attempt in restoring SymbolFilePDBTests
The original test was passing false to the append argument of FindTypes (the only use of this feature!). This patch now replicates that by passing a fresh TypeMap into the function where applicable. llvm-svn: 373409
-rw-r--r--lldb/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/lldb/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp b/lldb/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp
index 5908bea135e..909ef601e44 100644
--- a/lldb/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp
+++ b/lldb/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp
@@ -401,12 +401,14 @@ TEST_F(SymbolFilePDBTests, TestNestedClassTypes) {
// and one is global. We process correctly this case and create the same
// compiler type for both, but `FindTypes` may return more than one type
// (with the same compiler type) because the symbols have different IDs.
+
+ TypeMap more_results;
auto ClassCompilerDeclCtx = CompilerDeclContext(clang_ast_ctx, ClassDeclCtx);
symfile->FindTypes(ConstString("NestedClass"), &ClassCompilerDeclCtx, 0,
- searched_files, results);
- EXPECT_LE(1u, results.GetSize());
+ searched_files, more_results);
+ EXPECT_LE(1u, more_results.GetSize());
- lldb::TypeSP udt_type = results.GetTypeAtIndex(0);
+ lldb::TypeSP udt_type = more_results.GetTypeAtIndex(0);
EXPECT_EQ(ConstString("NestedClass"), udt_type->GetName());
CompilerType compiler_type = udt_type->GetForwardCompilerType();
@@ -568,19 +570,17 @@ TEST_F(SymbolFilePDBTests, TestMaxMatches) {
TypeMap results;
const ConstString name("ClassTypedef");
symfile->FindTypes(name, nullptr, 0, searched_files, results);
- // Try to limit ourselves from 1 to 10 results, otherwise we could be doing
- // this thousands of times.
- // The idea is just to make sure that for a variety of values, the number of
- // limited results always
- // comes out to the number we are expecting.
- uint32_t iterations = std::min(results.GetSize(), 10u);
+ // Try to limit ourselves from 1 to 10 results, otherwise we could
+ // be doing this thousands of times. The idea is just to make sure
+ // that for a variety of values, the number of limited results
+ // always comes out to the number we are expecting.
uint32_t num_results = results.GetSize();
+ uint32_t iterations = std::min(num_results, 10u);
for (uint32_t i = 1; i <= iterations; ++i) {
- symfile->FindTypes(name, nullptr, i, searched_files, results);
- uint32_t num_limited_results = results.GetSize() - num_results;
+ TypeMap more_results;
+ symfile->FindTypes(name, nullptr, i, searched_files, more_results);
+ uint32_t num_limited_results = more_results.GetSize();
EXPECT_EQ(i, num_limited_results);
- EXPECT_EQ(num_limited_results, results.GetSize());
- num_results = num_limited_results;
}
}
OpenPOWER on IntegriCloud