Skip to content

Commit 87bf1af

Browse files
[lldb][PDB] Update max matches test for type queries (#75813)
NestedClass will be found via Class::NestedClass and ClassTypedef::NestedClass. So the first part of the test gets 2 results as the default is to find all matching types. In the next part, we ask for only the first match and expect to get only 1 of those two possible results.
1 parent 3cd1e73 commit 87bf1af

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

lldb/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -579,24 +579,14 @@ TEST_F(SymbolFilePDBTests, TestMaxMatches) {
579579
static_cast<SymbolFilePDB *>(module->GetSymbolFile());
580580

581581
// Make a type query object we can use for all types and for one type
582-
//
583-
// TODO: this test was ported as is and before the new FindTypes patch
584-
// this test was trying to find all matches, and it would find one. Then
585-
// it would limit its number of matches from zero to < the minimum of the
586-
// number of matches that were found in the first search, or 10. Then it
587-
// would set the max matches to that number (1) and verify it was the
588-
// same (1). This test should be fixed in the figure by updating the
589-
// lldb/unittests/SymbolFile/PDB/Inputs/test-pdb-types.cpp file and
590-
// recompiling the exe + pdb file so that there are actually multiple
591-
// types whose basename is "ClassTypedef" or any other type. Now type
592-
// matches only return a single match, or all of the matches.
593-
TypeQuery query("ClassTypedef");
582+
TypeQuery query("NestedClass");
594583
{
595584
// Find all types that match
596585
TypeResults query_results;
597586
symfile->FindTypes(query, query_results);
598587
TypeMap &results = query_results.GetTypeMap();
599-
EXPECT_EQ(results.GetSize(), 1u);
588+
// We expect to find Class::NestedClass and ClassTypedef::NestedClass.
589+
EXPECT_EQ(results.GetSize(), 2u);
600590
}
601591
{
602592
// Find a single type that matches

0 commit comments

Comments
 (0)