Nikolay Sivov : comctl32/tests: Replace some asserts with regular test calls.

Alexandre Julliard julliard at winehq.org
Tue Feb 20 16:44:52 CST 2018


Module: wine
Branch: master
Commit: acc44e5d44d0fb340ac2387d2be3e925d4434f71
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=acc44e5d44d0fb340ac2387d2be3e925d4434f71

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Tue Feb 20 09:38:18 2018 +0300

comctl32/tests: Replace some asserts with regular test calls.

Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/comctl32/tests/listbox.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/dlls/comctl32/tests/listbox.c b/dlls/comctl32/tests/listbox.c
index 6759242..23c2e2b 100644
--- a/dlls/comctl32/tests/listbox.c
+++ b/dlls/comctl32/tests/listbox.c
@@ -17,7 +17,6 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
-#include <assert.h>
 #include <stdarg.h>
 #include <stdio.h>
 
@@ -292,10 +291,10 @@ static void test_ownerdraw(void)
     RECT rc;
 
     parent = create_parent();
-    assert(parent);
+    ok(parent != NULL, "Failed to create parent window.\n");
 
     hLB = create_listbox(LBS_OWNERDRAWFIXED | WS_CHILD | WS_VISIBLE, parent);
-    assert(hLB);
+    ok(hLB != NULL, "Failed to create listbox window.\n");
 
     SetForegroundWindow(hLB);
     UpdateWindow(hLB);
@@ -334,7 +333,7 @@ static void test_LB_SELITEMRANGE(void)
     INT ret;
 
     hLB = create_listbox(LBS_EXTENDEDSEL, 0);
-    assert(hLB);
+    ok(hLB != NULL, "Failed to create listbox window.\n");
 
     listbox_query(hLB, &answer);
     listbox_test_query(test_nosel, answer);
@@ -594,7 +593,7 @@ static void test_listbox_LB_DIR(void)
      */
     hList = CreateWindowA( WC_LISTBOXA, "list test", WS_VISIBLE|WS_POPUP,
                           1, 1, 600, 100, NULL, NULL, NULL, NULL );
-    assert(hList);
+    ok(hList != NULL, "Failed to create listbox window.\n");
 
     /* Test for standard usage */
 
@@ -1076,6 +1075,7 @@ static void test_listbox_dlgdir(void)
     char * p;
     char driveletter;
     HANDLE file;
+    BOOL ret;
 
     file = CreateFileA( "wtest1.tmp.c", GENERIC_READ|GENERIC_WRITE, 0, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL );
     ok(file != INVALID_HANDLE_VALUE, "Error creating the test file: %d\n", GetLastError());
@@ -1088,7 +1088,8 @@ static void test_listbox_dlgdir(void)
      */
 
     hInst = GetModuleHandleA(0);
-    if (!RegisterListboxWindowClass(hInst)) assert(0);
+    ret = RegisterListboxWindowClass(hInst);
+    ok(ret, "Failed to register test class.\n");
 
     hWnd = CreateWindowA("ListboxContainerClass", "ListboxContainerClass",
                     WS_OVERLAPPEDWINDOW | WS_VISIBLE,




More information about the wine-cvs mailing list