windowscodecs: Add a test for invalid predefined palette type.

This commit is contained in:
Dmitry Timoshkov 2012-07-23 12:49:03 +09:00 committed by Alexandre Julliard
parent 106e7fb589
commit 9083bcc59c
2 changed files with 12 additions and 2 deletions

View File

@ -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);

View File

@ -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);