[PATCH 3/3] comctl32/tests: Get rid of variables holding empty strings

Michael Stefaniuc mstefani at winehq.org
Mon Oct 21 18:24:32 CDT 2019


Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>
---
 dlls/comctl32/tests/edit.c  |  3 +--
 dlls/comctl32/tests/pager.c | 24 +++++++++++-------------
 2 files changed, 12 insertions(+), 15 deletions(-)

diff --git a/dlls/comctl32/tests/edit.c b/dlls/comctl32/tests/edit.c
index 111545d298..3fe208c321 100644
--- a/dlls/comctl32/tests/edit.c
+++ b/dlls/comctl32/tests/edit.c
@@ -3240,7 +3240,6 @@ static void test_cue_banner(void)
     static WCHAR getcuetestW[5] = {'T',0};
     static const WCHAR testcmp1W[] = {'T','e','s','t',0};
     static const WCHAR testcmp2W[] = {'T','e','s',0};
-    static const WCHAR emptyW[] = {0};
 
     hwnd_edit = create_editcontrolW(ES_AUTOHSCROLL | ES_AUTOVSCROLL, 0);
 
@@ -3279,7 +3278,7 @@ static void test_cue_banner(void)
     ok(ret == TRUE, "EM_GETCUEBANNER should have returned TRUE.\n");
     ok(lstrcmpW(getcuetestW, testcmp1W) == 0, "EM_GETCUEBANNER returned string %s.\n", wine_dbgstr_w(getcuetestW));
 
-    ret = SendMessageW(hwnd_edit, EM_SETCUEBANNER, 0, (LPARAM)emptyW);
+    ret = SendMessageW(hwnd_edit, EM_SETCUEBANNER, 0, (LPARAM)L"");
     ok(ret == TRUE, "EM_SETCUEBANNER should have returned TRUE.\n");
 
     ret = SendMessageW(hwnd_edit, EM_GETCUEBANNER, (WPARAM)getcuetestW, 5);
diff --git a/dlls/comctl32/tests/pager.c b/dlls/comctl32/tests/pager.c
index 0e2c25b08a..30005c88fa 100644
--- a/dlls/comctl32/tests/pager.c
+++ b/dlls/comctl32/tests/pager.c
@@ -34,8 +34,6 @@ static const CHAR test_a[] = "test";
 static const WCHAR test_w[] = L"test";
 /* Double zero so that it's safe to cast it to WCHAR * */
 static const CHAR te_a[] = {'t', 'e', 0, 0};
-static WCHAR empty_w[] = {0};
-static CHAR empty_a[] = {0};
 static const CHAR large_a[] =
     "You should have received a copy of the GNU Lesser General Public License along with this ...";
 static const WCHAR large_w[] =
@@ -132,17 +130,17 @@ static const struct notify_test_send test_dont_convert_send_data[] =
 
 static const struct notify_test_receive test_convert_receive_data[] =
 {
-    {empty_w, sizeof(empty_w), ARRAY_SIZE(buffer), NULL, test_a, sizeof(test_a), -1, test_w, ARRAY_SIZE(buffer)},
-    {empty_w, sizeof(empty_w), ARRAY_SIZE(buffer), test_a, NULL, 0, -1, test_w, ARRAY_SIZE(buffer)},
-    {NULL, sizeof(empty_w), ARRAY_SIZE(buffer), test_a, NULL, 0, -1, NULL, ARRAY_SIZE(buffer)},
-    {empty_w, sizeof(empty_w), ARRAY_SIZE(buffer), large_a, NULL, 0, -1, large_truncated_65_w, ARRAY_SIZE(buffer)},
-    {empty_w, sizeof(empty_w), ARRAY_SIZE(buffer), empty_a, 0, 0, 1, empty_w, 1},
+    {L"", sizeof(L""), ARRAY_SIZE(buffer), NULL, test_a, sizeof(test_a), -1, test_w, ARRAY_SIZE(buffer)},
+    {L"", sizeof(L""), ARRAY_SIZE(buffer), test_a, NULL, 0, -1, test_w, ARRAY_SIZE(buffer)},
+    {NULL, sizeof(L""), ARRAY_SIZE(buffer), test_a, NULL, 0, -1, NULL, ARRAY_SIZE(buffer)},
+    {L"", sizeof(L""), ARRAY_SIZE(buffer), large_a, NULL, 0, -1, large_truncated_65_w, ARRAY_SIZE(buffer)},
+    {L"", sizeof(L""), ARRAY_SIZE(buffer), "", 0, 0, 1, L"", 1},
 };
 
 static const struct notify_test_receive test_dont_convert_receive_data[] =
 {
-    {empty_w, sizeof(empty_w), ARRAY_SIZE(buffer), NULL, test_a, sizeof(test_a), -1, test_a, ARRAY_SIZE(buffer)},
-    {empty_w, sizeof(empty_w), ARRAY_SIZE(buffer), test_a, NULL, 0, -1, test_a, ARRAY_SIZE(buffer)},
+    {L"", sizeof(L""), ARRAY_SIZE(buffer), NULL, test_a, sizeof(test_a), -1, test_a, ARRAY_SIZE(buffer)},
+    {L"", sizeof(L""), ARRAY_SIZE(buffer), test_a, NULL, 0, -1, test_a, ARRAY_SIZE(buffer)},
 };
 
 static const struct notify_test_tooltip
@@ -165,15 +163,15 @@ static const struct notify_test_tooltip
     const WCHAR *send_lpsztext;
 } test_tooltip_data[] =
 {
-    {NULL, 0, NULL, NULL, empty_w, -1, empty_w},
+    {NULL, 0, NULL, NULL, L"", -1, L""},
     {test_a, sizeof(test_a), NULL, NULL, test_w, -1, test_w},
     {test_a, sizeof(test_a), test_a, NULL, test_w, -1, test_w},
-    {test_a, sizeof(test_a), (CHAR *)1, (HMODULE)0xdeadbeef, empty_w, -1, (WCHAR *)1, (HMODULE)0xdeadbeef},
+    {test_a, sizeof(test_a), (CHAR *)1, (HMODULE)0xdeadbeef, L"", -1, (WCHAR *)1, (HMODULE)0xdeadbeef},
     {test_a, sizeof(test_a), test_a, (HMODULE)0xdeadbeef, test_w, -1, test_w, (HMODULE)0xdeadbeef},
     {NULL, 0, test_a, NULL, test_w, -1, test_w},
     {test_a, 2, test_a, NULL, test_w, -1, test_w},
     {NULL, 0, NULL, NULL, test_w, -1, test_w, NULL, test_a, test_w, sizeof(test_w)},
-    {NULL, 0, NULL, NULL, empty_w, -1, empty_w, NULL, empty_a, NULL, 0, test_w},
+    {NULL, 0, NULL, NULL, L"", -1, L"", NULL, "", NULL, 0, test_w},
     {NULL, 0, large_a, NULL, large_truncated_80_w, sizeof(large_truncated_80_w), large_w}
 };
 
@@ -194,7 +192,7 @@ static const struct notify_test_datetime_format
 } test_datetime_format_data[] =
 {
     {test_w, test_a},
-    {NULL, NULL, NULL, 0, test_a, empty_w, -1, test_w},
+    {NULL, NULL, NULL, 0, test_a, L"", -1, test_w},
     {NULL, NULL, test_a, sizeof(test_a), NULL, test_w, -1, test_w},
     {NULL, NULL, test_a, 2, test_a, (WCHAR *)te_a, -1, test_w},
     {NULL, NULL, NULL, 0, large_a, NULL, 0, large_w}
-- 
2.20.1




More information about the wine-devel mailing list