From 793dfb460e2764f3d9fa6bd4a3762b3d85b596ed Mon Sep 17 00:00:00 2001 From: Vincent Povirk Date: Fri, 2 Jul 2010 17:22:18 -0400 Subject: [PATCH 5/5] gdiplus: Test flags of loaded images. --- dlls/gdiplus/tests/image.c | 22 +++++++++++++++------- 1 files changed, 15 insertions(+), 7 deletions(-) diff --git a/dlls/gdiplus/tests/image.c b/dlls/gdiplus/tests/image.c index f00d003..5f419bb 100644 --- a/dlls/gdiplus/tests/image.c +++ b/dlls/gdiplus/tests/image.c @@ -69,7 +69,7 @@ static void expect_rawformat(REFGUID expected, GpImage *img, int line, BOOL todo expect_guid(expected, &raw, line, todo); } -static void test_bufferrawformat(void* buff, int size, REFGUID expected, int line, BOOL todo) +static void test_bufferrawformat(void* buff, int size, REFGUID expected, int line, BOOL todo, UINT expected_flags, BOOL flags_todo) { LPSTREAM stream; HGLOBAL hglob; @@ -77,6 +77,7 @@ static void test_bufferrawformat(void* buff, int size, REFGUID expected, int lin HRESULT hres; GpStatus stat; GpImage *img; + UINT flags; hglob = GlobalAlloc (0, size); data = GlobalLock (hglob); @@ -96,6 +97,13 @@ static void test_bufferrawformat(void* buff, int size, REFGUID expected, int lin expect_rawformat(expected, img, line, todo); + stat = GdipGetImageFlags(img, &flags); + expect(Ok, stat); + if (flags_todo) + todo_wine expect(expected_flags, flags); + else + expect(expected_flags, flags); + GdipDisposeImage(img); IStream_Release(stream); } @@ -1063,12 +1071,12 @@ static const unsigned char wmfimage[180] = { }; static void test_getrawformat(void) { - test_bufferrawformat((void*)pngimage, sizeof(pngimage), &ImageFormatPNG, __LINE__, FALSE); - test_bufferrawformat((void*)gifimage, sizeof(gifimage), &ImageFormatGIF, __LINE__, FALSE); - test_bufferrawformat((void*)bmpimage, sizeof(bmpimage), &ImageFormatBMP, __LINE__, FALSE); - test_bufferrawformat((void*)jpgimage, sizeof(jpgimage), &ImageFormatJPEG, __LINE__, FALSE); - test_bufferrawformat((void*)tiffimage, sizeof(tiffimage), &ImageFormatTIFF, __LINE__, FALSE); - test_bufferrawformat((void*)wmfimage, sizeof(wmfimage), &ImageFormatWMF, __LINE__, FALSE); + test_bufferrawformat((void*)pngimage, sizeof(pngimage), &ImageFormatPNG, __LINE__, FALSE, 0x13010, TRUE); + test_bufferrawformat((void*)gifimage, sizeof(gifimage), &ImageFormatGIF, __LINE__, FALSE, 0x12010, TRUE); + test_bufferrawformat((void*)bmpimage, sizeof(bmpimage), &ImageFormatBMP, __LINE__, FALSE, 0x13010, TRUE); + test_bufferrawformat((void*)jpgimage, sizeof(jpgimage), &ImageFormatJPEG, __LINE__, FALSE, 0x13088, TRUE); + test_bufferrawformat((void*)tiffimage, sizeof(tiffimage), &ImageFormatTIFF, __LINE__, FALSE, 0x13010, TRUE); + test_bufferrawformat((void*)wmfimage, sizeof(wmfimage), &ImageFormatWMF, __LINE__, FALSE, 0x50003, TRUE); } static void test_loadwmf(void) -- 1.6.3.3