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");
37 GdipDisposeImage((GpImage*)bm);
39 bm = (GpBitmap*)0xdeadbeef;
40 stat = GdipCreateBitmapFromScan0(10, -10, 10, PixelFormat24bppRGB, NULL, &bm);
41 expect(InvalidParameter, stat);
45 bm = (GpBitmap*)0xdeadbeef;
46 stat = GdipCreateBitmapFromScan0(-10, 10, 10, PixelFormat24bppRGB, NULL, &bm);
47 expect(InvalidParameter, stat);
51 bm = (GpBitmap*)0xdeadbeef;
52 stat = GdipCreateBitmapFromScan0(10, 0, 10, PixelFormat24bppRGB, NULL, &bm);
53 expect(InvalidParameter, stat);
58 stat = GdipCreateBitmapFromScan0(10, 10, 12, PixelFormat24bppRGB, buff, &bm);
60 ok(NULL != bm, "Expected bitmap to be initialized\n");
61 GdipDisposeImage((GpImage*)bm);
63 bm = (GpBitmap*) 0xdeadbeef;
64 stat = GdipCreateBitmapFromScan0(10, 10, 10, PixelFormat24bppRGB, buff, &bm);
65 expect(InvalidParameter, stat);
68 bm = (GpBitmap*)0xdeadbeef;
69 stat = GdipCreateBitmapFromScan0(10, 10, 0, PixelFormat24bppRGB, buff, &bm);
70 expect(InvalidParameter, stat);
71 expect(0xdeadbeef, bm);
76 struct GdiplusStartupInput gdiplusStartupInput;
77 ULONG_PTR gdiplusToken;
79 gdiplusStartupInput.GdiplusVersion = 1;
80 gdiplusStartupInput.DebugEventCallback = NULL;
81 gdiplusStartupInput.SuppressBackgroundThread = 0;
82 gdiplusStartupInput.SuppressExternalCodecs = 0;
84 GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);
88 GdiplusShutdown(gdiplusToken);