Reactos

[GDIPLUS_WINETEST] Sync with Wine Staging 3.3. CORE-14434

+453 -23
+5 -1
modules/rostests/winetests/gdiplus/brush.c
··· 18 18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA 19 19 */ 20 20 21 - #include "precomp.h" 21 + #include <math.h> 22 + 23 + #include "objbase.h" 24 + #include "gdiplus.h" 25 + #include "wine/test.h" 22 26 23 27 #define expect(expected, got) ok(got == expected, "Expected %.8x, got %.8x\n", expected, got) 24 28 #define expectf(expected, got) ok(fabs(expected - got) < 0.0001, "Expected %.2f, got %.2f\n", expected, got)
+3 -1
modules/rostests/winetests/gdiplus/customlinecap.c
··· 18 18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA 19 19 */ 20 20 21 - #include "precomp.h" 21 + #include "objbase.h" 22 + #include "gdiplus.h" 23 + #include "wine/test.h" 22 24 23 25 #define expect(expected, got) ok(got == expected, "Expected %.8x, got %.8x\n", expected, got) 24 26 #define expectf(expected, got) ok(got == expected, "Expected %.2f, got %.2f\n", expected, got)
+5 -1
modules/rostests/winetests/gdiplus/font.c
··· 19 19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA 20 20 */ 21 21 22 - #include "precomp.h" 22 + #include <math.h> 23 + 24 + #include "objbase.h" 25 + #include "gdiplus.h" 26 + #include "wine/test.h" 23 27 24 28 #define expect(expected, got) ok(got == expected, "Expected %d, got %d\n", expected, got) 25 29 #define expect_(expected, got, precision) ok(abs((expected) - (got)) <= (precision), "Expected %d, got %d\n", (expected), (got))
+5 -1
modules/rostests/winetests/gdiplus/graphics.c
··· 19 19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA 20 20 */ 21 21 22 - #include "precomp.h" 22 + #include <math.h> 23 + 24 + #include "objbase.h" 25 + #include "gdiplus.h" 26 + #include "wine/test.h" 23 27 24 28 #define expect(expected, got) ok((got) == (expected), "Expected %d, got %d\n", (INT)(expected), (INT)(got)) 25 29 #define expectf_(expected, got, precision) ok(fabs((expected) - (got)) <= (precision), "Expected %f, got %f\n", (expected), (got))
+29 -2
modules/rostests/winetests/gdiplus/graphicspath.c
··· 18 18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA 19 19 */ 20 20 21 - #include "precomp.h" 21 + #include "objbase.h" 22 + #include "gdiplus.h" 23 + #include "wine/test.h" 24 + #include <math.h> 22 25 23 26 #define expect(expected, got) ok(got == expected, "Expected %.8x, got %.8x\n", expected, got) 24 27 #define expectf(expected, got) ok(fabs(expected - got) < 2.0, "Expected %.2f, got %.2f\n", expected, got) ··· 1298 1301 { 1299 1302 GpPath *path; 1300 1303 GpStatus status; 1304 + INT count; 1301 1305 BOOL result; 1302 1306 1303 1307 status = GdipCreatePath(FillModeAlternate, &path); ··· 1306 1310 status = GdipAddPathRectangle(path, 0.0, 0.0, -5.0, 5.0); 1307 1311 expect(Ok, status); 1308 1312 1313 + status = GdipGetPointCount(path, &count); 1314 + expect(Ok, status); 1315 + expect(0, count); 1316 + 1309 1317 status = GdipIsVisiblePathPoint(path, -2.0, 2.0, NULL, &result); 1310 1318 expect(Ok, status); 1311 - expect(FALSE, status); 1319 + expect(FALSE, result); 1312 1320 1313 1321 status = GdipAddPathRectangle(path, 0.0, 0.0, 5.0, -5.0); 1314 1322 expect(Ok, status); 1315 1323 1324 + status = GdipGetPointCount(path, &count); 1325 + expect(Ok, status); 1326 + expect(0, count); 1327 + 1316 1328 status = GdipAddPathRectangle(path, 0.0, 0.0, 0.0, 5.0); 1317 1329 expect(Ok, status); 1318 1330 1331 + status = GdipGetPointCount(path, &count); 1332 + expect(Ok, status); 1333 + expect(0, count); 1334 + 1319 1335 status = GdipAddPathRectangle(path, 0.0, 0.0, 5.0, 0.0); 1320 1336 expect(Ok, status); 1337 + 1338 + status = GdipGetPointCount(path, &count); 1339 + expect(Ok, status); 1340 + expect(0, count); 1341 + 1342 + status = GdipAddPathRectangle(path, 0.0, 0.0, 5.0, 0.1); 1343 + expect(Ok, status); 1344 + 1345 + status = GdipGetPointCount(path, &count); 1346 + expect(Ok, status); 1347 + expect(4, count); 1321 1348 1322 1349 GdipDeletePath(path); 1323 1350 }
+376 -11
modules/rostests/winetests/gdiplus/image.c
··· 19 19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA 20 20 */ 21 21 22 - #include "precomp.h" 22 + #define COBJMACROS 23 23 24 + #include <math.h> 24 25 #include <assert.h> 26 + #include <stdio.h> 27 + 28 + #include "initguid.h" 29 + #include "objbase.h" 30 + #include "gdiplus.h" 31 + #include "wine/test.h" 32 + 33 + #ifdef __REACTOS__ 25 34 #include <ole2.h> 35 + #endif 26 36 27 37 /* FIXME: They belong to gdipluseffects.h */ 28 38 DEFINE_GUID(BlurEffectGuid, 0x633c80a4, 0x1843, 0x482b, 0x9e, 0xf2, 0xbe, 0x28, 0x34, 0xc5, 0xfd, 0xd4); ··· 40 50 static GpStatus (WINAPI *pGdipBitmapGetHistogramSize)(HistogramFormat,UINT*); 41 51 static GpStatus (WINAPI *pGdipBitmapGetHistogram)(GpBitmap*,HistogramFormat,UINT,UINT*,UINT*,UINT*,UINT*); 42 52 static GpStatus (WINAPI *pGdipImageSetAbort)(GpImage*,GdiplusAbort*); 53 + 54 + static GpStatus (WINGDIPAPI *pGdipInitializePalette)(ColorPalette*,PaletteType,INT,BOOL,GpBitmap*); 43 55 44 56 #define expect(expected, got) ok((got) == (expected), "Expected %d, got %d\n", (UINT)(expected), (UINT)(got)) 45 57 #define expectf(expected, got) ok(fabs((expected) - (got)) < 0.0001, "Expected %f, got %f\n", (expected), (got)) ··· 3248 3260 ok(refcount == 1, "expected stream refcount 1, got %d\n", refcount); 3249 3261 3250 3262 status = GdipLoadImageFromStream(stream, &image); 3251 - ok(status == Ok || broken(status == InvalidParameter), /* XP */ 3252 - "GdipLoadImageFromStream error %d\n", status); 3253 3263 if (status != Ok) 3254 3264 { 3255 3265 IStream_Release(stream); ··· 4804 4814 { 4805 4815 LPCWSTR mime; 4806 4816 const GUID *format; 4807 - BOOL todo; 4808 4817 } td[] = 4809 4818 { 4810 - { bmp_mimetype, &ImageFormatBMP, FALSE }, 4811 - { jpeg_mimetype, &ImageFormatJPEG, FALSE }, 4812 - { gif_mimetype, &ImageFormatGIF, TRUE }, 4813 - { tiff_mimetype, &ImageFormatTIFF, FALSE }, 4814 - { png_mimetype, &ImageFormatPNG, FALSE } 4819 + { bmp_mimetype, &ImageFormatBMP }, 4820 + { jpeg_mimetype, &ImageFormatJPEG }, 4821 + { gif_mimetype, &ImageFormatGIF }, 4822 + { tiff_mimetype, &ImageFormatTIFF }, 4823 + { png_mimetype, &ImageFormatPNG } 4815 4824 }; 4816 4825 GUID format, clsid; 4817 4826 BOOL ret; ··· 4837 4846 ok(hr == S_OK, "CreateStreamOnHGlobal error %#x\n", hr); 4838 4847 4839 4848 status = GdipSaveImageToStream((GpImage *)bm, stream, &clsid, NULL); 4840 - todo_wine_if (td[i].todo) 4841 - ok(status == Ok, "GdipSaveImageToStream error %d\n", status); 4849 + ok(status == Ok, "GdipSaveImageToStream error %d\n", status); 4842 4850 4843 4851 IStream_Release(stream); 4844 4852 } ··· 5168 5176 } 5169 5177 } 5170 5178 5179 + static void test_GdipLoadImageFromStream(void) 5180 + { 5181 + IStream *stream; 5182 + GpStatus status; 5183 + GpImage *image; 5184 + HGLOBAL hglob; 5185 + BYTE *data; 5186 + HRESULT hr; 5187 + 5188 + status = GdipLoadImageFromStream(NULL, NULL); 5189 + ok(status == InvalidParameter, "Unexpected return value %d.\n", status); 5190 + 5191 + image = (void *)0xdeadbeef; 5192 + status = GdipLoadImageFromStream(NULL, &image); 5193 + ok(status == InvalidParameter, "Unexpected return value %d.\n", status); 5194 + ok(image == (void *)0xdeadbeef, "Unexpected image pointer.\n"); 5195 + 5196 + hglob = GlobalAlloc(0, sizeof(pngimage)); 5197 + data = GlobalLock (hglob); 5198 + memcpy(data, pngimage, sizeof(pngimage)); 5199 + GlobalUnlock(hglob); 5200 + 5201 + hr = CreateStreamOnHGlobal(hglob, TRUE, &stream); 5202 + ok(hr == S_OK, "Failed to create a stream.\n"); 5203 + 5204 + status = GdipLoadImageFromStream(stream, NULL); 5205 + ok(status == InvalidParameter, "Unexpected return value %d.\n", status); 5206 + 5207 + IStream_Release(stream); 5208 + } 5209 + 5210 + static BYTE *init_bitmap(UINT *width, UINT *height, UINT *stride) 5211 + { 5212 + BYTE *src; 5213 + UINT i, j, scale; 5214 + 5215 + *width = 256; 5216 + *height = 256; 5217 + *stride = (*width * 3 + 3) & ~3; 5218 + trace("width %d, height %d, stride %d\n", *width, *height, *stride); 5219 + 5220 + src = HeapAlloc(GetProcessHeap(), 0, *stride * *height); 5221 + 5222 + scale = 256 / *width; 5223 + if (!scale) scale = 1; 5224 + 5225 + for (i = 0; i < *height; i++) 5226 + { 5227 + for (j = 0; j < *width; j++) 5228 + { 5229 + src[i * *stride + j*3 + 0] = scale * i; 5230 + src[i * *stride + j*3 + 1] = scale * (255 - (i+j)/2); 5231 + src[i * *stride + j*3 + 2] = scale * j; 5232 + } 5233 + } 5234 + 5235 + return src; 5236 + } 5237 + 5238 + static void test_GdipInitializePalette(void) 5239 + { 5240 + GpStatus status; 5241 + BYTE *data; 5242 + GpBitmap *bitmap; 5243 + ColorPalette *palette; 5244 + UINT width, height, stride; 5245 + 5246 + pGdipInitializePalette = (void *)GetProcAddress(GetModuleHandleA("gdiplus.dll"), "GdipInitializePalette"); 5247 + if (!pGdipInitializePalette) 5248 + { 5249 + win_skip("GdipInitializePalette is not supported on this platform\n"); 5250 + return; 5251 + } 5252 + 5253 + data = init_bitmap(&width, &height, &stride); 5254 + 5255 + status = GdipCreateBitmapFromScan0(width, height, stride, PixelFormat24bppRGB, data, &bitmap); 5256 + expect(Ok, status); 5257 + 5258 + palette = GdipAlloc(sizeof(*palette) + sizeof(ARGB) * 255); 5259 + 5260 + palette->Flags = 0; 5261 + palette->Count = 15; 5262 + status = pGdipInitializePalette(palette, PaletteTypeOptimal, 16, FALSE, bitmap); 5263 + expect(GenericError, status); 5264 + 5265 + palette->Flags = 0; 5266 + palette->Count = 256; 5267 + status = pGdipInitializePalette(palette, PaletteTypeOptimal, 16, FALSE, NULL); 5268 + expect(InvalidParameter, status); 5269 + 5270 + memset(palette->Entries, 0x11, sizeof(ARGB) * 256); 5271 + palette->Flags = 0; 5272 + palette->Count = 256; 5273 + status = pGdipInitializePalette(palette, PaletteTypeCustom, 16, FALSE, NULL); 5274 + expect(Ok, status); 5275 + expect(0, palette->Flags); 5276 + expect(256, palette->Count); 5277 + expect(0x11111111, palette->Entries[0]); 5278 + expect(0x11111111, palette->Entries[128]); 5279 + expect(0x11111111, palette->Entries[255]); 5280 + 5281 + memset(palette->Entries, 0x11, sizeof(ARGB) * 256); 5282 + palette->Flags = 0; 5283 + palette->Count = 256; 5284 + status = pGdipInitializePalette(palette, PaletteTypeFixedBW, 0, FALSE, bitmap); 5285 + expect(Ok, status); 5286 + todo_wine 5287 + expect(0x200, palette->Flags); 5288 + expect(2, palette->Count); 5289 + expect(0xff000000, palette->Entries[0]); 5290 + expect(0xffffffff, palette->Entries[1]); 5291 + 5292 + memset(palette->Entries, 0x11, sizeof(ARGB) * 256); 5293 + palette->Flags = 0; 5294 + palette->Count = 256; 5295 + status = pGdipInitializePalette(palette, PaletteTypeFixedHalftone8, 1, FALSE, NULL); 5296 + expect(Ok, status); 5297 + todo_wine 5298 + expect(0x300, palette->Flags); 5299 + expect(16, palette->Count); 5300 + expect(0xff000000, palette->Entries[0]); 5301 + expect(0xffc0c0c0, palette->Entries[8]); 5302 + expect(0xff008080, palette->Entries[15]); 5303 + 5304 + memset(palette->Entries, 0x11, sizeof(ARGB) * 256); 5305 + palette->Flags = 0; 5306 + palette->Count = 256; 5307 + status = pGdipInitializePalette(palette, PaletteTypeFixedHalftone8, 1, FALSE, bitmap); 5308 + expect(Ok, status); 5309 + todo_wine 5310 + expect(0x300, palette->Flags); 5311 + expect(16, palette->Count); 5312 + expect(0xff000000, palette->Entries[0]); 5313 + expect(0xffc0c0c0, palette->Entries[8]); 5314 + expect(0xff008080, palette->Entries[15]); 5315 + 5316 + memset(palette->Entries, 0x11, sizeof(ARGB) * 256); 5317 + palette->Flags = 0; 5318 + palette->Count = 256; 5319 + status = pGdipInitializePalette(palette, PaletteTypeFixedHalftone252, 1, FALSE, bitmap); 5320 + expect(Ok, status); 5321 + todo_wine 5322 + expect(0x800, palette->Flags); 5323 + expect(252, palette->Count); 5324 + expect(0xff000000, palette->Entries[0]); 5325 + expect(0xff990066, palette->Entries[128]); 5326 + expect(0xffffffff, palette->Entries[251]); 5327 + 5328 + palette->Flags = 0; 5329 + palette->Count = 256; 5330 + status = pGdipInitializePalette(palette, PaletteTypeOptimal, 1, FALSE, bitmap); 5331 + expect(InvalidParameter, status); 5332 + 5333 + palette->Flags = 0; 5334 + palette->Count = 256; 5335 + status = pGdipInitializePalette(palette, PaletteTypeOptimal, 2, FALSE, bitmap); 5336 + expect(Ok, status); 5337 + expect(0, palette->Flags); 5338 + expect(2, palette->Count); 5339 + 5340 + palette->Flags = 0; 5341 + palette->Count = 256; 5342 + status = pGdipInitializePalette(palette, PaletteTypeOptimal, 16, FALSE, bitmap); 5343 + expect(Ok, status); 5344 + expect(0, palette->Flags); 5345 + expect(16, palette->Count); 5346 + 5347 + /* passing invalid enumeration palette type crashes under most Windows versions */ 5348 + 5349 + GdipFree(palette); 5350 + GdipDisposeImage((GpImage *)bitmap); 5351 + } 5352 + 5353 + #include "pshpack2.h" 5354 + static const struct tiff_1x1_data 5355 + { 5356 + USHORT byte_order; 5357 + USHORT version; 5358 + ULONG dir_offset; 5359 + USHORT number_of_entries; 5360 + struct IFD_entry entry[12]; 5361 + ULONG next_IFD; 5362 + struct IFD_rational res; 5363 + short palette_data[3][256]; 5364 + short bps_data[4]; 5365 + BYTE pixel_data[32]; 5366 + } tiff_1x1_data = 5367 + { 5368 + #ifdef WORDS_BIGENDIAN 5369 + 'M' | 'M' << 8, 5370 + #else 5371 + 'I' | 'I' << 8, 5372 + #endif 5373 + 42, 5374 + FIELD_OFFSET(struct tiff_1x1_data, number_of_entries), 5375 + 12, 5376 + { 5377 + { 0xff, IFD_SHORT, 1, 0 }, /* SUBFILETYPE */ 5378 + { 0x100, IFD_LONG, 1, 1 }, /* IMAGEWIDTH */ 5379 + { 0x101, IFD_LONG, 1, 1 }, /* IMAGELENGTH */ 5380 + { 0x102, IFD_SHORT, 3, FIELD_OFFSET(struct tiff_1x1_data, bps_data) }, /* BITSPERSAMPLE */ 5381 + { 0x103, IFD_SHORT, 1, 1 }, /* COMPRESSION: XP doesn't accept IFD_LONG here */ 5382 + { 0x106, IFD_SHORT, 1, 2 }, /* PHOTOMETRIC */ 5383 + { 0x111, IFD_LONG, 1, FIELD_OFFSET(struct tiff_1x1_data, pixel_data) }, /* STRIPOFFSETS */ 5384 + { 0x115, IFD_SHORT, 1, 3 }, /* SAMPLESPERPIXEL */ 5385 + { 0x11a, IFD_RATIONAL, 1, FIELD_OFFSET(struct tiff_1x1_data, res) }, 5386 + { 0x11b, IFD_RATIONAL, 1, FIELD_OFFSET(struct tiff_1x1_data, res) }, 5387 + { 0x128, IFD_SHORT, 1, 2 }, /* RESOLUTIONUNIT */ 5388 + { 0x140, IFD_SHORT, 256*3, FIELD_OFFSET(struct tiff_1x1_data, palette_data) } /* COLORMAP */ 5389 + }, 5390 + 0, 5391 + { 96, 1 }, 5392 + { { 0 } }, 5393 + { 8,8,8,0 }, 5394 + { 1,0,2,3,4,5,6,7,8,9,0,1,2,3,4,5 } 5395 + }; 5396 + #include "poppack.h" 5397 + 5398 + static void test_tiff_color_formats(void) 5399 + { 5400 + static const struct 5401 + { 5402 + int photometric; /* PhotometricInterpretation */ 5403 + int samples; /* SamplesPerPixel */ 5404 + int bps; /* BitsPerSample */ 5405 + PixelFormat format; 5406 + } td[] = 5407 + { 5408 + /* 2 - RGB */ 5409 + { 2, 3, 1, PixelFormat24bppRGB }, 5410 + { 2, 3, 4, PixelFormat24bppRGB }, 5411 + { 2, 3, 8, PixelFormat24bppRGB }, 5412 + { 2, 3, 16, PixelFormat48bppRGB }, 5413 + { 2, 3, 24, 0 }, 5414 + #if 0 /* FIXME */ 5415 + { 2, 3, 32, 0 }, 5416 + #endif 5417 + { 2, 4, 1, PixelFormat32bppARGB }, 5418 + { 2, 4, 4, PixelFormat32bppARGB }, 5419 + { 2, 4, 8, PixelFormat32bppARGB }, 5420 + { 2, 4, 16, PixelFormat48bppRGB }, 5421 + { 2, 4, 24, 0 }, 5422 + { 2, 4, 32, 0 }, 5423 + /* 1 - BlackIsZero (Bilevel) */ 5424 + { 1, 1, 1, PixelFormat1bppIndexed }, 5425 + #if 0 /* FIXME: PNG vs TIFF mismatch */ 5426 + { 1, 1, 4, PixelFormat8bppIndexed }, 5427 + #endif 5428 + { 1, 1, 8, PixelFormat8bppIndexed }, 5429 + { 1, 1, 16, PixelFormat32bppARGB }, 5430 + { 1, 1, 24, 0 }, 5431 + { 1, 1, 32, PixelFormat32bppARGB }, 5432 + /* 3 - Palette Color */ 5433 + { 3, 1, 1, PixelFormat1bppIndexed }, 5434 + { 3, 1, 4, PixelFormat4bppIndexed }, 5435 + { 3, 1, 8, PixelFormat8bppIndexed }, 5436 + #if 0 /* FIXME: for some reason libtiff replaces photometric 3 by 1 for bps > 8 */ 5437 + { 3, 1, 16, 0 }, 5438 + { 3, 1, 24, 0 }, 5439 + { 3, 1, 32, 0 }, 5440 + #endif 5441 + /* 5 - Separated */ 5442 + { 5, 4, 1, 0 }, 5443 + { 5, 4, 4, 0 }, 5444 + { 5, 4, 8, PixelFormat32bppCMYK }, 5445 + { 5, 4, 16, PixelFormat48bppRGB }, 5446 + { 5, 4, 24, 0 }, 5447 + { 5, 4, 32, 0 }, 5448 + }; 5449 + BYTE buf[sizeof(tiff_1x1_data)]; 5450 + GpStatus status; 5451 + GpImage *image; 5452 + UINT count, i; 5453 + struct IFD_entry *tag, *tag_photo = NULL, *tag_bps = NULL, *tag_samples = NULL, *tag_colormap = NULL; 5454 + short *bps; 5455 + ImageType type; 5456 + PixelFormat format; 5457 + 5458 + memcpy(buf, &tiff_1x1_data, sizeof(tiff_1x1_data)); 5459 + 5460 + count = *(short *)(buf + tiff_1x1_data.dir_offset); 5461 + tag = (struct IFD_entry *)(buf + tiff_1x1_data.dir_offset + sizeof(short)); 5462 + 5463 + /* verify the TIFF structure */ 5464 + for (i = 0; i < count; i++) 5465 + { 5466 + if (tag[i].id == 0x102) /* BitsPerSample */ 5467 + tag_bps = &tag[i]; 5468 + else if (tag[i].id == 0x106) /* PhotometricInterpretation */ 5469 + tag_photo = &tag[i]; 5470 + else if (tag[i].id == 0x115) /* SamplesPerPixel */ 5471 + tag_samples = &tag[i]; 5472 + else if (tag[i].id == 0x140) /* ColorMap */ 5473 + tag_colormap = &tag[i]; 5474 + } 5475 + 5476 + ok(tag_bps && tag_photo && tag_samples && tag_colormap, "tag 0x102,0x106,0x115 or 0x140 is missing\n"); 5477 + if (!tag_bps || !tag_photo || !tag_samples || !tag_colormap) return; 5478 + 5479 + ok(tag_bps->type == IFD_SHORT, "tag 0x102 should have type IFD_SHORT\n"); 5480 + bps = (short *)(buf + tag_bps->value); 5481 + ok(bps[0] == 8 && bps[1] == 8 && bps[2] == 8 && bps[3] == 0, 5482 + "expected bps 8,8,8,0 got %d,%d,%d,%d\n", bps[0], bps[1], bps[2], bps[3]); 5483 + 5484 + for (i = 0; i < sizeof(td)/sizeof(td[0]); i++) 5485 + { 5486 + tag_colormap->count = (1 << td[i].bps) * 3; 5487 + tag_photo->value = td[i].photometric; 5488 + tag_bps->count = td[i].samples; 5489 + tag_samples->value = td[i].samples; 5490 + 5491 + if (td[i].samples == 1) 5492 + tag_bps->value = td[i].bps; 5493 + else if (td[i].samples == 2) 5494 + tag_bps->value = MAKELONG(td[i].bps, td[i].bps); 5495 + else if (td[i].samples == 3) 5496 + { 5497 + tag_bps->value = (BYTE *)bps - buf; 5498 + bps[0] = bps[1] = bps[2] = td[i].bps; 5499 + } 5500 + else if (td[i].samples == 4) 5501 + { 5502 + tag_bps->value = (BYTE *)bps - buf; 5503 + bps[0] = bps[1] = bps[2] = bps[3] = td[i].bps; 5504 + } 5505 + else 5506 + { 5507 + ok(0, "%u: unsupported samples count %d\n", i, td[i].samples); 5508 + continue; 5509 + } 5510 + 5511 + image = load_image(buf, sizeof(buf)); 5512 + if (!td[i].format) 5513 + ok(!image, 5514 + "%u: (%d,%d,%d) TIFF image loading should have failed\n", i, td[i].photometric, td[i].samples, td[i].bps); 5515 + else 5516 + ok(image != NULL || broken(!image) /* XP */, "%u: failed to load TIFF image data (%d,%d,%d)\n", 5517 + i, td[i].photometric, td[i].samples, td[i].bps); 5518 + if (!image) continue; 5519 + 5520 + status = GdipGetImageType(image, &type); 5521 + ok(status == Ok, "%u: GdipGetImageType error %d\n", i, status); 5522 + ok(type == ImageTypeBitmap, "%u: wrong image type %d\n", i, type); 5523 + 5524 + status = GdipGetImagePixelFormat(image, &format); 5525 + expect(Ok, status); 5526 + ok(format == td[i].format, 5527 + "%u: expected %#x, got %#x\n", i, td[i].format, format); 5528 + 5529 + GdipDisposeImage(image); 5530 + } 5531 + } 5532 + 5171 5533 START_TEST(image) 5172 5534 { 5173 5535 HMODULE mod = GetModuleHandleA("gdiplus.dll"); ··· 5192 5554 pGdipBitmapGetHistogram = (void*)GetProcAddress(mod, "GdipBitmapGetHistogram"); 5193 5555 pGdipImageSetAbort = (void*)GetProcAddress(mod, "GdipImageSetAbort"); 5194 5556 5557 + test_tiff_color_formats(); 5558 + test_GdipInitializePalette(); 5195 5559 test_png_color_formats(); 5196 5560 test_supported_encoders(); 5197 5561 test_CloneBitmapArea(); ··· 5241 5605 test_getadjustedpalette(); 5242 5606 test_histogram(); 5243 5607 test_imageabort(); 5608 + test_GdipLoadImageFromStream(); 5244 5609 5245 5610 GdiplusShutdown(gdiplusToken); 5246 5611 }
+6 -1
modules/rostests/winetests/gdiplus/matrix.c
··· 18 18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA 19 19 */ 20 20 21 - #include "precomp.h" 21 + #include <math.h> 22 + #include <limits.h> 23 + 24 + #include "objbase.h" 25 + #include "gdiplus.h" 26 + #include "wine/test.h" 22 27 23 28 #define expect(expected, got) ok(got == expected, "Expected %.8x, got %.8x\n", expected, got) 24 29 #define expectf(expected, got) ok(fabs(expected - got) < 0.0001, "Expected %.2f, got %.2f\n", expected, got)
+5 -1
modules/rostests/winetests/gdiplus/metafile.c
··· 18 18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA 19 19 */ 20 20 21 - #include "precomp.h" 21 + #include <math.h> 22 + 23 + #include "objbase.h" 24 + #include "gdiplus.h" 25 + #include "wine/test.h" 22 26 23 27 #define expect(expected, got) ok(got == expected, "Expected %.8x, got %.8x\n", expected, got) 24 28 #define expectf_(expected, got, precision) ok(fabs((expected) - (got)) <= (precision), "Expected %f, got %f\n", (expected), (got))
+3 -1
modules/rostests/winetests/gdiplus/pathiterator.c
··· 18 18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA 19 19 */ 20 20 21 - #include "precomp.h" 21 + #include "objbase.h" 22 + #include "gdiplus.h" 23 + #include "wine/test.h" 22 24 23 25 #define expect(expected, got) ok(got == expected, "Expected %.8x, got %.8x\n", expected, got) 24 26
+5 -1
modules/rostests/winetests/gdiplus/pen.c
··· 18 18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA 19 19 */ 20 20 21 - #include "precomp.h" 21 + #include <math.h> 22 + 23 + #include "objbase.h" 24 + #include "gdiplus.h" 25 + #include "wine/test.h" 22 26 23 27 #define expect(expected, got) ok(got == expected, "Expected %.8x, got %.8x\n", expected, got) 24 28 #define expectf(expected, got) ok(fabs(got - expected) < 0.1, "Expected %.2f, got %.2f\n", expected, got)
+3
modules/rostests/winetests/gdiplus/precomp.h
··· 1 + 1 2 #ifndef _GDIPLUS_WINETEST_PRECOMP_H_ 2 3 #define _GDIPLUS_WINETEST_PRECOMP_H_ 3 4 ··· 6 7 #define WIN32_NO_STATUS 7 8 #define _INC_WINDOWS 8 9 #define COM_NO_WINDOWS_H 10 + 9 11 #define COBJMACROS 10 12 11 13 #include <wine/test.h> 14 + 12 15 #include <wingdi.h> 13 16 #include <winnls.h> 14 17 #include <objbase.h>
+5 -1
modules/rostests/winetests/gdiplus/region.c
··· 19 19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA 20 20 */ 21 21 22 - #include "precomp.h" 22 + #include <math.h> 23 + 24 + #include "objbase.h" 25 + #include "gdiplus.h" 26 + #include "wine/test.h" 23 27 24 28 #define RGNDATA_RECT 0x10000000 25 29 #define RGNDATA_PATH 0x10000001
+3 -1
modules/rostests/winetests/gdiplus/stringformat.c
··· 18 18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA 19 19 */ 20 20 21 - #include "precomp.h" 21 + #include "objbase.h" 22 + #include "gdiplus.h" 23 + #include "wine/test.h" 22 24 23 25 #define expect(expected, got) ok(got == expected, "Expected %.8x, got %.8x\n", expected, got) 24 26 #define expectf(expected, got) ok(got == expected, "Expected %.2f, got %.2f\n", expected, got)