Module: wine Branch: master Commit: e21af554b5602af5497c28ed336b42964cef6204 URL: http://source.winehq.org/git/wine.git/?a=commit;h=e21af554b5602af5497c28ed33...
Author: Vincent Povirk vincent@codeweavers.com Date: Thu May 30 14:47:13 2013 -0500
gdiplus: Add test for measuring a single line that exactly fits.
---
dlls/gdiplus/tests/graphics.c | 17 +++++++++++++++++ 1 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/dlls/gdiplus/tests/graphics.c b/dlls/gdiplus/tests/graphics.c index cbe0b9d..5de0602 100644 --- a/dlls/gdiplus/tests/graphics.c +++ b/dlls/gdiplus/tests/graphics.c @@ -3042,6 +3042,23 @@ static void test_string_functions(void) expect(2, linesfilled); char_height = bounds.Height - char_bounds.Height;
+ /* Measure the first line. */ + status = GdipMeasureString(graphics, teststring, 4, font, &rc, NULL, &bounds, &codepointsfitted, &linesfilled); + expect(Ok, status); + expectf(0.0, bounds.X); + expectf(0.0, bounds.Y); + expect(4, codepointsfitted); + expect(1, linesfilled); + + /* Give just enough space to fit the first line. */ + rc.Width = bounds.Width; + status = GdipMeasureString(graphics, teststring, 5, font, &rc, NULL, &bounds, &codepointsfitted, &linesfilled); + expect(Ok, status); + expectf(0.0, bounds.X); + expectf(0.0, bounds.Y); + todo_wine expect(5, codepointsfitted); + todo_wine expect(1, linesfilled); + /* Cut off everything after the first space. */ rc.Width = char_bounds.Width + char_width * 2.1;