Commit 6996a9c8 authored by Alexandre Julliard's avatar Alexandre Julliard

comcat/tests: Skip tests if we can't create a test category.

parent f63d950d
......@@ -31,19 +31,19 @@
#define ok_ole_success(hr, func) ok(hr == S_OK, func " failed with error 0x%08x \n", hr)
static void register_testentry(void)
static BOOL register_testentry(void)
{
HKEY hkey,hkey2;
HKEY hkey = 0, hkey2 = 0;
DWORD ret;
RegCreateKeyA(HKEY_CLASSES_ROOT,"CLSID\\{deadcafe-beed-bead-dead-cafebeaddead}",
&hkey);
RegSetValueA(hkey,NULL,REG_SZ,"ComCat Test key",16);
RegCreateKeyA(hkey,
ret = RegCreateKeyA(HKEY_CLASSES_ROOT,"CLSID\\{deadcafe-beed-bead-dead-cafebeaddead}", &hkey);
if (!ret) ret = RegSetValueA(hkey,NULL,REG_SZ,"ComCat Test key",16);
if (!ret) ret = RegCreateKeyA(hkey,
"Implemented Categories\\{deadcafe-0000-0000-0000-000000000000}",
&hkey2);
RegCloseKey(hkey);
RegCloseKey(hkey2);
return !ret;
}
static void unregister_testentry(void)
......@@ -107,9 +107,9 @@ static void do_enum(void)
ok (fetched == 0,"Fetched wrong number of guids %u\n",fetched);
IEnumGUID_Release(pIEnum);
register_testentry();
hr = ICatInformation_EnumClassesOfCategories(pICat, 1, the_cat, -1, NULL,
&pIEnum);
if (register_testentry())
{
hr = ICatInformation_EnumClassesOfCategories(pICat, 1, the_cat, -1, NULL, &pIEnum);
ok_ole_success(hr,"ICatInformation_EnumClassesOfCategories");
hr = IEnumGUID_Next(pIEnum,1,the_guid, &fetched);
......@@ -117,8 +117,11 @@ static void do_enum(void)
ok (IsEqualGUID(the_guid,&wanted_guid),"Guids do not match\n");
IEnumGUID_Release(pIEnum);
ICatInformation_Release(pICat);
unregister_testentry();
}
else skip( "Could not register the test category\n" );
ICatInformation_Release(pICat);
OleUninitialize();
}
......
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