From 984300b59e70047c0964b9c269ffedb236ea3206 Mon Sep 17 00:00:00 2001 From: Paul Vriens Date: Wed, 10 Jun 2009 10:16:13 +0200 Subject: [PATCH] riched32/tests: Fix a few test failures on Win9x, WinME and NT4. --- dlls/riched32/tests/editor.c | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/dlls/riched32/tests/editor.c b/dlls/riched32/tests/editor.c index cb5db770a8a..8e0388c0fe2 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); -- 2.11.4.GIT