Module: wine Branch: master Commit: 635fe30eacded85fed671a6e4b8a65666fb44849 URL: http://source.winehq.org/git/wine.git/?a=commit;h=635fe30eacded85fed671a6e4b...
Author: Vincent Povirk vincent@codeweavers.com Date: Sat May 8 13:16:33 2010 -0500
gdiplus: Add test for GdipGetImageThumbnail.
---
dlls/gdiplus/tests/image.c | 73 ++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 73 insertions(+), 0 deletions(-)
diff --git a/dlls/gdiplus/tests/image.c b/dlls/gdiplus/tests/image.c index a981bbf..8abb40c 100644 --- a/dlls/gdiplus/tests/image.c +++ b/dlls/gdiplus/tests/image.c @@ -1212,6 +1212,78 @@ static void test_createhbitmap(void) expect(Ok, stat); }
+static void test_getthumbnail(void) +{ + GpStatus stat; + GpImage *bitmap1, *bitmap2; + UINT width, height; + + stat = GdipGetImageThumbnail(NULL, 0, 0, &bitmap2, NULL, NULL); + todo_wine expect(InvalidParameter, stat); + + stat = GdipCreateBitmapFromScan0(128, 128, 0, PixelFormat32bppRGB, NULL, (GpBitmap**)&bitmap1); + expect(Ok, stat); + + stat = GdipGetImageThumbnail(bitmap1, 0, 0, NULL, NULL, NULL); + todo_wine expect(InvalidParameter, stat); + + stat = GdipGetImageThumbnail(bitmap1, 0, 0, &bitmap2, NULL, NULL); + todo_wine expect(Ok, stat); + + if (stat == Ok) + { + stat = GdipGetImageWidth(bitmap2, &width); + expect(Ok, stat); + expect(120, width); + + stat = GdipGetImageHeight(bitmap2, &height); + expect(Ok, stat); + expect(120, height); + + GdipDisposeImage(bitmap2); + } + + GdipDisposeImage(bitmap1); + + + stat = GdipCreateBitmapFromScan0(64, 128, 0, PixelFormat32bppRGB, NULL, (GpBitmap**)&bitmap1); + expect(Ok, stat); + + stat = GdipGetImageThumbnail(bitmap1, 32, 32, &bitmap2, NULL, NULL); + todo_wine expect(Ok, stat); + + if (stat == Ok) + { + stat = GdipGetImageWidth(bitmap2, &width); + expect(Ok, stat); + expect(32, width); + + stat = GdipGetImageHeight(bitmap2, &height); + expect(Ok, stat); + expect(32, height); + + GdipDisposeImage(bitmap2); + } + + stat = GdipGetImageThumbnail(bitmap1, 0, 0, &bitmap2, NULL, NULL); + todo_wine expect(Ok, stat); + + if (stat == Ok) + { + stat = GdipGetImageWidth(bitmap2, &width); + expect(Ok, stat); + expect(120, width); + + stat = GdipGetImageHeight(bitmap2, &height); + expect(Ok, stat); + expect(120, height); + + GdipDisposeImage(bitmap2); + } + + GdipDisposeImage(bitmap1); +} + static void test_getsetpixel(void) { GpStatus stat; @@ -2099,6 +2171,7 @@ START_TEST(image) test_createfromwmf(); test_resolution(); test_createhbitmap(); + test_getthumbnail(); test_getsetpixel(); test_palette(); test_colormatrix();