Improve test coverage for va_end() called before va_start()

This commit is contained in:
Dmitry-Me 2017-10-14 19:28:26 +03:00
parent e4de220a2d
commit 2c040096ca
1 changed files with 7 additions and 0 deletions

View File

@ -184,6 +184,13 @@ private:
"}");
ASSERT_EQUALS("[test.cpp:5]: (error) va_list 'arg_ptr' used before va_start() was called.\n", errout.str());
check("void Format(char* szFormat, char (*szBuffer)[_Size], ...) {\n"
" va_list arg_ptr;\n"
" va_end(arg_ptr);\n"
"}");
ASSERT_EQUALS("[test.cpp:3]: (error) va_list 'arg_ptr' used before va_start() was called.\n", errout.str());
check("void Format(char* szFormat, char (*szBuffer)[_Size], ...) {\n"
" va_list arg_ptr;\n"
" va_start(arg_ptr, szBuffer);\n"