Module: wine Branch: master Commit: db7539f9f3ead16cb94ff03c2b8f9ca11b44a253 URL: https://source.winehq.org/git/wine.git/?a=commit;h=db7539f9f3ead16cb94ff03c2...
Author: Alistair Leslie-Hughes leslie_alistair@hotmail.com Date: Wed Jan 29 14:38:47 2020 +0100
d3dx9/tests: Add some tests for ID3DXFont_DrawText().
Signed-off-by: Sven Baars sbaars@codeweavers.com Signed-off-by: Matteo Bruni mbruni@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/d3dx9_36/tests/core.c | 57 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+)
diff --git a/dlls/d3dx9_36/tests/core.c b/dlls/d3dx9_36/tests/core.c index 79b69ccc5f..bc80b2e397 100644 --- a/dlls/d3dx9_36/tests/core.c +++ b/dlls/d3dx9_36/tests/core.c @@ -646,6 +646,63 @@ static void test_ID3DXFont(IDirect3DDevice9 *device)
ID3DXFont_Release(font); } + + + /* ID3DXFont_DrawTextA, ID3DXFont_DrawTextW */ + hr = D3DXCreateFontA(device, 12, 0, FW_DONTCARE, 0, FALSE, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, + DEFAULT_QUALITY, DEFAULT_PITCH, "Tahoma", &font); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + todo_wine { + SetRect(&rect, 10, 10, 200, 200); + + height = ID3DXFont_DrawTextA(font, NULL, "test", -2, &rect, 0, 0xFF00FF); + ok(height == 12, "Got unexpected height %d.\n", height); + + height = ID3DXFont_DrawTextA(font, NULL, "test", -1, &rect, 0, 0xFF00FF); + ok(height == 12, "Got unexpected height %d.\n", height); + + height = ID3DXFont_DrawTextA(font, NULL, "test", 0, &rect, 0, 0xFF00FF); + ok(height == 0, "Got unexpected height %d.\n", height); + + height = ID3DXFont_DrawTextA(font, NULL, "test", 1, &rect, 0, 0xFF00FF); + ok(height == 12, "Got unexpected height %d.\n", height); + + height = ID3DXFont_DrawTextA(font, NULL, "test", 2, &rect, 0, 0xFF00FF); + ok(height == 12, "Got unexpected height %d.\n", height); + + height = ID3DXFont_DrawTextA(font, NULL, "test", -1, NULL, 0, 0xFF00FF); + ok(height == 12, "Got unexpected height %d.\n", height); + + height = ID3DXFont_DrawTextA(font, NULL, "test", -1, NULL, DT_CALCRECT, 0xFF00FF); + ok(height == 12, "Got unexpected height %d.\n", height); + + height = ID3DXFont_DrawTextA(font, NULL, NULL, -1, NULL, 0, 0xFF00FF); + ok(height == 0, "Got unexpected height %d.\n", height); + + height = ID3DXFont_DrawTextW(font, NULL, testW, -1, &rect, 0, 0xFF00FF); + ok(height == 12, "Got unexpected height %d.\n", height); + + height = ID3DXFont_DrawTextW(font, NULL, testW, 0, &rect, 0, 0xFF00FF); + ok(height == 0, "Got unexpected height %d.\n", height); + + height = ID3DXFont_DrawTextW(font, NULL, testW, 1, &rect, 0, 0xFF00FF); + ok(height == 12, "Got unexpected height %d.\n", height); + + height = ID3DXFont_DrawTextW(font, NULL, testW, 2, &rect, 0, 0xFF00FF); + ok(height == 12, "Got unexpected height %d.\n", height); + + height = ID3DXFont_DrawTextW(font, NULL, testW, -1, NULL, 0, 0xFF00FF); + ok(height == 12, "Got unexpected height %d.\n", height); + + height = ID3DXFont_DrawTextW(font, NULL, testW, -1, NULL, DT_CALCRECT, 0xFF00FF); + ok(height == 12, "Got unexpected height %d.\n", height); + + height = ID3DXFont_DrawTextW(font, NULL, NULL, -1, NULL, 0, 0xFF00FF); + ok(height == 0, "Got unexpected height %d.\n", height); + } + + ID3DXFont_Release(font); }
static void test_D3DXCreateRenderToSurface(IDirect3DDevice9 *device)