Module: wine Branch: master Commit: 984300b59e70047c0964b9c269ffedb236ea3206 URL: http://source.winehq.org/git/wine.git/?a=commit;h=984300b59e70047c0964b9c269...
Author: Paul Vriens Paul.Vriens.Wine@gmail.com Date: Wed Jun 10 10:16:13 2009 +0200
riched32/tests: Fix a few test failures on Win9x, WinME and NT4.
---
dlls/riched32/tests/editor.c | 30 +++++++++++++++++++++++++----- 1 files changed, 25 insertions(+), 5 deletions(-)
diff --git a/dlls/riched32/tests/editor.c b/dlls/riched32/tests/editor.c index cb5db77..8e0388c 100644 --- a/dlls/riched32/tests/editor.c +++ b/dlls/riched32/tests/editor.c @@ -868,11 +868,19 @@ static void test_word_wrap(void) res = SendMessage(hwnd, WM_SETTEXT, 0, (LPARAM) text); ok(res, "WM_SETTEXT failed.\n"); pos = SendMessage(hwnd, EM_CHARFROMPOS, 0, (LPARAM) &point); - ok(!pos, "pos=%d indicating word wrap when none is expected.\n", pos); + ok(!pos || + broken(pos == lstrlen(text)), /* Win9x, WinME and NT4 */ + "pos=%d indicating word wrap when none is expected.\n", pos); + lines = SendMessage(hwnd, EM_GETLINECOUNT, 0, 0); + ok(lines == 1, "Line was not expected to wrap (lines=%d).\n", lines);
SetWindowLong(hwnd, GWL_STYLE, dwCommonStyle); pos = SendMessage(hwnd, EM_CHARFROMPOS, 0, (LPARAM) &point); - ok(!pos, "pos=%d indicating word wrap when none is expected.\n", pos); + ok(!pos || + broken(pos == lstrlen(text)), /* Win9x, WinME and NT4 */ + "pos=%d indicating word wrap when none is expected.\n", pos); + lines = SendMessage(hwnd, EM_GETLINECOUNT, 0, 0); + ok(lines == 1, "Line was not expected to wrap (lines=%d).\n", lines); DestroyWindow(hwnd);
hwnd = CreateWindow(RICHEDIT_CLASS10A, NULL, @@ -882,17 +890,29 @@ static void test_word_wrap(void) res = SendMessage(hwnd, WM_SETTEXT, 0, (LPARAM) text); ok(res, "WM_SETTEXT failed.\n"); pos = SendMessage(hwnd, EM_CHARFROMPOS, 0, (LPARAM) &point); - ok(!pos, "pos=%d indicating word wrap when none is expected.\n", pos); + ok(!pos || + broken(pos == lstrlen(text)), /* Win9x, WinME and NT4 */ + "pos=%d indicating word wrap when none is expected.\n", pos); + lines = SendMessage(hwnd, EM_GETLINECOUNT, 0, 0); + ok(lines == 1, "Line was not expected to wrap (lines=%d).\n", lines);
SetWindowLong(hwnd, GWL_STYLE, dwCommonStyle); pos = SendMessage(hwnd, EM_CHARFROMPOS, 0, (LPARAM) &point); - ok(!pos, "pos=%d indicating word wrap when none is expected.\n", pos); + ok(!pos || + broken(pos == lstrlen(text)), /* Win9x, WinME and NT4 */ + "pos=%d indicating word wrap when none is expected.\n", pos); + lines = SendMessage(hwnd, EM_GETLINECOUNT, 0, 0); + ok(lines == 1, "Line was not expected to wrap (lines=%d).\n", lines);
/* Test the effect of EM_SETTARGETDEVICE on word wrap. */ res = SendMessage(hwnd, EM_SETTARGETDEVICE, 0, 1); ok(res, "EM_SETTARGETDEVICE failed (returned %d).\n", res); pos = SendMessage(hwnd, EM_CHARFROMPOS, 0, (LPARAM) &point); - ok(!pos, "pos=%d indicating word wrap when none is expected.\n", pos); + ok(!pos || + broken(pos == lstrlen(text)), /* Win9x, WinME and NT4 */ + "pos=%d indicating word wrap when none is expected.\n", pos); + lines = SendMessage(hwnd, EM_GETLINECOUNT, 0, 0); + ok(lines == 1, "Line was not expected to wrap (lines=%d).\n", lines);
res = SendMessage(hwnd, EM_SETTARGETDEVICE, 0, 0); ok(res, "EM_SETTARGETDEVICE failed (returned %d).\n", res);