dwrite/tests: Test to show that canWrapLineAfter is not fixed up by disabled wrapping.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2017-04-19 15:15:25 +03:00 committed by Alexandre Julliard
parent 672ca3d3b8
commit 4745565192
1 changed files with 20 additions and 0 deletions

View File

@ -1858,6 +1858,7 @@ static void test_GetClusterMetrics(void)
static const WCHAR str2W[] = {0x202a,0x202c,'a',0}; static const WCHAR str2W[] = {0x202a,0x202c,'a',0};
static const WCHAR strW[] = {'a','b','c','d',0}; static const WCHAR strW[] = {'a','b','c','d',0};
static const WCHAR str4W[] = {'a',' ',0}; static const WCHAR str4W[] = {'a',' ',0};
static const WCHAR str6W[] = {'a',' ','b',0};
DWRITE_INLINE_OBJECT_METRICS inline_metrics; DWRITE_INLINE_OBJECT_METRICS inline_metrics;
DWRITE_CLUSTER_METRICS metrics[22]; DWRITE_CLUSTER_METRICS metrics[22];
DWRITE_TEXT_METRICS text_metrics; DWRITE_TEXT_METRICS text_metrics;
@ -2254,6 +2255,25 @@ todo_wine
IDWriteTextLayout_Release(layout); IDWriteTextLayout_Release(layout);
/* NO_WRAP, check cluster wrapping attribute. */
hr = IDWriteTextFormat_SetWordWrapping(format, DWRITE_WORD_WRAPPING_NO_WRAP);
ok(hr == S_OK, "got 0x%08x\n", hr);
hr = IDWriteFactory_CreateTextLayout(factory, str6W, lstrlenW(str6W), format, 1000.0f, 200.0f, &layout);
ok(hr == S_OK, "got 0x%08x\n", hr);
count = 0;
memset(metrics, 0, sizeof(metrics));
hr = IDWriteTextLayout_GetClusterMetrics(layout, metrics, 3, &count);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(count == 3, "got %u\n", count);
ok(metrics[0].canWrapLineAfter == 0, "got %d\n", metrics[0].canWrapLineAfter);
ok(metrics[1].canWrapLineAfter == 1, "got %d\n", metrics[1].canWrapLineAfter);
ok(metrics[2].canWrapLineAfter == 1, "got %d\n", metrics[2].canWrapLineAfter);
IDWriteTextLayout_Release(layout);
IDWriteInlineObject_Release(trimm); IDWriteInlineObject_Release(trimm);
IDWriteTextFormat_Release(format); IDWriteTextFormat_Release(format);
IDWriteFactory_Release(factory); IDWriteFactory_Release(factory);