Skip to content

Commit 2d9a26f

Browse files
committed
add test for #14604
1 parent 995a766 commit 2d9a26f

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

test/testsimplifytypedef.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@ class TestSimplifyTypedef : public TestFixture {
262262
TEST_CASE(typedefInfo2);
263263
TEST_CASE(typedefInfo3);
264264
TEST_CASE(typedefInfo4);
265+
TEST_CASE(typedefInfo5);
265266
}
266267

267268
class TokenizerTest final : public Tokenizer
@@ -4683,6 +4684,23 @@ class TestSimplifyTypedef : public TestFixture {
46834684
" <info name=\"coord\" file=\"file.c\" line=\"1\" column=\"1\" tagline=\"1\" tagcolumn=\"16\" used=\"1\" isFunctionPointer=\"0\"/>\n"
46844685
" </typedef-info>\n", xml);
46854686
}
4687+
4688+
void typedefInfo5() {
4689+
const std::string xml = dumpTypedefInfo("typedef (*pfi)(void);\n");
4690+
ASSERT_EQUALS(" <typedef-info>\n"
4691+
" <info name=\"pfi\" file=\"file.c\" line=\"1\" column=\"1\" used=\"0\" isFunctionPointer=\"1\">\n"
4692+
" <token line=\"1\" column=\"1\" str=\"typedef\"/>\n"
4693+
" <token line=\"1\" column=\"0\" str=\"int\"/>\n"
4694+
" <token line=\"1\" column=\"9\" str=\"(\"/>\n"
4695+
" <token line=\"1\" column=\"10\" str=\"*\"/>\n"
4696+
" <token line=\"1\" column=\"11\" str=\"pfi\"/>\n"
4697+
" <token line=\"1\" column=\"14\" str=\")\"/>\n"
4698+
" <token line=\"1\" column=\"15\" str=\"(\"/>\n"
4699+
" <token line=\"1\" column=\"16\" str=\"void\"/>\n"
4700+
" <token line=\"1\" column=\"20\" str=\")\"/>\n"
4701+
" </info>\n"
4702+
" </typedef-info>\n", xml);
4703+
}
46864704
};
46874705

46884706
REGISTER_TEST(TestSimplifyTypedef)

0 commit comments

Comments
 (0)