Module: wine Branch: master Commit: 3845ed795f65a4fdaf179c7a93bcd09f9fcb741d URL: http://source.winehq.org/git/wine.git/?a=commit;h=3845ed795f65a4fdaf179c7a93...
Author: Nikolay Sivov bunglehead@gmail.com Date: Fri Apr 24 14:51:43 2009 +0400
comctl32/tests: Tests for LVM_GETCOLUMNORDERARRAY: it actually uses HDM_GETORDERARRAY.
---
dlls/comctl32/tests/listview.c | 34 +++++++++++++++++++++++++++++++++- 1 files changed, 33 insertions(+), 1 deletions(-)
diff --git a/dlls/comctl32/tests/listview.c b/dlls/comctl32/tests/listview.c index 8fcf0f4..1612171 100644 --- a/dlls/comctl32/tests/listview.c +++ b/dlls/comctl32/tests/listview.c @@ -152,6 +152,12 @@ static const struct message listview_ownerdata_switchto_seq[] = { { 0 } };
+static const struct message listview_getorderarray_seq[] = { + { LVM_GETCOLUMNORDERARRAY, sent|id|wparam, 2, 0, LISTVIEW_ID }, + { HDM_GETORDERARRAY, sent|id|wparam, 2, 0, HEADER_ID }, + { 0 } +}; + struct subclass_info { WNDPROC oldproc; @@ -800,9 +806,10 @@ static void test_items(void)
static void test_columns(void) { - HWND hwnd; + HWND hwnd, hwndheader; LVCOLUMN column; DWORD rc; + INT order[2];
hwnd = CreateWindowEx(0, "SysListView32", "foo", LVS_REPORT, 10, 10, 100, 200, hwndparent, NULL, NULL, NULL); @@ -821,6 +828,31 @@ static void test_columns(void) "Inserting column with no mask failed to set width to 10 with %d\n", rc);
DestroyWindow(hwnd); + + /* LVM_GETCOLUMNORDERARRAY */ + hwnd = create_listview_control(0); + hwndheader = subclass_header(hwnd); + + memset(&column, 0, sizeof(column)); + column.mask = LVCF_WIDTH; + column.cx = 100; + rc = ListView_InsertColumn(hwnd, 0, &column); + ok(rc == 0, "Inserting column failed with %d\n", rc); + + column.cx = 200; + rc = ListView_InsertColumn(hwnd, 1, &column); + ok(rc == 1, "Inserting column failed with %d\n", rc); + + flush_sequences(sequences, NUM_MSG_SEQUENCES); + + rc = SendMessage(hwnd, LVM_GETCOLUMNORDERARRAY, 2, (LPARAM)&order); + ok(rc != 0, "Expected LVM_GETCOLUMNORDERARRAY to succeed\n"); + ok(order[0] == 0, "Expected order 0, got %d\n", order[0]); + ok(order[1] == 1, "Expected order 1, got %d\n", order[1]); + + ok_sequence(sequences, LISTVIEW_SEQ_INDEX, listview_getorderarray_seq, "get order array", TRUE); + + DestroyWindow(hwnd); } /* test setting imagelist between WM_NCCREATE and WM_CREATE */ static WNDPROC listviewWndProc;