windowscodecs/tests: Add a test for global GIF palette exposed by recent Windows versions.
This commit is contained in:
parent
5cbf173636
commit
f6c73a227b
|
@ -271,8 +271,9 @@ static void test_local_gif_palette(void)
|
|||
IWICBitmapDecoder *decoder;
|
||||
IWICBitmapFrameDecode *frame;
|
||||
IWICPalette *palette;
|
||||
WICBitmapPaletteType type;
|
||||
GUID format;
|
||||
UINT count, ret;
|
||||
UINT count, ret, i;
|
||||
WICColor color[256];
|
||||
|
||||
decoder = create_decoder(gif_local_palette, sizeof(gif_local_palette));
|
||||
|
@ -283,8 +284,28 @@ static void test_local_gif_palette(void)
|
|||
|
||||
/* global palette */
|
||||
hr = IWICBitmapDecoder_CopyPalette(decoder, palette);
|
||||
ok(hr == WINCODEC_ERR_FRAMEMISSING,
|
||||
"expected WINCODEC_ERR_FRAMEMISSING, got %#x\n", hr);
|
||||
todo_wine
|
||||
ok(hr == S_OK || broken(hr == WINCODEC_ERR_FRAMEMISSING), "CopyPalette %#x\n", hr);
|
||||
if (hr == S_OK)
|
||||
{
|
||||
type = -1;
|
||||
hr = IWICPalette_GetType(palette, &type);
|
||||
ok(hr == S_OK, "GetType error %#x\n", hr);
|
||||
ok(type == WICBitmapPaletteTypeCustom, "expected WICBitmapPaletteTypeCustom, got %#x\n", type);
|
||||
|
||||
hr = IWICPalette_GetColorCount(palette, &count);
|
||||
ok(hr == S_OK, "GetColorCount error %#x\n", hr);
|
||||
ok(count == 256, "expected 256, got %u\n", count);
|
||||
|
||||
hr = IWICPalette_GetColors(palette, count, color, &ret);
|
||||
ok(hr == S_OK, "GetColors error %#x\n", hr);
|
||||
ok(ret == count, "expected %u, got %u\n", count, ret);
|
||||
ok(color[0] == 0xff000000, "expected 0xff000000, got %#x\n", color[0]);
|
||||
ok(color[1] == 0x00ffffff, "expected 0x00ffffff, got %#x\n", color[1]);
|
||||
|
||||
for (i = 2; i < 256; i++)
|
||||
ok(color[i] == 0xff000000, "expected 0xff000000, got %#x\n", color[i]);
|
||||
}
|
||||
|
||||
/* frame palette */
|
||||
hr = IWICBitmapDecoder_GetFrame(decoder, 0, &frame);
|
||||
|
@ -302,6 +323,11 @@ static void test_local_gif_palette(void)
|
|||
ok(hr == S_OK, "GetColorCount error %#x\n", hr);
|
||||
ok(count == 4, "expected 4, got %u\n", count);
|
||||
|
||||
type = -1;
|
||||
hr = IWICPalette_GetType(palette, &type);
|
||||
ok(hr == S_OK, "GetType error %#x\n", hr);
|
||||
ok(type == WICBitmapPaletteTypeCustom, "expected WICBitmapPaletteTypeCustom, got %#x\n", type);
|
||||
|
||||
hr = IWICPalette_GetColors(palette, count, color, &ret);
|
||||
ok(hr == S_OK, "GetColors error %#x\n", hr);
|
||||
ok(ret == count, "expected %u, got %u\n", count, ret);
|
||||
|
|
Loading…
Reference in New Issue