Dylan Smith : richedit: Added tests for autoscrolling options based on WS_V /HSCROLL.
Alexandre Julliard
julliard at winehq.org
Mon Jan 12 10:41:11 CST 2009
Module: wine
Branch: master
Commit: 55d9e95892c08e4e46b705f8ffa84b6237261e19
URL: http://source.winehq.org/git/wine.git/?a=commit;h=55d9e95892c08e4e46b705f8ffa84b6237261e19
Author: Dylan Smith <dylan.ah.smith at gmail.com>
Date: Sun Jan 11 22:20:42 2009 -0500
richedit: Added tests for autoscrolling options based on WS_V/HSCROLL.
---
dlls/riched20/tests/editor.c | 30 ++++++++++++++++++++++++++++--
dlls/riched32/tests/editor.c | 32 ++++++++++++++++++++++++++++++++
2 files changed, 60 insertions(+), 2 deletions(-)
diff --git a/dlls/riched20/tests/editor.c b/dlls/riched20/tests/editor.c
index 4efe8e3..534d217 100644
--- a/dlls/riched20/tests/editor.c
+++ b/dlls/riched20/tests/editor.c
@@ -5826,7 +5826,7 @@ static void test_word_wrap(void)
DestroyWindow(hwnd);
}
-static void test_auto_yscroll(void)
+static void test_autoscroll(void)
{
HWND hwnd = new_richedit(NULL);
int lines, ret, redraw;
@@ -5856,6 +5856,32 @@ static void test_auto_yscroll(void)
SendMessage(hwnd, WM_SETREDRAW, TRUE, 0);
DestroyWindow(hwnd);
+
+ /* The WS_VSCROLL and WS_HSCROLL styles implicitly set
+ * auto vertical/horizontal scrolling options. */
+ hwnd = CreateWindowEx(0, RICHEDIT_CLASS, NULL,
+ WS_POPUP|ES_MULTILINE|WS_VSCROLL|WS_HSCROLL,
+ 0, 0, 200, 60, NULL, NULL, hmoduleRichEdit, NULL);
+ ok(hwnd != NULL, "class: %s, error: %d\n", RICHEDIT_CLASS, (int) GetLastError());
+ ret = SendMessage(hwnd, EM_GETOPTIONS, 0, 0);
+ todo_wine ok(ret & ECO_AUTOVSCROLL, "ECO_AUTOVSCROLL isn't set.\n");
+ todo_wine ok(ret & ECO_AUTOHSCROLL, "ECO_AUTOHSCROLL isn't set.\n");
+ ret = GetWindowLong(hwnd, GWL_STYLE);
+ ok(!(ret & ES_AUTOVSCROLL), "ES_AUTOVSCROLL is set.\n");
+ ok(!(ret & ES_AUTOHSCROLL), "ES_AUTOHSCROLL is set.\n");
+ DestroyWindow(hwnd);
+
+ hwnd = CreateWindowEx(0, RICHEDIT_CLASS, NULL,
+ WS_POPUP|ES_MULTILINE,
+ 0, 0, 200, 60, NULL, NULL, hmoduleRichEdit, NULL);
+ ok(hwnd != NULL, "class: %s, error: %d\n", RICHEDIT_CLASS, (int) GetLastError());
+ ret = SendMessage(hwnd, EM_GETOPTIONS, 0, 0);
+ ok(!(ret & ECO_AUTOVSCROLL), "ECO_AUTOVSCROLL is set.\n");
+ ok(!(ret & ECO_AUTOHSCROLL), "ECO_AUTOHSCROLL is set.\n");
+ ret = GetWindowLong(hwnd, GWL_STYLE);
+ ok(!(ret & ES_AUTOVSCROLL), "ES_AUTOVSCROLL is set.\n");
+ ok(!(ret & ES_AUTOHSCROLL), "ES_AUTOHSCROLL is set.\n");
+ DestroyWindow(hwnd);
}
@@ -6255,7 +6281,7 @@ START_TEST( editor )
test_EM_CHARFROMPOS();
test_SETPARAFORMAT();
test_word_wrap();
- test_auto_yscroll();
+ test_autoscroll();
test_format_rect();
test_WM_GETDLGCODE();
diff --git a/dlls/riched32/tests/editor.c b/dlls/riched32/tests/editor.c
index 09bdc2e..5a3530d 100644
--- a/dlls/riched32/tests/editor.c
+++ b/dlls/riched32/tests/editor.c
@@ -889,6 +889,37 @@ static void test_word_wrap(void)
DestroyWindow(hwnd);
}
+static void test_autoscroll(void)
+{
+ HWND hwnd;
+ UINT ret;
+
+ /* The WS_VSCROLL and WS_HSCROLL styles implicitly set
+ * auto vertical/horizontal scrolling options. */
+ hwnd = CreateWindowEx(0, RICHEDIT_CLASS10A, NULL,
+ WS_POPUP|ES_MULTILINE|WS_VSCROLL|WS_HSCROLL,
+ 0, 0, 200, 60, NULL, NULL, hmoduleRichEdit, NULL);
+ ok(hwnd != NULL, "class: %s, error: %d\n", RICHEDIT_CLASS, (int) GetLastError());
+ ret = SendMessage(hwnd, EM_GETOPTIONS, 0, 0);
+ todo_wine ok(ret & ECO_AUTOVSCROLL, "ECO_AUTOVSCROLL isn't set.\n");
+ ok(!(ret & ECO_AUTOHSCROLL), "ECO_AUTOHSCROLL is set.\n");
+ ret = GetWindowLong(hwnd, GWL_STYLE);
+ todo_wine ok(ret & ES_AUTOVSCROLL, "ES_AUTOVSCROLL isn't set.\n");
+ ok(!(ret & ES_AUTOHSCROLL), "ES_AUTOHSCROLL is set.\n");
+ DestroyWindow(hwnd);
+
+ hwnd = CreateWindowEx(0, RICHEDIT_CLASS, NULL,
+ WS_POPUP|ES_MULTILINE,
+ 0, 0, 200, 60, NULL, NULL, hmoduleRichEdit, NULL);
+ ok(hwnd != NULL, "class: %s, error: %d\n", RICHEDIT_CLASS, (int) GetLastError());
+ ret = SendMessage(hwnd, EM_GETOPTIONS, 0, 0);
+ ok(!(ret & ECO_AUTOVSCROLL), "ECO_AUTOVSCROLL is set.\n");
+ ok(!(ret & ECO_AUTOHSCROLL), "ECO_AUTOHSCROLL is set.\n");
+ ret = GetWindowLong(hwnd, GWL_STYLE);
+ ok(!(ret & ES_AUTOVSCROLL), "ES_AUTOVSCROLL is set.\n");
+ ok(!(ret & ES_AUTOHSCROLL), "ES_AUTOHSCROLL is set.\n");
+ DestroyWindow(hwnd);
+}
START_TEST( editor )
{
@@ -911,6 +942,7 @@ START_TEST( editor )
test_EM_FINDTEXT();
test_EM_POSFROMCHAR();
test_word_wrap();
+ test_autoscroll();
/* Set the environment variable WINETEST_RICHED32 to keep windows
* responsive and open for 30 seconds. This is useful for debugging.
More information about the wine-cvs
mailing list