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
2822b577
Commit
2822b577
authored
Feb 10, 2020
by
Jacek Caban
Committed by
Alexandre Julliard
Feb 10, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oleaut32/tests: Add test of reference typelib caching.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
dc96f63f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
78 additions
and
13 deletions
+78
-13
Makefile.in
dlls/oleaut32/tests/Makefile.in
+1
-0
test_simple.idl
dlls/oleaut32/tests/test_simple.idl
+34
-0
tmarshal.rc
dlls/oleaut32/tests/tmarshal.rc
+3
-0
typelib.c
dlls/oleaut32/tests/typelib.c
+40
-13
No files found.
dlls/oleaut32/tests/Makefile.in
View file @
2822b577
...
...
@@ -17,5 +17,6 @@ RC_SRCS = tmarshal.rc
IDL_SRCS
=
\
test_reg.idl
\
test_simple.idl
\
test_tlb.idl
\
tmarshal.idl
dlls/oleaut32/tests/test_simple.idl
0 → 100644
View file @
2822b577
/*
*
Copyright
2020
Jacek
Caban
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
*/
#
pragma
makedep
ident
#
pragma
makedep
typelib
import
"oaidl.idl"
; /* needed by widl */
[
uuid
(
8b05
fe77
-
4
a6c
-
4133
-
b9cd
-
8
f00007af786
)
]
library
base
{
importlib
(
"stdole2.tlb"
)
;
[
uuid
(
b14b6bb5
-904e-4
ff9
-
b247
-
bd361f7a0004
)
]
interface
IBaseIface
:
IDispatch
{
HRESULT
simple_test
()
;
}
}
dlls/oleaut32/tests/tmarshal.rc
View file @
2822b577
...
...
@@ -35,3 +35,6 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
/* @makedep: test_reg.tlb */
3 TYPELIB test_reg.tlb
/* @makedep: test_simple.tlb */
4 TL test_simple.tlb
dlls/oleaut32/tests/typelib.c
View file @
2822b577
...
...
@@ -41,6 +41,7 @@
#include "test_reg.h"
#include "test_tlb.h"
#include "test_simple.h"
#define expect_eq(expr, value, type, format) { type _ret = (expr); ok((value) == _ret, #expr " expected " format " got " format "\n", value, _ret); }
#define expect_int(expr, value) expect_eq(expr, (int)(value), int, "%d")
...
...
@@ -775,7 +776,7 @@ static void test_CreateDispTypeInfo(void)
SysFreeString
(
methdata
[
3
].
szName
);
}
static
void
write_typelib
(
int
res_no
,
const
WCHAR
*
filename
)
static
void
write_typelib
(
int
res_no
,
const
WCHAR
*
filename
,
const
WCHAR
*
type
)
{
DWORD
written
;
HANDLE
file
;
...
...
@@ -785,8 +786,8 @@ static void write_typelib(int res_no, const WCHAR *filename)
file
=
CreateFileW
(
filename
,
GENERIC_READ
|
GENERIC_WRITE
,
0
,
NULL
,
CREATE_ALWAYS
,
0
,
0
);
ok
(
file
!=
INVALID_HANDLE_VALUE
,
"file creation failed
\n
"
);
if
(
file
==
INVALID_HANDLE_VALUE
)
return
;
res
=
FindResource
A
(
GetModuleHandleA
(
NULL
),
(
LPCSTR
)
MAKEINTRESOURCE
(
res_no
),
"TYPELIB"
);
ok
(
res
!=
0
,
"couldn't find resource
\n
"
);
res
=
FindResource
W
(
GetModuleHandleA
(
NULL
),
(
const
WCHAR
*
)
MAKEINTRESOURCE
(
res_no
),
type
);
ok
(
res
!=
0
,
"couldn't find resource
%d %s
\n
"
,
res_no
,
debugstr_w
(
type
)
);
ptr
=
LockResource
(
LoadResource
(
GetModuleHandleA
(
NULL
),
res
));
WriteFile
(
file
,
ptr
,
SizeofResource
(
GetModuleHandleA
(
NULL
),
res
),
&
written
,
NULL
);
ok
(
written
==
SizeofResource
(
GetModuleHandleA
(
NULL
),
res
),
"couldn't write resource
\n
"
);
...
...
@@ -820,12 +821,12 @@ static void test_invoke_func(ITypeInfo *typeinfo)
ok
(
hres
==
DISP_E_BADPARAMCOUNT
,
"got 0x%08x
\n
"
,
hres
);
}
static
WCHAR
*
create_test_typelib
(
int
res_no
)
static
WCHAR
*
create_test_typelib
(
int
res_no
,
const
WCHAR
*
type
)
{
static
WCHAR
filename
[
MAX_PATH
];
GetTempFileNameW
(
L"."
,
L"tlb"
,
0
,
filename
);
write_typelib
(
res_no
,
filename
);
write_typelib
(
res_no
,
filename
,
type
);
return
filename
;
}
...
...
@@ -1028,7 +1029,7 @@ static void test_TypeInfo(void)
ITypeInfo_Release
(
pTypeInfo
);
ITypeLib_Release
(
pTypeLib
);
filename
=
create_test_typelib
(
3
);
filename
=
create_test_typelib
(
3
,
L"TYPELIB"
);
hr
=
LoadTypeLib
(
filename
,
&
pTypeLib
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
...
...
@@ -5036,7 +5037,7 @@ static void test_register_typelib(BOOL system_registration)
if
(
pIsWow64Process
)
pIsWow64Process
(
GetCurrentProcess
(),
&
is_wow64
);
filename
=
create_test_typelib
(
3
);
filename
=
create_test_typelib
(
3
,
L"TYPELIB"
);
hr
=
LoadTypeLibEx
(
filename
,
REGKIND_NONE
,
&
typelib
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
...
...
@@ -5787,8 +5788,8 @@ static void test_LoadRegTypeLib(void)
DeleteFileA
(
"main.manifest"
);
/* create typelib file */
write_typelib
(
1
,
L"test_actctx_tlb.tlb"
);
write_typelib
(
3
,
L"test_actctx_tlb2.tlb"
);
write_typelib
(
1
,
L"test_actctx_tlb.tlb"
,
L"TYPELIB"
);
write_typelib
(
3
,
L"test_actctx_tlb2.tlb"
,
L"TYPELIB"
);
hr
=
LoadRegTypeLib
(
&
LIBID_TestTypelib
,
1
,
0
,
LOCALE_NEUTRAL
,
&
tl
);
ok
(
hr
==
TYPE_E_LIBNOTREGISTERED
,
"got 0x%08x
\n
"
,
hr
);
...
...
@@ -6388,11 +6389,11 @@ static void test_dep(void) {
trace
(
"Starting typelib dependency tests
\n
"
);
refFilename
=
create_test_typelib
(
2
);
refFilename
=
create_test_typelib
(
4
,
L"TL"
);
hr
=
LoadTypeLibEx
(
refFilename
,
REGKIND_NONE
,
&
preftLib
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
ITypeLib_GetTypeInfoOfGuid
(
preftLib
,
&
IID_I
Simpl
eIface
,
&
preftInfo
);
hr
=
ITypeLib_GetTypeInfoOfGuid
(
preftLib
,
&
IID_I
Bas
eIface
,
&
preftInfo
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
GetTempFileNameA
(
"."
,
"tlb"
,
0
,
filename
);
...
...
@@ -6448,13 +6449,39 @@ static void test_dep(void) {
ok
(
hr
==
S_OK
,
"got: %x
\n
"
,
hr
);
hr
=
ITypeInfo_GetRefTypeInfo
(
ptInfo
,
refType
,
&
ptInfoExt
);
ok
(
hr
==
S_OK
||
broken
(
hr
==
TYPE_E_CANTLOADLIBRARY
)
/* win 2000 */
,
"got: %x
\n
"
,
hr
);
ok
(
hr
==
TYPE_E_CANTLOADLIBRARY
,
"got: %x
\n
"
,
hr
);
ITypeInfo_Release
(
ptInfo
);
if
(
ptInfoExt
)
ITypeInfo_Release
(
ptInfoExt
);
ITypeLib_Release
(
ptLib
);
hr
=
LoadTypeLibEx
(
filenameW
,
REGKIND_NONE
,
&
ptLib
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
ITypeLib_GetTypeInfo
(
ptLib
,
0
,
&
ptInfo
);
ok
(
hr
==
S_OK
,
"GetTypeInfo failed: %08x
\n
"
,
hr
);
hr
=
ITypeInfo_GetRefTypeOfImplType
(
ptInfo
,
0
,
&
refType
);
ok
(
hr
==
S_OK
,
"GetRefTypeOfImplType failed: %08x
\n
"
,
hr
);
hr
=
ITypeInfo_GetRefTypeInfo
(
ptInfo
,
refType
,
&
ptInfoExt
);
ok
(
hr
==
TYPE_E_CANTLOADLIBRARY
,
"got: %x
\n
"
,
hr
);
refFilename
=
create_test_typelib
(
4
,
L"TL"
);
hr
=
LoadTypeLibEx
(
refFilename
,
REGKIND_NONE
,
&
preftLib
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
ITypeInfo_GetRefTypeInfo
(
ptInfo
,
refType
,
&
ptInfoExt
);
ok
(
hr
==
S_OK
,
"got: %x
\n
"
,
hr
);
ITypeInfo_Release
(
ptInfoExt
);
ITypeLib_Release
(
preftLib
);
DeleteFileW
(
refFilename
);
ITypeInfo_Release
(
ptInfo
);
ITypeLib_Release
(
ptLib
);
DeleteFileW
(
filenameW
);
}
...
...
@@ -6580,7 +6607,7 @@ START_TEST(typelib)
test_SetDocString
();
test_FindName
();
if
((
filename
=
create_test_typelib
(
2
)))
if
((
filename
=
create_test_typelib
(
2
,
L"TYPELIB"
)))
{
test_dump_typelib
(
filename
);
DeleteFileW
(
filename
);
...
...
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