Alexandre Julliard : gdi32/tests: Create a window for justification tests that generate output
Module: wine Branch: master Commit: 6ede7a1130db8d7b964b506005a1f9bc1679f3ea URL: http://source.winehq.org/git/wine.git/?a=commit;h=6ede7a1130db8d7b964b506005... Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Feb 15 19:41:34 2007 +0100 gdi32/tests: Create a window for justification tests that generate output instead of painting over the desktop. --- dlls/gdi32/tests/font.c | 12 +++++++++--- 1 files changed, 9 insertions(+), 3 deletions(-) diff --git a/dlls/gdi32/tests/font.c b/dlls/gdi32/tests/font.c index ada2c7f..f491459 100644 --- a/dlls/gdi32/tests/font.c +++ b/dlls/gdi32/tests/font.c @@ -998,10 +998,11 @@ static void testJustification(HDC hdc, PSTR str, RECT *clientArea) static void test_SetTextJustification(void) { - HDC hdc = GetDC(0); - RECT clientArea = {0, 0, 400, 400}; + HDC hdc; + RECT clientArea; LOGFONTA lf; HFONT hfont; + HWND hwnd; static char testText[] = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do " "eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut " @@ -1011,6 +1012,10 @@ static void test_SetTextJustification(void) "nulla pariatur. Excepteur sint occaecat cupidatat non proident, " "sunt in culpa qui officia deserunt mollit anim id est laborum."; + hwnd = CreateWindowExA(0, "static", "", WS_POPUP, 0,0, 400,400, 0, 0, 0, NULL); + GetClientRect( hwnd, &clientArea ); + hdc = GetDC( hwnd ); + memset(&lf, 0, sizeof lf); lf.lfCharSet = ANSI_CHARSET; lf.lfClipPrecision = CLIP_DEFAULT_PRECIS; @@ -1024,7 +1029,8 @@ static void test_SetTextJustification(void) testJustification(hdc, testText, &clientArea); DeleteObject(hfont); - ReleaseDC(0, hdc); + ReleaseDC(hwnd, hdc); + DestroyWindow(hwnd); } static void test_font_charset(void)
participants (1)
-
Alexandre Julliard