[PATCH 1/2] kernel32/tests: Don't call function in assert()

Daniel Lehman dlehman25 at gmail.com
Mon Feb 6 23:07:04 CST 2017


when -DNDEBUG is defined, gcc throws warnings like:

n file included from ../../../../dlls/kernel32/tests/debugger.c:27:0:
../../../../dlls/kernel32/tests/debugger.c: In function ‘crash_and_debug’:
../../../../include/wine/test.h:112:82: warning: ‘dbg_blackbox.argc’ may be used uninitialized in this function [-Wmaybe-uninitialized]
 #define ok_(file, line)       (winetest_set_location(file, line), 0) ? (void)0 : winetest_ok
                                                                                  ^
../../../../dlls/kernel32/tests/debugger.c:273:25: note: ‘dbg_blackbox.argc’ was declared here
     debugger_blackbox_t dbg_blackbox;
                         ^

Signed-off-by: Daniel Lehman <dlehman25 at gmail.com>
---
 dlls/kernel32/tests/debugger.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/kernel32/tests/debugger.c b/dlls/kernel32/tests/debugger.c
index 82faf3f..759234c 100644
--- a/dlls/kernel32/tests/debugger.c
+++ b/dlls/kernel32/tests/debugger.c
@@ -365,8 +365,8 @@ static void crash_and_debug(HKEY hkey, const char* argv0, const char* dbgtasks)
 #endif
     ok(wait_code == WAIT_OBJECT_0, "Timed out waiting for the debugger\n");
 
-    assert(load_blackbox(childlog, &crash_blackbox, sizeof(crash_blackbox)));
-    assert(load_blackbox(dbglog, &dbg_blackbox, sizeof(dbg_blackbox)));
+    ok(load_blackbox(childlog, &crash_blackbox, sizeof(crash_blackbox)), "failed to open: %s\n", childlog);
+    ok(load_blackbox(dbglog, &dbg_blackbox, sizeof(dbg_blackbox)), "failed to open: %s\n", dbglog);
 
     ok(dbg_blackbox.argc == 6, "wrong debugger argument count: %d\n", dbg_blackbox.argc);
     ok(dbg_blackbox.pid == crash_blackbox.pid, "the child and debugged pids don't match: %d != %d\n", crash_blackbox.pid, dbg_blackbox.pid);
-- 
2.7.4




More information about the wine-patches mailing list