1
0
mirror of https://github.com/wine-mirror/wine synced 2024-07-03 08:19:41 +00:00

windowscodecs: Add a test for loading a .bmp file with BITMAPINFOHEADER.

This commit is contained in:
Dmitry Timoshkov 2013-01-09 15:46:23 +08:00 committed by Alexandre Julliard
parent af59e6f1b7
commit 01ab797b64
2 changed files with 23 additions and 7 deletions

View File

@ -31,15 +31,21 @@
static const char testbmp_24bpp[] = {
/* BITMAPFILEHEADER */
66,77, /* "BM" */
50,0,0,0, /* file size */
78,0,0,0, /* file size */
0,0,0,0, /* reserved */
26,0,0,0, /* offset to bits */
/* BITMAPCOREHEADER */
12,0,0,0, /* header size */
2,0, /* width */
3,0, /* height */
54,0,0,0, /* offset to bits */
/* BITMAPINFOHEADER */
40,0,0,0, /* header size */
2,0,0,0, /* width */
3,0,0,0, /* height */
1,0, /* planes */
24,0, /* bit count */
0,0,0,0, /* compression */
0,0,0,0, /* image size */
0x74,0x12,0,0, /* X pels per meter => 120 dpi */
0,0,0,0, /* Y pels per meter */
0,0,0,0, /* colors used */
0,0,0,0, /* colors important */
/* bits */
0,0,0, 0,255,0, 0,0,
255,0,0, 255,255,0, 0,0,
@ -86,7 +92,14 @@ static void test_decode_24bpp(void)
if (SUCCEEDED(hr))
{
hr = IWICBitmapDecoder_Initialize(decoder, bmpstream, WICDecodeMetadataCacheOnLoad);
ok(hr == S_OK, "Initialize failed, hr=%x\n", hr);
ok(hr == S_OK || broken(hr == WINCODEC_ERR_BADIMAGE) /* XP */, "Initialize failed, hr=%x\n", hr);
if (FAILED(hr))
{
win_skip("BMP decoder failed to initialize\n");
GlobalFree(hbmpdata);
IWICBitmapDecoder_Release(decoder);
return;
}
hr = IWICBitmapDecoder_GetContainerFormat(decoder, &guidresult);
ok(SUCCEEDED(hr), "GetContainerFormat failed, hr=%x\n", hr);
@ -125,7 +138,9 @@ static void test_decode_24bpp(void)
hr = IWICBitmapFrameDecode_GetResolution(framedecode, &dpiX, &dpiY);
ok(SUCCEEDED(hr), "GetResolution failed, hr=%x\n", hr);
todo_wine
ok(dpiX == 96.0, "expected dpiX=96.0, got %f\n", dpiX);
todo_wine
ok(dpiY == 96.0, "expected dpiY=96.0, got %f\n", dpiY);
hr = IWICBitmapFrameDecode_GetPixelFormat(framedecode, &guidresult);

View File

@ -213,6 +213,7 @@ cpp_quote("#define WINCODEC_ERR_PROPERTYNOTFOUND 0x88982f40")
cpp_quote("#define WINCODEC_ERR_CODECNOTHUMBNAIL 0x88982f44")
cpp_quote("#define WINCODEC_ERR_PALETTEUNAVAILABLE 0x88982f45")
cpp_quote("#define WINCODEC_ERR_COMPONENTNOTFOUND 0x88982f50")
cpp_quote("#define WINCODEC_ERR_BADIMAGE 0x88982f60")
cpp_quote("#define WINCODEC_ERR_FRAMEMISSING 0x88982f62")
cpp_quote("#define WINCODEC_ERR_BADMETADATAHEADER 0x88982f63")
cpp_quote("#define WINCODEC_ERR_UNSUPPORTEDPIXELFORMAT 0x88982f80")