windowscodecs: Add a test for invalid predefined palette type.
This commit is contained in:
parent
106e7fb589
commit
9083bcc59c
|
@ -403,8 +403,8 @@ static HRESULT WINAPI PaletteImpl_InitializePredefined(IWICPalette *iface,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
FIXME("(%p,%u,%d): stub\n", iface, type, add_transparent);
|
WARN("invalid palette type %u\n", type);
|
||||||
return E_NOTIMPL;
|
return E_INVALIDARG;
|
||||||
}
|
}
|
||||||
|
|
||||||
EnterCriticalSection(&This->lock);
|
EnterCriticalSection(&This->lock);
|
||||||
|
|
|
@ -402,6 +402,16 @@ static void test_predefined_palette(void)
|
||||||
&IID_IWICImagingFactory, (void **)&factory);
|
&IID_IWICImagingFactory, (void **)&factory);
|
||||||
ok(hr == S_OK, "CoCreateInstance error %#x\n", hr);
|
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++)
|
for (i = 0; i < sizeof(td)/sizeof(td[0]); i++)
|
||||||
{
|
{
|
||||||
hr = IWICImagingFactory_CreatePalette(factory, &palette);
|
hr = IWICImagingFactory_CreatePalette(factory, &palette);
|
||||||
|
|
Loading…
Reference in New Issue