crt: tests: update t_winmain_assert It is unclear what is the purpose of t_winmain_assert; it could be a simple test program to observe behavior of assert() in an application using `WinMain` as the entry point. While this test uses `WinMain` as its entry point, it does not actually create any windows, which allows to run it just like any other test program. Update test test to assert that `lpCmdLine` argument is non-NULL. Add t_winmain_assert to testcases/Makefile.am. Signed-off-by: Kirill Makurin <maiddaisuki@outlook.com> Signed-off-by: LIU Hao <lh_mouse@126.com>
diff --git a/mingw-w64-crt/testcases/Makefile.am b/mingw-w64-crt/testcases/Makefile.am index bea64c0..58eaf81 100644 --- a/mingw-w64-crt/testcases/Makefile.am +++ b/mingw-w64-crt/testcases/Makefile.am
@@ -103,6 +103,7 @@ t_wcstok_s \ t_wctob \ t_wctype \ + t_winmain_assert \ t_wreaddir # FIXME: the following tests are disabled on arm64ec; linking them statically
diff --git a/mingw-w64-crt/testcases/t_winmain_assert.c b/mingw-w64-crt/testcases/t_winmain_assert.c index a690c31..6b9f10a 100644 --- a/mingw-w64-crt/testcases/t_winmain_assert.c +++ b/mingw-w64-crt/testcases/t_winmain_assert.c
@@ -4,14 +4,12 @@ * No warranty is given; refer to the file DISCLAIMER.PD within this package. */ #include <assert.h> -#include <string.h> #define WIN32_LEAN_AND_MEAN #include <windows.h> int WINAPI WinMain(HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { - int argc = strlen (lpCmdLine); - assert (argc & 1); + assert (lpCmdLine != NULL); return 0; }