Skip to content

Commit a2a9df3

Browse files
committed
[RICHED20_WINETEST] EM_SETSEL tests. Addendum to r67074. By Christoph von Wittich.
svn path=/trunk/; revision=67076
1 parent 5cc5501 commit a2a9df3

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

rostests/winetests/riched20/editor.c

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4422,6 +4422,43 @@ static void test_EM_EXSETSEL(void)
44224422
DestroyWindow(hwndRichEdit);
44234423
}
44244424

4425+
static void check_EM_SETSEL(HWND hwnd, const struct exsetsel_s *setsel, int id) {
4426+
LRESULT result;
4427+
int start, end;
4428+
4429+
result = SendMessageA(hwnd, EM_SETSEL, setsel->min, setsel->max);
4430+
4431+
ok(result == setsel->expected_retval, "EM_SETSEL(%d): expected: %ld actual: %ld\n", id, setsel->expected_retval, result);
4432+
4433+
SendMessageA(hwnd, EM_GETSEL, (WPARAM)&start, (LPARAM)&end);
4434+
4435+
if (setsel->_getsel_todo_wine) {
4436+
todo_wine {
4437+
ok(start == setsel->expected_getsel_start && end == setsel->expected_getsel_end, "EM_SETSEL(%d): expected (%d,%d) actual:(%d,%d)\n", id, setsel->expected_getsel_start, setsel->expected_getsel_end, start, end);
4438+
}
4439+
} else {
4440+
ok(start == setsel->expected_getsel_start && end == setsel->expected_getsel_end, "EM_SETSEL(%d): expected (%d,%d) actual:(%d,%d)\n", id, setsel->expected_getsel_start, setsel->expected_getsel_end, start, end);
4441+
}
4442+
}
4443+
4444+
static void test_EM_SETSEL(void)
4445+
{
4446+
HWND hwndRichEdit = new_richedit(NULL);
4447+
int i;
4448+
const int num_tests = sizeof(exsetsel_tests)/sizeof(struct exsetsel_s);
4449+
4450+
/* sending some text to the window */
4451+
SendMessageA(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)"testing selection");
4452+
/* 01234567890123456*/
4453+
/* 10 */
4454+
4455+
for (i = 0; i < num_tests; i++) {
4456+
check_EM_SETSEL(hwndRichEdit, &exsetsel_tests[i], i);
4457+
}
4458+
4459+
DestroyWindow(hwndRichEdit);
4460+
}
4461+
44254462
static void test_EM_REPLACESEL(int redraw)
44264463
{
44274464
HWND hwndRichEdit = new_richedit(NULL);
@@ -7626,6 +7663,7 @@ START_TEST( editor )
76267663
test_EM_GETLIMITTEXT();
76277664
test_WM_SETFONT();
76287665
test_EM_GETMODIFY();
7666+
test_EM_SETSEL();
76297667
test_EM_EXSETSEL();
76307668
test_WM_PASTE();
76317669
test_EM_STREAMIN();

0 commit comments

Comments
 (0)