[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-02-05 22:13:54 +01:00
committed by Jérôme Gardou
parent f9c6d6e396
commit 58d515ea16
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);
}
}