ole32/tests: Use common wine_dbgstr_guid implementation from test.h.

This commit is contained in:
Frédéric Delanoy 2014-01-25 15:24:39 +01:00 committed by Alexandre Julliard
parent 3201f970b6
commit 86a9e6a366
3 changed files with 10 additions and 39 deletions

View File

@ -77,18 +77,6 @@ static const WCHAR progidW[] = {'P','r','o','g','I','d','.','P','r','o','g','I',
DEFINE_GUID(IID_IWineTest, 0x5201163f, 0x8164, 0x4fd0, 0xa1, 0xa2, 0x5d, 0x5a, 0x36, 0x54, 0xd3, 0xbd); DEFINE_GUID(IID_IWineTest, 0x5201163f, 0x8164, 0x4fd0, 0xa1, 0xa2, 0x5d, 0x5a, 0x36, 0x54, 0xd3, 0xbd);
DEFINE_GUID(CLSID_WineOOPTest, 0x5201163f, 0x8164, 0x4fd0, 0xa1, 0xa2, 0x5d, 0x5a, 0x36, 0x54, 0xd3, 0xbd); DEFINE_GUID(CLSID_WineOOPTest, 0x5201163f, 0x8164, 0x4fd0, 0xa1, 0xa2, 0x5d, 0x5a, 0x36, 0x54, 0xd3, 0xbd);
static const char *debugstr_guid(REFIID riid)
{
static char buf[50];
sprintf(buf, "{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}",
riid->Data1, riid->Data2, riid->Data3, riid->Data4[0],
riid->Data4[1], riid->Data4[2], riid->Data4[3], riid->Data4[4],
riid->Data4[5], riid->Data4[6], riid->Data4[7]);
return buf;
}
static LONG cLocks; static LONG cLocks;
static void LockModule(void) static void LockModule(void)
@ -381,7 +369,7 @@ static void test_CLSIDFromProgID(void)
hr = CLSIDFromProgID(progidW, &clsid); hr = CLSIDFromProgID(progidW, &clsid);
/* it returns generated CLSID here */ /* it returns generated CLSID here */
ok(!IsEqualCLSID(&clsid, &CLSID_non_existent) && !IsEqualCLSID(&clsid, &CLSID_NULL), ok(!IsEqualCLSID(&clsid, &CLSID_non_existent) && !IsEqualCLSID(&clsid, &CLSID_NULL),
"got wrong clsid %s\n", debugstr_guid(&clsid)); "got wrong clsid %s\n", wine_dbgstr_guid(&clsid));
/* duplicate progid present in context - returns generated guid here too */ /* duplicate progid present in context - returns generated guid here too */
clsid = CLSID_NULL; clsid = CLSID_NULL;
@ -391,7 +379,7 @@ static void test_CLSIDFromProgID(void)
/* that's where it differs from StdFont */ /* that's where it differs from StdFont */
clsid1.Data4[7] = 0x52; clsid1.Data4[7] = 0x52;
ok(!IsEqualCLSID(&clsid, &CLSID_StdFont) && !IsEqualCLSID(&clsid, &CLSID_NULL) && !IsEqualCLSID(&clsid, &clsid1), ok(!IsEqualCLSID(&clsid, &CLSID_StdFont) && !IsEqualCLSID(&clsid, &CLSID_NULL) && !IsEqualCLSID(&clsid, &clsid1),
"got %s\n", debugstr_guid(&clsid)); "got %s\n", wine_dbgstr_guid(&clsid));
pDeactivateActCtx(0, cookie); pDeactivateActCtx(0, cookie);
pReleaseActCtx(handle); pReleaseActCtx(handle);
@ -1034,22 +1022,22 @@ static void test_CoGetPSClsid(void)
memset(&clsid, 0, sizeof(clsid)); memset(&clsid, 0, sizeof(clsid));
hr = CoGetPSClsid(&IID_Testiface, &clsid); hr = CoGetPSClsid(&IID_Testiface, &clsid);
ok(hr == S_OK, "got 0x%08x\n", hr); ok(hr == S_OK, "got 0x%08x\n", hr);
ok(IsEqualGUID(&clsid, &IID_Testiface), "got clsid %s\n", debugstr_guid(&clsid)); ok(IsEqualGUID(&clsid, &IID_Testiface), "got clsid %s\n", wine_dbgstr_guid(&clsid));
memset(&clsid, 0, sizeof(clsid)); memset(&clsid, 0, sizeof(clsid));
hr = CoGetPSClsid(&IID_Testiface2, &clsid); hr = CoGetPSClsid(&IID_Testiface2, &clsid);
ok(hr == S_OK, "got 0x%08x\n", hr); ok(hr == S_OK, "got 0x%08x\n", hr);
ok(IsEqualGUID(&clsid, &IID_Testiface2), "got clsid %s\n", debugstr_guid(&clsid)); ok(IsEqualGUID(&clsid, &IID_Testiface2), "got clsid %s\n", wine_dbgstr_guid(&clsid));
memset(&clsid, 0, sizeof(clsid)); memset(&clsid, 0, sizeof(clsid));
hr = CoGetPSClsid(&IID_Testiface3, &clsid); hr = CoGetPSClsid(&IID_Testiface3, &clsid);
ok(hr == S_OK, "got 0x%08x\n", hr); ok(hr == S_OK, "got 0x%08x\n", hr);
ok(IsEqualGUID(&clsid, &IID_TestPS), "got clsid %s\n", debugstr_guid(&clsid)); ok(IsEqualGUID(&clsid, &IID_TestPS), "got clsid %s\n", wine_dbgstr_guid(&clsid));
memset(&clsid, 0xaa, sizeof(clsid)); memset(&clsid, 0xaa, sizeof(clsid));
hr = CoGetPSClsid(&IID_Testiface4, &clsid); hr = CoGetPSClsid(&IID_Testiface4, &clsid);
ok(hr == S_OK, "got 0x%08x\n", hr); ok(hr == S_OK, "got 0x%08x\n", hr);
ok(IsEqualGUID(&clsid, &GUID_NULL), "got clsid %s\n", debugstr_guid(&clsid)); ok(IsEqualGUID(&clsid, &GUID_NULL), "got clsid %s\n", wine_dbgstr_guid(&clsid));
/* register same interface and try to get CLSID back */ /* register same interface and try to get CLSID back */
hr = CoRegisterPSClsid(&IID_Testiface, &IID_Testiface4); hr = CoRegisterPSClsid(&IID_Testiface, &IID_Testiface4);
@ -1057,7 +1045,7 @@ static void test_CoGetPSClsid(void)
memset(&clsid, 0, sizeof(clsid)); memset(&clsid, 0, sizeof(clsid));
hr = CoGetPSClsid(&IID_Testiface, &clsid); hr = CoGetPSClsid(&IID_Testiface, &clsid);
ok(hr == S_OK, "got 0x%08x\n", hr); ok(hr == S_OK, "got 0x%08x\n", hr);
ok(IsEqualGUID(&clsid, &IID_Testiface4), "got clsid %s\n", debugstr_guid(&clsid)); ok(IsEqualGUID(&clsid, &IID_Testiface4), "got clsid %s\n", wine_dbgstr_guid(&clsid));
pDeactivateActCtx(0, cookie); pDeactivateActCtx(0, cookie);
pReleaseActCtx(handle); pReleaseActCtx(handle);

View File

@ -64,18 +64,6 @@ DEFINE_EXPECT(CF_QueryInterface_ClassFactory);
DEFINE_EXPECT(CF_CreateInstance); DEFINE_EXPECT(CF_CreateInstance);
DEFINE_EXPECT(CF_QueryInterface_IMarshal); DEFINE_EXPECT(CF_QueryInterface_IMarshal);
static const char *debugstr_guid(REFIID riid)
{
static char buf[50];
sprintf(buf, "{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}",
riid->Data1, riid->Data2, riid->Data3, riid->Data4[0],
riid->Data4[1], riid->Data4[2], riid->Data4[3], riid->Data4[4],
riid->Data4[5], riid->Data4[6], riid->Data4[7]);
return buf;
}
static HRESULT create_storage(IStorage **stg) static HRESULT create_storage(IStorage **stg)
{ {
HRESULT hr; HRESULT hr;
@ -194,7 +182,7 @@ static HRESULT WINAPI ClassFactory_QueryInterface(IClassFactory *iface, REFIID r
return S_OK; return S_OK;
} }
ok(0, "unexpected interface: %s\n", debugstr_guid(riid)); ok(0, "unexpected interface: %s\n", wine_dbgstr_guid(riid));
*ppv = NULL; *ppv = NULL;
return E_NOINTERFACE; return E_NOINTERFACE;
} }
@ -215,7 +203,7 @@ static HRESULT WINAPI ClassFactory_CreateInstance(IClassFactory *iface,
CHECK_EXPECT(CF_CreateInstance); CHECK_EXPECT(CF_CreateInstance);
ok(pUnkOuter == NULL, "pUnkOuter != NULL\n"); ok(pUnkOuter == NULL, "pUnkOuter != NULL\n");
todo_wine ok(IsEqualGUID(riid, &IID_IUnknown), "riid = %s\n", debugstr_guid(riid)); todo_wine ok(IsEqualGUID(riid, &IID_IUnknown), "riid = %s\n", wine_dbgstr_guid(riid));
if(IsEqualGUID(riid, &IID_IOleObject)) { if(IsEqualGUID(riid, &IID_IOleObject)) {
*ppv = NULL; *ppv = NULL;
return E_NOINTERFACE; return E_NOINTERFACE;

View File

@ -65,7 +65,6 @@ static LONG obj_ref, class_ref, server_locks;
static const char *debugstr_guid(const GUID *guid) static const char *debugstr_guid(const GUID *guid)
{ {
static char buf[50];
int i; int i;
if (!guid) return "(null)"; if (!guid) return "(null)";
@ -76,11 +75,7 @@ static const char *debugstr_guid(const GUID *guid)
return guid_name[i].name; return guid_name[i].name;
} }
sprintf(buf, "{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}", return wine_dbgstr_guid(guid);
guid->Data1, guid->Data2, guid->Data3, guid->Data4[0],
guid->Data4[1], guid->Data4[2], guid->Data4[3], guid->Data4[4],
guid->Data4[5], guid->Data4[6], guid->Data4[7]);
return buf;
} }
/******************************* OLE server *******************************/ /******************************* OLE server *******************************/