Re: [1/2] comctl32/listview: Additional tests for LVM_GETSUBITEMRECT
Paul Vriens wrote: Nikolay Sivov wrote: Paul Vriens wrote: Nikolay Sivov wrote: Changelog: - Additional tests for LVM_GETSUBITEMRECT From 2f2cb8e54b81ff6be7229b7931945a3bb76f4bde Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Wed, 22 Apr 2009 13:05:56 -0400 Subject: Additional tests for LVM_GETSUBITEMRECT --- dlls/comctl32/tests/listview.c | 41 1 files changed, 41 insertions(+), 0 deletions(-) diff --git a/dlls/comctl32/tests/listview.c b/dlls/comctl32/tests/listview.c index 6f205fd..fba7a01 100644 --- a/dlls/comctl32/tests/listview.c +++ b/dlls/comctl32/tests/listview.c @@ -847,6 +847,7 @@ static void test_create(void) LONG_PTR ret; LONG r; LVCOLUMNA col; +RECT rect; WNDCLASSEX cls; cls.cbSize = sizeof(WNDCLASSEX); ok(GetClassInfoEx(GetModuleHandle(NULL), "SysListView32", &cls), "GetClassInfoEx failed\n"); @@ -976,6 +977,31 @@ static void test_create(void) ok(IsWindow(hHeader), "Header should be created\n"); ok(hHeader == GetDlgItem(hList, 0), "Expected header as dialog item\n"); DestroyWindow(hList); + +/* requesting header info with LVM_GETSUBITEMRECT doesn't create it */ +hList = CreateWindow("SysListView32", "Test", LVS_REPORT, 0, 0, 100, 100, NULL, NULL, + GetModuleHandle(NULL), 0); +ok(!IsWindow(hHeader), "Header shouldn't be created\n"); +ok(NULL == GetDlgItem(hList, 0), "NULL dialog item expected\n"); + +rect.left = LVIR_BOUNDS; +rect.top = 1; +rect.right = rect.bottom = -10; +r = SendMessage(hList, LVM_GETSUBITEMRECT, -1, (LPARAM)&rect); +todo_wine +ok(r != 0, "Expected not-null LRESULT\n"); + +hHeader = (HWND)SendMessage(hList, LVM_GETHEADER, 0, 0); +ok(!IsWindow(hHeader), "Header shouldn't be created\n"); +ok(NULL == GetDlgItem(hList, 0), "NULL dialog item expected\n"); + +expect(0, rect.left); +todo_wine { +expect(0, rect.right); +expect(0, rect.top); These first 3 seems to fail on everything from W2K downwards. Could you have a look? And on one of Vista machines too. So it's only stable for XP and 2k3, maybe it's better to remove them completely? I see 2 of those on a Vista box and also on a W2K8 box. The results are also not consistent. I agree that this makes it a bit useless for testing purposes. Ok, I'll sent a patch in a couple of hours. I still prefer to return zero rectangle keeping in mind that all about this special case is undocumented.
Re: [1/2] comctl32/listview: Additional tests for LVM_GETSUBITEMRECT
Nikolay Sivov wrote: Paul Vriens wrote: Nikolay Sivov wrote: Changelog: - Additional tests for LVM_GETSUBITEMRECT From 2f2cb8e54b81ff6be7229b7931945a3bb76f4bde Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Wed, 22 Apr 2009 13:05:56 -0400 Subject: Additional tests for LVM_GETSUBITEMRECT --- dlls/comctl32/tests/listview.c | 41 1 files changed, 41 insertions(+), 0 deletions(-) diff --git a/dlls/comctl32/tests/listview.c b/dlls/comctl32/tests/listview.c index 6f205fd..fba7a01 100644 --- a/dlls/comctl32/tests/listview.c +++ b/dlls/comctl32/tests/listview.c @@ -847,6 +847,7 @@ static void test_create(void) LONG_PTR ret; LONG r; LVCOLUMNA col; +RECT rect; WNDCLASSEX cls; cls.cbSize = sizeof(WNDCLASSEX); ok(GetClassInfoEx(GetModuleHandle(NULL), "SysListView32", &cls), "GetClassInfoEx failed\n"); @@ -976,6 +977,31 @@ static void test_create(void) ok(IsWindow(hHeader), "Header should be created\n"); ok(hHeader == GetDlgItem(hList, 0), "Expected header as dialog item\n"); DestroyWindow(hList); + +/* requesting header info with LVM_GETSUBITEMRECT doesn't create it */ +hList = CreateWindow("SysListView32", "Test", LVS_REPORT, 0, 0, 100, 100, NULL, NULL, + GetModuleHandle(NULL), 0); +ok(!IsWindow(hHeader), "Header shouldn't be created\n"); +ok(NULL == GetDlgItem(hList, 0), "NULL dialog item expected\n"); + +rect.left = LVIR_BOUNDS; +rect.top = 1; +rect.right = rect.bottom = -10; +r = SendMessage(hList, LVM_GETSUBITEMRECT, -1, (LPARAM)&rect); +todo_wine +ok(r != 0, "Expected not-null LRESULT\n"); + +hHeader = (HWND)SendMessage(hList, LVM_GETHEADER, 0, 0); +ok(!IsWindow(hHeader), "Header shouldn't be created\n"); +ok(NULL == GetDlgItem(hList, 0), "NULL dialog item expected\n"); + +expect(0, rect.left); +todo_wine { +expect(0, rect.right); +expect(0, rect.top); These first 3 seems to fail on everything from W2K downwards. Could you have a look? And on one of Vista machines too. So it's only stable for XP and 2k3, maybe it's better to remove them completely? I see 2 of those on a Vista box and also on a W2K8 box. The results are also not consistent. I agree that this makes it a bit useless for testing purposes. -- Cheers, Paul.
Re: [1/2] comctl32/listview: Additional tests for LVM_GETSUBITEMRECT
Paul Vriens wrote: Nikolay Sivov wrote: Changelog: - Additional tests for LVM_GETSUBITEMRECT From 2f2cb8e54b81ff6be7229b7931945a3bb76f4bde Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Wed, 22 Apr 2009 13:05:56 -0400 Subject: Additional tests for LVM_GETSUBITEMRECT --- dlls/comctl32/tests/listview.c | 41 1 files changed, 41 insertions(+), 0 deletions(-) diff --git a/dlls/comctl32/tests/listview.c b/dlls/comctl32/tests/listview.c index 6f205fd..fba7a01 100644 --- a/dlls/comctl32/tests/listview.c +++ b/dlls/comctl32/tests/listview.c @@ -847,6 +847,7 @@ static void test_create(void) LONG_PTR ret; LONG r; LVCOLUMNA col; +RECT rect; WNDCLASSEX cls; cls.cbSize = sizeof(WNDCLASSEX); ok(GetClassInfoEx(GetModuleHandle(NULL), "SysListView32", &cls), "GetClassInfoEx failed\n"); @@ -976,6 +977,31 @@ static void test_create(void) ok(IsWindow(hHeader), "Header should be created\n"); ok(hHeader == GetDlgItem(hList, 0), "Expected header as dialog item\n"); DestroyWindow(hList); + +/* requesting header info with LVM_GETSUBITEMRECT doesn't create it */ +hList = CreateWindow("SysListView32", "Test", LVS_REPORT, 0, 0, 100, 100, NULL, NULL, + GetModuleHandle(NULL), 0); +ok(!IsWindow(hHeader), "Header shouldn't be created\n"); +ok(NULL == GetDlgItem(hList, 0), "NULL dialog item expected\n"); + +rect.left = LVIR_BOUNDS; +rect.top = 1; +rect.right = rect.bottom = -10; +r = SendMessage(hList, LVM_GETSUBITEMRECT, -1, (LPARAM)&rect); +todo_wine +ok(r != 0, "Expected not-null LRESULT\n"); + +hHeader = (HWND)SendMessage(hList, LVM_GETHEADER, 0, 0); +ok(!IsWindow(hHeader), "Header shouldn't be created\n"); +ok(NULL == GetDlgItem(hList, 0), "NULL dialog item expected\n"); + +expect(0, rect.left); +todo_wine { +expect(0, rect.right); +expect(0, rect.top); These first 3 seems to fail on everything from W2K downwards. Could you have a look? And on one of Vista machines too. So it's only stable for XP and 2k3, maybe it's better to remove them completely?
Re: [1/2] comctl32/listview: Additional tests for LVM_GETSUBITEMRECT
Nikolay Sivov wrote: Changelog: - Additional tests for LVM_GETSUBITEMRECT From 2f2cb8e54b81ff6be7229b7931945a3bb76f4bde Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Wed, 22 Apr 2009 13:05:56 -0400 Subject: Additional tests for LVM_GETSUBITEMRECT --- dlls/comctl32/tests/listview.c | 41 1 files changed, 41 insertions(+), 0 deletions(-) diff --git a/dlls/comctl32/tests/listview.c b/dlls/comctl32/tests/listview.c index 6f205fd..fba7a01 100644 --- a/dlls/comctl32/tests/listview.c +++ b/dlls/comctl32/tests/listview.c @@ -847,6 +847,7 @@ static void test_create(void) LONG_PTR ret; LONG r; LVCOLUMNA col; +RECT rect; WNDCLASSEX cls; cls.cbSize = sizeof(WNDCLASSEX); ok(GetClassInfoEx(GetModuleHandle(NULL), "SysListView32", &cls), "GetClassInfoEx failed\n"); @@ -976,6 +977,31 @@ static void test_create(void) ok(IsWindow(hHeader), "Header should be created\n"); ok(hHeader == GetDlgItem(hList, 0), "Expected header as dialog item\n"); DestroyWindow(hList); + +/* requesting header info with LVM_GETSUBITEMRECT doesn't create it */ +hList = CreateWindow("SysListView32", "Test", LVS_REPORT, 0, 0, 100, 100, NULL, NULL, + GetModuleHandle(NULL), 0); +ok(!IsWindow(hHeader), "Header shouldn't be created\n"); +ok(NULL == GetDlgItem(hList, 0), "NULL dialog item expected\n"); + +rect.left = LVIR_BOUNDS; +rect.top = 1; +rect.right = rect.bottom = -10; +r = SendMessage(hList, LVM_GETSUBITEMRECT, -1, (LPARAM)&rect); +todo_wine +ok(r != 0, "Expected not-null LRESULT\n"); + +hHeader = (HWND)SendMessage(hList, LVM_GETHEADER, 0, 0); +ok(!IsWindow(hHeader), "Header shouldn't be created\n"); +ok(NULL == GetDlgItem(hList, 0), "NULL dialog item expected\n"); + +expect(0, rect.left); +todo_wine { +expect(0, rect.right); +expect(0, rect.top); These first 3 seems to fail on everything from W2K downwards. Could you have a look? -- Cheers, Paul.