Skip to content

Commit 03bd671

Browse files
committed
add tests involving pointers
1 parent 4af3a04 commit 03bd671

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

test/testtokenize.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,8 @@ class TestTokenizer : public TestFixture {
219219
TEST_CASE(vardecl30);
220220
TEST_CASE(vardecl31); // function pointer init
221221
TEST_CASE(vardecl32);
222+
TEST_CASE(vardecl33);
223+
TEST_CASE(vardecl34);
222224
TEST_CASE(vardecl_stl_1);
223225
TEST_CASE(vardecl_stl_2);
224226
TEST_CASE(vardecl_stl_3);
@@ -2771,6 +2773,18 @@ class TestTokenizer : public TestFixture {
27712773
{
27722774
const char code[] = "static enum { E } f() { return E; }";
27732775
ASSERT_EQUALS("enum Anonymous0 { E } ; static enum Anonymous0 f ( ) { return E ; }", tokenizeAndStringify(code));
2776+
2777+
void vardecl33() {
2778+
{
2779+
const char code[] = "static enum { E } *f() { return NULL; }";
2780+
ASSERT_EQUALS("enum Anonymous0 { E } ; static enum Anonymous0 * f ( ) { return NULL ; }", tokenizeAndStringify(code, true, Platform::Type::Native, false));
2781+
}
2782+
}
2783+
2784+
void vardecl34() {
2785+
{
2786+
const char code[] = "static enum { E } const *f() { return NULL; }";
2787+
ASSERT_EQUALS("enum Anonymous0 { E } ; static enum Anonymous0 const * f ( ) { return NULL ; }", tokenizeAndStringify(code, true, Platform::Type::Native, false));
27742788
}
27752789
}
27762790

0 commit comments

Comments
 (0)