mirror of
https://github.com/reactos/wine.git
synced 2024-12-03 17:31:15 +00:00
comctl32/tests: Merge one test function to existing tests, use explicit message numbers.
This commit is contained in:
parent
16dfb1a039
commit
6711780a8f
@ -70,8 +70,8 @@ static const struct message rootchild_select_seq[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static const struct message getitemtext_seq[] = {
|
static const struct message getitemtext_seq[] = {
|
||||||
{ TVM_INSERTITEM, sent },
|
{ TVM_INSERTITEMA, sent },
|
||||||
{ TVM_GETITEM, sent },
|
{ TVM_GETITEMA, sent },
|
||||||
{ TVM_DELETEITEM, sent },
|
{ TVM_DELETEITEM, sent },
|
||||||
{ 0 }
|
{ 0 }
|
||||||
};
|
};
|
||||||
@ -134,10 +134,10 @@ static const struct message test_get_set_insertmarkcolor_seq[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static const struct message test_get_set_item_seq[] = {
|
static const struct message test_get_set_item_seq[] = {
|
||||||
{ TVM_GETITEM, sent },
|
{ TVM_GETITEMA, sent },
|
||||||
{ TVM_SETITEM, sent },
|
{ TVM_SETITEMA, sent },
|
||||||
{ TVM_GETITEM, sent },
|
{ TVM_GETITEMA, sent },
|
||||||
{ TVM_SETITEM, sent },
|
{ TVM_SETITEMA, sent },
|
||||||
{ 0 }
|
{ 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -187,8 +187,8 @@ static const struct message test_get_set_unicodeformat_seq[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static const struct message parent_expand_seq[] = {
|
static const struct message parent_expand_seq[] = {
|
||||||
{ WM_NOTIFY, sent|id, 0, 0, TVN_ITEMEXPANDING },
|
{ WM_NOTIFY, sent|id, 0, 0, TVN_ITEMEXPANDINGA },
|
||||||
{ WM_NOTIFY, sent|id, 0, 0, TVN_ITEMEXPANDED },
|
{ WM_NOTIFY, sent|id, 0, 0, TVN_ITEMEXPANDEDA },
|
||||||
{ 0 }
|
{ 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -302,7 +302,7 @@ static void fill_tree(HWND hTree)
|
|||||||
|
|
||||||
static void test_fillroot(void)
|
static void test_fillroot(void)
|
||||||
{
|
{
|
||||||
TVITEM tvi;
|
TVITEMA tvi;
|
||||||
HWND hTree;
|
HWND hTree;
|
||||||
|
|
||||||
hTree = create_treeview_control();
|
hTree = create_treeview_control();
|
||||||
@ -323,7 +323,7 @@ static void test_fillroot(void)
|
|||||||
/* UMLPad 1.15 depends on this being not -1 (I_IMAGECALLBACK) */
|
/* UMLPad 1.15 depends on this being not -1 (I_IMAGECALLBACK) */
|
||||||
tvi.hItem = hRoot;
|
tvi.hItem = hRoot;
|
||||||
tvi.mask = TVIF_IMAGE | TVIF_SELECTEDIMAGE;
|
tvi.mask = TVIF_IMAGE | TVIF_SELECTEDIMAGE;
|
||||||
SendMessage( hTree, TVM_GETITEM, 0, (LPARAM)&tvi );
|
SendMessage( hTree, TVM_GETITEMA, 0, (LPARAM)&tvi );
|
||||||
ok(tvi.iImage == 0, "tvi.iImage=%d\n", tvi.iImage);
|
ok(tvi.iImage == 0, "tvi.iImage=%d\n", tvi.iImage);
|
||||||
ok(tvi.iSelectedImage == 0, "tvi.iSelectedImage=%d\n", tvi.iSelectedImage);
|
ok(tvi.iSelectedImage == 0, "tvi.iSelectedImage=%d\n", tvi.iSelectedImage);
|
||||||
|
|
||||||
@ -335,7 +335,7 @@ static void test_callback(void)
|
|||||||
HTREEITEM hRoot;
|
HTREEITEM hRoot;
|
||||||
HTREEITEM hItem1, hItem2;
|
HTREEITEM hItem1, hItem2;
|
||||||
TVINSERTSTRUCTA ins;
|
TVINSERTSTRUCTA ins;
|
||||||
TVITEM tvi;
|
TVITEMA tvi;
|
||||||
CHAR test_string[] = "Test_string";
|
CHAR test_string[] = "Test_string";
|
||||||
CHAR buf[128];
|
CHAR buf[128];
|
||||||
LRESULT ret;
|
LRESULT ret;
|
||||||
@ -464,7 +464,7 @@ static void test_getitemtext(void)
|
|||||||
{
|
{
|
||||||
TVINSERTSTRUCTA ins;
|
TVINSERTSTRUCTA ins;
|
||||||
HTREEITEM hChild;
|
HTREEITEM hChild;
|
||||||
TVITEM tvi;
|
TVITEMA tvi;
|
||||||
HWND hTree;
|
HWND hTree;
|
||||||
|
|
||||||
CHAR szBuffer[80] = "Blah";
|
CHAR szBuffer[80] = "Blah";
|
||||||
@ -490,7 +490,7 @@ static void test_getitemtext(void)
|
|||||||
tvi.cchTextMax = nBufferSize;
|
tvi.cchTextMax = nBufferSize;
|
||||||
tvi.pszText = szBuffer;
|
tvi.pszText = szBuffer;
|
||||||
|
|
||||||
SendMessageA( hTree, TVM_GETITEM, 0, (LPARAM)&tvi );
|
SendMessageA( hTree, TVM_GETITEMA, 0, (LPARAM)&tvi );
|
||||||
ok(!strcmp(szBuffer, ""), "szBuffer=\"%s\", expected \"\"\n", szBuffer);
|
ok(!strcmp(szBuffer, ""), "szBuffer=\"%s\", expected \"\"\n", szBuffer);
|
||||||
ok(SendMessageA(hTree, TVM_DELETEITEM, 0, (LPARAM)hChild), "DeleteItem failed\n");
|
ok(SendMessageA(hTree, TVM_DELETEITEM, 0, (LPARAM)hChild), "DeleteItem failed\n");
|
||||||
ok_sequence(sequences, TREEVIEW_SEQ_INDEX, getitemtext_seq, "get item text seq", FALSE);
|
ok_sequence(sequences, TREEVIEW_SEQ_INDEX, getitemtext_seq, "get item text seq", FALSE);
|
||||||
@ -645,7 +645,7 @@ static void test_get_set_insertmark(void)
|
|||||||
|
|
||||||
static void test_get_set_item(void)
|
static void test_get_set_item(void)
|
||||||
{
|
{
|
||||||
TVITEM tviRoot = {0};
|
TVITEMA tviRoot = {0};
|
||||||
int nBufferSize = 80;
|
int nBufferSize = 80;
|
||||||
char szBuffer[80] = {0};
|
char szBuffer[80] = {0};
|
||||||
HWND hTree;
|
HWND hTree;
|
||||||
@ -660,20 +660,20 @@ static void test_get_set_item(void)
|
|||||||
tviRoot.mask = TVIF_TEXT;
|
tviRoot.mask = TVIF_TEXT;
|
||||||
tviRoot.cchTextMax = nBufferSize;
|
tviRoot.cchTextMax = nBufferSize;
|
||||||
tviRoot.pszText = szBuffer;
|
tviRoot.pszText = szBuffer;
|
||||||
SendMessage( hTree, TVM_GETITEM, 0, (LPARAM)&tviRoot );
|
SendMessage( hTree, TVM_GETITEMA, 0, (LPARAM)&tviRoot );
|
||||||
ok(!strcmp("Root", szBuffer), "GetItem: szBuffer=\"%s\", expected \"Root\"\n", szBuffer);
|
ok(!strcmp("Root", szBuffer), "GetItem: szBuffer=\"%s\", expected \"Root\"\n", szBuffer);
|
||||||
|
|
||||||
/* Change the root text */
|
/* Change the root text */
|
||||||
strncpy(szBuffer, "Testing123", nBufferSize);
|
strncpy(szBuffer, "Testing123", nBufferSize);
|
||||||
SendMessage( hTree, TVM_SETITEM, 0, (LPARAM)&tviRoot );
|
SendMessage( hTree, TVM_SETITEMA, 0, (LPARAM)&tviRoot );
|
||||||
memset(szBuffer, 0, nBufferSize);
|
memset(szBuffer, 0, nBufferSize);
|
||||||
SendMessage( hTree, TVM_GETITEM, 0, (LPARAM)&tviRoot );
|
SendMessage( hTree, TVM_GETITEMA, 0, (LPARAM)&tviRoot );
|
||||||
ok(!strcmp("Testing123", szBuffer), "GetItem: szBuffer=\"%s\", expected \"Testing123\"\n", szBuffer);
|
ok(!strcmp("Testing123", szBuffer), "GetItem: szBuffer=\"%s\", expected \"Testing123\"\n", szBuffer);
|
||||||
|
|
||||||
/* Reset the root text */
|
/* Reset the root text */
|
||||||
memset(szBuffer, 0, nBufferSize);
|
memset(szBuffer, 0, nBufferSize);
|
||||||
strncpy(szBuffer, "Root", nBufferSize);
|
strncpy(szBuffer, "Root", nBufferSize);
|
||||||
SendMessage( hTree, TVM_SETITEM, 0, (LPARAM)&tviRoot );
|
SendMessage( hTree, TVM_SETITEMA, 0, (LPARAM)&tviRoot );
|
||||||
|
|
||||||
ok_sequence(sequences, TREEVIEW_SEQ_INDEX, test_get_set_item_seq,
|
ok_sequence(sequences, TREEVIEW_SEQ_INDEX, test_get_set_item_seq,
|
||||||
"test get set item", FALSE);
|
"test get set item", FALSE);
|
||||||
@ -889,7 +889,7 @@ static LRESULT CALLBACK parent_wnd_proc(HWND hWnd, UINT message, WPARAM wParam,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case TVN_ENDLABELEDIT: return TRUE;
|
case TVN_ENDLABELEDIT: return TRUE;
|
||||||
case TVN_ITEMEXPANDING:
|
case TVN_ITEMEXPANDINGA:
|
||||||
ok(pTreeView->itemNew.mask ==
|
ok(pTreeView->itemNew.mask ==
|
||||||
(TVIF_HANDLE | TVIF_SELECTEDIMAGE | TVIF_IMAGE | TVIF_PARAM | TVIF_STATE),
|
(TVIF_HANDLE | TVIF_SELECTEDIMAGE | TVIF_IMAGE | TVIF_PARAM | TVIF_STATE),
|
||||||
"got wrong mask %x\n", pTreeView->itemNew.mask);
|
"got wrong mask %x\n", pTreeView->itemNew.mask);
|
||||||
@ -906,7 +906,7 @@ static LRESULT CALLBACK parent_wnd_proc(HWND hWnd, UINT message, WPARAM wParam,
|
|||||||
ok(ret == TRUE, "got %lu\n", ret);
|
ok(ret == TRUE, "got %lu\n", ret);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case TVN_ITEMEXPANDED:
|
case TVN_ITEMEXPANDEDA:
|
||||||
ok(pTreeView->itemNew.mask & TVIF_STATE, "got wrong mask %x\n", pTreeView->itemNew.mask);
|
ok(pTreeView->itemNew.mask & TVIF_STATE, "got wrong mask %x\n", pTreeView->itemNew.mask);
|
||||||
ok(pTreeView->itemNew.state & (TVIS_EXPANDED|TVIS_EXPANDEDONCE),
|
ok(pTreeView->itemNew.state & (TVIS_EXPANDED|TVIS_EXPANDEDONCE),
|
||||||
"got wrong mask %x\n", pTreeView->itemNew.mask);
|
"got wrong mask %x\n", pTreeView->itemNew.mask);
|
||||||
@ -920,7 +920,8 @@ static LRESULT CALLBACK parent_wnd_proc(HWND hWnd, UINT message, WPARAM wParam,
|
|||||||
ret = SendMessageA(pHdr->hwndFrom, TVM_GETITEMA, 0, (LPARAM)&g_item_expanded);
|
ret = SendMessageA(pHdr->hwndFrom, TVM_GETITEMA, 0, (LPARAM)&g_item_expanded);
|
||||||
ok(ret == TRUE, "got %lu\n", ret);
|
ok(ret == TRUE, "got %lu\n", ret);
|
||||||
}
|
}
|
||||||
if (g_get_rect_in_expand) {
|
if (g_get_rect_in_expand)
|
||||||
|
{
|
||||||
visibleItem = TreeView_GetNextItem(pHdr->hwndFrom, NULL, TVGN_FIRSTVISIBLE);
|
visibleItem = TreeView_GetNextItem(pHdr->hwndFrom, NULL, TVGN_FIRSTVISIBLE);
|
||||||
ok(pTreeView->itemNew.hItem == visibleItem, "expanded item == first visible item\n");
|
ok(pTreeView->itemNew.hItem == visibleItem, "expanded item == first visible item\n");
|
||||||
*(HTREEITEM*)&rect = visibleItem;
|
*(HTREEITEM*)&rect = visibleItem;
|
||||||
@ -1082,7 +1083,7 @@ static void test_itemedit(void)
|
|||||||
item.hItem = hRoot;
|
item.hItem = hRoot;
|
||||||
item.pszText = buff;
|
item.pszText = buff;
|
||||||
item.cchTextMax = sizeof(buff)/sizeof(CHAR);
|
item.cchTextMax = sizeof(buff)/sizeof(CHAR);
|
||||||
r = SendMessage(hTree, TVM_GETITEM, 0, (LPARAM)&item);
|
r = SendMessage(hTree, TVM_GETITEMA, 0, (LPARAM)&item);
|
||||||
expect(TRUE, r);
|
expect(TRUE, r);
|
||||||
ok(!strcmp("x", buff), "Expected item text to change\n");
|
ok(!strcmp("x", buff), "Expected item text to change\n");
|
||||||
|
|
||||||
@ -1188,22 +1189,20 @@ static void test_expandnotify(void)
|
|||||||
ok_sequence(sequences, PARENT_SEQ_INDEX, empty_seq, "collapse after expand notifications", FALSE);
|
ok_sequence(sequences, PARENT_SEQ_INDEX, empty_seq, "collapse after expand notifications", FALSE);
|
||||||
|
|
||||||
DestroyWindow(hTree);
|
DestroyWindow(hTree);
|
||||||
}
|
|
||||||
|
|
||||||
static void test_rect_retrieval_after_expand_with_select(void) {
|
/* test TVM_GETITEMRECT inside TVN_ITEMEXPANDED notification */
|
||||||
BOOL ret;
|
hTree = create_treeview_control();
|
||||||
HWND hTree;
|
fill_tree(hTree);
|
||||||
hTree = create_treeview_control();
|
g_get_rect_in_expand = TRUE;
|
||||||
fill_tree(hTree);
|
ret = TreeView_Select(hTree, hChild, TVGN_CARET);
|
||||||
g_get_rect_in_expand = TRUE;
|
g_get_rect_in_expand = FALSE;
|
||||||
ret = TreeView_Select(hTree, hChild, TVGN_CARET);
|
ok(ret, "got %d\n", ret);
|
||||||
g_get_rect_in_expand = FALSE;
|
DestroyWindow(hTree);
|
||||||
ok(ret,"TreeView_Select should return true\n");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void test_expandedimage(void)
|
static void test_expandedimage(void)
|
||||||
{
|
{
|
||||||
TVITEMEX item;
|
TVITEMEXA item;
|
||||||
HWND hTree;
|
HWND hTree;
|
||||||
BOOL ret;
|
BOOL ret;
|
||||||
|
|
||||||
@ -1213,13 +1212,13 @@ static void test_expandedimage(void)
|
|||||||
item.mask = TVIF_EXPANDEDIMAGE;
|
item.mask = TVIF_EXPANDEDIMAGE;
|
||||||
item.iExpandedImage = 1;
|
item.iExpandedImage = 1;
|
||||||
item.hItem = hRoot;
|
item.hItem = hRoot;
|
||||||
ret = SendMessageA(hTree, TVM_SETITEM, 0, (LPARAM)&item);
|
ret = SendMessageA(hTree, TVM_SETITEMA, 0, (LPARAM)&item);
|
||||||
ok(ret, "got %d\n", ret);
|
ok(ret, "got %d\n", ret);
|
||||||
|
|
||||||
item.mask = TVIF_EXPANDEDIMAGE;
|
item.mask = TVIF_EXPANDEDIMAGE;
|
||||||
item.iExpandedImage = -1;
|
item.iExpandedImage = -1;
|
||||||
item.hItem = hRoot;
|
item.hItem = hRoot;
|
||||||
ret = SendMessageA(hTree, TVM_GETITEM, 0, (LPARAM)&item);
|
ret = SendMessageA(hTree, TVM_GETITEMA, 0, (LPARAM)&item);
|
||||||
ok(ret, "got %d\n", ret);
|
ok(ret, "got %d\n", ret);
|
||||||
|
|
||||||
if (item.iExpandedImage != 1)
|
if (item.iExpandedImage != 1)
|
||||||
@ -1233,7 +1232,7 @@ static void test_expandedimage(void)
|
|||||||
item.mask = TVIF_EXPANDEDIMAGE;
|
item.mask = TVIF_EXPANDEDIMAGE;
|
||||||
item.iExpandedImage = -1;
|
item.iExpandedImage = -1;
|
||||||
item.hItem = hChild;
|
item.hItem = hChild;
|
||||||
ret = SendMessageA(hTree, TVM_GETITEM, 0, (LPARAM)&item);
|
ret = SendMessageA(hTree, TVM_GETITEMA, 0, (LPARAM)&item);
|
||||||
ok(ret, "got %d\n", ret);
|
ok(ret, "got %d\n", ret);
|
||||||
ok(item.iExpandedImage == (WORD)I_IMAGENONE, "got %d\n", item.iExpandedImage);
|
ok(item.iExpandedImage == (WORD)I_IMAGENONE, "got %d\n", item.iExpandedImage);
|
||||||
|
|
||||||
@ -1323,7 +1322,6 @@ START_TEST(treeview)
|
|||||||
test_itemedit();
|
test_itemedit();
|
||||||
test_treeview_classinfo();
|
test_treeview_classinfo();
|
||||||
test_expandnotify();
|
test_expandnotify();
|
||||||
test_rect_retrieval_after_expand_with_select();
|
|
||||||
test_TVS_SINGLEEXPAND();
|
test_TVS_SINGLEEXPAND();
|
||||||
|
|
||||||
if (!load_v6_module(&ctx_cookie, &hCtx))
|
if (!load_v6_module(&ctx_cookie, &hCtx))
|
||||||
@ -1353,7 +1351,8 @@ START_TEST(treeview)
|
|||||||
unload_v6_module(ctx_cookie, hCtx);
|
unload_v6_module(ctx_cookie, hCtx);
|
||||||
|
|
||||||
PostMessageA(hMainWnd, WM_CLOSE, 0, 0);
|
PostMessageA(hMainWnd, WM_CLOSE, 0, 0);
|
||||||
while(GetMessageA(&msg,0,0,0)) {
|
while(GetMessageA(&msg, 0, 0, 0))
|
||||||
|
{
|
||||||
TranslateMessage(&msg);
|
TranslateMessage(&msg);
|
||||||
DispatchMessageA(&msg);
|
DispatchMessageA(&msg);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user