Mariusz Pluciński : gameux/tests: Add basic test for InstallGame and UninstallGame.
Alexandre Julliard
julliard at winehq.org
Wed Sep 15 18:18:39 CDT 2010
Module: wine
Branch: master
Commit: 7c121d53aef1d6027c108f600dfcaf1fabb3f015
URL: http://source.winehq.org/git/wine.git/?a=commit;h=7c121d53aef1d6027c108f600dfcaf1fabb3f015
Author: Mariusz Pluciński <vshader at gmail.com>
Date: Wed Sep 15 00:57:02 2010 +0200
gameux/tests: Add basic test for InstallGame and UninstallGame.
---
dlls/gameux/tests/gameexplorer.c | 45 ++++++++++++++++++++++++++++++++++++-
dlls/gameux/tests/test.gdf.xml | 9 +++++++
2 files changed, 52 insertions(+), 2 deletions(-)
diff --git a/dlls/gameux/tests/gameexplorer.c b/dlls/gameux/tests/gameexplorer.c
index 3e86239..3a72d20 100644
--- a/dlls/gameux/tests/gameexplorer.c
+++ b/dlls/gameux/tests/gameexplorer.c
@@ -368,7 +368,7 @@ static void _validateGameRegistryKey(int line,
/*******************************************************************************
* Test routines
*/
-static void test_create(BOOL* gameExplorerAvailable)
+static void test_create(BOOL* gameExplorerAvailable, BOOL* gameExplorer2Available)
{
HRESULT hr;
@@ -391,6 +391,7 @@ static void test_create(BOOL* gameExplorerAvailable)
if(ge2)
{
ok( hr == S_OK, "IGameExplorer2 creating failed (result false)\n");
+ *gameExplorer2Available = TRUE;
IGameExplorer2_Release(ge2);
}
else
@@ -477,21 +478,61 @@ static void test_add_remove_game(void)
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)
{
HRESULT r;
BOOL gameExplorerAvailable = FALSE;
+ BOOL gameExplorer2Available = FALSE;
if(_loadDynamicRoutines())
{
r = CoInitialize( NULL );
ok( r == S_OK, "failed to init COM\n");
- test_create(&gameExplorerAvailable);
+ test_create(&gameExplorerAvailable, &gameExplorer2Available);
if(gameExplorerAvailable)
test_add_remove_game();
+
+ if(gameExplorer2Available)
+ test_install_uninstall_game();
}
else
/* this is not a failure, because both procedures loaded by address
diff --git a/dlls/gameux/tests/test.gdf.xml b/dlls/gameux/tests/test.gdf.xml
index 981abd3..c8959fc 100644
--- a/dlls/gameux/tests/test.gdf.xml
+++ b/dlls/gameux/tests/test.gdf.xml
@@ -27,5 +27,14 @@ xmlns="urn:schemas-microsoft-com:GameDescription.v1">
<Version>
<VersionNumber versionNumber="1.0.0.0"/>
</Version>
+ <ExtendedProperties>
+ <GameTasks>
+ <Play>
+ <Primary>
+ <FileTask path="gameux_crosstest.exe" arguments="" />
+ </Primary>
+ </Play>
+ </GameTasks>
+ </ExtendedProperties>
</GameDefinition>
</GameDefinitionFile>
More information about the wine-cvs
mailing list