@@ -401,12 +401,14 @@ TEST_F(SymbolFilePDBTests, TestNestedClassTypes) {
401
401
// and one is global. We process correctly this case and create the same
402
402
// compiler type for both, but `FindTypes` may return more than one type
403
403
// (with the same compiler type) because the symbols have different IDs.
404
+
405
+ TypeMap more_results;
404
406
auto ClassCompilerDeclCtx = CompilerDeclContext (clang_ast_ctx, ClassDeclCtx);
405
407
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 ());
408
410
409
- lldb::TypeSP udt_type = results .GetTypeAtIndex (0 );
411
+ lldb::TypeSP udt_type = more_results .GetTypeAtIndex (0 );
410
412
EXPECT_EQ (ConstString (" NestedClass" ), udt_type->GetName ());
411
413
412
414
CompilerType compiler_type = udt_type->GetForwardCompilerType ();
@@ -568,19 +570,17 @@ TEST_F(SymbolFilePDBTests, TestMaxMatches) {
568
570
TypeMap results;
569
571
const ConstString name (" ClassTypedef" );
570
572
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.
577
577
uint32_t num_results = results.GetSize ();
578
+ uint32_t iterations = std::min (num_results, 10u );
578
579
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 ();
581
583
EXPECT_EQ (i, num_limited_results);
582
- EXPECT_EQ (num_limited_results, results.GetSize ());
583
- num_results = num_limited_results;
584
584
}
585
585
}
586
586
0 commit comments