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
2d2a6526
Commit
2d2a6526
authored
Sep 05, 2010
by
Vincent Povirk
Committed by
Alexandre Julliard
Sep 06, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windowscodecs: Add tests for IWICBitmapDecoderInfo_GetMimeTypes.
parent
ad2895d1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
96 additions
and
0 deletions
+96
-0
Makefile.in
dlls/windowscodecs/tests/Makefile.in
+1
-0
info.c
dlls/windowscodecs/tests/info.c
+95
-0
No files found.
dlls/windowscodecs/tests/Makefile.in
View file @
2d2a6526
...
...
@@ -8,6 +8,7 @@ IMPORTS = ole32 windowscodecs
C_SRCS
=
\
bmpformat.c
\
converter.c
\
info.c
\
palette.c
\
stream.c
...
...
dlls/windowscodecs/tests/info.c
0 → 100644
View file @
2d2a6526
/*
* 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>
#include <math.h>
#define COBJMACROS
#include "windef.h"
#include "objbase.h"
#include "wincodec.h"
#include "wine/test.h"
static
void
test_decoder_info
(
void
)
{
IWICImagingFactory
*
factory
;
IWICComponentInfo
*
info
;
IWICBitmapDecoderInfo
*
decoder_info
;
HRESULT
hr
;
ULONG
len
;
WCHAR
value
[
256
];
const
WCHAR
expected_mimetype
[]
=
{
'i'
,
'm'
,
'a'
,
'g'
,
'e'
,
'/'
,
'b'
,
'm'
,
'p'
,
0
};
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_CreateComponentInfo
(
factory
,
&
CLSID_WICBmpDecoder
,
&
info
);
ok
(
hr
==
S_OK
,
"CreateComponentInfo failed, hr=%x
\n
"
,
hr
);
hr
=
IWICComponentInfo_QueryInterface
(
info
,
&
IID_IWICBitmapDecoderInfo
,
(
void
**
)
&
decoder_info
);
ok
(
hr
==
S_OK
,
"QueryInterface failed, hr=%x
\n
"
,
hr
);
todo_wine
{
hr
=
IWICBitmapDecoderInfo_GetMimeTypes
(
decoder_info
,
0
,
NULL
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"GetMimeType failed, hr=%x
\n
"
,
hr
);
hr
=
IWICBitmapDecoderInfo_GetMimeTypes
(
decoder_info
,
1
,
NULL
,
&
len
);
ok
(
hr
==
E_INVALIDARG
,
"GetMimeType failed, hr=%x
\n
"
,
hr
);
ok
(
len
==
lstrlenW
(
expected_mimetype
)
+
1
,
"GetMimeType returned wrong len %i
\n
"
,
len
);
hr
=
IWICBitmapDecoderInfo_GetMimeTypes
(
decoder_info
,
len
,
value
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"GetMimeType failed, hr=%x
\n
"
,
hr
);
hr
=
IWICBitmapDecoderInfo_GetMimeTypes
(
decoder_info
,
0
,
NULL
,
&
len
);
ok
(
hr
==
S_OK
,
"GetMimeType failed, hr=%x
\n
"
,
hr
);
ok
(
len
==
lstrlenW
(
expected_mimetype
)
+
1
,
"GetMimeType returned wrong len %i
\n
"
,
len
);
value
[
0
]
=
0
;
hr
=
IWICBitmapDecoderInfo_GetMimeTypes
(
decoder_info
,
len
,
value
,
&
len
);
ok
(
hr
==
S_OK
,
"GetMimeType failed, hr=%x
\n
"
,
hr
);
ok
(
lstrcmpW
(
value
,
expected_mimetype
)
==
0
,
"GetMimeType returned wrong value %s
\n
"
,
wine_dbgstr_w
(
value
));
ok
(
len
==
lstrlenW
(
expected_mimetype
)
+
1
,
"GetMimeType returned wrong len %i
\n
"
,
len
);
hr
=
IWICBitmapDecoderInfo_GetMimeTypes
(
decoder_info
,
1
,
value
,
&
len
);
ok
(
hr
==
WINCODEC_ERR_INSUFFICIENTBUFFER
,
"GetMimeType failed, hr=%x
\n
"
,
hr
);
ok
(
len
==
lstrlenW
(
expected_mimetype
)
+
1
,
"GetMimeType returned wrong len %i
\n
"
,
len
);
hr
=
IWICBitmapDecoderInfo_GetMimeTypes
(
decoder_info
,
256
,
value
,
&
len
);
ok
(
hr
==
S_OK
,
"GetMimeType failed, hr=%x
\n
"
,
hr
);
ok
(
lstrcmpW
(
value
,
expected_mimetype
)
==
0
,
"GetMimeType returned wrong value %s
\n
"
,
wine_dbgstr_w
(
value
));
ok
(
len
==
lstrlenW
(
expected_mimetype
)
+
1
,
"GetMimeType returned wrong len %i
\n
"
,
len
);
}
IWICBitmapDecoderInfo_Release
(
decoder_info
);
IWICComponentInfo_Release
(
info
);
IWICImagingFactory_Release
(
factory
);
}
START_TEST
(
info
)
{
CoInitializeEx
(
NULL
,
COINIT_APARTMENTTHREADED
);
test_decoder_info
();
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