Michael Stefaniuc : comctl32/tests: Simplify comparison with empty string.

Alexandre Julliard julliard at winehq.org
Tue Oct 22 16:57:01 CDT 2019


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

Author: Michael Stefaniuc <mstefani at winehq.org>
Date:   Tue Oct 22 01:24:31 2019 +0200

comctl32/tests: Simplify comparison with empty string.

Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/comctl32/tests/edit.c  | 6 +++---
 dlls/comctl32/tests/pager.c | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/dlls/comctl32/tests/edit.c b/dlls/comctl32/tests/edit.c
index 6013cafb59..111545d298 100644
--- a/dlls/comctl32/tests/edit.c
+++ b/dlls/comctl32/tests/edit.c
@@ -3245,13 +3245,13 @@ static void test_cue_banner(void)
     hwnd_edit = create_editcontrolW(ES_AUTOHSCROLL | ES_AUTOVSCROLL, 0);
 
     ret = SendMessageW(hwnd_edit, EM_GETCUEBANNER, (WPARAM)getcuetestW, 5);
-    if (lstrcmpW(getcuetestW, emptyW) != 0)
+    if (getcuetestW[0])
     {
         win_skip("skipping for Win XP and 2003 Server.\n");
         DestroyWindow(hwnd_edit);
         return;
     }
-    ok(lstrcmpW(getcuetestW, emptyW) == 0, "First char is %c\n", getcuetestW[0]);
+    ok(!getcuetestW[0], "First char is %c\n", getcuetestW[0]);
     ok(ret == FALSE, "EM_GETCUEBANNER should have returned FALSE.\n");
 
     lstrcpyW(getcuetestW, testcmp1W);
@@ -3284,7 +3284,7 @@ static void test_cue_banner(void)
 
     ret = SendMessageW(hwnd_edit, EM_GETCUEBANNER, (WPARAM)getcuetestW, 5);
     ok(ret == TRUE, "EM_GETCUEBANNER should have returned TRUE.\n");
-    ok(lstrcmpW(getcuetestW, emptyW) == 0, "EM_GETCUEBANNER returned string %s.\n", wine_dbgstr_w(getcuetestW));
+    ok(!getcuetestW[0], "EM_GETCUEBANNER returned string %s.\n", wine_dbgstr_w(getcuetestW));
 
     /* EM_GETCUEBANNER's buffer size includes null char */
     ret = SendMessageW(hwnd_edit, EM_SETCUEBANNER, 0, (LPARAM)testcmp1W);
diff --git a/dlls/comctl32/tests/pager.c b/dlls/comctl32/tests/pager.c
index 087e4452cc..0e2c25b08a 100644
--- a/dlls/comctl32/tests/pager.c
+++ b/dlls/comctl32/tests/pager.c
@@ -611,7 +611,7 @@ static void notify_generic_text_handler(CHAR **text, INT *text_max)
         send_data = (notify_test_info.test_id == CONVERT_SEND ? test_convert_send_data : test_dont_convert_send_data)
                     + notify_test_info.sub_test_id;
         if (notify_test_info.flags & ZERO_SEND)
-            ok(!lstrcmpA(*text, empty_a), "Code 0x%08x test 0x%08x sub test %d expect empty text, got %s\n",
+            ok(!*text[0], "Code 0x%08x test 0x%08x sub test %d expect empty text, got %s\n",
                notify_test_info.unicode, notify_test_info.test_id, notify_test_info.sub_test_id, *text);
         else if (notify_test_info.flags & CONVERT_SEND)
             ok(!lstrcmpA(send_data->expect_text, *text), "Code 0x%08x test 0x%08x sub test %d expect %s, got %s\n",
@@ -650,7 +650,7 @@ static void notify_generic_text_handler(CHAR **text, INT *text_max)
         break;
     }
     case SEND_EMPTY_IF_NULL:
-        ok(!lstrcmpA(*text, empty_a), "Code 0x%08x test 0x%08x sub test %d expect empty text, got %s\n",
+        ok(!*text[0], "Code 0x%08x test 0x%08x sub test %d expect empty text, got %s\n",
            notify_test_info.unicode, notify_test_info.test_id, notify_test_info.sub_test_id, *text);
         break;
     case DONT_SEND_EMPTY_IF_NULL:




More information about the wine-cvs mailing list