From 31f99bf37795f11a6766441cf465388bb8aaf93c Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Thu, 24 Apr 2014 12:13:18 +0000 Subject: [PATCH] [WINDOWSCODECS_WINETEST] * Sync with Wine 1.7.17. CORE-8080 svn path=/trunk/; revision=62937 --- .../winetests/windowscodecs/CMakeLists.txt | 5 +- rostests/winetests/windowscodecs/bitmap.c | 73 +++++++++++++------ rostests/winetests/windowscodecs/converter.c | 20 ++--- rostests/winetests/windowscodecs/gifformat.c | 22 ++---- rostests/winetests/windowscodecs/info.c | 23 +----- rostests/winetests/windowscodecs/metadata.c | 71 +++++++----------- rostests/winetests/windowscodecs/pngformat.c | 16 +--- rostests/winetests/windowscodecs/testlist.c | 2 +- rostests/winetests/windowscodecs/tiffformat.c | 14 +--- 9 files changed, 105 insertions(+), 141 deletions(-) diff --git a/rostests/winetests/windowscodecs/CMakeLists.txt b/rostests/winetests/windowscodecs/CMakeLists.txt index 29a157de6e1..81eb815e8fa 100644 --- a/rostests/winetests/windowscodecs/CMakeLists.txt +++ b/rostests/winetests/windowscodecs/CMakeLists.txt @@ -18,5 +18,8 @@ list(APPEND SOURCE add_executable(windowscodecs_winetest ${SOURCE}) set_module_type(windowscodecs_winetest win32cui) -add_importlibs(windowscodecs_winetest windowscodecs oleaut32 ole32 user32 gdi32 msvcrt kernel32 ntdll) +add_importlibs(windowscodecs_winetest windowscodecs oleaut32 ole32 user32 gdi32 msvcrt kernel32) +if(MSVC) + add_importlibs(windowscodecs_winetest ntdll) +endif() add_cd_file(TARGET windowscodecs_winetest DESTINATION reactos/bin FOR all) diff --git a/rostests/winetests/windowscodecs/bitmap.c b/rostests/winetests/windowscodecs/bitmap.c index ac33e7ca2bd..d323f8f5b51 100644 --- a/rostests/winetests/windowscodecs/bitmap.c +++ b/rostests/winetests/windowscodecs/bitmap.c @@ -38,18 +38,6 @@ static IWICImagingFactory *factory; -static const char *debugstr_guid(const GUID *guid) -{ - static char buf[50]; - - if (!guid) return "(null)"; - sprintf(buf, "{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}", - guid->Data1, guid->Data2, guid->Data3, guid->Data4[0], - guid->Data4[1], guid->Data4[2], guid->Data4[3], guid->Data4[4], - guid->Data4[5], guid->Data4[6], guid->Data4[7]); - return buf; -} - static HRESULT WINAPI bitmapsource_QueryInterface(IWICBitmapSource *iface, REFIID iid, void **ppv) { if (IsEqualIID(&IID_IUnknown, iid) || @@ -158,7 +146,7 @@ static HBITMAP create_dib(int width, int height, int bpp, LOGPALETTE *pal, const hdib = CreateDIBSection(0, bmi, DIB_RGB_COLORS, &bits, NULL, 0); ok(hdib != 0, "CreateDIBSection(%dx%d,%d bpp) failed\n", width, height, bpp); - GetObject(hdib, sizeof(bm), &bm); + GetObjectW(hdib, sizeof(bm), &bm); ok(bm.bmWidth == width, "expected %d, got %d\n", width, bm.bmWidth); ok(bm.bmHeight == height, "expected %d, got %d\n", height, bm.bmHeight); ok(bm.bmPlanes == 1, "expected 1, got %d\n", bm.bmPlanes); @@ -671,7 +659,7 @@ static void test_CreateBitmapFromHICON(void) IWICBitmap_GetPixelFormat(bitmap, &format); ok(IsEqualGUID(&format, &GUID_WICPixelFormat32bppBGRA), - "unexpected pixel format %s\n", debugstr_guid(&format)); + "unexpected pixel format %s\n", wine_dbgstr_guid(&format)); IWICBitmap_GetSize(bitmap, &width, &height); ok(hr == S_OK, "IWICBitmap_GetSize error %#x\n", hr); @@ -699,7 +687,7 @@ static void test_CreateBitmapFromHICON(void) IWICBitmap_GetPixelFormat(bitmap, &format); ok(IsEqualGUID(&format, &GUID_WICPixelFormat32bppBGRA), - "unexpected pixel format %s\n", debugstr_guid(&format)); + "unexpected pixel format %s\n", wine_dbgstr_guid(&format)); IWICBitmap_GetSize(bitmap, &width, &height); ok(hr == S_OK, "IWICBitmap_GetSize error %#x\n", hr); @@ -733,21 +721,17 @@ static void test_CreateBitmapFromHBITMAP(void) ok(hbmp != 0, "failed to create bitmap\n"); hr = IWICImagingFactory_CreateBitmapFromHBITMAP(factory, 0, 0, WICBitmapIgnoreAlpha, &bitmap); -todo_wine ok(hr == WINCODEC_ERR_WIN32ERROR || hr == 0x88980003 /*XP*/, "expected WINCODEC_ERR_WIN32ERROR, got %#x\n", hr); hr = IWICImagingFactory_CreateBitmapFromHBITMAP(factory, hbmp, 0, WICBitmapIgnoreAlpha, NULL); -todo_wine ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#x\n", hr); hr = IWICImagingFactory_CreateBitmapFromHBITMAP(factory, hbmp, 0, WICBitmapIgnoreAlpha, &bitmap); -todo_wine ok(hr == S_OK, "CreateBitmapFromHBITMAP error %#x\n", hr); - if (hr != S_OK) return; IWICBitmap_GetPixelFormat(bitmap, &format); ok(IsEqualGUID(&format, &GUID_WICPixelFormat8bppIndexed), - "unexpected pixel format %s\n", debugstr_guid(&format)); + "unexpected pixel format %s\n", wine_dbgstr_guid(&format)); hr = IWICBitmap_GetSize(bitmap, &width, &height); ok(hr == S_OK, "IWICBitmap_GetSize error %#x\n", hr); @@ -776,8 +760,9 @@ todo_wine ok(hr == S_OK, "CreateBitmapFromHBITMAP error %#x\n", hr); IWICBitmap_GetPixelFormat(bitmap, &format); +todo_wine ok(IsEqualGUID(&format, &GUID_WICPixelFormat4bppIndexed), - "unexpected pixel format %s\n", debugstr_guid(&format)); + "unexpected pixel format %s\n", wine_dbgstr_guid(&format)); hr = IWICBitmap_GetSize(bitmap, &width, &height); ok(hr == S_OK, "IWICBitmap_GetSize error %#x\n", hr); @@ -795,6 +780,7 @@ todo_wine hr = IWICPalette_GetColorCount(palette, &count); ok(hr == S_OK, "GetColorCount error %#x\n", hr); +todo_wine ok(count == 16, "expected 16, got %u\n", count); IWICPalette_Release(palette); @@ -817,7 +803,7 @@ todo_wine IWICBitmap_GetPixelFormat(bitmap, &format); ok(IsEqualGUID(&format, &GUID_WICPixelFormat8bppIndexed), - "unexpected pixel format %s\n", debugstr_guid(&format)); + "unexpected pixel format %s\n", wine_dbgstr_guid(&format)); hr = IWICBitmap_GetSize(bitmap, &width, &height); ok(hr == S_OK, "IWICBitmap_GetSize error %#x\n", hr); @@ -843,11 +829,52 @@ todo_wine hr = IWICBitmap_CopyPixels(bitmap, NULL, 4, sizeof(data), data); ok(hr == S_OK, "IWICBitmap_CopyPixels error %#x\n", hr); for (i = 0; i < sizeof(data); i++) - ok(data[i] == data_8bpp_pal_wic[i], "%u: expected %#x, got %#x\n", i, data_8bpp_pal_wic[i], data[i]); + { + if (data[i] != data_8bpp_pal_wic[i]) +todo_wine + ok(data[i] == data_8bpp_pal_wic[i], "%u: expected %#x, got %#x\n", i, data_8bpp_pal_wic[i], data[i]); + else + ok(data[i] == data_8bpp_pal_wic[i], "%u: expected %#x, got %#x\n", i, data_8bpp_pal_wic[i], data[i]); + } IWICBitmap_Release(bitmap); DeleteObject(hbmp); DeleteObject(hpal); + + /* 32bpp alpha */ + hbmp = create_dib(2, 2, 32, NULL, NULL); + hr = IWICImagingFactory_CreateBitmapFromHBITMAP(factory, hbmp, NULL, WICBitmapUseAlpha, &bitmap); + ok(hr == S_OK, "CreateBitmapFromHBITMAP error %#x\n", hr); + + hr = IWICBitmap_GetPixelFormat(bitmap, &format); + ok(hr == S_OK, "GetPixelFormat error %#x\n", hr); + ok(IsEqualGUID(&format, &GUID_WICPixelFormat32bppBGRA), + "unexpected pixel format %s\n", wine_dbgstr_guid(&format)); + + IWICBitmap_Release(bitmap); + + /* 32bpp pre-multiplied alpha */ + hr = IWICImagingFactory_CreateBitmapFromHBITMAP(factory, hbmp, NULL, WICBitmapUsePremultipliedAlpha, &bitmap); + ok(hr == S_OK, "CreateBitmapFromHBITMAP error %#x\n", hr); + + hr = IWICBitmap_GetPixelFormat(bitmap, &format); + ok(hr == S_OK, "GetPixelFormat error %#x\n", hr); + ok(IsEqualGUID(&format, &GUID_WICPixelFormat32bppPBGRA), + "unexpected pixel format %s\n", wine_dbgstr_guid(&format)); + + IWICBitmap_Release(bitmap); + + /* 32bpp no alpha */ + hr = IWICImagingFactory_CreateBitmapFromHBITMAP(factory, hbmp, NULL, WICBitmapIgnoreAlpha, &bitmap); + ok(hr == S_OK, "CreateBitmapFromHBITMAP error %#x\n", hr); + + hr = IWICBitmap_GetPixelFormat(bitmap, &format); + ok(hr == S_OK, "GetPixelFormat error %#x\n", hr); + ok(IsEqualGUID(&format, &GUID_WICPixelFormat32bppBGR), + "unexpected pixel format %s\n", wine_dbgstr_guid(&format)); + + IWICBitmap_Release(bitmap); + DeleteObject(hbmp); } static void test_clipper(void) diff --git a/rostests/winetests/windowscodecs/converter.c b/rostests/winetests/windowscodecs/converter.c index c7b516c42a8..1cdbafa792a 100644 --- a/rostests/winetests/windowscodecs/converter.c +++ b/rostests/winetests/windowscodecs/converter.c @@ -343,7 +343,7 @@ static void test_default_converter(void) { BitmapTestSrc *src_obj; IWICFormatConverter *converter; - BOOL can_convert=1; + BOOL can_convert = TRUE; HRESULT hr; CreateTestBitmap(&testdata_32bppBGRA, &src_obj); @@ -652,18 +652,18 @@ START_TEST(converter) { CoInitializeEx(NULL, COINIT_APARTMENTTHREADED); - test_conversion(&testdata_32bppBGRA, &testdata_32bppBGR, "BGRA -> BGR", 0); - test_conversion(&testdata_32bppBGR, &testdata_32bppBGRA, "BGR -> BGRA", 0); - test_conversion(&testdata_32bppBGRA, &testdata_32bppBGRA, "BGRA -> BGRA", 0); + test_conversion(&testdata_32bppBGRA, &testdata_32bppBGR, "BGRA -> BGR", FALSE); + test_conversion(&testdata_32bppBGR, &testdata_32bppBGRA, "BGR -> BGRA", FALSE); + test_conversion(&testdata_32bppBGRA, &testdata_32bppBGRA, "BGRA -> BGRA", FALSE); - test_conversion(&testdata_24bppBGR, &testdata_24bppBGR, "24bppBGR -> 24bppBGR", 0); - test_conversion(&testdata_24bppBGR, &testdata_24bppRGB, "24bppBGR -> 24bppRGB", 0); + test_conversion(&testdata_24bppBGR, &testdata_24bppBGR, "24bppBGR -> 24bppBGR", FALSE); + test_conversion(&testdata_24bppBGR, &testdata_24bppRGB, "24bppBGR -> 24bppRGB", FALSE); - test_conversion(&testdata_24bppRGB, &testdata_24bppRGB, "24bppRGB -> 24bppRGB", 0); - test_conversion(&testdata_24bppRGB, &testdata_24bppBGR, "24bppRGB -> 24bppBGR", 0); + test_conversion(&testdata_24bppRGB, &testdata_24bppRGB, "24bppRGB -> 24bppRGB", FALSE); + test_conversion(&testdata_24bppRGB, &testdata_24bppBGR, "24bppRGB -> 24bppBGR", FALSE); - test_conversion(&testdata_32bppBGR, &testdata_24bppRGB, "32bppBGR -> 24bppRGB", 0); - test_conversion(&testdata_24bppRGB, &testdata_32bppBGR, "24bppRGB -> 32bppBGR", 0); + test_conversion(&testdata_32bppBGR, &testdata_24bppRGB, "32bppBGR -> 24bppRGB", FALSE); + test_conversion(&testdata_24bppRGB, &testdata_32bppBGR, "24bppRGB -> 32bppBGR", FALSE); test_invalid_conversion(); test_default_converter(); diff --git a/rostests/winetests/windowscodecs/gifformat.c b/rostests/winetests/windowscodecs/gifformat.c index d0e8117fe07..a66cfd0554a 100644 --- a/rostests/winetests/windowscodecs/gifformat.c +++ b/rostests/winetests/windowscodecs/gifformat.c @@ -63,18 +63,6 @@ static const char gif_local_palette[] = { static IWICImagingFactory *factory; -static const char *debugstr_guid(const GUID *guid) -{ - static char buf[50]; - - if (!guid) return "(null)"; - sprintf(buf, "{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}", - guid->Data1, guid->Data2, guid->Data3, guid->Data4[0], - guid->Data4[1], guid->Data4[2], guid->Data4[3], guid->Data4[4], - guid->Data4[5], guid->Data4[6], guid->Data4[7]); - return buf; -} - static IWICBitmapDecoder *create_decoder(const void *image_data, UINT image_size) { HGLOBAL hmem; @@ -98,7 +86,7 @@ static IWICBitmapDecoder *create_decoder(const void *image_data, UINT image_size hr = IWICBitmapDecoder_GetContainerFormat(decoder, &format); ok(hr == S_OK, "GetContainerFormat error %#x\n", hr); ok(IsEqualGUID(&format, &GUID_ContainerFormatGif), - "wrong container format %s\n", debugstr_guid(&format)); + "wrong container format %s\n", wine_dbgstr_guid(&format)); IStream_Release(stream); @@ -144,7 +132,7 @@ static void test_global_gif_palette(void) hr = IWICBitmapFrameDecode_GetPixelFormat(frame, &format); ok(hr == S_OK, "GetPixelFormat error %#x\n", hr); ok(IsEqualGUID(&format, &GUID_WICPixelFormat8bppIndexed), - "wrong pixel format %s\n", debugstr_guid(&format)); + "wrong pixel format %s\n", wine_dbgstr_guid(&format)); hr = IWICBitmapFrameDecode_CopyPalette(frame, palette); ok(hr == S_OK, "CopyPalette error %#x\n", hr); @@ -206,7 +194,7 @@ static void test_global_gif_palette_2frames(void) hr = IWICBitmapFrameDecode_GetPixelFormat(frame, &format); ok(hr == S_OK, "GetPixelFormat error %#x\n", hr); ok(IsEqualGUID(&format, &GUID_WICPixelFormat8bppIndexed), - "wrong pixel format %s\n", debugstr_guid(&format)); + "wrong pixel format %s\n", wine_dbgstr_guid(&format)); hr = IWICBitmapFrameDecode_CopyPalette(frame, palette); ok(hr == S_OK, "CopyPalette error %#x\n", hr); @@ -249,7 +237,7 @@ static void test_global_gif_palette_2frames(void) hr = IWICBitmapFrameDecode_GetPixelFormat(frame, &format); ok(hr == S_OK, "GetPixelFormat error %#x\n", hr); ok(IsEqualGUID(&format, &GUID_WICPixelFormat8bppIndexed), - "wrong pixel format %s\n", debugstr_guid(&format)); + "wrong pixel format %s\n", wine_dbgstr_guid(&format)); hr = IWICBitmapFrameDecode_CopyPalette(frame, palette); ok(hr == S_OK, "CopyPalette error %#x\n", hr); @@ -319,7 +307,7 @@ static void test_local_gif_palette(void) hr = IWICBitmapFrameDecode_GetPixelFormat(frame, &format); ok(hr == S_OK, "GetPixelFormat error %#x\n", hr); ok(IsEqualGUID(&format, &GUID_WICPixelFormat8bppIndexed), - "wrong pixel format %s\n", debugstr_guid(&format)); + "wrong pixel format %s\n", wine_dbgstr_guid(&format)); hr = IWICBitmapFrameDecode_CopyPalette(frame, palette); ok(hr == S_OK, "CopyPalette error %#x\n", hr); diff --git a/rostests/winetests/windowscodecs/info.c b/rostests/winetests/windowscodecs/info.c index 3fb32db84ea..ec5c7c96d66 100644 --- a/rostests/winetests/windowscodecs/info.c +++ b/rostests/winetests/windowscodecs/info.c @@ -36,21 +36,6 @@ #include DEFINE_GUID(GUID_NULL,0,0,0,0,0,0,0,0,0,0,0); -static const char *debugstr_guid(GUID *guid) -{ - static char buf[50]; - - if(!guid) - return "(null)"; - - sprintf(buf, "{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}", - guid->Data1, guid->Data2, guid->Data3, guid->Data4[0], - guid->Data4[1], guid->Data4[2], guid->Data4[3], guid->Data4[4], - guid->Data4[5], guid->Data4[6], guid->Data4[7]); - - return buf; -} - static HRESULT get_component_info(const GUID *clsid, IWICComponentInfo **result) { IWICImagingFactory *factory; @@ -68,7 +53,7 @@ static HRESULT get_component_info(const GUID *clsid, IWICComponentInfo **result) return hr; } -static int is_pixelformat(GUID *format) +static BOOL is_pixelformat(GUID *format) { IWICComponentInfo *info; HRESULT hr; @@ -275,7 +260,7 @@ static void test_pixelformat_info(void) memset(&guid, 0xaa, sizeof(guid)); hr = IWICComponentInfo_GetCLSID(info, &guid); ok(hr == S_OK, "GetCLSID failed, hr=%x\n", hr); - ok(IsEqualGUID(&guid, &GUID_WICPixelFormat32bppBGRA), "unexpected CLSID %s\n", debugstr_guid(&guid)); + ok(IsEqualGUID(&guid, &GUID_WICPixelFormat32bppBGRA), "unexpected CLSID %s\n", wine_dbgstr_guid(&guid)); hr = IWICComponentInfo_GetComponentType(info, NULL); ok(hr == E_INVALIDARG, "GetComponentType failed, hr=%x\n", hr); @@ -305,7 +290,7 @@ static void test_pixelformat_info(void) hr = IWICComponentInfo_GetVendorGUID(info, &guid); ok(hr == S_OK, "GetVendorGUID failed, hr=%x\n", hr); ok(IsEqualGUID(&guid, &GUID_VendorMicrosoft) || - broken(IsEqualGUID(&guid, &GUID_NULL)) /* XP */, "unexpected GUID %s\n", debugstr_guid(&guid)); + broken(IsEqualGUID(&guid, &GUID_NULL)) /* XP */, "unexpected GUID %s\n", wine_dbgstr_guid(&guid)); len = 0xdeadbeef; hr = IWICComponentInfo_GetVersion(info, 0, NULL, &len); @@ -364,7 +349,7 @@ static void test_pixelformat_info(void) memset(&guid, 0xaa, sizeof(guid)); hr = IWICPixelFormatInfo_GetFormatGUID(pixelformat_info, &guid); ok(hr == S_OK, "GetFormatGUID failed, hr=%x\n", hr); - ok(IsEqualGUID(&guid, &GUID_WICPixelFormat32bppBGRA), "unexpected GUID %s\n", debugstr_guid(&guid)); + ok(IsEqualGUID(&guid, &GUID_WICPixelFormat32bppBGRA), "unexpected GUID %s\n", wine_dbgstr_guid(&guid)); IWICPixelFormatInfo_Release(pixelformat_info); } diff --git a/rostests/winetests/windowscodecs/metadata.c b/rostests/winetests/windowscodecs/metadata.c index 620d715f41c..06c85cc1761 100644 --- a/rostests/winetests/windowscodecs/metadata.c +++ b/rostests/winetests/windowscodecs/metadata.c @@ -182,21 +182,6 @@ static const char animatedgif[] = { 0x21,0x01,0x0C,'p','l','a','i','n','t','e','x','t',' ','#','2',0x00,0x3B }; -static const char *debugstr_guid(REFIID riid) -{ - static char buf[50]; - - if(!riid) - return "(null)"; - - sprintf(buf, "{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}", - riid->Data1, riid->Data2, riid->Data3, riid->Data4[0], - riid->Data4[1], riid->Data4[2], riid->Data4[3], riid->Data4[4], - riid->Data4[5], riid->Data4[6], riid->Data4[7]); - - return buf; -} - static IStream *create_stream(const char *data, int data_size) { HRESULT hr; @@ -372,7 +357,7 @@ static void test_metadata_tEXt(void) hr = IWICMetadataReader_GetMetadataFormat(reader, &format); ok(hr == S_OK, "GetMetadataFormat failed, hr=%x\n", hr); - ok(IsEqualGUID(&format, &GUID_MetadataFormatChunktEXt), "unexpected format %s\n", debugstr_guid(&format)); + ok(IsEqualGUID(&format, &GUID_MetadataFormatChunktEXt), "unexpected format %s\n", wine_dbgstr_guid(&format)); hr = IWICMetadataReader_GetMetadataFormat(reader, NULL); ok(hr == E_INVALIDARG, "GetMetadataFormat failed, hr=%x\n", hr); @@ -731,7 +716,7 @@ static void test_metadata_IFD(void) hr = IWICMetadataReader_GetMetadataFormat(reader, &format); ok(hr == S_OK, "GetMetadataFormat error %#x\n", hr); - ok(IsEqualGUID(&format, &GUID_MetadataFormatIfd), "unexpected format %s\n", debugstr_guid(&format)); + ok(IsEqualGUID(&format, &GUID_MetadataFormatIfd), "unexpected format %s\n", wine_dbgstr_guid(&format)); hr = IWICMetadataReader_GetMetadataFormat(reader, NULL); ok(hr == E_INVALIDARG, "GetMetadataFormat should fail\n"); @@ -875,7 +860,7 @@ todo_wine hr = IWICMetadataReader_GetMetadataFormat(reader, &format); ok(hr == S_OK, "GetMetadataFormat failed, hr=%x\n", hr); - ok(IsEqualGUID(&format, &GUID_MetadataFormatChunktEXt), "unexpected format %s\n", debugstr_guid(&format)); + ok(IsEqualGUID(&format, &GUID_MetadataFormatChunktEXt), "unexpected format %s\n", wine_dbgstr_guid(&format)); IWICMetadataReader_Release(reader); } @@ -893,7 +878,7 @@ todo_wine hr = IWICMetadataReader_GetMetadataFormat(reader, &format); ok(hr == S_OK, "GetMetadataFormat failed, hr=%x\n", hr); - ok(IsEqualGUID(&format, &GUID_MetadataFormatUnknown), "unexpected format %s\n", debugstr_guid(&format)); + ok(IsEqualGUID(&format, &GUID_MetadataFormatUnknown), "unexpected format %s\n", wine_dbgstr_guid(&format)); IWICMetadataReader_Release(reader); } @@ -1104,7 +1089,7 @@ static void test_metadata_gif(void) hr = IWICMetadataBlockReader_GetContainerFormat(blockreader, &format); ok(hr == S_OK, "GetContainerFormat error %#x\n", hr); ok(IsEqualGUID(&format, &GUID_ContainerFormatGif), - "wrong container format %s\n", debugstr_guid(&format)); + "wrong container format %s\n", wine_dbgstr_guid(&format)); hr = IWICMetadataBlockReader_GetCount(blockreader, &count); ok(hr == S_OK, "GetCount error %#x\n", hr); @@ -1117,7 +1102,7 @@ static void test_metadata_gif(void) { hr = IWICMetadataReader_GetMetadataFormat(reader, &format); ok(IsEqualGUID(&format, &GUID_MetadataFormatLSD), /* Logical Screen Descriptor */ - "wrong metadata format %s\n", debugstr_guid(&format)); + "wrong metadata format %s\n", wine_dbgstr_guid(&format)); hr = IWICMetadataReader_GetCount(reader, &count); ok(hr == S_OK, "GetCount error %#x\n", hr); @@ -1149,7 +1134,7 @@ static void test_metadata_gif(void) hr = IWICMetadataBlockReader_GetContainerFormat(blockreader, &format); ok(hr == S_OK, "GetContainerFormat error %#x\n", hr); ok(IsEqualGUID(&format, &GUID_ContainerFormatGif), - "wrong container format %s\n", debugstr_guid(&format)); + "wrong container format %s\n", wine_dbgstr_guid(&format)); hr = IWICMetadataBlockReader_GetCount(blockreader, NULL); ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#x\n", hr); @@ -1165,7 +1150,7 @@ static void test_metadata_gif(void) { hr = IWICMetadataReader_GetMetadataFormat(reader, &format); ok(IsEqualGUID(&format, &GUID_MetadataFormatIMD), /* Image Descriptor */ - "wrong metadata format %s\n", debugstr_guid(&format)); + "wrong metadata format %s\n", wine_dbgstr_guid(&format)); hr = IWICMetadataReader_GetCount(reader, &count); ok(hr == S_OK, "GetCount error %#x\n", hr); @@ -1205,7 +1190,7 @@ static void test_metadata_gif(void) hr = IWICMetadataBlockReader_GetContainerFormat(blockreader, &format); ok(hr == S_OK, "GetContainerFormat error %#x\n", hr); ok(IsEqualGUID(&format, &GUID_ContainerFormatGif), - "wrong container format %s\n", debugstr_guid(&format)); + "wrong container format %s\n", wine_dbgstr_guid(&format)); hr = IWICMetadataBlockReader_GetCount(blockreader, &count); ok(hr == S_OK, "GetCount error %#x\n", hr); @@ -1218,7 +1203,7 @@ static void test_metadata_gif(void) { hr = IWICMetadataReader_GetMetadataFormat(reader, &format); ok(IsEqualGUID(&format, &GUID_MetadataFormatLSD), /* Logical Screen Descriptor */ - "wrong metadata format %s\n", debugstr_guid(&format)); + "wrong metadata format %s\n", wine_dbgstr_guid(&format)); hr = IWICMetadataReader_GetCount(reader, &count); ok(hr == S_OK, "GetCount error %#x\n", hr); @@ -1236,7 +1221,7 @@ static void test_metadata_gif(void) { hr = IWICMetadataReader_GetMetadataFormat(reader, &format); ok(IsEqualGUID(&format, &GUID_MetadataFormatAPE), /* Application Extension */ - "wrong metadata format %s\n", debugstr_guid(&format)); + "wrong metadata format %s\n", wine_dbgstr_guid(&format)); hr = IWICMetadataReader_GetCount(reader, &count); ok(hr == S_OK, "GetCount error %#x\n", hr); @@ -1254,7 +1239,7 @@ static void test_metadata_gif(void) { hr = IWICMetadataReader_GetMetadataFormat(reader, &format); ok(IsEqualGUID(&format, &GUID_MetadataFormatGifComment), /* Comment Extension */ - "wrong metadata format %s\n", debugstr_guid(&format)); + "wrong metadata format %s\n", wine_dbgstr_guid(&format)); hr = IWICMetadataReader_GetCount(reader, &count); ok(hr == S_OK, "GetCount error %#x\n", hr); @@ -1272,7 +1257,7 @@ static void test_metadata_gif(void) { hr = IWICMetadataReader_GetMetadataFormat(reader, &format); ok(IsEqualGUID(&format, &GUID_MetadataFormatUnknown), - "wrong metadata format %s\n", debugstr_guid(&format)); + "wrong metadata format %s\n", wine_dbgstr_guid(&format)); hr = IWICMetadataReader_GetCount(reader, &count); ok(hr == S_OK, "GetCount error %#x\n", hr); @@ -1304,7 +1289,7 @@ static void test_metadata_gif(void) hr = IWICMetadataBlockReader_GetContainerFormat(blockreader, &format); ok(hr == S_OK, "GetContainerFormat error %#x\n", hr); ok(IsEqualGUID(&format, &GUID_ContainerFormatGif), - "wrong container format %s\n", debugstr_guid(&format)); + "wrong container format %s\n", wine_dbgstr_guid(&format)); hr = IWICMetadataBlockReader_GetCount(blockreader, NULL); ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#x\n", hr); @@ -1320,7 +1305,7 @@ static void test_metadata_gif(void) { hr = IWICMetadataReader_GetMetadataFormat(reader, &format); ok(IsEqualGUID(&format, &GUID_MetadataFormatIMD), /* Image Descriptor */ - "wrong metadata format %s\n", debugstr_guid(&format)); + "wrong metadata format %s\n", wine_dbgstr_guid(&format)); hr = IWICMetadataReader_GetCount(reader, &count); ok(hr == S_OK, "GetCount error %#x\n", hr); @@ -1338,7 +1323,7 @@ static void test_metadata_gif(void) { hr = IWICMetadataReader_GetMetadataFormat(reader, &format); ok(IsEqualGUID(&format, &GUID_MetadataFormatGifComment), /* Comment Extension */ - "wrong metadata format %s\n", debugstr_guid(&format)); + "wrong metadata format %s\n", wine_dbgstr_guid(&format)); hr = IWICMetadataReader_GetCount(reader, &count); ok(hr == S_OK, "GetCount error %#x\n", hr); @@ -1357,7 +1342,7 @@ static void test_metadata_gif(void) { hr = IWICMetadataReader_GetMetadataFormat(reader, &format); ok(IsEqualGUID(&format, &GUID_MetadataFormatUnknown), - "wrong metadata format %s\n", debugstr_guid(&format)); + "wrong metadata format %s\n", wine_dbgstr_guid(&format)); hr = IWICMetadataReader_GetCount(reader, &count); ok(hr == S_OK, "GetCount error %#x\n", hr); @@ -1375,7 +1360,7 @@ static void test_metadata_gif(void) { hr = IWICMetadataReader_GetMetadataFormat(reader, &format); ok(IsEqualGUID(&format, &GUID_MetadataFormatGCE), /* Graphic Control Extension */ - "wrong metadata format %s\n", debugstr_guid(&format)); + "wrong metadata format %s\n", wine_dbgstr_guid(&format)); hr = IWICMetadataReader_GetCount(reader, &count); ok(hr == S_OK, "GetCount error %#x\n", hr); @@ -1455,14 +1440,14 @@ static void test_metadata_LSD(void) hr = IWICMetadataReader_GetMetadataFormat(reader, &format); ok(hr == S_OK, "GetMetadataFormat error %#x\n", hr); - ok(IsEqualGUID(&format, &GUID_MetadataFormatLSD), "wrong format %s\n", debugstr_guid(&format)); + ok(IsEqualGUID(&format, &GUID_MetadataFormatLSD), "wrong format %s\n", wine_dbgstr_guid(&format)); hr = IWICMetadataReader_GetMetadataHandlerInfo(reader, &info); ok(hr == S_OK, "GetMetadataHandlerInfo error %#x\n", hr); hr = IWICMetadataHandlerInfo_GetCLSID(info, &id); ok(hr == S_OK, "GetCLSID error %#x\n", hr); - ok(IsEqualGUID(&id, &CLSID_WICLSDMetadataReader), "wrong CLSID %s\n", debugstr_guid(&id)); + ok(IsEqualGUID(&id, &CLSID_WICLSDMetadataReader), "wrong CLSID %s\n", wine_dbgstr_guid(&id)); hr = IWICMetadataHandlerInfo_GetFriendlyName(info, 64, name, &dummy); ok(hr == S_OK, "GetFriendlyName error %#x\n", hr); @@ -1533,14 +1518,14 @@ static void test_metadata_IMD(void) hr = IWICMetadataReader_GetMetadataFormat(reader, &format); ok(hr == S_OK, "GetMetadataFormat error %#x\n", hr); - ok(IsEqualGUID(&format, &GUID_MetadataFormatIMD), "wrong format %s\n", debugstr_guid(&format)); + ok(IsEqualGUID(&format, &GUID_MetadataFormatIMD), "wrong format %s\n", wine_dbgstr_guid(&format)); hr = IWICMetadataReader_GetMetadataHandlerInfo(reader, &info); ok(hr == S_OK, "GetMetadataHandlerInfo error %#x\n", hr); hr = IWICMetadataHandlerInfo_GetCLSID(info, &id); ok(hr == S_OK, "GetCLSID error %#x\n", hr); - ok(IsEqualGUID(&id, &CLSID_WICIMDMetadataReader), "wrong CLSID %s\n", debugstr_guid(&id)); + ok(IsEqualGUID(&id, &CLSID_WICIMDMetadataReader), "wrong CLSID %s\n", wine_dbgstr_guid(&id)); hr = IWICMetadataHandlerInfo_GetFriendlyName(info, 64, name, &dummy); ok(hr == S_OK, "GetFriendlyName error %#x\n", hr); @@ -1608,14 +1593,14 @@ static void test_metadata_GCE(void) hr = IWICMetadataReader_GetMetadataFormat(reader, &format); ok(hr == S_OK, "GetMetadataFormat error %#x\n", hr); - ok(IsEqualGUID(&format, &GUID_MetadataFormatGCE), "wrong format %s\n", debugstr_guid(&format)); + ok(IsEqualGUID(&format, &GUID_MetadataFormatGCE), "wrong format %s\n", wine_dbgstr_guid(&format)); hr = IWICMetadataReader_GetMetadataHandlerInfo(reader, &info); ok(hr == S_OK, "GetMetadataHandlerInfo error %#x\n", hr); hr = IWICMetadataHandlerInfo_GetCLSID(info, &id); ok(hr == S_OK, "GetCLSID error %#x\n", hr); - ok(IsEqualGUID(&id, &CLSID_WICGCEMetadataReader), "wrong CLSID %s\n", debugstr_guid(&id)); + ok(IsEqualGUID(&id, &CLSID_WICGCEMetadataReader), "wrong CLSID %s\n", wine_dbgstr_guid(&id)); hr = IWICMetadataHandlerInfo_GetFriendlyName(info, 64, name, &dummy); ok(hr == S_OK, "GetFriendlyName error %#x\n", hr); @@ -1681,7 +1666,7 @@ static void test_metadata_APE(void) hr = IWICMetadataReader_GetMetadataFormat(reader, &format); ok(hr == S_OK, "GetMetadataFormat error %#x\n", hr); - ok(IsEqualGUID(&format, &GUID_MetadataFormatAPE), "wrong format %s\n", debugstr_guid(&format)); + ok(IsEqualGUID(&format, &GUID_MetadataFormatAPE), "wrong format %s\n", wine_dbgstr_guid(&format)); PropVariantInit(&value); id.vt = VT_LPWSTR; @@ -1700,7 +1685,7 @@ static void test_metadata_APE(void) hr = IWICMetadataHandlerInfo_GetCLSID(info, &clsid); ok(hr == S_OK, "GetCLSID error %#x\n", hr); - ok(IsEqualGUID(&clsid, &CLSID_WICAPEMetadataReader), "wrong CLSID %s\n", debugstr_guid(&clsid)); + ok(IsEqualGUID(&clsid, &CLSID_WICAPEMetadataReader), "wrong CLSID %s\n", wine_dbgstr_guid(&clsid)); hr = IWICMetadataHandlerInfo_GetFriendlyName(info, 64, name, &dummy); ok(hr == S_OK, "GetFriendlyName error %#x\n", hr); @@ -1765,7 +1750,7 @@ static void test_metadata_GIF_comment(void) hr = IWICMetadataReader_GetMetadataFormat(reader, &format); ok(hr == S_OK, "GetMetadataFormat error %#x\n", hr); - ok(IsEqualGUID(&format, &GUID_MetadataFormatGifComment), "wrong format %s\n", debugstr_guid(&format)); + ok(IsEqualGUID(&format, &GUID_MetadataFormatGifComment), "wrong format %s\n", wine_dbgstr_guid(&format)); PropVariantInit(&value); id.vt = VT_LPWSTR; @@ -1782,7 +1767,7 @@ static void test_metadata_GIF_comment(void) hr = IWICMetadataHandlerInfo_GetCLSID(info, &clsid); ok(hr == S_OK, "GetCLSID error %#x\n", hr); - ok(IsEqualGUID(&clsid, &CLSID_WICGifCommentMetadataReader), "wrong CLSID %s\n", debugstr_guid(&clsid)); + ok(IsEqualGUID(&clsid, &CLSID_WICGifCommentMetadataReader), "wrong CLSID %s\n", wine_dbgstr_guid(&clsid)); hr = IWICMetadataHandlerInfo_GetFriendlyName(info, 64, name, &dummy); ok(hr == S_OK, "GetFriendlyName error %#x\n", hr); diff --git a/rostests/winetests/windowscodecs/pngformat.c b/rostests/winetests/windowscodecs/pngformat.c index 43e85998f04..7b1ccd5902a 100644 --- a/rostests/winetests/windowscodecs/pngformat.c +++ b/rostests/winetests/windowscodecs/pngformat.c @@ -281,18 +281,6 @@ static const char png_color_profile[] = { static IWICImagingFactory *factory; -static const char *debugstr_guid(const GUID *guid) -{ - static char buf[50]; - - if (!guid) return "(null)"; - sprintf(buf, "{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}", - guid->Data1, guid->Data2, guid->Data3, guid->Data4[0], - guid->Data4[1], guid->Data4[2], guid->Data4[3], guid->Data4[4], - guid->Data4[5], guid->Data4[6], guid->Data4[7]); - return buf; -} - static IWICBitmapDecoder *create_decoder(const void *image_data, UINT image_size) { HGLOBAL hmem; @@ -316,7 +304,7 @@ static IWICBitmapDecoder *create_decoder(const void *image_data, UINT image_size hr = IWICBitmapDecoder_GetContainerFormat(decoder, &format); ok(hr == S_OK, "GetContainerFormat error %#x\n", hr); ok(IsEqualGUID(&format, &GUID_ContainerFormatPng), - "wrong container format %s\n", debugstr_guid(&format)); + "wrong container format %s\n", wine_dbgstr_guid(&format)); IStream_Release(stream); @@ -569,7 +557,7 @@ static void test_png_palette(void) hr = IWICBitmapFrameDecode_GetPixelFormat(frame, &format); ok(hr == S_OK, "GetPixelFormat error %#x\n", hr); ok(IsEqualGUID(&format, &GUID_WICPixelFormat1bppIndexed), - "got wrong format %s\n", debugstr_guid(&format)); + "got wrong format %s\n", wine_dbgstr_guid(&format)); hr = IWICImagingFactory_CreatePalette(factory, &palette); ok(hr == S_OK, "CreatePalette error %#x\n", hr); diff --git a/rostests/winetests/windowscodecs/testlist.c b/rostests/winetests/windowscodecs/testlist.c index 5965e26095e..588446a013a 100644 --- a/rostests/winetests/windowscodecs/testlist.c +++ b/rostests/winetests/windowscodecs/testlist.c @@ -1,7 +1,7 @@ /* Automatically generated file; DO NOT EDIT!! */ #define STANDALONE -#include "wine/test.h" +#include extern void func_bitmap(void); extern void func_bmpformat(void); diff --git a/rostests/winetests/windowscodecs/tiffformat.c b/rostests/winetests/windowscodecs/tiffformat.c index 782f5eff3fe..a6d4915cf74 100644 --- a/rostests/winetests/windowscodecs/tiffformat.c +++ b/rostests/winetests/windowscodecs/tiffformat.c @@ -102,18 +102,6 @@ static const struct tiff_1bpp_data static IWICImagingFactory *factory; -static const char *debugstr_guid(const GUID *guid) -{ - static char buf[50]; - - if (!guid) return "(null)"; - sprintf(buf, "{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}", - guid->Data1, guid->Data2, guid->Data3, guid->Data4[0], - guid->Data4[1], guid->Data4[2], guid->Data4[3], guid->Data4[4], - guid->Data4[5], guid->Data4[6], guid->Data4[7]); - return buf; -} - static IStream *create_stream(const void *data, int data_size) { HRESULT hr; @@ -173,7 +161,7 @@ static void test_tiff_palette(void) hr = IWICBitmapFrameDecode_GetPixelFormat(frame, &format); ok(hr == S_OK, "GetPixelFormat error %#x\n", hr); ok(IsEqualGUID(&format, &GUID_WICPixelFormatBlackWhite), - "got wrong format %s\n", debugstr_guid(&format)); + "got wrong format %s\n", wine_dbgstr_guid(&format)); hr = IWICImagingFactory_CreatePalette(factory, &palette); ok(hr == S_OK, "CreatePalette error %#x\n", hr);