dwrite/tests: Simple test to show that run analysis instances are not reused.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2015-11-03 22:05:25 +03:00 committed by Alexandre Julliard
parent b6f1e74ced
commit a5127f5fc5
1 changed files with 10 additions and 1 deletions

View File

@ -3495,7 +3495,7 @@ static void test_CreateGlyphRunAnalysis(void)
DWRITE_RENDERING_MODE_NATURAL_SYMMETRIC,
};
IDWriteGlyphRunAnalysis *analysis;
IDWriteGlyphRunAnalysis *analysis, *analysis2;
IDWriteFactory *factory;
DWRITE_GLYPH_RUN run;
IDWriteFontFace *face;
@ -3783,6 +3783,15 @@ static void test_CreateGlyphRunAnalysis(void)
hr = IDWriteGlyphRunAnalysis_GetAlphaTextureBounds(analysis, DWRITE_TEXTURE_ALIASED_1x1, &rect2);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok((rect2.right - rect2.left) > (rect.right - rect.left), "got rect width %d\n", rect2.right - rect2.left);
/* instances are not reused for same runs */
hr = IDWriteFactory_CreateGlyphRunAnalysis(factory, &run, 1.0, &m,
DWRITE_RENDERING_MODE_ALIASED, DWRITE_MEASURING_MODE_NATURAL,
0.0, 0.0, &analysis2);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(analysis2 != analysis, "got %p, previous instance %p\n", analysis2, analysis);
IDWriteGlyphRunAnalysis_Release(analysis2);
IDWriteGlyphRunAnalysis_Release(analysis);
IDWriteFontFace_Release(face);