Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
ludviggunne committed Jan 14, 2025
1 parent 7fe105c commit 185e56d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/testsymboldatabase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,7 @@ class TestSymbolDatabase : public TestFixture {
TEST_CASE(symboldatabase106);
TEST_CASE(symboldatabase107);
TEST_CASE(symboldatabase108);
TEST_CASE(symboldatabase109); // #13553

TEST_CASE(createSymbolDatabaseFindAllScopes1);
TEST_CASE(createSymbolDatabaseFindAllScopes2);
Expand Down Expand Up @@ -5710,6 +5711,18 @@ class TestSymbolDatabase : public TestFixture {
}
}

void symboldatabase109() { // #13553
GET_SYMBOL_DB("extern \"C\" {\n"
"class Base {\n"
"public:\n"
" virtual void show(void) = 0;\n"
"};\n"
"}\n");
const Token *f = db ? Token::findsimplematch(tokenizer.tokens(), "show") : nullptr;
ASSERT(f != nullptr);
ASSERT(f && f->function() && f->function()->hasVirtualSpecifier());
}

void createSymbolDatabaseFindAllScopes1() {
GET_SYMBOL_DB("void f() { union {int x; char *p;} a={0}; }");
ASSERT(db->scopeList.size() == 3);
Expand Down

0 comments on commit 185e56d

Please sign in to comment.