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
b19e329b
Commit
b19e329b
authored
Jun 10, 2009
by
Vincent Povirk
Committed by
Alexandre Julliard
Jun 29, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windowscodecs: Add test for BMP decoder.
parent
78c3aa78
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
180 additions
and
0 deletions
+180
-0
configure
configure
+9
-0
configure.ac
configure.ac
+1
-0
Makefile.in
dlls/Makefile.in
+5
-0
Makefile.in
dlls/windowscodecs/Makefile.in
+1
-0
Makefile.in
dlls/windowscodecs/tests/Makefile.in
+13
-0
bmpformat.c
dlls/windowscodecs/tests/bmpformat.c
+151
-0
No files found.
configure
View file @
b19e329b
...
...
@@ -27767,6 +27767,14 @@ dlls/windowscodecs/Makefile: dlls/windowscodecs/Makefile.in dlls/Makedll.rules"
ac_config_files
=
"
$ac_config_files
dlls/windowscodecs/Makefile"
ALL_MAKEFILES
=
"
$ALL_MAKEFILES
\\
dlls/windowscodecs/tests/Makefile"
test
"x
$enable_tests
"
!=
xno
&&
ALL_TEST_DIRS
=
"
$ALL_TEST_DIRS
\\
windowscodecs/tests"
ALL_MAKEFILE_DEPENDS
=
"
$ALL_MAKEFILE_DEPENDS
dlls/windowscodecs/tests/Makefile: dlls/windowscodecs/tests/Makefile.in dlls/Maketest.rules"
ac_config_files
=
"
$ac_config_files
dlls/windowscodecs/tests/Makefile"
ALL_MAKEFILES
=
"
$ALL_MAKEFILES
\\
dlls/winealsa.drv/Makefile"
test
"x
$enable_winealsa_drv
"
!=
xno
&&
ALL_DLL_DIRS
=
"
$ALL_DLL_DIRS
\\
winealsa.drv"
...
...
@@ -29751,6 +29759,7 @@ do
"dlls/winaspi.dll16/Makefile") CONFIG_FILES="
$CONFIG_FILES
dlls/winaspi.dll16/Makefile" ;;
"dlls/windebug.dll16/Makefile") CONFIG_FILES="
$CONFIG_FILES
dlls/windebug.dll16/Makefile" ;;
"dlls/windowscodecs/Makefile") CONFIG_FILES="
$CONFIG_FILES
dlls/windowscodecs/Makefile" ;;
"dlls/windowscodecs/tests/Makefile") CONFIG_FILES="
$CONFIG_FILES
dlls/windowscodecs/tests/Makefile" ;;
"dlls/winealsa.drv/Makefile") CONFIG_FILES="
$CONFIG_FILES
dlls/winealsa.drv/Makefile" ;;
"dlls/wineaudioio.drv/Makefile") CONFIG_FILES="
$CONFIG_FILES
dlls/wineaudioio.drv/Makefile" ;;
"dlls/winecoreaudio.drv/Makefile") CONFIG_FILES="
$CONFIG_FILES
dlls/winecoreaudio.drv/Makefile" ;;
...
...
configure.ac
View file @
b19e329b
...
...
@@ -2401,6 +2401,7 @@ WINE_CONFIG_MAKEFILE([dlls/win87em.dll16/Makefile],[dlls/Makedll.rules],[dlls],[
WINE_CONFIG_MAKEFILE([dlls/winaspi.dll16/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS],[enable_win16])
WINE_CONFIG_MAKEFILE([dlls/windebug.dll16/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS],[enable_win16])
WINE_CONFIG_MAKEFILE([dlls/windowscodecs/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS])
WINE_CONFIG_MAKEFILE([dlls/windowscodecs/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests])
WINE_CONFIG_MAKEFILE([dlls/winealsa.drv/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS])
WINE_CONFIG_MAKEFILE([dlls/wineaudioio.drv/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS])
WINE_CONFIG_MAKEFILE([dlls/winecoreaudio.drv/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS])
...
...
dlls/Makefile.in
View file @
b19e329b
...
...
@@ -212,6 +212,7 @@ IMPORT_LIBS = \
uxtheme/libuxtheme.
$(IMPLIBEXT)
\
vdmdbg/libvdmdbg.
$(IMPLIBEXT)
\
version/libversion.
$(IMPLIBEXT)
\
windowscodecs/libwindowscodecs.
$(IMPLIBEXT)
\
wined3d/libwined3d.
$(IMPLIBEXT)
\
winhttp/libwinhttp.
$(IMPLIBEXT)
\
wininet/libwininet.
$(IMPLIBEXT)
\
...
...
@@ -355,6 +356,7 @@ CROSS_IMPLIBS = \
uxtheme/libuxtheme.a
\
vdmdbg/libvdmdbg.a
\
version/libversion.a
\
windowscodecs/libwindowscodecs.a
\
wined3d/libwined3d.a
\
winhttp/libwinhttp.a
\
wininet/libwininet.a
\
...
...
@@ -752,6 +754,9 @@ vdmdbg/libvdmdbg.def vdmdbg/libvdmdbg.a: vdmdbg/vdmdbg.spec $(WINEBUILD)
version/libversion.def version/libversion.a
:
version/version.spec $(WINEBUILD)
@
cd
version
&&
$(MAKE)
`
basename
$@
`
windowscodecs/libwindowscodecs.def windowscodecs/libwindowscodecs.a
:
windowscodecs/windowscodecs.spec $(WINEBUILD)
@
cd
windowscodecs
&&
$(MAKE)
`
basename
$@
`
wined3d/libwined3d.def wined3d/libwined3d.a
:
wined3d/wined3d.spec $(WINEBUILD)
@
cd
wined3d
&&
$(MAKE)
`
basename
$@
`
...
...
dlls/windowscodecs/Makefile.in
View file @
b19e329b
...
...
@@ -3,6 +3,7 @@ TOPOBJDIR = ../..
SRCDIR
=
@srcdir@
VPATH
=
@srcdir@
MODULE
=
windowscodecs.dll
IMPORTLIB
=
windowscodecs
IMPORTS
=
uuid ole32 advapi32 kernel32
C_SRCS
=
\
...
...
dlls/windowscodecs/tests/Makefile.in
0 → 100644
View file @
b19e329b
TOPSRCDIR
=
@top_srcdir@
TOPOBJDIR
=
../../..
SRCDIR
=
@srcdir@
VPATH
=
@srcdir@
TESTDLL
=
windowscodecs.dll
IMPORTS
=
kernel32 ole32
CTESTS
=
\
bmpformat.c
@MAKE_TEST_RULES@
@DEPENDENCIES@
# everything below this line is overwritten by make depend
dlls/windowscodecs/tests/bmpformat.c
0 → 100644
View file @
b19e329b
/*
* Copyright 2009 Vincent Povirk for CodeWeavers
*
* 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>
#define COBJMACROS
#include "windef.h"
#include "initguid.h"
#include "objbase.h"
#include "wincodec.h"
#include "wine/test.h"
static
const
char
testbmp_24bpp
[]
=
{
/* BITMAPFILEHEADER */
66
,
77
,
/* "BM" */
50
,
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 */
1
,
0
,
/* planes */
24
,
0
,
/* bit count */
/* bits */
0
,
0
,
0
,
0
,
255
,
0
,
0
,
0
,
255
,
0
,
0
,
255
,
255
,
0
,
0
,
0
,
255
,
0
,
255
,
255
,
255
,
255
,
0
,
0
};
static
void
test_decode_24bpp
(
void
)
{
IWICBitmapDecoder
*
decoder
,
*
decoder2
;
IWICBitmapFrameDecode
*
framedecode
;
HRESULT
hr
;
HGLOBAL
hbmpdata
;
char
*
bmpdata
;
IStream
*
bmpstream
;
DWORD
capability
=
0
;
GUID
guidresult
;
UINT
count
=
0
,
width
=
0
,
height
=
0
;
double
dpiX
,
dpiY
;
hr
=
CoCreateInstance
(
&
CLSID_WICBmpDecoder
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IWICBitmapDecoder
,
(
void
**
)
&
decoder
);
ok
(
SUCCEEDED
(
hr
),
"CoCreateInstance failed, hr=%x
\n
"
,
hr
);
if
(
!
SUCCEEDED
(
hr
))
return
;
hbmpdata
=
GlobalAlloc
(
GMEM_MOVEABLE
,
sizeof
(
testbmp_24bpp
));
ok
(
hbmpdata
!=
0
,
"GlobalAlloc failed
\n
"
);
if
(
hbmpdata
)
{
bmpdata
=
GlobalLock
(
hbmpdata
);
memcpy
(
bmpdata
,
testbmp_24bpp
,
sizeof
(
testbmp_24bpp
));
GlobalUnlock
(
hbmpdata
);
hr
=
CreateStreamOnHGlobal
(
hbmpdata
,
FALSE
,
&
bmpstream
);
ok
(
SUCCEEDED
(
hr
),
"CreateStreamOnHGlobal failed, hr=%x
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
IWICBitmapDecoder_Initialize
(
decoder
,
bmpstream
,
WICDecodeMetadataCacheOnLoad
);
ok
(
hr
==
S_OK
,
"Initialize failed, hr=%x
\n
"
,
hr
);
hr
=
IWICBitmapDecoder_GetContainerFormat
(
decoder
,
&
guidresult
);
ok
(
SUCCEEDED
(
hr
),
"GetContainerFormat failed, hr=%x
\n
"
,
hr
);
ok
(
IsEqualGUID
(
&
guidresult
,
&
GUID_ContainerFormatBmp
),
"unexpected container format
\n
"
);
hr
=
IWICBitmapDecoder_GetFrameCount
(
decoder
,
&
count
);
ok
(
SUCCEEDED
(
hr
),
"GetFrameCount failed, hr=%x
\n
"
,
hr
);
ok
(
count
==
1
,
"unexpected count %u
\n
"
,
count
);
hr
=
IWICBitmapDecoder_GetFrame
(
decoder
,
1
,
&
framedecode
);
ok
(
hr
==
E_INVALIDARG
,
"expected E_INVALIDARG, got %x
\n
"
,
hr
);
hr
=
IWICBitmapDecoder_GetFrame
(
decoder
,
0
,
&
framedecode
);
ok
(
SUCCEEDED
(
hr
),
"GetFrame failed, hr=%x
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
IWICBitmapFrameDecode_GetSize
(
framedecode
,
&
width
,
&
height
);
ok
(
SUCCEEDED
(
hr
),
"GetSize failed, hr=%x
\n
"
,
hr
);
ok
(
width
==
2
,
"expected width=2, got %u
\n
"
,
width
);
ok
(
height
==
3
,
"expected height=2, got %u
\n
"
,
height
);
hr
=
IWICBitmapFrameDecode_GetResolution
(
framedecode
,
&
dpiX
,
&
dpiY
);
ok
(
SUCCEEDED
(
hr
),
"GetResolution failed, hr=%x
\n
"
,
hr
);
ok
(
dpiX
==
96
.
0
,
"expected dpiX=96.0, got %f
\n
"
,
dpiX
);
ok
(
dpiY
==
96
.
0
,
"expected dpiY=96.0, got %f
\n
"
,
dpiY
);
IWICBitmapFrameDecode_Release
(
framedecode
);
}
/* cannot initialize twice */
hr
=
IWICBitmapDecoder_Initialize
(
decoder
,
bmpstream
,
WICDecodeMetadataCacheOnLoad
);
ok
(
hr
==
WINCODEC_ERR_WRONGSTATE
,
"expected WINCODEC_ERR_WRONGSTATE, hr=%x
\n
"
,
hr
);
/* cannot querycapability after initialize */
hr
=
IWICBitmapDecoder_QueryCapability
(
decoder
,
bmpstream
,
&
capability
);
todo_wine
ok
(
hr
==
WINCODEC_ERR_WRONGSTATE
,
"expected WINCODEC_ERR_WRONGSTATE, hr=%x
\n
"
,
hr
);
hr
=
CoCreateInstance
(
&
CLSID_WICBmpDecoder
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IWICBitmapDecoder
,
(
void
**
)
&
decoder2
);
ok
(
SUCCEEDED
(
hr
),
"CoCreateInstance failed, hr=%x
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
IWICBitmapDecoder_QueryCapability
(
decoder2
,
bmpstream
,
&
capability
);
todo_wine
ok
(
hr
==
S_OK
,
"QueryCapability failed, hr=%x
\n
"
,
hr
);
todo_wine
ok
(
capability
==
(
WICBitmapDecoderCapabilityCanDecodeAllImages
),
"unexpected capabilities: %x
\n
"
,
capability
);
/* cannot initialize after querycapability */
hr
=
IWICBitmapDecoder_Initialize
(
decoder2
,
bmpstream
,
WICDecodeMetadataCacheOnLoad
);
todo_wine
ok
(
hr
==
WINCODEC_ERR_WRONGSTATE
,
"expected WINCODEC_ERR_WRONGSTATE, hr=%x
\n
"
,
hr
);
/* cannot querycapability twice */
hr
=
IWICBitmapDecoder_QueryCapability
(
decoder2
,
bmpstream
,
&
capability
);
todo_wine
ok
(
hr
==
WINCODEC_ERR_WRONGSTATE
,
"expected WINCODEC_ERR_WRONGSTATE, hr=%x
\n
"
,
hr
);
}
IStream_Release
(
bmpstream
);
}
GlobalFree
(
hbmpdata
);
}
IWICBitmapDecoder_Release
(
decoder
);
}
START_TEST
(
bmpformat
)
{
CoInitializeEx
(
NULL
,
COINIT_APARTMENTTHREADED
);
test_decode_24bpp
();
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