Skip to content

Commit 51ba854

Browse files
Update testio.cpp
1 parent d3a5a90 commit 51ba854

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

test/testio.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3371,6 +3371,20 @@ class TestIO : public TestFixture {
33713371
"}");
33723372
ASSERT_EQUALS("", errout_str());
33733373

3374+
check("enum E : uint8_t { E0 }; \n"
3375+
"void f(E e) {\n"
3376+
" printf(\"%hhu\", e);\n"
3377+
"}");
3378+
ASSERT_EQUALS("", errout_str());
3379+
3380+
check("enum E : uint8_t { E0 }; \n"
3381+
"void f(E e) {\n"
3382+
" printf(\"%lu\", e);\n"
3383+
"}");
3384+
TODO_ASSERT_EQUALS("[test.cpp:3]: (warning) %lu in format string (no. 1) requires 'unsigned long' but the argument type is 'uint8_t'.\n",
3385+
"",
3386+
errout_str());
3387+
33743388
check("void f() {\n"
33753389
" printf(\"%lu\", sizeof(char));\n"
33763390
"}\n", dinit(CheckOptions, $.portability = true, $.platform = Platform::Type::Win64));

0 commit comments

Comments
 (0)