-- v10: comctl32/listview: Do not return items count on getting next item for last one. comctl32/listview: Add LVM_GETNEXTITEM test.
From: Ilia Docin ilya.docin@contentai.ru
--- dlls/comctl32/tests/listview.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+)
diff --git a/dlls/comctl32/tests/listview.c b/dlls/comctl32/tests/listview.c index 1081a045cde..dbe2cd574f9 100644 --- a/dlls/comctl32/tests/listview.c +++ b/dlls/comctl32/tests/listview.c @@ -7162,6 +7162,36 @@ static void test_LVM_SETBKIMAGE(BOOL is_v6) CoUninitialize(); }
+static void test_LVM_GETNEXTITEM(void) +{ + /* LVM_GETNEXTITEM */ + + HWND hwnd; + DWORD r; + UINT uFlagsAbove = MAKELPARAM(LVNI_ABOVE, 0); + UINT uFlagsBelow = MAKELPARAM(LVNI_BELOW, 0); + + hwnd = create_listview_control(LVS_REPORT); + insert_item(hwnd, 0); + insert_item(hwnd, 1); + insert_item(hwnd, 2); + + r = SendMessageA(hwnd, LVM_GETNEXTITEM, 0, uFlagsAbove); + expect(-1, r); + r = SendMessageA(hwnd, LVM_GETNEXTITEM, 0, uFlagsBelow); + expect(1, r); + r = SendMessageA(hwnd, LVM_GETNEXTITEM, 1, uFlagsAbove); + expect(0, r); + r = SendMessageA(hwnd, LVM_GETNEXTITEM, 1, uFlagsBelow); + expect(2, r); + r = SendMessageA(hwnd, LVM_GETNEXTITEM, 2, uFlagsAbove); + expect(1, r); + r = SendMessageA(hwnd, LVM_GETNEXTITEM, 2, uFlagsBelow); + expect(-1, r); + + DestroyWindow(hwnd); +} + START_TEST(listview) { ULONG_PTR ctx_cookie; @@ -7275,6 +7305,7 @@ START_TEST(listview) test_item_state_change(); test_selected_column(); test_LVM_GETNEXTITEMINDEX(); + test_LVM_GETNEXTITEM(); test_LVM_SETBKIMAGE(TRUE);
unload_v6_module(ctx_cookie, hCtx);
From: Ilia Docin ilya.docin@contentai.ru
--- dlls/comctl32/listview.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c index c82473b6205..b7ef90635ba 100644 --- a/dlls/comctl32/listview.c +++ b/dlls/comctl32/listview.c @@ -7371,7 +7371,7 @@ static INT LISTVIEW_GetNextItem(const LISTVIEW_INFO *infoPtr, INT nItem, UINT uF { if ((infoPtr->uView == LV_VIEW_LIST) || (infoPtr->uView == LV_VIEW_DETAILS)) { - while (nItem < infoPtr->nItemCount) + while (nItem < infoPtr->nItemCount - 1) { nItem++; if ((LISTVIEW_GetItemState(infoPtr, nItem, uMask) & uMask) == uMask)
On Thu Jul 18 06:20:15 2024 +0000, Zhiyi Zhang wrote:
there is no todo_wine in this patch, which means the wine tests are already passing without your fix.
Sorry for the late response. But how it passes without fix if the feature branch has that fix and pipeline runs on the feature branch? Besides, I checked locally that it fails with: listview.c:7262: Test failed: Expected -1, got 3
On Thu Jul 18 18:29:50 2024 +0000, Ilia Docin wrote:
changed this line in [version 10 of the diff](/wine/wine/-/merge_requests/5909/diffs?diff_id=122867&start_sha=df9fa103e18b9a1da166096e88d8a575fa98961f#bab0d15f966441b7f4c6d4f932100e60bd2985e3_9810_9810)
Done.