[WINESYNC]d3dx9_36: ID3DXFont_DrawText calc_rect can be null

Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>

wine-staging patch by Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
This commit is contained in:
winesync 2020-01-04 02:11:30 +01:00 committed by Jérôme Gardou
parent 219ef2e81f
commit 33f33c9387
3 changed files with 90 additions and 2 deletions

View file

@ -662,6 +662,15 @@ static void test_ID3DXFont(IDirect3DDevice9 *device)
height = ID3DXFont_DrawTextA(font, NULL, testA, 2, &rect, 0, 0xFF00FF);
ok(height == 12, "DrawTextA returned %d, expected 12.\n", height);
height = ID3DXFont_DrawTextA(font, NULL, testA, -1, NULL, 0, 0xFF00FF);
ok(height == 12, "DrawTextA returned %d, expected 12.\n", height);
height = ID3DXFont_DrawTextA(font, NULL, testA, -1, NULL, DT_CALCRECT, 0xFF00FF);
ok(height == 12, "DrawTextA returned %d, expected 12.\n", height);
height = ID3DXFont_DrawTextA(font, NULL, NULL, -1, NULL, 0, 0xFF00FF);
ok(height == 0, "DrawTextA returned %d, expected 0.\n", height);
if (0) { /* Causes a lockup on windows 7. */
height = ID3DXFont_DrawTextW(font, NULL, testW, -2, &rect, 0, 0xFF00FF);
ok(height == 12, "DrawTextW returned %d, expected 12.\n", height);
@ -679,6 +688,15 @@ if (0) { /* Causes a lockup on windows 7. */
height = ID3DXFont_DrawTextW(font, NULL, testW, 2, &rect, 0, 0xFF00FF);
ok(height == 12, "DrawTextW returned %d, expected 12.\n", height);
height = ID3DXFont_DrawTextW(font, NULL, testW, -1, NULL, 0, 0xFF00FF);
ok(height == 12, "DrawTextA returned %d, expected 12.\n", height);
height = ID3DXFont_DrawTextW(font, NULL, testW, -1, NULL, DT_CALCRECT, 0xFF00FF);
ok(height == 12, "DrawTextA returned %d, expected 12.\n", height);
height = ID3DXFont_DrawTextW(font, NULL, NULL, -1, NULL, 0, 0xFF00FF);
ok(height == 0, "DrawTextA returned %d, expected 0.\n", height);
ID3DXFont_Release(font);
}
}