[PATCH 2/3] comctl32/tests: A bit more tests for partial strings in LVM_FINDITEM

Nikolay Sivov nsivov at codeweavers.com
Sun May 21 16:09:40 CDT 2017


Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
---
 dlls/comctl32/tests/listview.c | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/dlls/comctl32/tests/listview.c b/dlls/comctl32/tests/listview.c
index 471f9f715c..4bc95bb3e8 100644
--- a/dlls/comctl32/tests/listview.c
+++ b/dlls/comctl32/tests/listview.c
@@ -5055,12 +5055,30 @@ static void test_finditem(void)
     fi.psz = f;
     r = SendMessageA(hwnd, LVM_FINDITEMA, -1, (LPARAM)&fi);
     expect(0, r);
+
+    fi.flags = LVFI_STRING | LVFI_PARTIAL;
+    r = SendMessageA(hwnd, LVM_FINDITEMA, -1, (LPARAM)&fi);
+    expect(0, r);
+
+    fi.flags = LVFI_PARTIAL;
+    r = SendMessageA(hwnd, LVM_FINDITEMA, -1, (LPARAM)&fi);
+    expect(0, r);
+
     /* partial string search, inserted text was "foo" */
     strcpy(f, "fo");
     fi.flags = LVFI_STRING | LVFI_PARTIAL;
     fi.psz = f;
     r = SendMessageA(hwnd, LVM_FINDITEMA, -1, (LPARAM)&fi);
     expect(0, r);
+
+    fi.flags = LVFI_STRING;
+    r = SendMessageA(hwnd, LVM_FINDITEMA, -1, (LPARAM)&fi);
+    expect(-1, r);
+
+    fi.flags = LVFI_PARTIAL;
+    r = SendMessageA(hwnd, LVM_FINDITEMA, -1, (LPARAM)&fi);
+    expect(0, r);
+
     /* partial string search, part after start char */
     strcpy(f, "oo");
     fi.flags = LVFI_STRING | LVFI_PARTIAL;
@@ -5091,12 +5109,22 @@ static void test_finditem(void)
     r = SendMessageA(hwnd, LVM_FINDITEMA, -1, (LPARAM)&fi);
     expect(-1, r);
 
+    strcpy(f, "o");
+    fi.flags = LVFI_SUBSTRING | LVFI_PARTIAL;
+    fi.psz = f;
+    r = SendMessageA(hwnd, LVM_FINDITEMA, -1, (LPARAM)&fi);
+    expect(-1, r);
+
     strcpy(f, "f");
     fi.flags = LVFI_SUBSTRING | LVFI_STRING;
     fi.psz = f;
     r = SendMessageA(hwnd, LVM_FINDITEMA, -1, (LPARAM)&fi);
     expect(0, r);
 
+    fi.flags = LVFI_SUBSTRING | LVFI_PARTIAL;
+    r = SendMessageA(hwnd, LVM_FINDITEMA, -1, (LPARAM)&fi);
+    expect(0, r);
+
     DestroyWindow(hwnd);
 }
 
-- 
2.11.0




More information about the wine-patches mailing list