Module: wine Branch: master Commit: a5127f5fc5ee12ec527f711cbcdeb33a35d66f3a URL: http://source.winehq.org/git/wine.git/?a=commit;h=a5127f5fc5ee12ec527f711cbc...
Author: Nikolay Sivov nsivov@codeweavers.com Date: Tue Nov 3 22:05:25 2015 +0300
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
---
dlls/dwrite/tests/font.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/dlls/dwrite/tests/font.c b/dlls/dwrite/tests/font.c index 104e8e6..f6bca9c 100644 --- a/dlls/dwrite/tests/font.c +++ b/dlls/dwrite/tests/font.c @@ -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);