Skip to content

Commit 030b120

Browse files
Update testsimplifytypedef.cpp
1 parent 10bab82 commit 030b120

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/testsimplifytypedef.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ class TestSimplifyTypedef : public TestFixture {
223223
TEST_CASE(simplifyTypedef155);
224224
TEST_CASE(simplifyTypedef156);
225225
TEST_CASE(simplifyTypedef157);
226+
TEST_CASE(simplifyTypedef158);
226227

227228
TEST_CASE(simplifyTypedefFunction1);
228229
TEST_CASE(simplifyTypedefFunction2); // ticket #1685
@@ -3773,6 +3774,16 @@ class TestSimplifyTypedef : public TestFixture {
37733774
ASSERT_EQUALS(exp, tok(code));
37743775
}
37753776

3777+
void simplifyTypedef158() {
3778+
const char code[] = "void f() {\n"
3779+
" typedef const char* const triple[3];\n"
3780+
" static const triple data[] = { {\"a\" , \"b\" , \"c\" } };\n"
3781+
"}\n";
3782+
const char exp[] = "void f ( ) { static const char * const data [ ] [ 3 ] = { { \"a\" , \"b\" , \"c\" } } ; }";
3783+
const char cur[] = "void f ( ) { static const char * const const data [ ] [ 3 ] = { { \"a\" , \"b\" , \"c\" } } ; }";
3784+
TODO_ASSERT_EQUALS(exp, cur, tok(code));
3785+
}
3786+
37763787
void simplifyTypedefFunction1() {
37773788
{
37783789
const char code[] = "typedef void (*my_func)();\n"

0 commit comments

Comments
 (0)