Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
10054668
Commit
10054668
authored
Jul 28, 2009
by
Vincent Povirk
Committed by
Alexandre Julliard
Aug 05, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windowscodecs: Add test for IWICImagingFactory::CreateDecoderFromStream.
parent
219b8c64
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
0 deletions
+49
-0
bmpformat.c
dlls/windowscodecs/tests/bmpformat.c
+49
-0
No files found.
dlls/windowscodecs/tests/bmpformat.c
View file @
10054668
...
...
@@ -986,6 +986,54 @@ static void test_componentinfo(void)
}
}
static
void
test_createfromstream
(
void
)
{
IWICBitmapDecoder
*
decoder
;
IWICImagingFactory
*
factory
;
HRESULT
hr
;
HGLOBAL
hbmpdata
;
char
*
bmpdata
;
IStream
*
bmpstream
;
GUID
guidresult
;
hr
=
CoCreateInstance
(
&
CLSID_WICImagingFactory
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IWICImagingFactory
,
(
void
**
)
&
factory
);
ok
(
SUCCEEDED
(
hr
),
"CoCreateInstance failed, hr=%x
\n
"
,
hr
);
if
(
!
SUCCEEDED
(
hr
))
return
;
hbmpdata
=
GlobalAlloc
(
GMEM_MOVEABLE
,
sizeof
(
testbmp_1bpp
));
ok
(
hbmpdata
!=
0
,
"GlobalAlloc failed
\n
"
);
if
(
hbmpdata
)
{
bmpdata
=
GlobalLock
(
hbmpdata
);
memcpy
(
bmpdata
,
testbmp_1bpp
,
sizeof
(
testbmp_1bpp
));
GlobalUnlock
(
hbmpdata
);
hr
=
CreateStreamOnHGlobal
(
hbmpdata
,
FALSE
,
&
bmpstream
);
ok
(
SUCCEEDED
(
hr
),
"CreateStreamOnHGlobal failed, hr=%x
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
IWICImagingFactory_CreateDecoderFromStream
(
factory
,
bmpstream
,
NULL
,
WICDecodeMetadataCacheOnDemand
,
&
decoder
);
ok
(
SUCCEEDED
(
hr
),
"CreateDecoderFromStream failed, hr=%x
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
IWICBitmapDecoder_GetContainerFormat
(
decoder
,
&
guidresult
);
ok
(
SUCCEEDED
(
hr
),
"GetContainerFormat failed, hr=%x
\n
"
,
hr
);
ok
(
IsEqualGUID
(
&
guidresult
,
&
GUID_ContainerFormatBmp
),
"unexpected container format
\n
"
);
IWICBitmapDecoder_Release
(
decoder
);
}
IStream_Release
(
bmpstream
);
}
GlobalFree
(
hbmpdata
);
}
IWICImagingFactory_Release
(
factory
);
}
START_TEST
(
bmpformat
)
{
CoInitializeEx
(
NULL
,
COINIT_APARTMENTTHREADED
);
...
...
@@ -996,6 +1044,7 @@ START_TEST(bmpformat)
test_decode_rle8
();
test_decode_rle4
();
test_componentinfo
();
test_createfromstream
();
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