Skip to content

Commit e2385e0

Browse files
committed
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
1 parent 8c19925 commit e2385e0

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

lldb/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -401,12 +401,14 @@ TEST_F(SymbolFilePDBTests, TestNestedClassTypes) {
401401
// and one is global. We process correctly this case and create the same
402402
// compiler type for both, but `FindTypes` may return more than one type
403403
// (with the same compiler type) because the symbols have different IDs.
404+
405+
TypeMap more_results;
404406
auto ClassCompilerDeclCtx = CompilerDeclContext(clang_ast_ctx, ClassDeclCtx);
405407
symfile->FindTypes(ConstString("NestedClass"), &ClassCompilerDeclCtx, 0,
406-
searched_files, results);
407-
EXPECT_LE(1u, results.GetSize());
408+
searched_files, more_results);
409+
EXPECT_LE(1u, more_results.GetSize());
408410

409-
lldb::TypeSP udt_type = results.GetTypeAtIndex(0);
411+
lldb::TypeSP udt_type = more_results.GetTypeAtIndex(0);
410412
EXPECT_EQ(ConstString("NestedClass"), udt_type->GetName());
411413

412414
CompilerType compiler_type = udt_type->GetForwardCompilerType();
@@ -568,19 +570,17 @@ TEST_F(SymbolFilePDBTests, TestMaxMatches) {
568570
TypeMap results;
569571
const ConstString name("ClassTypedef");
570572
symfile->FindTypes(name, nullptr, 0, searched_files, results);
571-
// Try to limit ourselves from 1 to 10 results, otherwise we could be doing
572-
// this thousands of times.
573-
// The idea is just to make sure that for a variety of values, the number of
574-
// limited results always
575-
// comes out to the number we are expecting.
576-
uint32_t iterations = std::min(results.GetSize(), 10u);
573+
// Try to limit ourselves from 1 to 10 results, otherwise we could
574+
// be doing this thousands of times. The idea is just to make sure
575+
// that for a variety of values, the number of limited results
576+
// always comes out to the number we are expecting.
577577
uint32_t num_results = results.GetSize();
578+
uint32_t iterations = std::min(num_results, 10u);
578579
for (uint32_t i = 1; i <= iterations; ++i) {
579-
symfile->FindTypes(name, nullptr, i, searched_files, results);
580-
uint32_t num_limited_results = results.GetSize() - num_results;
580+
TypeMap more_results;
581+
symfile->FindTypes(name, nullptr, i, searched_files, more_results);
582+
uint32_t num_limited_results = more_results.GetSize();
581583
EXPECT_EQ(i, num_limited_results);
582-
EXPECT_EQ(num_limited_results, results.GetSize());
583-
num_results = num_limited_results;
584584
}
585585
}
586586

0 commit comments

Comments
 (0)