comctl32: Allow a little slop in the status bar metric tests.

This commit is contained in:
James Hawkins 2008-09-08 00:46:53 -05:00 committed by Alexandre Julliard
parent f5e298d2db
commit d54963e512
1 changed files with 12 additions and 9 deletions

View File

@ -27,10 +27,13 @@
#define SUBCLASS_NAME "MyStatusBar" #define SUBCLASS_NAME "MyStatusBar"
#define expect(expected,got) ok (expected == got,"Expected %d, got %d\n",expected,got) #define expect(expected,got) ok (expected == got,"Expected %d, got %d\n",expected,got)
#define expect_rect(_left,_top,_right,_bottom,got) do { RECT _rcExp = {_left, _top, _right, _bottom}; \ #define expect_rect(_left,_top,_right,_bottom,got) do { \
ok(memcmp(&_rcExp, &(got), sizeof(RECT)) == 0, "Expected rect {%d,%d, %d,%d}, got {%d,%d, %d,%d}\n", \ RECT exp = {abs(got.left - _left), abs(got.top - _top), \
_rcExp.left, _rcExp.top, _rcExp.right, _rcExp.bottom, \ abs(got.right - _right), abs(got.bottom - _bottom)}; \
(got).left, (got).top, (got).right, (got).bottom); } while (0) ok(exp.left <= 2 && exp.top <= 2 && exp.right <= 2 && exp.bottom <= 2, \
"Expected rect {%d,%d, %d,%d}, got {%d,%d, %d,%d}\n", \
_left, _top, _right, _bottom, \
(got).left, (got).top, (got).right, (got).bottom); } while (0)
static HINSTANCE hinst; static HINSTANCE hinst;
static WNDPROC g_status_wndproc; static WNDPROC g_status_wndproc;
@ -166,25 +169,25 @@ static void test_height(void)
ok(g_wmsize_count > 0, "WM_SETFONT should issue WM_SIZE\n"); ok(g_wmsize_count > 0, "WM_SETFONT should issue WM_SIZE\n");
GetClientRect(hwndStatus, &rc2); GetClientRect(hwndStatus, &rc2);
todo_wine expect_rect(0, 0, 672, 42, rc2); /* GetTextMetrics returns invalid tmInternalLeading for this font */ expect_rect(0, 0, 672, 42, rc2); /* GetTextMetrics returns invalid tmInternalLeading for this font */
g_wmsize_count = 0; g_wmsize_count = 0;
SendMessage(hwndStatus, WM_SETFONT, (WPARAM)hFont, TRUE); SendMessage(hwndStatus, WM_SETFONT, (WPARAM)hFont, TRUE);
ok(g_wmsize_count > 0, "WM_SETFONT should issue WM_SIZE\n"); ok(g_wmsize_count > 0, "WM_SETFONT should issue WM_SIZE\n");
GetClientRect(hwndStatus, &rc2); GetClientRect(hwndStatus, &rc2);
todo_wine expect_rect(0, 0, 672, 42, rc2); expect_rect(0, 0, 672, 42, rc2);
/* minheight < fontsize - no effects*/ /* minheight < fontsize - no effects*/
SendMessage(hwndStatus, SB_SETMINHEIGHT, 12, 0); SendMessage(hwndStatus, SB_SETMINHEIGHT, 12, 0);
SendMessage(hwndStatus, WM_SIZE, 0, 0); SendMessage(hwndStatus, WM_SIZE, 0, 0);
GetClientRect(hwndStatus, &rc2); GetClientRect(hwndStatus, &rc2);
todo_wine expect_rect(0, 0, 672, 42, rc2); expect_rect(0, 0, 672, 42, rc2);
/* minheight > fontsize - has an effect after WM_SIZE */ /* minheight > fontsize - has an effect after WM_SIZE */
SendMessage(hwndStatus, SB_SETMINHEIGHT, 60, 0); SendMessage(hwndStatus, SB_SETMINHEIGHT, 60, 0);
GetClientRect(hwndStatus, &rc2); GetClientRect(hwndStatus, &rc2);
todo_wine expect_rect(0, 0, 672, 42, rc2); expect_rect(0, 0, 672, 42, rc2);
SendMessage(hwndStatus, WM_SIZE, 0, 0); SendMessage(hwndStatus, WM_SIZE, 0, 0);
GetClientRect(hwndStatus, &rc2); GetClientRect(hwndStatus, &rc2);
expect_rect(0, 0, 672, 62, rc2); expect_rect(0, 0, 672, 62, rc2);
@ -194,7 +197,7 @@ static void test_height(void)
expect_rect(0, 0, 672, 62, rc2); expect_rect(0, 0, 672, 62, rc2);
SendMessage(hwndStatus, WM_SIZE, 0, 0); SendMessage(hwndStatus, WM_SIZE, 0, 0);
GetClientRect(hwndStatus, &rc2); GetClientRect(hwndStatus, &rc2);
todo_wine expect_rect(0, 0, 672, 42, rc2); expect_rect(0, 0, 672, 42, rc2);
hFontSm = CreateFont(9, 0, 0, 0, FW_DONTCARE, FALSE, FALSE, FALSE, ANSI_CHARSET, hFontSm = CreateFont(9, 0, 0, 0, FW_DONTCARE, FALSE, FALSE, FALSE, ANSI_CHARSET,
OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, FF_DONTCARE, "Tahoma"); OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, FF_DONTCARE, "Tahoma");
SendMessage(hwndStatus, WM_SETFONT, (WPARAM)hFontSm, TRUE); SendMessage(hwndStatus, WM_SETFONT, (WPARAM)hFontSm, TRUE);