2 * Unit test suite for images
4 * Copyright (C) 2007 Google (Evan Stade)
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
23 #include "wine/test.h"
25 #define expect(expected, got) ok(((UINT)got) == ((UINT)expected), "Expected %.8x, got %.8x\n", (UINT)expected, (UINT)got)
27 static void test_Scan0(void)
34 stat = GdipCreateBitmapFromScan0(10, 10, 10, PixelFormat24bppRGB, NULL, &bm);
36 ok(NULL != bm, "Expected bitmap to be initialized\n");
38 GdipDisposeImage((GpImage*)bm);
40 bm = (GpBitmap*)0xdeadbeef;
41 stat = GdipCreateBitmapFromScan0(10, -10, 10, PixelFormat24bppRGB, NULL, &bm);
42 expect(InvalidParameter, stat);
46 bm = (GpBitmap*)0xdeadbeef;
47 stat = GdipCreateBitmapFromScan0(-10, 10, 10, PixelFormat24bppRGB, NULL, &bm);
48 expect(InvalidParameter, stat);
52 bm = (GpBitmap*)0xdeadbeef;
53 stat = GdipCreateBitmapFromScan0(10, 0, 10, PixelFormat24bppRGB, NULL, &bm);
54 expect(InvalidParameter, stat);
59 stat = GdipCreateBitmapFromScan0(10, 10, 12, PixelFormat24bppRGB, buff, &bm);
61 ok(NULL != bm, "Expected bitmap to be initialized\n");
63 GdipDisposeImage((GpImage*)bm);
65 bm = (GpBitmap*) 0xdeadbeef;
66 stat = GdipCreateBitmapFromScan0(10, 10, 10, PixelFormat24bppRGB, buff, &bm);
67 expect(InvalidParameter, stat);
70 bm = (GpBitmap*)0xdeadbeef;
71 stat = GdipCreateBitmapFromScan0(10, 10, 0, PixelFormat24bppRGB, buff, &bm);
72 expect(InvalidParameter, stat);
73 expect(0xdeadbeef, bm);
78 struct GdiplusStartupInput gdiplusStartupInput;
79 ULONG_PTR gdiplusToken;
81 gdiplusStartupInput.GdiplusVersion = 1;
82 gdiplusStartupInput.DebugEventCallback = NULL;
83 gdiplusStartupInput.SuppressBackgroundThread = 0;
84 gdiplusStartupInput.SuppressExternalCodecs = 0;
86 GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);
90 GdiplusShutdown(gdiplusToken);