[Gdiplus 3/4] Test GdipCloneImage

Adam Petaccia adam at tpetaccia.com
Tue Jul 1 20:04:10 CDT 2008


---
 dlls/gdiplus/tests/image.c |   30 ++++++++++++++++++++++++++++++
 1 files changed, 30 insertions(+), 0 deletions(-)

diff --git a/dlls/gdiplus/tests/image.c b/dlls/gdiplus/tests/image.c
index 686fe54..38a58b9 100644
--- a/dlls/gdiplus/tests/image.c
+++ b/dlls/gdiplus/tests/image.c
@@ -478,6 +478,35 @@ static void test_GdipGetImageFlags(void)
     expect(InvalidParameter, stat);
 }
 
+static void test_GdipCloneImage(void)
+{
+    GpStatus stat;
+    GpRectF rectF;
+    GpUnit unit;
+    GpBitmap *bm;
+    GpImage *image_src, *image_dest = NULL;
+    const INT WIDTH = 10, HEIGHT = 20;
+
+    /* Create an image, clone it, delete the original, make sure the copy works */
+    stat = GdipCreateBitmapFromScan0(WIDTH, HEIGHT, 0, PixelFormat24bppRGB, NULL, &bm);
+    expect(Ok, stat);
+todo_wine
+{
+    image_src = ((GpImage*)bm);
+    stat = GdipCloneImage(image_src, &image_dest);
+    expect(Ok, stat);
+}
+    stat = GdipDisposeImage((GpImage*)bm);
+    expect(Ok, stat);
+todo_wine
+{
+    stat = GdipGetImageBounds(image_dest, &rectF, &unit);
+    expect(Ok, stat);
+    stat = GdipDisposeImage(image_dest);
+    expect(Ok, stat);
+}
+}
+
 START_TEST(image)
 {
     struct GdiplusStartupInput gdiplusStartupInput;
@@ -499,6 +528,7 @@ START_TEST(image)
     test_LockBits();
     test_GdipCreateBitmapFromHBITMAP();
     test_GdipGetImageFlags();
+    test_GdipCloneImage();
 
     GdiplusShutdown(gdiplusToken);
 }
-- 
1.5.4.3




More information about the wine-patches mailing list