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
d66af9c1
Commit
d66af9c1
authored
Dec 24, 2015
by
Nikolay Sivov
Committed by
Alexandre Julliard
Dec 24, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32/tests: Simple test for aggregation in CreateDataCache().
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
88111ca2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
29 deletions
+44
-29
ole2.c
dlls/ole32/tests/ole2.c
+44
-29
No files found.
dlls/ole32/tests/ole2.c
View file @
d66af9c1
...
...
@@ -1496,6 +1496,39 @@ static IDataObjectVtbl DataObjectVtbl =
static
IDataObject
DataObject
=
{
&
DataObjectVtbl
};
static
HRESULT
WINAPI
Unknown_QueryInterface
(
IUnknown
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
*
ppv
=
NULL
;
if
(
IsEqualIID
(
riid
,
&
IID_IUnknown
))
*
ppv
=
iface
;
if
(
*
ppv
)
{
IUnknown_AddRef
((
IUnknown
*
)
*
ppv
);
return
S_OK
;
}
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
Unknown_AddRef
(
IUnknown
*
iface
)
{
ok
(
0
,
"unexpected AddRef
\n
"
);
return
2
;
}
static
ULONG
WINAPI
Unknown_Release
(
IUnknown
*
iface
)
{
ok
(
0
,
"unexpected Release
\n
"
);
return
1
;
}
static
const
IUnknownVtbl
UnknownVtbl
=
{
Unknown_QueryInterface
,
Unknown_AddRef
,
Unknown_Release
};
static
IUnknown
unknown
=
{
&
UnknownVtbl
};
static
void
test_data_cache
(
void
)
{
HRESULT
hr
;
...
...
@@ -1566,6 +1599,17 @@ static void test_data_cache(void)
hr
=
StgCreateDocfile
(
NULL
,
STGM_READWRITE
|
STGM_CREATE
|
STGM_SHARE_EXCLUSIVE
|
STGM_DELETEONRELEASE
,
0
,
&
pStorage
);
ok_ole_success
(
hr
,
"StgCreateDocfile"
);
/* aggregation */
/* requested is not IUnknown */
hr
=
CreateDataCache
(
&
unknown
,
&
CLSID_NULL
,
&
IID_IOleCache2
,
(
void
**
)
&
pOleCache
);
todo_wine
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x
\n
"
,
hr
);
hr
=
CreateDataCache
(
&
unknown
,
&
CLSID_NULL
,
&
IID_IUnknown
,
(
void
**
)
&
pOleCache
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
IOleCache2_Release
(
pOleCache
);
/* Test with new data */
hr
=
CreateDataCache
(
NULL
,
&
CLSID_NULL
,
&
IID_IOleCache2
,
(
LPVOID
*
)
&
pOleCache
);
...
...
@@ -2214,34 +2258,6 @@ static void test_runnable(void)
g_showRunnable
=
TRUE
;
}
static
HRESULT
WINAPI
Unknown_QueryInterface
(
IUnknown
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
*
ppv
=
NULL
;
if
(
IsEqualIID
(
riid
,
&
IID_IUnknown
))
*
ppv
=
iface
;
if
(
*
ppv
)
{
IUnknown_AddRef
((
IUnknown
*
)
*
ppv
);
return
S_OK
;
}
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
Unknown_AddRef
(
IUnknown
*
iface
)
{
return
2
;
}
static
ULONG
WINAPI
Unknown_Release
(
IUnknown
*
iface
)
{
return
1
;
}
static
const
IUnknownVtbl
UnknownVtbl
=
{
Unknown_QueryInterface
,
Unknown_AddRef
,
Unknown_Release
};
static
HRESULT
WINAPI
OleRun_QueryInterface
(
IRunnableObject
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
...
...
@@ -2314,7 +2330,6 @@ static const IRunnableObjectVtbl oleruntestvtbl =
OleRun_SetContainedObject
};
static
IUnknown
unknown
=
{
&
UnknownVtbl
};
static
IRunnableObject
testrunnable
=
{
&
oleruntestvtbl
};
static
void
test_OleRun
(
void
)
...
...
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