comctl32/tests: Write-strings warnings fix
Andrew Talbot
Andrew.Talbot at talbotville.com
Wed Jul 19 13:17:56 CDT 2006
Changelog:
comctl32/tests: Write-strings warnings fix.
diff -urN a/dlls/comctl32/tests/listview.c b/dlls/comctl32/tests/listview.c
--- a/dlls/comctl32/tests/listview.c 2006-07-18 18:54:08.000000000 +0100
+++ b/dlls/comctl32/tests/listview.c 2006-07-19 18:45:08.000000000 +0100
@@ -97,6 +97,9 @@
HWND hwnd, hwndparent = 0;
LVITEMA item;
DWORD r;
+ static CHAR text[] = "Text",
+ text2[] = "Text2",
+ text3[] = "Text3";
hwnd = CreateWindowEx(0, "SysListView32", "foo", LVS_REPORT,
10, 10, 100, 200, hwndparent, NULL, NULL, NULL);
@@ -108,7 +111,7 @@
item.state = 0xfccc;
item.iItem = 0;
item.iSubItem = 0;
- item.pszText = "Text";
+ item.pszText = text;
r = SendMessage(hwnd, LVM_INSERTITEMA, 0, (LPARAM) &item);
ok(r == 0, "ret %ld\n", r);
@@ -124,7 +127,7 @@
item.state = 0xfccc;
item.iItem = 1;
item.iSubItem = 0;
- item.pszText = "Text";
+ item.pszText = text;
r = SendMessage(hwnd, LVM_INSERTITEMA, 0, (LPARAM) &item);
ok(r == 1, "ret %ld\n", r);
@@ -136,7 +139,7 @@
r = SendMessage(hwnd, LVM_SETEXTENDEDLISTVIEWSTYLE, LVS_EX_CHECKBOXES, LVS_EX_CHECKBOXES);
ok(r == 0, "should return zero\n");
-
+
/* Having turned on checkboxes, check that all existing items are set to 0x1000 (unchecked) */
item.iItem = 0;
item.mask = LVIF_STATE;
@@ -148,7 +151,7 @@
item.iItem = 2;
item.mask = LVIF_TEXT;
item.state = 0;
- item.pszText = "Text2";
+ item.pszText = text2;
r = SendMessage(hwnd, LVM_INSERTITEMA, 0, (LPARAM) &item);
ok(r == 2, "ret %ld\n", r);
@@ -163,7 +166,7 @@
item.mask = LVIF_TEXT | LVIF_STATE;
item.stateMask = 0xffff;
item.state = 0x2aaa;
- item.pszText = "Text3";
+ item.pszText = text3;
r = SendMessage(hwnd, LVM_INSERTITEMA, 0, (LPARAM) &item);
ok(r == 3, "ret %ld\n", r);
@@ -189,7 +192,7 @@
/* Set the style again and check that doesn't change an item's state */
r = SendMessage(hwnd, LVM_SETEXTENDEDLISTVIEWSTYLE, LVS_EX_CHECKBOXES, LVS_EX_CHECKBOXES);
ok(r == LVS_EX_CHECKBOXES, "ret %lx\n", r);
-
+
item.iItem = 3;
item.mask = LVIF_STATE;
item.stateMask = 0xffff;
@@ -209,14 +212,13 @@
/* Now setting the style again will change an item's state */
r = SendMessage(hwnd, LVM_SETEXTENDEDLISTVIEWSTYLE, LVS_EX_CHECKBOXES, LVS_EX_CHECKBOXES);
ok(r == 0, "ret %lx\n", r);
-
+
item.iItem = 3;
item.mask = LVIF_STATE;
item.stateMask = 0xffff;
r = SendMessage(hwnd, LVM_GETITEMA, 0, (LPARAM) &item);
ok(item.state == 0x1aaa, "state %x\n", item.state);
-
DestroyWindow(hwnd);
}
More information about the wine-patches
mailing list