From aef50786fb5df36002cf06426ed53fb29208916f Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Wed, 14 Jan 2015 08:13:12 +0300 Subject: [PATCH] dwrite/tests: Additional test for Draw(). --- dlls/dwrite/tests/layout.c | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/dlls/dwrite/tests/layout.c b/dlls/dwrite/tests/layout.c index 1a1cfd98426..760c34f44ad 100644 --- a/dlls/dwrite/tests/layout.c +++ b/dlls/dwrite/tests/layout.c @@ -785,7 +785,17 @@ static const struct drawcall_entry draw_seq[] = { { DRAW_LAST_KIND } }; -static void test_draw_sequence(void) +static const struct drawcall_entry draw_seq2[] = { + { DRAW_GLYPHRUN }, + { DRAW_GLYPHRUN }, + { DRAW_GLYPHRUN }, + { DRAW_GLYPHRUN }, + { DRAW_GLYPHRUN }, + { DRAW_GLYPHRUN }, + { DRAW_LAST_KIND } +}; + +static void test_Draw(void) { static const WCHAR strW[] = {'s','t','r','i','n','g',0}; static const WCHAR ruW[] = {'r','u',0}; @@ -831,9 +841,20 @@ static void test_draw_sequence(void) todo_wine ok(hr == S_OK, "got 0x%08x\n", hr); ok_sequence(sequences, RENDERER_ID, draw_seq, "draw test", TRUE); + IDWriteTextLayout_Release(layout); + + /* with reduced width DrawGlyphRun() is called for every line */ + hr = IDWriteFactory_CreateTextLayout(factory, strW, 6, format, 5.0, 100.0, &layout); + ok(hr == S_OK, "got 0x%08x\n", hr); + flush_sequence(sequences, RENDERER_ID); + hr = IDWriteTextLayout_Draw(layout, NULL, &testrenderer, 0.0, 0.0); +todo_wine + ok(hr == S_OK, "got 0x%08x\n", hr); + ok_sequence(sequences, RENDERER_ID, draw_seq2, "draw test 2", TRUE); + + IDWriteTextLayout_Release(layout); IDWriteTextFormat_Release(format); - IDWriteTextLayout_Release(layout); } static void test_typography(void) @@ -1010,7 +1031,7 @@ START_TEST(layout) test_CreateEllipsisTrimmingSign(); test_fontweight(); test_SetInlineObject(); - test_draw_sequence(); + test_Draw(); test_typography(); test_GetClusterMetrics(); test_SetLocaleName();