Commit 297a7349 authored by Alexandre Julliard's avatar Alexandre Julliard

comctl32/tests: Use nameless unions/structs.

parent 573e20e9
...@@ -485,14 +485,14 @@ static void fill_tree(HWND hTree) ...@@ -485,14 +485,14 @@ static void fill_tree(HWND hTree)
ins.hParent = TVI_ROOT; ins.hParent = TVI_ROOT;
ins.hInsertAfter = TVI_ROOT; ins.hInsertAfter = TVI_ROOT;
U(ins).item.mask = TVIF_TEXT; ins.item.mask = TVIF_TEXT;
U(ins).item.pszText = root; ins.item.pszText = root;
hRoot = TreeView_InsertItemA(hTree, &ins); hRoot = TreeView_InsertItemA(hTree, &ins);
ins.hParent = hRoot; ins.hParent = hRoot;
ins.hInsertAfter = TVI_FIRST; ins.hInsertAfter = TVI_FIRST;
U(ins).item.mask = TVIF_TEXT; ins.item.mask = TVIF_TEXT;
U(ins).item.pszText = child; ins.item.pszText = child;
hChild = TreeView_InsertItemA(hTree, &ins); hChild = TreeView_InsertItemA(hTree, &ins);
} }
...@@ -544,8 +544,8 @@ static void test_callback(void) ...@@ -544,8 +544,8 @@ static void test_callback(void)
expect(TRUE, ret); expect(TRUE, ret);
ins.hParent = TVI_ROOT; ins.hParent = TVI_ROOT;
ins.hInsertAfter = TVI_ROOT; ins.hInsertAfter = TVI_ROOT;
U(ins).item.mask = TVIF_TEXT; ins.item.mask = TVIF_TEXT;
U(ins).item.pszText = LPSTR_TEXTCALLBACKA; ins.item.pszText = LPSTR_TEXTCALLBACKA;
hRoot = TreeView_InsertItemA(hTree, &ins); hRoot = TreeView_InsertItemA(hTree, &ins);
ok(hRoot != NULL, "failed to set root\n"); ok(hRoot != NULL, "failed to set root\n");
...@@ -560,8 +560,8 @@ static void test_callback(void) ...@@ -560,8 +560,8 @@ static void test_callback(void)
ins.hParent = hRoot; ins.hParent = hRoot;
ins.hInsertAfter = TVI_FIRST; ins.hInsertAfter = TVI_FIRST;
U(ins).item.mask = TVIF_TEXT; ins.item.mask = TVIF_TEXT;
U(ins).item.pszText = test_string; ins.item.pszText = test_string;
hItem1 = TreeView_InsertItemA(hTree, &ins); hItem1 = TreeView_InsertItemA(hTree, &ins);
ok(hItem1 != NULL, "failed to set Item1\n"); ok(hItem1 != NULL, "failed to set Item1\n");
...@@ -581,7 +581,7 @@ static void test_callback(void) ...@@ -581,7 +581,7 @@ static void test_callback(void)
ok(strcmp(tvi.pszText, TEST_CALLBACK_TEXT) == 0, "Item text mismatch %s vs %s\n", ok(strcmp(tvi.pszText, TEST_CALLBACK_TEXT) == 0, "Item text mismatch %s vs %s\n",
tvi.pszText, TEST_CALLBACK_TEXT); tvi.pszText, TEST_CALLBACK_TEXT);
U(ins).item.pszText = NULL; ins.item.pszText = NULL;
hItem2 = TreeView_InsertItemA(hTree, &ins); hItem2 = TreeView_InsertItemA(hTree, &ins);
ok(hItem2 != NULL, "failed to set Item2\n"); ok(hItem2 != NULL, "failed to set Item2\n");
tvi.hItem = hItem2; tvi.hItem = hItem2;
...@@ -741,9 +741,9 @@ static void test_getitemtext(void) ...@@ -741,9 +741,9 @@ static void test_getitemtext(void)
/* add an item without TVIF_TEXT mask and pszText == NULL */ /* add an item without TVIF_TEXT mask and pszText == NULL */
ins.hParent = hRoot; ins.hParent = hRoot;
ins.hInsertAfter = TVI_ROOT; ins.hInsertAfter = TVI_ROOT;
U(ins).item.mask = 0; ins.item.mask = 0;
U(ins).item.pszText = NULL; ins.item.pszText = NULL;
U(ins).item.cchTextMax = 0; ins.item.cchTextMax = 0;
hChild = TreeView_InsertItemA(hTree, &ins); hChild = TreeView_InsertItemA(hTree, &ins);
ok(hChild != NULL, "failed to set hChild\n"); ok(hChild != NULL, "failed to set hChild\n");
...@@ -782,13 +782,13 @@ static void test_focus(void) ...@@ -782,13 +782,13 @@ static void test_focus(void)
*/ */
ins.hParent = hRoot; ins.hParent = hRoot;
ins.hInsertAfter = hChild; ins.hInsertAfter = hChild;
U(ins).item.mask = TVIF_TEXT; ins.item.mask = TVIF_TEXT;
U(ins).item.pszText = child1; ins.item.pszText = child1;
hChild1 = TreeView_InsertItemA(hTree, &ins); hChild1 = TreeView_InsertItemA(hTree, &ins);
ok(hChild1 != NULL, "failed to set hChild1\n"); ok(hChild1 != NULL, "failed to set hChild1\n");
ins.hInsertAfter = hChild1; ins.hInsertAfter = hChild1;
U(ins).item.mask = TVIF_TEXT; ins.item.mask = TVIF_TEXT;
U(ins).item.pszText = child2; ins.item.pszText = child2;
hChild2 = TreeView_InsertItemA(hTree, &ins); hChild2 = TreeView_InsertItemA(hTree, &ins);
ok(hChild2 != NULL, "failed to set hChild2\n"); ok(hChild2 != NULL, "failed to set hChild2\n");
...@@ -1510,28 +1510,28 @@ static void test_expandinvisible(void) ...@@ -1510,28 +1510,28 @@ static void test_expandinvisible(void)
ok(ret == TRUE, "ret\n"); ok(ret == TRUE, "ret\n");
ins.hParent = TVI_ROOT; ins.hParent = TVI_ROOT;
ins.hInsertAfter = TVI_ROOT; ins.hInsertAfter = TVI_ROOT;
U(ins).item.mask = TVIF_TEXT; ins.item.mask = TVIF_TEXT;
U(ins).item.pszText = nodeText[0]; ins.item.pszText = nodeText[0];
node[0] = TreeView_InsertItemA(hTree, &ins); node[0] = TreeView_InsertItemA(hTree, &ins);
ok(node[0] != NULL, "failed to set node[0]\n"); ok(node[0] != NULL, "failed to set node[0]\n");
ins.hInsertAfter = TVI_LAST; ins.hInsertAfter = TVI_LAST;
U(ins).item.mask = TVIF_TEXT; ins.item.mask = TVIF_TEXT;
ins.hParent = node[0]; ins.hParent = node[0];
U(ins).item.pszText = nodeText[1]; ins.item.pszText = nodeText[1];
node[1] = TreeView_InsertItemA(hTree, &ins); node[1] = TreeView_InsertItemA(hTree, &ins);
ok(node[1] != NULL, "failed to set node[1]\n"); ok(node[1] != NULL, "failed to set node[1]\n");
U(ins).item.pszText = nodeText[4]; ins.item.pszText = nodeText[4];
node[4] = TreeView_InsertItemA(hTree, &ins); node[4] = TreeView_InsertItemA(hTree, &ins);
ok(node[4] != NULL, "failed to set node[4]\n"); ok(node[4] != NULL, "failed to set node[4]\n");
ins.hParent = node[1]; ins.hParent = node[1];
U(ins).item.pszText = nodeText[2]; ins.item.pszText = nodeText[2];
node[2] = TreeView_InsertItemA(hTree, &ins); node[2] = TreeView_InsertItemA(hTree, &ins);
ok(node[2] != NULL, "failed to set node[2]\n"); ok(node[2] != NULL, "failed to set node[2]\n");
U(ins).item.pszText = nodeText[3]; ins.item.pszText = nodeText[3];
node[3] = TreeView_InsertItemA(hTree, &ins); node[3] = TreeView_InsertItemA(hTree, &ins);
ok(node[3] != NULL, "failed to set node[3]\n"); ok(node[3] != NULL, "failed to set node[3]\n");
...@@ -1579,7 +1579,7 @@ static void test_expand(void) ...@@ -1579,7 +1579,7 @@ static void test_expand(void)
ins.hParent = TVI_ROOT; ins.hParent = TVI_ROOT;
ins.hInsertAfter = TVI_LAST; ins.hInsertAfter = TVI_LAST;
U(ins).item.mask = 0; ins.item.mask = 0;
first = TreeView_InsertItemA(tv, &ins); first = TreeView_InsertItemA(tv, &ins);
ok(first != NULL, "failed to insert first node\n"); ok(first != NULL, "failed to insert first node\n");
second = TreeView_InsertItemA(tv, &ins); second = TreeView_InsertItemA(tv, &ins);
...@@ -2111,8 +2111,8 @@ static void test_TVS_SINGLEEXPAND(void) ...@@ -2111,8 +2111,8 @@ static void test_TVS_SINGLEEXPAND(void)
{ {
ins.hParent = items[i].parent ? *items[i].parent : TVI_ROOT; ins.hParent = items[i].parent ? *items[i].parent : TVI_ROOT;
ins.hInsertAfter = TVI_FIRST; ins.hInsertAfter = TVI_FIRST;
U(ins).item.mask = TVIF_TEXT; ins.item.mask = TVIF_TEXT;
U(ins).item.pszText = foo; ins.item.pszText = foo;
*items[i].handle = TreeView_InsertItemA(hTree, &ins); *items[i].handle = TreeView_InsertItemA(hTree, &ins);
} }
...@@ -2282,15 +2282,15 @@ static void test_delete_items(void) ...@@ -2282,15 +2282,15 @@ static void test_delete_items(void)
ins.hParent = TVI_ROOT; ins.hParent = TVI_ROOT;
ins.hInsertAfter = TVI_ROOT; ins.hInsertAfter = TVI_ROOT;
U(ins).item.mask = TVIF_TEXT; ins.item.mask = TVIF_TEXT;
U(ins).item.pszText = item1; ins.item.pszText = item1;
hItem1 = TreeView_InsertItemA(hTree, &ins); hItem1 = TreeView_InsertItemA(hTree, &ins);
ok(hItem1 != NULL, "InsertItem failed\n"); ok(hItem1 != NULL, "InsertItem failed\n");
ins.hParent = TVI_ROOT; ins.hParent = TVI_ROOT;
ins.hInsertAfter = hItem1; ins.hInsertAfter = hItem1;
U(ins).item.mask = TVIF_TEXT; ins.item.mask = TVIF_TEXT;
U(ins).item.pszText = item2; ins.item.pszText = item2;
hItem2 = TreeView_InsertItemA(hTree, &ins); hItem2 = TreeView_InsertItemA(hTree, &ins);
ok(hItem2 != NULL, "InsertItem failed\n"); ok(hItem2 != NULL, "InsertItem failed\n");
...@@ -2429,14 +2429,14 @@ static void test_htreeitem_layout(BOOL is_version_6) ...@@ -2429,14 +2429,14 @@ static void test_htreeitem_layout(BOOL is_version_6)
ins.hParent = hChild; ins.hParent = hChild;
ins.hInsertAfter = TVI_FIRST; ins.hInsertAfter = TVI_FIRST;
U(ins).item.mask = 0; ins.item.mask = 0;
item1 = TreeView_InsertItemA(hTree, &ins); item1 = TreeView_InsertItemA(hTree, &ins);
CHECK_ITEM(hTree, item1); CHECK_ITEM(hTree, item1);
ins.hParent = hRoot; ins.hParent = hRoot;
ins.hInsertAfter = TVI_FIRST; ins.hInsertAfter = TVI_FIRST;
U(ins).item.mask = 0; ins.item.mask = 0;
item2 = TreeView_InsertItemA(hTree, &ins); item2 = TreeView_InsertItemA(hTree, &ins);
CHECK_ITEM(hTree, item2); CHECK_ITEM(hTree, item2);
...@@ -2760,8 +2760,8 @@ static void test_WM_KEYDOWN(void) ...@@ -2760,8 +2760,8 @@ static void test_WM_KEYDOWN(void)
ins.hParent = TVI_ROOT; ins.hParent = TVI_ROOT;
ins.hInsertAfter = TVI_ROOT; ins.hInsertAfter = TVI_ROOT;
U(ins).item.mask = TVIF_TEXT; ins.item.mask = TVIF_TEXT;
U(ins).item.pszText = (char*)rootA; ins.item.pszText = (char*)rootA;
hRoot = TreeView_InsertItemA(hwnd, &ins); hRoot = TreeView_InsertItemA(hwnd, &ins);
ok(hRoot != NULL, "got %p\n", hRoot); ok(hRoot != NULL, "got %p\n", hRoot);
...@@ -2841,31 +2841,31 @@ static void fill_treeview_sort_test(HWND hwnd) ...@@ -2841,31 +2841,31 @@ static void fill_treeview_sort_test(HWND hwnd)
/* root, two children, with two children each */ /* root, two children, with two children each */
ins.hParent = TVI_ROOT; ins.hParent = TVI_ROOT;
ins.hInsertAfter = TVI_ROOT; ins.hInsertAfter = TVI_ROOT;
U(ins).item.mask = TVIF_TEXT; ins.item.mask = TVIF_TEXT;
U(ins).item.pszText = (char *)itemnames[i++]; ins.item.pszText = (char *)itemnames[i++];
root = (HTREEITEM)SendMessageA(hwnd, TVM_INSERTITEMA, 0, (LPARAM)&ins); root = (HTREEITEM)SendMessageA(hwnd, TVM_INSERTITEMA, 0, (LPARAM)&ins);
ins.hParent = root; ins.hParent = root;
ins.hInsertAfter = TVI_LAST; ins.hInsertAfter = TVI_LAST;
U(ins).item.mask = TVIF_TEXT; ins.item.mask = TVIF_TEXT;
U(ins).item.pszText = (char *)itemnames[i++]; ins.item.pszText = (char *)itemnames[i++];
children[0] = (HTREEITEM)SendMessageA(hwnd, TVM_INSERTITEMA, 0, (LPARAM)&ins); children[0] = (HTREEITEM)SendMessageA(hwnd, TVM_INSERTITEMA, 0, (LPARAM)&ins);
U(ins).item.pszText = (char *)itemnames[i++]; ins.item.pszText = (char *)itemnames[i++];
children[1] = (HTREEITEM)SendMessageA(hwnd, TVM_INSERTITEMA, 0, (LPARAM)&ins); children[1] = (HTREEITEM)SendMessageA(hwnd, TVM_INSERTITEMA, 0, (LPARAM)&ins);
ins.hParent = children[0]; ins.hParent = children[0];
U(ins).item.pszText = (char *)itemnames[i++]; ins.item.pszText = (char *)itemnames[i++];
SendMessageA(hwnd, TVM_INSERTITEMA, 0, (LPARAM)&ins); SendMessageA(hwnd, TVM_INSERTITEMA, 0, (LPARAM)&ins);
U(ins).item.pszText = (char *)itemnames[i++]; ins.item.pszText = (char *)itemnames[i++];
SendMessageA(hwnd, TVM_INSERTITEMA, 0, (LPARAM)&ins); SendMessageA(hwnd, TVM_INSERTITEMA, 0, (LPARAM)&ins);
ins.hParent = children[1]; ins.hParent = children[1];
U(ins).item.pszText = (char *)itemnames[i++]; ins.item.pszText = (char *)itemnames[i++];
SendMessageA(hwnd, TVM_INSERTITEMA, 0, (LPARAM)&ins); SendMessageA(hwnd, TVM_INSERTITEMA, 0, (LPARAM)&ins);
U(ins).item.pszText = (char *)itemnames[i++]; ins.item.pszText = (char *)itemnames[i++];
SendMessageA(hwnd, TVM_INSERTITEMA, 0, (LPARAM)&ins); SendMessageA(hwnd, TVM_INSERTITEMA, 0, (LPARAM)&ins);
} }
...@@ -2891,8 +2891,8 @@ static void test_TVM_SORTCHILDREN(void) ...@@ -2891,8 +2891,8 @@ static void test_TVM_SORTCHILDREN(void)
/* add only root, sort from it */ /* add only root, sort from it */
ins.hParent = TVI_ROOT; ins.hParent = TVI_ROOT;
ins.hInsertAfter = TVI_ROOT; ins.hInsertAfter = TVI_ROOT;
U(ins).item.mask = TVIF_TEXT; ins.item.mask = TVIF_TEXT;
U(ins).item.pszText = (char *)"root"; ins.item.pszText = (char *)"root";
root = (HTREEITEM)SendMessageA(hwnd, TVM_INSERTITEMA, 0, (LPARAM)&ins); root = (HTREEITEM)SendMessageA(hwnd, TVM_INSERTITEMA, 0, (LPARAM)&ins);
ok(root != NULL, "Expected root node\n"); ok(root != NULL, "Expected root node\n");
...@@ -2962,19 +2962,19 @@ static void test_TVM_SORTCHILDREN(void) ...@@ -2962,19 +2962,19 @@ static void test_TVM_SORTCHILDREN(void)
ins.hParent = TVI_ROOT; ins.hParent = TVI_ROOT;
ins.hInsertAfter = TVI_ROOT; ins.hInsertAfter = TVI_ROOT;
U(ins).item.mask = TVIF_TEXT; ins.item.mask = TVIF_TEXT;
U(ins).item.pszText = (char *)"root"; ins.item.pszText = (char *)"root";
root = (HTREEITEM)SendMessageA(hwnd, TVM_INSERTITEMA, 0, (LPARAM)&ins); root = (HTREEITEM)SendMessageA(hwnd, TVM_INSERTITEMA, 0, (LPARAM)&ins);
ok(root != NULL, "Expected root node\n"); ok(root != NULL, "Expected root node\n");
ins.hParent = root; ins.hParent = root;
ins.hInsertAfter = TVI_LAST; ins.hInsertAfter = TVI_LAST;
U(ins).item.pszText = (char *)"I1"; ins.item.pszText = (char *)"I1";
SendMessageA(hwnd, TVM_INSERTITEMA, 0, (LPARAM)&ins); SendMessageA(hwnd, TVM_INSERTITEMA, 0, (LPARAM)&ins);
ins.hParent = root; ins.hParent = root;
ins.hInsertAfter = TVI_LAST; ins.hInsertAfter = TVI_LAST;
U(ins).item.pszText = (char *)"i1"; ins.item.pszText = (char *)"i1";
SendMessageA(hwnd, TVM_INSERTITEMA, 0, (LPARAM)&ins); SendMessageA(hwnd, TVM_INSERTITEMA, 0, (LPARAM)&ins);
ret = SendMessageA(hwnd, TVM_SORTCHILDREN, TRUE, (LPARAM)root); ret = SendMessageA(hwnd, TVM_SORTCHILDREN, TRUE, (LPARAM)root);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment