Michael Stefaniuc : riched20/tests: Simplify the check for an empty string (PVS-Studio).
Alexandre Julliard
julliard at wine.codeweavers.com
Tue Nov 11 11:04:45 CST 2014
Module: wine
Branch: master
Commit: 5ce384e1917b1b0a1c42fc81a8b83cc15cb55362
URL: http://source.winehq.org/git/wine.git/?a=commit;h=5ce384e1917b1b0a1c42fc81a8b83cc15cb55362
Author: Michael Stefaniuc <mstefani at redhat.de>
Date: Mon Nov 10 23:44:08 2014 +0100
riched20/tests: Simplify the check for an empty string (PVS-Studio).
---
dlls/riched20/tests/editor.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/dlls/riched20/tests/editor.c b/dlls/riched20/tests/editor.c
index 5ad063e..244f065 100644
--- a/dlls/riched20/tests/editor.c
+++ b/dlls/riched20/tests/editor.c
@@ -3736,9 +3736,8 @@ static void test_EM_SETTEXTEX(void)
ok (result == 1,
"EM_SETTEXTEX returned %d, instead of 1\n",result);
- ok(lstrlenW(buf) == 0,
- "EM_SETTEXTEX with NULL lParam should clear rich edit.\n");
-
+ ok(!buf[0], "EM_SETTEXTEX with NULL lParam should clear rich edit.\n");
+
/* put some text back: !ST_SELECTION && Unicode && !\rtf */
setText.flags = 0;
SendMessageA(hwndRichEdit, EM_SETTEXTEX, (WPARAM)&setText, (LPARAM)TestItem1);
@@ -5225,8 +5224,7 @@ static void test_EM_STREAMIN(void)
result = SendMessageA(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM)buffer);
ok (result == 0,
"EM_STREAMIN: Test 2 returned %ld, expected 0\n", result);
- ok (strlen(buffer) == 0,
- "EM_STREAMIN: Test 2 set wrong text: Result: %s\n",buffer);
+ ok(!buffer[0], "EM_STREAMIN: Test 2 set wrong text: Result: %s\n",buffer);
ok(es.dwError == -16, "EM_STREAMIN: Test 2 set error %d, expected %d\n", es.dwError, -16);
es.dwCookie = (DWORD_PTR)&streamText3;
@@ -5237,8 +5235,7 @@ static void test_EM_STREAMIN(void)
result = SendMessageA(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM)buffer);
ok (result == 0,
"EM_STREAMIN: Test 3 returned %ld, expected 0\n", result);
- ok (strlen(buffer) == 0,
- "EM_STREAMIN: Test 3 set wrong text: Result: %s\n",buffer);
+ ok(!buffer[0], "EM_STREAMIN: Test 3 set wrong text: Result: %s\n",buffer);
ok(es.dwError == -16, "EM_STREAMIN: Test 3 set error %d, expected %d\n", es.dwError, -16);
es.dwCookie = (DWORD_PTR)&streamTextUTF8BOM;
More information about the wine-cvs
mailing list