Commit 5620159e authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

gameux/tests: Simplify initial test skipping.

parent 2062a483
...@@ -161,24 +161,6 @@ static BOOL _isFileExists(LPCWSTR lpFile) ...@@ -161,24 +161,6 @@ static BOOL _isFileExists(LPCWSTR lpFile)
/******************************************************************************* /*******************************************************************************
* test routines * test routines
*/ */
static void test_create(BOOL* gameStatisticsAvailable)
{
HRESULT hr;
IGameStatisticsMgr* gsm = NULL;
*gameStatisticsAvailable = FALSE;
/* interface available up from Win7 */
hr = CoCreateInstance( &CLSID_GameStatistics, NULL, CLSCTX_INPROC_SERVER, &IID_IGameStatisticsMgr, (LPVOID*)&gsm);
if(gsm)
{
ok( hr == S_OK, "IGameStatisticsMgr creating failed (result: 0x%08x)\n", hr);
*gameStatisticsAvailable = TRUE;
IGameStatisticsMgr_Release(gsm);
}
else
win_skip("IGameStatisticsMgr cannot be created\n");
}
static void test_gamestatisticsmgr( void ) static void test_gamestatisticsmgr( void )
{ {
static const GUID guidApplicationId = { 0x17A6558E, 0x60BE, 0x4078, { 0xB6, 0x6F, 0x9C, 0x3A, 0xDA, 0x2A, 0x32, 0xE6 } }; static const GUID guidApplicationId = { 0x17A6558E, 0x60BE, 0x4078, { 0xB6, 0x6F, 0x9C, 0x3A, 0xDA, 0x2A, 0x32, 0xE6 } };
...@@ -411,28 +393,33 @@ static void test_gamestatisticsmgr( void ) ...@@ -411,28 +393,33 @@ static void test_gamestatisticsmgr( void )
START_TEST(gamestatistics) START_TEST(gamestatistics)
{ {
HRESULT hr; HRESULT hr;
BOOL gameStatisticsAvailable; IGameStatisticsMgr* gsm;
IGameExplorer *ge;
if(_loadDynamicRoutines()) if (!_loadDynamicRoutines())
{ {
hr = CoInitialize( NULL ); /* this is not a failure, because a procedure loaded by address
ok( hr == S_OK, "failed to init COM\n"); * is always available on systems which has gameux.dll */
win_skip("too old system, cannot load required dynamic procedures\n");
test_create(&gameStatisticsAvailable); return;
}
if(gameStatisticsAvailable)
{
IGameExplorer *ge;
test_register_game(&ge); hr = CoInitialize( NULL );
test_gamestatisticsmgr(); ok(hr == S_OK, "failed to init COM\n");
test_unregister_game(ge);
}
/* interface available up from Win7 */
hr = CoCreateInstance(&CLSID_GameStatistics, NULL, CLSCTX_INPROC_SERVER, &IID_IGameStatisticsMgr, (void**)&gsm);
if (FAILED(hr))
{
win_skip("IGameStatisticsMgr is not supported.\n");
CoUninitialize(); CoUninitialize();
return;
} }
else IGameStatisticsMgr_Release(gsm);
/* this is not a failure, because a procedure loaded by address
* is always available on systems which has gameux.dll */ test_register_game(&ge);
win_skip("too old system, cannot load required dynamic procedures\n"); test_gamestatisticsmgr();
test_unregister_game(ge);
CoUninitialize();
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment