comctl32/tests: A bit more tests for partial strings in LVM_FINDITEM.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2017-05-22 00:09:40 +03:00 committed by Alexandre Julliard
parent 407a3c06fa
commit d05b351fe0
1 changed files with 28 additions and 0 deletions

View File

@ -5055,12 +5055,30 @@ static void test_finditem(void)
fi.psz = f; fi.psz = f;
r = SendMessageA(hwnd, LVM_FINDITEMA, -1, (LPARAM)&fi); r = SendMessageA(hwnd, LVM_FINDITEMA, -1, (LPARAM)&fi);
expect(0, r); 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" */ /* partial string search, inserted text was "foo" */
strcpy(f, "fo"); strcpy(f, "fo");
fi.flags = LVFI_STRING | LVFI_PARTIAL; fi.flags = LVFI_STRING | LVFI_PARTIAL;
fi.psz = f; fi.psz = f;
r = SendMessageA(hwnd, LVM_FINDITEMA, -1, (LPARAM)&fi); r = SendMessageA(hwnd, LVM_FINDITEMA, -1, (LPARAM)&fi);
expect(0, r); 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 */ /* partial string search, part after start char */
strcpy(f, "oo"); strcpy(f, "oo");
fi.flags = LVFI_STRING | LVFI_PARTIAL; fi.flags = LVFI_STRING | LVFI_PARTIAL;
@ -5091,12 +5109,22 @@ static void test_finditem(void)
r = SendMessageA(hwnd, LVM_FINDITEMA, -1, (LPARAM)&fi); r = SendMessageA(hwnd, LVM_FINDITEMA, -1, (LPARAM)&fi);
expect(-1, r); 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"); strcpy(f, "f");
fi.flags = LVFI_SUBSTRING | LVFI_STRING; fi.flags = LVFI_SUBSTRING | LVFI_STRING;
fi.psz = f; fi.psz = f;
r = SendMessageA(hwnd, LVM_FINDITEMA, -1, (LPARAM)&fi); r = SendMessageA(hwnd, LVM_FINDITEMA, -1, (LPARAM)&fi);
expect(0, r); expect(0, r);
fi.flags = LVFI_SUBSTRING | LVFI_PARTIAL;
r = SendMessageA(hwnd, LVM_FINDITEMA, -1, (LPARAM)&fi);
expect(0, r);
DestroyWindow(hwnd); DestroyWindow(hwnd);
} }