Greg Geldorp : user32/tests: Fix edit tests.
Alexandre Julliard
julliard at winehq.org
Mon Jan 24 11:07:35 CST 2011
Module: wine
Branch: master
Commit: 0406b5d543a3d64e628b02fd0eadc85b78878c44
URL: http://source.winehq.org/git/wine.git/?a=commit;h=0406b5d543a3d64e628b02fd0eadc85b78878c44
Author: Greg Geldorp <ggeldorp at vmware.com>
Date: Mon Jan 24 00:56:10 2011 +0100
user32/tests: Fix edit tests.
---
dlls/user32/tests/edit.c | 21 +++++++++++++++++----
1 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/dlls/user32/tests/edit.c b/dlls/user32/tests/edit.c
index fb74143..2308faa 100644
--- a/dlls/user32/tests/edit.c
+++ b/dlls/user32/tests/edit.c
@@ -837,10 +837,15 @@ static void test_edit_control_3(void)
{
HWND hWnd;
HWND hParent;
- int len;
+ HDC hDC;
+ int len, dpi;
static const char *str = "this is a long string.";
static const char *str2 = "this is a long string.\r\nthis is a long string.\r\nthis is a long string.\r\nthis is a long string.";
+ hDC = GetDC(NULL);
+ dpi = GetDeviceCaps(hDC, LOGPIXELSY);
+ ReleaseDC(NULL, hDC);
+
trace("EDIT: Test notifications\n");
hParent = CreateWindowExA(0,
@@ -947,7 +952,7 @@ static void test_edit_control_3(void)
"EDIT",
NULL,
ES_MULTILINE,
- 10, 10, 50, 50,
+ 10, 10, (50 * dpi) / 96, (50 * dpi) / 96,
hParent, NULL, NULL, NULL);
assert(hWnd);
@@ -992,7 +997,7 @@ static void test_edit_control_3(void)
"EDIT",
NULL,
ES_MULTILINE | ES_AUTOHSCROLL,
- 10, 10, 50, 50,
+ 10, 10, (50 * dpi) / 96, (50 * dpi) / 96,
hParent, NULL, NULL, NULL);
assert(hWnd);
@@ -1527,6 +1532,7 @@ static void test_margins_font_change(void)
ok(HIWORD(margins) == HIWORD(font_margins), "got %d\n", HIWORD(margins));
SendMessageA(hwEdit, EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, MAKELONG(EC_USEFONTINFO,EC_USEFONTINFO));
+ SendMessageA(hwEdit, WM_SETFONT, (WPARAM)hfont, 0);
margins = SendMessage(hwEdit, EM_GETMARGINS, 0, 0);
ok(LOWORD(margins) == LOWORD(font_margins), "got %d\n", LOWORD(margins));
ok(HIWORD(margins) == HIWORD(font_margins), "got %d\n", HIWORD(margins));
@@ -2212,9 +2218,15 @@ static void test_fontsize(void)
{
HWND hwEdit;
HFONT hfont;
+ HDC hDC;
LOGFONT lf;
LONG r;
char szLocalString[MAXLEN];
+ int dpi;
+
+ hDC = GetDC(NULL);
+ dpi = GetDeviceCaps(hDC, LOGPIXELSY);
+ ReleaseDC(NULL, hDC);
memset(&lf,0,sizeof(LOGFONTA));
strcpy(lf.lfFaceName,"Arial");
@@ -2224,7 +2236,8 @@ static void test_fontsize(void)
trace("EDIT: Oversized font (Multi line)\n");
hwEdit= CreateWindow("EDIT", NULL, ES_MULTILINE|ES_AUTOHSCROLL,
- 0, 0, 150, 50, NULL, NULL, hinst, NULL);
+ 0, 0, (150 * dpi) / 96, (50 * dpi) / 96, NULL, NULL,
+ hinst, NULL);
SendMessage(hwEdit,WM_SETFONT,(WPARAM)hfont,0);
More information about the wine-cvs
mailing list