From 2c040096cae98ae6dfc1e85abc52568c52c8f1b2 Mon Sep 17 00:00:00 2001 From: Dmitry-Me Date: Sat, 14 Oct 2017 19:28:26 +0300 Subject: [PATCH] Improve test coverage for va_end() called before va_start() --- test/testvaarg.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/testvaarg.cpp b/test/testvaarg.cpp index 3c9c268b8..6b6ee30db 100644 --- a/test/testvaarg.cpp +++ b/test/testvaarg.cpp @@ -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"