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
7c121d53
Commit
7c121d53
authored
Sep 15, 2010
by
Mariusz Pluciński
Committed by
Alexandre Julliard
Sep 15, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gameux/tests: Add basic test for InstallGame and UninstallGame.
parent
d02a6ab2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
2 deletions
+52
-2
gameexplorer.c
dlls/gameux/tests/gameexplorer.c
+43
-2
test.gdf.xml
dlls/gameux/tests/test.gdf.xml
+9
-0
No files found.
dlls/gameux/tests/gameexplorer.c
View file @
7c121d53
...
@@ -368,7 +368,7 @@ static void _validateGameRegistryKey(int line,
...
@@ -368,7 +368,7 @@ static void _validateGameRegistryKey(int line,
/*******************************************************************************
/*******************************************************************************
* Test routines
* Test routines
*/
*/
static
void
test_create
(
BOOL
*
gameExplorerAvailable
)
static
void
test_create
(
BOOL
*
gameExplorerAvailable
,
BOOL
*
gameExplorer2Available
)
{
{
HRESULT
hr
;
HRESULT
hr
;
...
@@ -391,6 +391,7 @@ static void test_create(BOOL* gameExplorerAvailable)
...
@@ -391,6 +391,7 @@ static void test_create(BOOL* gameExplorerAvailable)
if
(
ge2
)
if
(
ge2
)
{
{
ok
(
hr
==
S_OK
,
"IGameExplorer2 creating failed (result false)
\n
"
);
ok
(
hr
==
S_OK
,
"IGameExplorer2 creating failed (result false)
\n
"
);
*
gameExplorer2Available
=
TRUE
;
IGameExplorer2_Release
(
ge2
);
IGameExplorer2_Release
(
ge2
);
}
}
else
else
...
@@ -477,21 +478,61 @@ static void test_add_remove_game(void)
...
@@ -477,21 +478,61 @@ static void test_add_remove_game(void)
IGameExplorer_Release
(
ge
);
IGameExplorer_Release
(
ge
);
}
}
}
}
void
test_install_uninstall_game
(
void
)
{
HRESULT
hr
;
IGameExplorer2
*
ge2
=
NULL
;
WCHAR
sExeName
[
MAX_PATH
];
WCHAR
sExePath
[
MAX_PATH
];
DWORD
dwExeNameLen
;
hr
=
CoCreateInstance
(
&
CLSID_GameExplorer
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IGameExplorer2
,
(
LPVOID
*
)
&
ge2
);
ok
(
ge2
!=
NULL
,
"cannot create coclass IGameExplorer2
\n
"
);
ok
(
hr
==
S_OK
,
"cannot create coclass IGameExplorer2
\n
"
);
if
(
ge2
)
{
/* prepare path to binary */
dwExeNameLen
=
GetModuleFileNameW
(
NULL
,
sExeName
,
sizeof
(
sExeName
)
/
sizeof
(
sExeName
[
0
]));
ok
(
dwExeNameLen
!=
0
,
"GetModuleFileNameW returned invalid value
\n
"
);
lstrcpynW
(
sExePath
,
sExeName
,
StrRChrW
(
sExeName
,
NULL
,
'\\'
)
-
sExeName
+
1
);
trace
(
"prepared EXE name: %s
\n
"
,
wine_dbgstr_w
(
sExeName
));
trace
(
"prepared EXE path: %s
\n
"
,
wine_dbgstr_w
(
sExePath
));
hr
=
IGameExplorer2_InstallGame
(
ge2
,
sExeName
,
sExePath
,
GIS_CURRENT_USER
);
todo_wine
ok
(
SUCCEEDED
(
hr
),
"IGameExplorer2::InstallGame failed (error 0x%08x)
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
IGameExplorer2_UninstallGame
(
ge2
,
sExeName
);
todo_wine
ok
(
SUCCEEDED
(
hr
),
"IGameExplorer2::UninstallGame failed (error 0x%08x)
\n
"
,
hr
);
}
IGameExplorer2_Release
(
ge2
);
}
}
START_TEST
(
gameexplorer
)
START_TEST
(
gameexplorer
)
{
{
HRESULT
r
;
HRESULT
r
;
BOOL
gameExplorerAvailable
=
FALSE
;
BOOL
gameExplorerAvailable
=
FALSE
;
BOOL
gameExplorer2Available
=
FALSE
;
if
(
_loadDynamicRoutines
())
if
(
_loadDynamicRoutines
())
{
{
r
=
CoInitialize
(
NULL
);
r
=
CoInitialize
(
NULL
);
ok
(
r
==
S_OK
,
"failed to init COM
\n
"
);
ok
(
r
==
S_OK
,
"failed to init COM
\n
"
);
test_create
(
&
gameExplorerAvailable
);
test_create
(
&
gameExplorerAvailable
,
&
gameExplorer2Available
);
if
(
gameExplorerAvailable
)
if
(
gameExplorerAvailable
)
test_add_remove_game
();
test_add_remove_game
();
if
(
gameExplorer2Available
)
test_install_uninstall_game
();
}
}
else
else
/* this is not a failure, because both procedures loaded by address
/* this is not a failure, because both procedures loaded by address
...
...
dlls/gameux/tests/test.gdf.xml
View file @
7c121d53
...
@@ -27,5 +27,14 @@ xmlns="urn:schemas-microsoft-com:GameDescription.v1">
...
@@ -27,5 +27,14 @@ xmlns="urn:schemas-microsoft-com:GameDescription.v1">
<Version>
<Version>
<VersionNumber
versionNumber=
"1.0.0.0"
/>
<VersionNumber
versionNumber=
"1.0.0.0"
/>
</Version>
</Version>
<ExtendedProperties>
<GameTasks>
<Play>
<Primary>
<FileTask
path=
"gameux_crosstest.exe"
arguments=
""
/>
</Primary>
</Play>
</GameTasks>
</ExtendedProperties>
</GameDefinition>
</GameDefinition>
</GameDefinitionFile>
</GameDefinitionFile>
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