Commit 9083bcc5 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

windowscodecs: Add a test for invalid predefined palette type.

parent 106e7fb5
......@@ -403,8 +403,8 @@ static HRESULT WINAPI PaletteImpl_InitializePredefined(IWICPalette *iface,
break;
default:
FIXME("(%p,%u,%d): stub\n", iface, type, add_transparent);
return E_NOTIMPL;
WARN("invalid palette type %u\n", type);
return E_INVALIDARG;
}
EnterCriticalSection(&This->lock);
......
......@@ -402,6 +402,16 @@ static void test_predefined_palette(void)
&IID_IWICImagingFactory, (void **)&factory);
ok(hr == S_OK, "CoCreateInstance error %#x\n", hr);
hr = IWICImagingFactory_CreatePalette(factory, &palette);
ok(hr == S_OK, "CreatePalette error %#x\n", hr);
hr = IWICPalette_InitializePredefined(palette, WICBitmapPaletteTypeCustom, FALSE);
ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#x\n", hr);
hr = IWICPalette_InitializePredefined(palette, WICBitmapPaletteTypeMedianCut, FALSE);
ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#x\n", hr);
hr = IWICPalette_InitializePredefined(palette, 0x0f, FALSE);
ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#x\n", hr);
IWICPalette_Release(palette);
for (i = 0; i < sizeof(td)/sizeof(td[0]); i++)
{
hr = IWICImagingFactory_CreatePalette(factory, &palette);
......
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