Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
f68333cb
Commit
f68333cb
authored
Sep 08, 2010
by
Damjan Jovanovic
Committed by
Alexandre Julliard
Sep 08, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windowscodecs: Test that ICO GetSize returns the BITMAPINFOHEADER size instead…
windowscodecs: Test that ICO GetSize returns the BITMAPINFOHEADER size instead of the ICONDIRENTRY size.
parent
199b2db5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
160 additions
and
0 deletions
+160
-0
Makefile.in
dlls/windowscodecs/tests/Makefile.in
+1
-0
icoformat.c
dlls/windowscodecs/tests/icoformat.c
+159
-0
No files found.
dlls/windowscodecs/tests/Makefile.in
View file @
f68333cb
...
...
@@ -8,6 +8,7 @@ IMPORTS = ole32 windowscodecs
C_SRCS
=
\
bmpformat.c
\
converter.c
\
icoformat.c
\
info.c
\
palette.c
\
stream.c
...
...
dlls/windowscodecs/tests/icoformat.c
0 → 100644
View file @
f68333cb
/*
* Copyright 2010 Damjan Jovanovic
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <stdarg.h>
#include <math.h>
#define COBJMACROS
#include "windef.h"
#include "objbase.h"
#include "wincodec.h"
#include "wine/test.h"
static
unsigned
char
testico_bad_icondirentry_size
[]
=
{
/* ICONDIR */
0
,
0
,
/* reserved */
1
,
0
,
/* type */
1
,
0
,
/* count */
/* ICONDIRENTRY */
2
,
/* width */
2
,
/* height */
2
,
/* colorCount */
0
,
/* reserved */
1
,
0
,
/* planes */
8
,
0
,
/* bitCount */
(
40
+
2
*
4
+
16
*
16
+
16
*
4
)
&
0xFF
,((
40
+
2
*
4
+
16
*
16
+
16
*
4
)
>>
8
)
&
0xFF
,
0
,
0
,
/* bytesInRes */
22
,
0
,
0
,
0
,
/* imageOffset */
/* BITMAPINFOHEADER */
40
,
0
,
0
,
0
,
/* header size */
16
,
0
,
0
,
0
,
/* width */
2
*
16
,
0
,
0
,
0
,
/* height (XOR+AND rows) */
1
,
0
,
/* planes */
8
,
0
,
/* bit count */
0
,
0
,
0
,
0
,
/* compression */
0
,
0
,
0
,
0
,
/* sizeImage */
0
,
0
,
0
,
0
,
/* x pels per meter */
0
,
0
,
0
,
0
,
/* y pels per meter */
2
,
0
,
0
,
0
,
/* clrUsed */
0
,
0
,
0
,
0
,
/* clrImportant */
/* palette */
0
,
0
,
0
,
0
,
0xFF
,
0xFF
,
0xFF
,
0
,
/* XOR mask */
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
0
,
0
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
void
)
{
IWICBitmapDecoder
*
decoder
;
IWICImagingFactory
*
factory
;
HRESULT
hr
;
IWICStream
*
icostream
;
IWICBitmapFrameDecode
*
framedecode
=
NULL
;
hr
=
CoCreateInstance
(
&
CLSID_WICImagingFactory
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IWICImagingFactory
,
(
void
**
)
&
factory
);
ok
(
hr
==
S_OK
,
"CoCreateInstance failed, hr=%x
\n
"
,
hr
);
if
(
FAILED
(
hr
))
return
;
hr
=
IWICImagingFactory_CreateStream
(
factory
,
&
icostream
);
ok
(
hr
==
S_OK
,
"CreateStream failed, hr=%x
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
IWICStream_InitializeFromMemory
(
icostream
,
testico_bad_icondirentry_size
,
sizeof
(
testico_bad_icondirentry_size
));
ok
(
hr
==
S_OK
,
"InitializeFromMemory failed, hr=%x
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
CoCreateInstance
(
&
CLSID_WICIcoDecoder
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IWICBitmapDecoder
,
(
void
**
)
&
decoder
);
ok
(
hr
==
S_OK
,
"CoCreateInstance failed, hr=%x
\n
"
,
hr
);
}
if
(
SUCCEEDED
(
hr
))
{
hr
=
IWICBitmapDecoder_Initialize
(
decoder
,
(
IStream
*
)
icostream
,
WICDecodeMetadataCacheOnDemand
);
ok
(
hr
==
S_OK
,
"Initialize failed, hr=%x
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
IWICBitmapDecoder_GetFrame
(
decoder
,
0
,
&
framedecode
);
ok
(
hr
==
S_OK
,
"GetFrame failed, hr=%x
\n
"
,
hr
);
}
if
(
SUCCEEDED
(
hr
))
{
UINT
width
=
0
,
height
=
0
;
hr
=
IWICBitmapFrameDecode_GetSize
(
framedecode
,
&
width
,
&
height
);
ok
(
hr
==
S_OK
,
"GetFrameSize failed, hr=%x
\n
"
,
hr
);
todo_wine
ok
(
width
==
16
&&
height
==
16
,
"framesize=%ux%u
\n
"
,
width
,
height
);
IWICBitmapFrameDecode_Release
(
framedecode
);
}
IWICBitmapDecoder_Release
(
decoder
);
}
IWICStream_Release
(
icostream
);
}
IWICImagingFactory_Release
(
factory
);
}
START_TEST
(
icoformat
)
{
CoInitializeEx
(
NULL
,
COINIT_APARTMENTTHREADED
);
test_bad_icondirentry_size
();
CoUninitialize
();
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment