Commit 9be7e1e8 authored by Frédéric Delanoy's avatar Frédéric Delanoy Committed by Alexandre Julliard

windowscodecs/tests: Use common wine_dbgstr_guid implementation from test.h.

parent e04c7359
......@@ -32,18 +32,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) ||
......@@ -665,7 +653,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);
......@@ -693,7 +681,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);
......@@ -737,7 +725,7 @@ static void test_CreateBitmapFromHBITMAP(void)
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);
......@@ -768,7 +756,7 @@ static void test_CreateBitmapFromHBITMAP(void)
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);
......@@ -809,7 +797,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);
......@@ -855,7 +843,7 @@ todo_wine
hr = IWICBitmap_GetPixelFormat(bitmap, &format);
ok(hr == S_OK, "GetPixelFormat error %#x\n", hr);
ok(IsEqualGUID(&format, &GUID_WICPixelFormat32bppBGRA),
"unexpected pixel format %s\n", debugstr_guid(&format));
"unexpected pixel format %s\n", wine_dbgstr_guid(&format));
IWICBitmap_Release(bitmap);
......@@ -866,7 +854,7 @@ todo_wine
hr = IWICBitmap_GetPixelFormat(bitmap, &format);
ok(hr == S_OK, "GetPixelFormat error %#x\n", hr);
ok(IsEqualGUID(&format, &GUID_WICPixelFormat32bppPBGRA),
"unexpected pixel format %s\n", debugstr_guid(&format));
"unexpected pixel format %s\n", wine_dbgstr_guid(&format));
IWICBitmap_Release(bitmap);
......@@ -877,7 +865,7 @@ todo_wine
hr = IWICBitmap_GetPixelFormat(bitmap, &format);
ok(hr == S_OK, "GetPixelFormat error %#x\n", hr);
ok(IsEqualGUID(&format, &GUID_WICPixelFormat32bppBGR),
"unexpected pixel format %s\n", debugstr_guid(&format));
"unexpected pixel format %s\n", wine_dbgstr_guid(&format));
IWICBitmap_Release(bitmap);
DeleteObject(hbmp);
......
......@@ -57,18 +57,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;
......@@ -92,7 +80,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);
......@@ -138,7 +126,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);
......@@ -200,7 +188,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);
......@@ -243,7 +231,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);
......@@ -313,7 +301,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);
......
......@@ -31,21 +31,6 @@
#include "initguid.h"
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;
......@@ -270,7 +255,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);
......@@ -300,7 +285,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);
......@@ -359,7 +344,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);
}
......
......@@ -275,18 +275,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;
......@@ -310,7 +298,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);
......@@ -563,7 +551,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);
......
......@@ -96,18 +96,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;
......@@ -167,7 +155,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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment