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
065470ed
Commit
065470ed
authored
Nov 15, 2011
by
Vincent Povirk
Committed by
Alexandre Julliard
Nov 16, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windowscodecs: Flesh out IWICMetadataReader test.
parent
318c4e67
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
73 additions
and
5 deletions
+73
-5
metadata.c
dlls/windowscodecs/tests/metadata.c
+72
-5
wincodec.idl
include/wincodec.idl
+1
-0
No files found.
dlls/windowscodecs/tests/metadata.c
View file @
065470ed
...
...
@@ -163,24 +163,39 @@ static void test_metadata_tEXt(void)
IWICMetadataReader
*
reader
;
IWICEnumMetadataItem
*
enumerator
;
PROPVARIANT
schema
,
id
,
value
;
ULONG
items_returned
;
ULONG
items_returned
,
count
;
GUID
format
;
PropVariantInit
(
&
schema
);
PropVariantInit
(
&
id
);
PropVariantInit
(
&
value
);
hr
=
CoCreateInstance
(
&
CLSID_WICPngTextMetadataReader
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IWICMetadataReader
,
(
void
**
)
&
reader
);
todo_wine
ok
(
hr
==
S_OK
,
"CoCreateInstance failed, hr=%x
\n
"
,
hr
);
if
(
FAILED
(
hr
))
return
;
hr
=
IWICMetadataReader_GetCount
(
reader
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"GetCount failed, hr=%x
\n
"
,
hr
);
hr
=
IWICMetadataReader_GetCount
(
reader
,
&
count
);
ok
(
hr
==
S_OK
,
"GetCount failed, hr=%x
\n
"
,
hr
);
ok
(
count
==
0
,
"unexpected count %i
\n
"
,
count
);
load_stream
((
IUnknown
*
)
reader
,
metadata_tEXt
,
sizeof
(
metadata_tEXt
));
hr
=
IWICMetadataReader_GetCount
(
reader
,
&
count
);
ok
(
hr
==
S_OK
,
"GetCount failed, hr=%x
\n
"
,
hr
);
ok
(
count
==
1
,
"unexpected count %i
\n
"
,
count
);
hr
=
IWICMetadataReader_GetEnumerator
(
reader
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"GetEnumerator failed, hr=%x
\n
"
,
hr
);
hr
=
IWICMetadataReader_GetEnumerator
(
reader
,
&
enumerator
);
ok
(
hr
==
S_OK
,
"GetEnumerator failed, hr=%x
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
PropVariantInit
(
&
schema
);
PropVariantInit
(
&
id
);
PropVariantInit
(
&
value
);
hr
=
IWICEnumMetadataItem_Next
(
enumerator
,
1
,
&
schema
,
&
id
,
&
value
,
&
items_returned
);
ok
(
hr
==
S_OK
,
"Next failed, hr=%x
\n
"
,
hr
);
ok
(
items_returned
==
1
,
"unexpected item count %i
\n
"
,
items_returned
);
...
...
@@ -205,6 +220,58 @@ static void test_metadata_tEXt(void)
IWICEnumMetadataItem_Release
(
enumerator
);
}
hr
=
IWICMetadataReader_GetMetadataFormat
(
reader
,
&
format
);
ok
(
hr
==
S_OK
,
"GetMetadataFormat failed, hr=%x
\n
"
,
hr
);
ok
(
IsEqualGUID
(
&
format
,
&
GUID_MetadataFormatChunktEXt
),
"unexpected format %s
\n
"
,
debugstr_guid
(
&
format
));
hr
=
IWICMetadataReader_GetMetadataFormat
(
reader
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"GetMetadataFormat failed, hr=%x
\n
"
,
hr
);
id
.
vt
=
VT_LPSTR
;
id
.
pszVal
=
CoTaskMemAlloc
(
strlen
(
"winetest"
)
+
1
);
strcpy
(
id
.
pszVal
,
"winetest"
);
hr
=
IWICMetadataReader_GetValue
(
reader
,
NULL
,
&
id
,
NULL
);
ok
(
hr
==
S_OK
,
"GetValue failed, hr=%x
\n
"
,
hr
);
hr
=
IWICMetadataReader_GetValue
(
reader
,
&
schema
,
NULL
,
&
value
);
ok
(
hr
==
E_INVALIDARG
,
"GetValue failed, hr=%x
\n
"
,
hr
);
hr
=
IWICMetadataReader_GetValue
(
reader
,
&
schema
,
&
id
,
&
value
);
ok
(
hr
==
S_OK
,
"GetValue failed, hr=%x
\n
"
,
hr
);
ok
(
value
.
vt
==
VT_LPSTR
,
"unexpected vt: %i
\n
"
,
id
.
vt
);
ok
(
!
strcmp
(
value
.
pszVal
,
"value"
),
"unexpected value: %s
\n
"
,
id
.
pszVal
);
PropVariantClear
(
&
value
);
strcpy
(
id
.
pszVal
,
"test"
);
hr
=
IWICMetadataReader_GetValue
(
reader
,
&
schema
,
&
id
,
&
value
);
ok
(
hr
==
WINCODEC_ERR_PROPERTYNOTFOUND
,
"GetValue failed, hr=%x
\n
"
,
hr
);
PropVariantClear
(
&
id
);
hr
=
IWICMetadataReader_GetValueByIndex
(
reader
,
0
,
NULL
,
NULL
,
NULL
);
ok
(
hr
==
S_OK
,
"GetValueByIndex failed, hr=%x
\n
"
,
hr
);
hr
=
IWICMetadataReader_GetValueByIndex
(
reader
,
0
,
&
schema
,
NULL
,
NULL
);
ok
(
hr
==
S_OK
,
"GetValueByIndex failed, hr=%x
\n
"
,
hr
);
ok
(
schema
.
vt
==
VT_EMPTY
,
"unexpected vt: %i
\n
"
,
schema
.
vt
);
hr
=
IWICMetadataReader_GetValueByIndex
(
reader
,
0
,
NULL
,
&
id
,
NULL
);
ok
(
hr
==
S_OK
,
"GetValueByIndex failed, hr=%x
\n
"
,
hr
);
ok
(
id
.
vt
==
VT_LPSTR
,
"unexpected vt: %i
\n
"
,
id
.
vt
);
ok
(
!
strcmp
(
id
.
pszVal
,
"winetest"
),
"unexpected id: %s
\n
"
,
id
.
pszVal
);
PropVariantClear
(
&
id
);
hr
=
IWICMetadataReader_GetValueByIndex
(
reader
,
0
,
NULL
,
NULL
,
&
value
);
ok
(
hr
==
S_OK
,
"GetValueByIndex failed, hr=%x
\n
"
,
hr
);
ok
(
value
.
vt
==
VT_LPSTR
,
"unexpected vt: %i
\n
"
,
id
.
vt
);
ok
(
!
strcmp
(
value
.
pszVal
,
"value"
),
"unexpected value: %s
\n
"
,
id
.
pszVal
);
PropVariantClear
(
&
value
);
hr
=
IWICMetadataReader_GetValueByIndex
(
reader
,
1
,
NULL
,
NULL
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"GetValueByIndex failed, hr=%x
\n
"
,
hr
);
IWICMetadataReader_Release
(
reader
);
}
...
...
include/wincodec.idl
View file @
065470ed
...
...
@@ -192,6 +192,7 @@ typedef UINT32 WICColor;
cpp_quote
(
"#define WINCODEC_ERR_WRONGSTATE 0x88982f04"
)
cpp_quote
(
"#define WINCODEC_ERR_VALUEOUTOFRANGE 0x88982f05"
)
cpp_quote
(
"#define WINCODEC_ERR_NOTINITIALIZED 0x88982f0c"
)
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"
)
...
...
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