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
51158a2f
Commit
51158a2f
authored
Apr 15, 2008
by
Rob Shearman
Committed by
Alexandre Julliard
Apr 16, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Add tests for clipboard's implementation of IDataObject_GetData.
parent
2cd4117f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
0 deletions
+45
-0
clipboard.c
dlls/ole32/tests/clipboard.c
+45
-0
No files found.
dlls/ole32/tests/clipboard.c
View file @
51158a2f
...
...
@@ -58,6 +58,7 @@ typedef struct EnumFormatImpl {
}
EnumFormatImpl
;
static
BOOL
expect_DataObjectImpl_QueryGetData
=
TRUE
;
static
ULONG
DataObjectImpl_GetData_calls
=
0
;
static
HRESULT
EnumFormatImpl_Create
(
FORMATETC
*
fmtetc
,
UINT
size
,
LPENUMFORMATETC
*
lplpformatetc
);
...
...
@@ -196,6 +197,8 @@ static HRESULT WINAPI DataObjectImpl_GetData(IDataObject* iface, FORMATETC *pfor
{
DataObjectImpl
*
This
=
(
DataObjectImpl
*
)
iface
;
DataObjectImpl_GetData_calls
++
;
if
(
pformatetc
->
lindex
!=
-
1
)
return
DV_E_LINDEX
;
...
...
@@ -326,6 +329,7 @@ static void test_get_clipboard(void)
HRESULT
hr
;
IDataObject
*
data_obj
;
FORMATETC
fmtetc
;
STGMEDIUM
stgmedium
;
hr
=
OleGetClipboard
(
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"OleGetClipboard(NULL) should return E_INVALIDARG instead of 0x%08x
\n
"
,
hr
);
...
...
@@ -333,6 +337,8 @@ static void test_get_clipboard(void)
hr
=
OleGetClipboard
(
&
data_obj
);
ok
(
hr
==
S_OK
,
"OleGetClipboard failed with error 0x%08x
\n
"
,
hr
);
/* test IDataObject_QueryGetData */
/* clipboard's IDataObject_QueryGetData shouldn't defer to our IDataObject_QueryGetData */
expect_DataObjectImpl_QueryGetData
=
FALSE
;
...
...
@@ -367,6 +373,45 @@ static void test_get_clipboard(void)
expect_DataObjectImpl_QueryGetData
=
TRUE
;
/* test IDataObject_GetData */
DataObjectImpl_GetData_calls
=
0
;
InitFormatEtc
(
fmtetc
,
CF_TEXT
,
TYMED_HGLOBAL
);
hr
=
IDataObject_GetData
(
data_obj
,
&
fmtetc
,
&
stgmedium
);
ok
(
hr
==
S_OK
,
"IDataObject_GetData failed with error 0x%08x
\n
"
,
hr
);
ReleaseStgMedium
(
&
stgmedium
);
InitFormatEtc
(
fmtetc
,
CF_TEXT
,
TYMED_HGLOBAL
);
fmtetc
.
dwAspect
=
0xdeadbeef
;
hr
=
IDataObject_GetData
(
data_obj
,
&
fmtetc
,
&
stgmedium
);
ok
(
hr
==
S_OK
,
"IDataObject_GetData failed with error 0x%08x
\n
"
,
hr
);
ReleaseStgMedium
(
&
stgmedium
);
InitFormatEtc
(
fmtetc
,
CF_TEXT
,
TYMED_HGLOBAL
);
fmtetc
.
dwAspect
=
DVASPECT_THUMBNAIL
;
hr
=
IDataObject_GetData
(
data_obj
,
&
fmtetc
,
&
stgmedium
);
ok
(
hr
==
S_OK
,
"IDataObject_GetData failed with error 0x%08x
\n
"
,
hr
);
ReleaseStgMedium
(
&
stgmedium
);
InitFormatEtc
(
fmtetc
,
CF_TEXT
,
TYMED_HGLOBAL
);
fmtetc
.
lindex
=
256
;
hr
=
IDataObject_GetData
(
data_obj
,
&
fmtetc
,
&
stgmedium
);
todo_wine
ok
(
hr
==
DV_E_FORMATETC
,
"IDataObject_GetData should have failed with DV_E_FORMATETC instead of 0x%08x
\n
"
,
hr
);
InitFormatEtc
(
fmtetc
,
CF_TEXT
,
TYMED_HGLOBAL
);
fmtetc
.
cfFormat
=
CF_RIFF
;
hr
=
IDataObject_GetData
(
data_obj
,
&
fmtetc
,
&
stgmedium
);
ok
(
hr
==
DV_E_FORMATETC
,
"IDataObject_GetData should have failed with DV_E_FORMATETC instead of 0x%08x
\n
"
,
hr
);
InitFormatEtc
(
fmtetc
,
CF_TEXT
,
TYMED_HGLOBAL
);
fmtetc
.
tymed
=
TYMED_FILE
;
hr
=
IDataObject_GetData
(
data_obj
,
&
fmtetc
,
&
stgmedium
);
ok
(
hr
==
DV_E_TYMED
,
"IDataObject_GetData should have failed with DV_E_TYMED instead of 0x%08x
\n
"
,
hr
);
ok
(
DataObjectImpl_GetData_calls
==
6
,
"DataObjectImpl_GetData should have been called 6 times instead of %d times
\n
"
,
DataObjectImpl_GetData_calls
);
IDataObject_Release
(
data_obj
);
}
...
...
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