Module: wine Branch: master Commit: 53a3307983e7d1f9ac8b73973b3c8ac88c8d924a URL: http://source.winehq.org/git/wine.git/?a=commit;h=53a3307983e7d1f9ac8b73973b...
Author: Vincent Povirk vincent@codeweavers.com Date: Sat Dec 26 20:06:34 2009 -0500
gdiplus: Add test for GdipCreateMetafileFromWmf.
---
dlls/gdiplus/tests/image.c | 37 +++++++++++++++++++++++++++++++++++++ 1 files changed, 37 insertions(+), 0 deletions(-)
diff --git a/dlls/gdiplus/tests/image.c b/dlls/gdiplus/tests/image.c index 31656e8..e35d3a3 100644 --- a/dlls/gdiplus/tests/image.c +++ b/dlls/gdiplus/tests/image.c @@ -853,6 +853,42 @@ static void test_loadwmf(void) GdipDisposeImage(img); }
+static void test_createfromwmf(void) +{ + HMETAFILE hwmf; + GpImage *img; + GpStatus stat; + GpRectF bounds; + GpUnit unit; + REAL res = 12345.0; + + hwmf = SetMetaFileBitsEx(sizeof(wmfimage)-sizeof(WmfPlaceableFileHeader), + wmfimage+sizeof(WmfPlaceableFileHeader)); + ok(hwmf != 0, "SetMetaFileBitsEx failed\n"); + + stat = GdipCreateMetafileFromWmf(hwmf, TRUE, + (WmfPlaceableFileHeader*)wmfimage, (GpMetafile**)&img); + expect(Ok, stat); + + stat = GdipGetImageBounds(img, &bounds, &unit); + expect(Ok, stat); + todo_wine expect(UnitPixel, unit); + expectf(0.0, bounds.X); + todo_wine expectf(0.0, bounds.Y); + todo_wine expectf(320.0, bounds.Width); + todo_wine expectf(320.0, bounds.Height); + + stat = GdipGetImageHorizontalResolution(img, &res); + todo_wine expect(Ok, stat); + todo_wine expectf(1440.0, res); + + stat = GdipGetImageVerticalResolution(img, &res); + todo_wine expect(Ok, stat); + todo_wine expectf(1440.0, res); + + GdipDisposeImage(img); +} + static void test_createhbitmap(void) { GpStatus stat; @@ -1428,6 +1464,7 @@ START_TEST(image) test_fromhicon(); test_getrawformat(); test_loadwmf(); + test_createfromwmf(); test_createhbitmap(); test_getsetpixel(); test_palette();