diff --git a/dlls/riched20/tests/editor.c b/dlls/riched20/tests/editor.c index 5bbb613c92..11efb7bab2 100644 --- a/dlls/riched20/tests/editor.c +++ b/dlls/riched20/tests/editor.c @@ -1452,7 +1452,7 @@ static void test_EM_GETSELTEXT(void) /* FIXME: need to test unimplemented options and robustly test wparam */ static void test_EM_SETOPTIONS(void) { - HWND hwndRichEdit = new_richedit(NULL); + HWND hwndRichEdit; static const char text[] = "Hello. My name is RichEdit!"; char buffer[1024] = {0}; DWORD dwStyle, options, oldOptions; @@ -1460,6 +1460,27 @@ static void test_EM_SETOPTIONS(void) ES_READONLY|ES_WANTRETURN|ES_SAVESEL| ES_SELECTIONBAR|ES_VERTICAL; + /* Test initial options. */ + hwndRichEdit = CreateWindow(RICHEDIT_CLASS, NULL, WS_POPUP, + 0, 0, 200, 60, NULL, NULL, + hmoduleRichEdit, NULL); + ok(hwndRichEdit != NULL, "class: %s, error: %d\n", + RICHEDIT_CLASS, (int) GetLastError()); + options = SendMessage(hwndRichEdit, EM_GETOPTIONS, 0, 0); + ok(options == 0, "Incorrect initial options %x\n", options); + DestroyWindow(hwndRichEdit); + + hwndRichEdit = CreateWindow(RICHEDIT_CLASS, NULL, + WS_POPUP|WS_HSCROLL|WS_VSCROLL, + 0, 0, 200, 60, NULL, NULL, + hmoduleRichEdit, NULL); + ok(hwndRichEdit != NULL, "class: %s, error: %d\n", + RICHEDIT_CLASS, (int) GetLastError()); + options = SendMessage(hwndRichEdit, EM_GETOPTIONS, 0, 0); + /* WS_[VH]SCROLL cause the ECO_AUTO[VH]SCROLL options to be set */ + todo_wine ok(options == (ECO_AUTOVSCROLL|ECO_AUTOHSCROLL), + "Incorrect initial options %x\n", options); + /* NEGATIVE TESTING - NO OPTIONS SET */ SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM) text); SendMessage(hwndRichEdit, EM_SETOPTIONS, ECOOP_SET, 0); diff --git a/dlls/riched32/tests/editor.c b/dlls/riched32/tests/editor.c index 5a3530d68e..ccac356a0c 100644 --- a/dlls/riched32/tests/editor.c +++ b/dlls/riched32/tests/editor.c @@ -889,6 +889,27 @@ static void test_word_wrap(void) DestroyWindow(hwnd); } +static void test_EM_GETOPTIONS(void) +{ + HWND hwnd; + DWORD options; + + hwnd = CreateWindow(RICHEDIT_CLASS10A, NULL, + WS_POPUP, + 0, 0, 200, 60, NULL, NULL, hmoduleRichEdit, NULL); + options = SendMessage(hwnd, EM_GETOPTIONS, 0, 0); + ok(options == 0, "Incorrect options %x\n", options); + DestroyWindow(hwnd); + + hwnd = CreateWindow(RICHEDIT_CLASS10A, NULL, + WS_POPUP|WS_VSCROLL|WS_HSCROLL, + 0, 0, 200, 60, NULL, NULL, hmoduleRichEdit, NULL); + options = SendMessage(hwnd, EM_GETOPTIONS, 0, 0); + todo_wine ok(options == ECO_AUTOVSCROLL, + "Incorrect initial options %x\n", options); + DestroyWindow(hwnd); +} + static void test_autoscroll(void) { HWND hwnd; @@ -942,6 +963,7 @@ START_TEST( editor ) test_EM_FINDTEXT(); test_EM_POSFROMCHAR(); test_word_wrap(); + test_EM_GETOPTIONS(); test_autoscroll(); /* Set the environment variable WINETEST_RICHED32 to keep windows