gdiplus: Add tests for passing negative strides to GdipCreateBitmapFromScan0.
authorLei Zhang <thestig@google.com>
Fri, 18 Jul 2008 22:31:58 +0000 (15:31 -0700)
committerAlexandre Julliard <julliard@winehq.org>
Mon, 21 Jul 2008 13:26:23 +0000 (15:26 +0200)
dlls/gdiplus/tests/image.c

index 38a58b9..49d1e5e 100644 (file)
@@ -73,6 +73,20 @@ static void test_Scan0(void)
     stat = GdipCreateBitmapFromScan0(10, 10, 0, PixelFormat24bppRGB, buff, &bm);
     expect(InvalidParameter, stat);
     expect(0xdeadbeef, bm);
+
+    bm = NULL;
+    stat = GdipCreateBitmapFromScan0(10, 10, -8, PixelFormat24bppRGB, buff, &bm);
+    todo_wine{
+        expect(Ok, stat);
+        ok(NULL != bm, "Expected bitmap to be initialized\n");
+    }
+    if (stat == Ok)
+        GdipDisposeImage((GpImage*)bm);
+
+    bm = (GpBitmap*)0xdeadbeef;
+    stat = GdipCreateBitmapFromScan0(10, 10, -10, PixelFormat24bppRGB, buff, &bm);
+    expect(InvalidParameter, stat);
+    expect(NULL, bm);
 }
 
 static void test_GetImageDimension(void)