mirror of
https://github.com/reactos/reactos.git
synced 2025-06-12 06:08:29 +00:00
[User32Test]
- Patch by Henri Verbeet : Fix TEXT_WordBreak() when no characters fit. - Update text to wine head. svn path=/trunk/; revision=62487
This commit is contained in:
parent
fa0e017d2a
commit
4498725892
1 changed files with 16 additions and 0 deletions
|
@ -42,6 +42,8 @@ static void test_DrawTextCalcRect(void)
|
||||||
's','t','r','i','n','g','\0'};
|
's','t','r','i','n','g','\0'};
|
||||||
static CHAR emptystring[] = "";
|
static CHAR emptystring[] = "";
|
||||||
static WCHAR emptystringW[] = { 0 };
|
static WCHAR emptystringW[] = { 0 };
|
||||||
|
static CHAR wordbreak_text[] = "line1 line2";
|
||||||
|
static WCHAR wordbreak_textW[] = {'l','i','n','e','1',' ','l','i','n','e','2',0};
|
||||||
INT textlen, textheight, heightcheck;
|
INT textlen, textheight, heightcheck;
|
||||||
RECT rect = { 0, 0, 100, 0 };
|
RECT rect = { 0, 0, 100, 0 };
|
||||||
BOOL ret;
|
BOOL ret;
|
||||||
|
@ -556,6 +558,20 @@ static void test_DrawTextCalcRect(void)
|
||||||
ok(rect.bottom, "rect.bottom should not be 0\n");
|
ok(rect.bottom, "rect.bottom should not be 0\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SetRect(&rect, 0, 0, 1, 1);
|
||||||
|
heightcheck = DrawTextA(hdc, wordbreak_text, -1, &rect, DT_CALCRECT);
|
||||||
|
SetRect(&rect, 0, 0, 1, 1);
|
||||||
|
textheight = DrawTextA(hdc, wordbreak_text, -1, &rect, DT_CALCRECT | DT_WORDBREAK);
|
||||||
|
ok(textheight == heightcheck * 2, "Got unexpected textheight %d, expected %d.\n",
|
||||||
|
textheight, heightcheck * 2);
|
||||||
|
|
||||||
|
SetRect(&rect, 0, 0, 1, 1);
|
||||||
|
heightcheck = DrawTextW(hdc, wordbreak_textW, -1, &rect, DT_CALCRECT);
|
||||||
|
SetRect(&rect, 0, 0, 1, 1);
|
||||||
|
textheight = DrawTextW(hdc, wordbreak_textW, -1, &rect, DT_CALCRECT | DT_WORDBREAK);
|
||||||
|
ok(textheight == heightcheck * 2, "Got unexpected textheight %d, expected %d.\n",
|
||||||
|
textheight, heightcheck * 2);
|
||||||
|
|
||||||
SelectObject(hdc, hOldFont);
|
SelectObject(hdc, hOldFont);
|
||||||
ret = DeleteObject(hFont);
|
ret = DeleteObject(hFont);
|
||||||
ok( ret, "DeleteObject error %u\n", GetLastError());
|
ok( ret, "DeleteObject error %u\n", GetLastError());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue