[PATCH] user32: move functional code out of assert() (Coverity)

Marcus Meissner meissner at suse.de
Wed Feb 23 10:33:20 CST 2011


Hi,

assert()s can go away with -DNDEBUG, so better not do stuff in
them. Also not really appropriate for the testsuite, just use ok().

Ciao, Marcus
---
 dlls/user32/tests/win.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c
index cca222f..603e93e 100644
--- a/dlls/user32/tests/win.c
+++ b/dlls/user32/tests/win.c
@@ -2897,6 +2897,7 @@ static void test_capture_4(void)
     HWND hwnd;
     WNDCLASSA wclass;
     HINSTANCE hInstance = GetModuleHandleA( NULL );
+    ATOM aclass;
 
     if (!pGetGUIThreadInfo)
     {
@@ -2913,10 +2914,11 @@ static void test_capture_4(void)
     wclass.lpszMenuName  = 0;
     wclass.cbClsExtra    = 0;
     wclass.cbWndExtra    = 0;
-    assert (RegisterClassA( &wclass ));
-    assert (hwnd = CreateWindowA( wclass.lpszClassName, "MenuTest",
-                                  WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, 0,
-                                  400, 200, NULL, NULL, hInstance, NULL) );
+    aclass = RegisterClassA( &wclass );
+    ok( aclass, "RegisterClassA failed with error %d\n", GetLastError());
+    hwnd = CreateWindowA( wclass.lpszClassName, "MenuTest",
+                          WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, 0,
+                          400, 200, NULL, NULL, hInstance, NULL);
     ok(hwnd != NULL, "CreateWindowEx failed with error %d\n", GetLastError());
     if (!hwnd) return;
     hmenu = CreatePopupMenu();
-- 
1.7.1



More information about the wine-patches mailing list