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
59501e03
Commit
59501e03
authored
Mar 30, 2009
by
Huw Davies
Committed by
Alexandre Julliard
Mar 30, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32/tests: Tests for EnumFormatEtc.
parent
89dcb968
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
61 additions
and
0 deletions
+61
-0
clipboard.c
dlls/ole32/tests/clipboard.c
+61
-0
No files found.
dlls/ole32/tests/clipboard.c
View file @
59501e03
...
...
@@ -61,6 +61,7 @@ typedef struct EnumFormatImpl {
static
BOOL
expect_DataObjectImpl_QueryGetData
=
TRUE
;
static
ULONG
DataObjectImpl_GetData_calls
=
0
;
static
ULONG
DataObjectImpl_EnumFormatEtc_calls
=
0
;
static
UINT
cf_stream
,
cf_storage
,
cf_another
,
cf_onemore
;
...
...
@@ -291,6 +292,8 @@ static HRESULT WINAPI DataObjectImpl_EnumFormatEtc(IDataObject* iface, DWORD dwD
{
DataObjectImpl
*
This
=
(
DataObjectImpl
*
)
iface
;
DataObjectImpl_EnumFormatEtc_calls
++
;
if
(
dwDirection
!=
DATADIR_GET
)
{
ok
(
0
,
"unexpected direction %d
\n
"
,
dwDirection
);
return
E_NOTIMPL
;
...
...
@@ -502,6 +505,61 @@ static void test_get_clipboard(void)
IDataObject_Release
(
data_obj
);
}
static
void
test_enum_fmtetc
(
IDataObject
*
src
)
{
HRESULT
hr
;
IDataObject
*
data
;
IEnumFORMATETC
*
enum_fmt
,
*
src_enum
;
FORMATETC
fmt
,
src_fmt
;
DWORD
count
=
0
;
hr
=
OleGetClipboard
(
&
data
);
ok
(
hr
==
S_OK
,
"OleGetClipboard failed with error 0x%08x
\n
"
,
hr
);
hr
=
IDataObject_EnumFormatEtc
(
data
,
DATADIR_SET
,
&
enum_fmt
);
ok
(
hr
==
E_NOTIMPL
,
"got %08x
\n
"
,
hr
);
DataObjectImpl_EnumFormatEtc_calls
=
0
;
hr
=
IDataObject_EnumFormatEtc
(
data
,
DATADIR_GET
,
&
enum_fmt
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
DataObjectImpl_EnumFormatEtc_calls
==
0
,
"EnumFormatEtc was called
\n
"
);
if
(
src
)
IDataObject_EnumFormatEtc
(
src
,
DATADIR_GET
,
&
src_enum
);
while
((
hr
=
IEnumFORMATETC_Next
(
enum_fmt
,
1
,
&
fmt
,
NULL
))
==
S_OK
)
{
ok
(
src
!=
NULL
,
"shouldn't be here
\n
"
);
hr
=
IEnumFORMATETC_Next
(
src_enum
,
1
,
&
src_fmt
,
NULL
);
ok
(
hr
==
S_OK
,
"%d: got %08x
\n
"
,
count
,
hr
);
ok
(
fmt
.
cfFormat
==
src_fmt
.
cfFormat
,
"%d: %04x %04x
\n
"
,
count
,
fmt
.
cfFormat
,
src_fmt
.
cfFormat
);
ok
(
fmt
.
dwAspect
==
src_fmt
.
dwAspect
,
"%d: %08x %08x
\n
"
,
count
,
fmt
.
dwAspect
,
src_fmt
.
dwAspect
);
ok
(
fmt
.
lindex
==
src_fmt
.
lindex
,
"%d: %08x %08x
\n
"
,
count
,
fmt
.
lindex
,
src_fmt
.
lindex
);
ok
(
fmt
.
tymed
==
src_fmt
.
tymed
,
"%d: %08x %08x
\n
"
,
count
,
fmt
.
tymed
,
src_fmt
.
tymed
);
if
(
fmt
.
ptd
)
{
ok
(
src_fmt
.
ptd
!=
NULL
,
"%d: expected non-NULL
\n
"
,
count
);
CoTaskMemFree
(
fmt
.
ptd
);
CoTaskMemFree
(
src_fmt
.
ptd
);
}
count
++
;
}
ok
(
hr
==
S_FALSE
,
"%d: got %08x
\n
"
,
count
,
hr
);
if
(
src
)
{
hr
=
IEnumFORMATETC_Next
(
src_enum
,
1
,
&
src_fmt
,
NULL
);
ok
(
hr
==
S_FALSE
,
"%d: got %08x
\n
"
,
count
,
hr
);
IEnumFORMATETC_Release
(
src_enum
);
}
hr
=
IEnumFORMATETC_Reset
(
enum_fmt
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
IEnumFORMATETC_Release
(
enum_fmt
);
IDataObject_Release
(
data
);
}
static
void
test_cf_dataobject
(
IDataObject
*
data
)
{
UINT
cf
=
0
;
...
...
@@ -718,9 +776,12 @@ static void test_set_clipboard(void)
hr
=
OleSetClipboard
(
data_cmpl
);
ok
(
hr
==
S_OK
,
"failed to set clipboard to complex data, hr = 0x%08x
\n
"
,
hr
);
test_cf_dataobject
(
data_cmpl
);
test_enum_fmtetc
(
data_cmpl
);
ok
(
OleSetClipboard
(
NULL
)
==
S_OK
,
"failed to clear clipboard, hr = 0x%08x
\n
"
,
hr
);
test_enum_fmtetc
(
NULL
);
ref
=
IDataObject_Release
(
data1
);
ok
(
ref
==
0
,
"expected data1 ref=0, got %d
\n
"
,
ref
);
ref
=
IDataObject_Release
(
data2
);
...
...
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