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
dc60ed45
Commit
dc60ed45
authored
Nov 13, 2013
by
André Hentschel
Committed by
Alexandre Julliard
Nov 13, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mscoree/tests: Don't expect a 2.x runtime.
parent
de92a458
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
36 deletions
+40
-36
metahost.c
dlls/mscoree/tests/metahost.c
+40
-36
No files found.
dlls/mscoree/tests/metahost.c
View file @
dc60ed45
...
...
@@ -64,6 +64,44 @@ static void cleanup(void)
FreeLibrary
(
hmscoree
);
}
static
WCHAR
*
strrchrW
(
WCHAR
*
str
,
WCHAR
ch
)
{
WCHAR
*
ret
=
NULL
;
do
{
if
(
*
str
==
ch
)
ret
=
str
;
}
while
(
*
str
++
);
return
ret
;
}
static
void
test_getruntime
(
WCHAR
*
version
)
{
static
const
WCHAR
dotzero
[]
=
{
'.'
,
'0'
,
0
};
WCHAR
*
dot
;
HRESULT
hr
;
ICLRRuntimeInfo
*
info
;
DWORD
count
;
WCHAR
buf
[
MAX_PATH
];
hr
=
ICLRMetaHost_GetRuntime
(
metahost
,
NULL
,
&
IID_ICLRRuntimeInfo
,
(
void
**
)
&
info
);
ok
(
hr
==
E_POINTER
,
"GetVersion failed, hr=%x
\n
"
,
hr
);
hr
=
ICLRMetaHost_GetRuntime
(
metahost
,
version
,
&
IID_ICLRRuntimeInfo
,
(
void
**
)
&
info
);
ok
(
hr
==
S_OK
,
"GetVersion failed, hr=%x
\n
"
,
hr
);
if
(
hr
!=
S_OK
)
return
;
count
=
MAX_PATH
;
hr
=
ICLRRuntimeInfo_GetVersionString
(
info
,
buf
,
&
count
);
ok
(
hr
==
S_OK
,
"GetVersionString returned %x
\n
"
,
hr
);
ok
(
count
==
lstrlenW
(
buf
)
+
1
,
"GetVersionString returned count %u but string of length %u
\n
"
,
count
,
lstrlenW
(
buf
)
+
1
);
ok
(
lstrcmpW
(
buf
,
version
)
==
0
,
"got unexpected version %s
\n
"
,
wine_dbgstr_w
(
buf
));
ICLRRuntimeInfo_Release
(
info
);
/* Versions must match exactly. */
dot
=
strrchrW
(
version
,
'.'
);
lstrcpyW
(
dot
,
dotzero
);
hr
=
ICLRMetaHost_GetRuntime
(
metahost
,
version
,
&
IID_ICLRRuntimeInfo
,
(
void
**
)
&
info
);
ok
(
hr
==
CLR_E_SHIM_RUNTIME
,
"GetVersion failed, hr=%x
\n
"
,
hr
);
}
static
void
test_enumruntimes
(
void
)
{
IEnumUnknown
*
runtime_enum
;
...
...
@@ -100,8 +138,9 @@ static void test_enumruntimes(void)
trace
(
"runtime found: %s
\n
"
,
wine_dbgstr_w
(
buf
));
ICLRRuntimeInfo_Release
(
runtime_info
);
IUnknown_Release
(
unk
);
test_getruntime
(
buf
);
}
ok
(
hr
==
S_FALSE
,
"IEnumUnknown_Next returned %x
\n
"
,
hr
);
...
...
@@ -109,39 +148,6 @@ static void test_enumruntimes(void)
IEnumUnknown_Release
(
runtime_enum
);
}
static
void
test_getruntime
(
void
)
{
static
const
WCHAR
twodotzero
[]
=
{
'v'
,
'2'
,
'.'
,
'0'
,
'.'
,
'5'
,
'0'
,
'7'
,
'2'
,
'7'
,
0
};
static
const
WCHAR
twodotzerodotzero
[]
=
{
'v'
,
'2'
,
'.'
,
'0'
,
'.'
,
'0'
,
0
};
HRESULT
hr
;
ICLRRuntimeInfo
*
info
;
DWORD
count
;
WCHAR
buf
[
MAX_PATH
];
hr
=
ICLRMetaHost_GetRuntime
(
metahost
,
NULL
,
&
IID_ICLRRuntimeInfo
,
(
void
**
)
&
info
);
ok
(
hr
==
E_POINTER
,
"GetVersion failed, hr=%x
\n
"
,
hr
);
hr
=
ICLRMetaHost_GetRuntime
(
metahost
,
twodotzero
,
&
IID_ICLRRuntimeInfo
,
(
void
**
)
&
info
);
if
(
hr
==
CLR_E_SHIM_RUNTIME
)
/* FIXME: Get Mono properly packaged so we can fail here. */
todo_wine
ok
(
hr
==
S_OK
,
"GetVersion failed, hr=%x
\n
"
,
hr
);
else
ok
(
hr
==
S_OK
,
"GetVersion failed, hr=%x
\n
"
,
hr
);
if
(
hr
!=
S_OK
)
return
;
count
=
MAX_PATH
;
hr
=
ICLRRuntimeInfo_GetVersionString
(
info
,
buf
,
&
count
);
ok
(
hr
==
S_OK
,
"GetVersionString returned %x
\n
"
,
hr
);
ok
(
count
==
lstrlenW
(
buf
)
+
1
,
"GetVersionString returned count %u but string of length %u
\n
"
,
count
,
lstrlenW
(
buf
)
+
1
);
ok
(
lstrcmpW
(
buf
,
twodotzero
)
==
0
,
"got unexpected version %s
\n
"
,
wine_dbgstr_w
(
buf
));
ICLRRuntimeInfo_Release
(
info
);
/* Versions must match exactly. */
hr
=
ICLRMetaHost_GetRuntime
(
metahost
,
twodotzerodotzero
,
&
IID_ICLRRuntimeInfo
,
(
void
**
)
&
info
);
ok
(
hr
==
CLR_E_SHIM_RUNTIME
,
"GetVersion failed, hr=%x
\n
"
,
hr
);
}
static
void
WINAPI
notification_callback
(
ICLRRuntimeInfo
*
pRuntimeInfo
,
CallbackThreadSetFnPtr
pfnCallbackThreadSet
,
CallbackThreadUnsetFnPtr
pfnCallbackThreadUnset
)
{
...
...
@@ -165,8 +171,6 @@ START_TEST(metahost)
return
;
test_enumruntimes
();
test_getruntime
();
test_notification
();
cleanup
();
...
...
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