tests: Avoid duplicating debugstr_guid()
Frédéric Delanoy
frederic.delanoy at gmail.com
Wed Jan 15 16:53:46 CST 2014
Note: 'printf' call in xfile.c and d3dxof.c splitted to avoid the need for temp variables
---
dlls/apphelp/tests/apphelp.c | 12 ------------
dlls/atl100/tests/atl.c | 15 ---------------
dlls/comdlg32/tests/printdlg.c | 12 ------------
dlls/d3dx9_36/tests/xfile.c | 15 ++-------------
dlls/d3dxof/tests/d3dxof.c | 15 ++-------------
dlls/dmime/tests/performance.c | 12 ------------
dlls/dmusic/tests/dmusic.c | 10 ----------
dlls/hlink/tests/hlink.c | 12 ------------
dlls/ieframe/tests/webbrowser.c | 12 ------------
dlls/jscript/tests/activex.c | 12 ------------
dlls/kernel32/tests/actctx.c | 12 ------------
dlls/mscoree/tests/debugging.c | 15 ---------------
dlls/mshtml/tests/activex.c | 12 ------------
dlls/mshtml/tests/events.c | 12 ------------
dlls/mshtml/tests/htmldoc.c | 15 ---------------
dlls/mshtml/tests/protocol.c | 12 ------------
dlls/mshtml/tests/script.c | 12 ------------
dlls/msxml3/tests/domdoc.c | 15 ---------------
dlls/msxml3/tests/httpreq.c | 15 ---------------
dlls/ole32/tests/compobj.c | 12 ------------
dlls/ole32/tests/defaulthandler.c | 12 ------------
dlls/ole32/tests/ole_server.c | 8 ++++----
dlls/oleaut32/tests/vartype.c | 12 ------------
dlls/oledb32/tests/database.c | 15 ---------------
dlls/qcap/tests/qcap.c | 12 ------------
dlls/riched20/tests/txtsrv.c | 15 ---------------
dlls/shell32/tests/ebrowser.c | 15 ---------------
dlls/shell32/tests/shellole.c | 12 ------------
dlls/shell32/tests/shlfolder.c | 12 ------------
dlls/urlmon/tests/protocol.c | 12 ------------
dlls/urlmon/tests/url.c | 12 ------------
dlls/vbscript/tests/createobj.c | 12 ------------
dlls/vbscript/tests/run.c | 12 ------------
dlls/windowscodecs/tests/bitmap.c | 12 ------------
dlls/windowscodecs/tests/gifformat.c | 12 ------------
dlls/windowscodecs/tests/info.c | 15 ---------------
dlls/windowscodecs/tests/metadata.c | 15 ---------------
dlls/windowscodecs/tests/pngformat.c | 12 ------------
dlls/windowscodecs/tests/tiffformat.c | 12 ------------
dlls/xmllite/tests/reader.c | 11 -----------
include/wine/test.h | 16 ++++++++++++++++
41 files changed, 24 insertions(+), 501 deletions(-)
diff --git a/dlls/apphelp/tests/apphelp.c b/dlls/apphelp/tests/apphelp.c
index fb2e3a3..f7eb4ab 100644
--- a/dlls/apphelp/tests/apphelp.c
+++ b/dlls/apphelp/tests/apphelp.c
@@ -47,18 +47,6 @@ static const CLSID * objects[] = {
&test_UserAssist,
NULL,};
-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 void test_ApphelpCheckShellObject(void)
{
ULONGLONG flags;
diff --git a/dlls/atl100/tests/atl.c b/dlls/atl100/tests/atl.c
index 4cf4a62..9403d5c 100644
--- a/dlls/atl100/tests/atl.c
+++ b/dlls/atl100/tests/atl.c
@@ -43,21 +43,6 @@ static const GUID CATID_CatTest2 =
{0x178fc163,0x0000,0x0000,{0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x46}};
#define CATID_CATTEST2_STR "178fc163-0000-0000-0000-000000000246"
-static const char *debugstr_guid(REFIID riid)
-{
- static char buf[50];
-
- if(!riid)
- return "(null)";
-
- 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 void test_winmodule(void)
{
_AtlCreateWndData create_data[3];
diff --git a/dlls/comdlg32/tests/printdlg.c b/dlls/comdlg32/tests/printdlg.c
index 9dec1e2..5b97168 100644
--- a/dlls/comdlg32/tests/printdlg.c
+++ b/dlls/comdlg32/tests/printdlg.c
@@ -52,18 +52,6 @@ static HRESULT (WINAPI * pPrintDlgExW)(LPPRINTDLGEXW);
static const CHAR emptyA[] = "";
static const CHAR PrinterPortsA[] = "PrinterPorts";
-static const char *debugstr_guid(const GUID *guid)
-{
- static char buf[50];
-
- if (!guid) return "(null)";
- sprintf(buf, "{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}",
- 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;
-}
-
/* ########################### */
static void test_PageSetupDlgA(void)
diff --git a/dlls/d3dx9_36/tests/xfile.c b/dlls/d3dx9_36/tests/xfile.c
index d105aee..3573a37 100644
--- a/dlls/d3dx9_36/tests/xfile.c
+++ b/dlls/d3dx9_36/tests/xfile.c
@@ -244,22 +244,12 @@ static void test_type_index_color(void)
d3dxfile->lpVtbl->Release(d3dxfile);
}
-static inline void debugstr_guid(char* buf, const GUID *id)
-{
- sprintf(buf, "{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}",
- id->Data1, id->Data2, id->Data3,
- id->Data4[0], id->Data4[1], id->Data4[2], id->Data4[3],
- id->Data4[4], id->Data4[5], id->Data4[6], id->Data4[7] );
-}
-
static void process_data(ID3DXFileData *xfile_data, int level)
{
HRESULT ret;
char name[100];
GUID clsid;
GUID clsid_type;
- char str_clsid[40];
- char str_clsid_type[40];
SIZE_T len = sizeof(name);
int i;
const BYTE *data;
@@ -277,10 +267,9 @@ static void process_data(ID3DXFileData *xfile_data, int level)
for (i = 0; i < level; i++)
printf(" ");
- debugstr_guid(str_clsid, &clsid);
- debugstr_guid(str_clsid_type, &clsid_type);
- printf("Found object '%s' - %s - %s - %lu\n", len ? name : "", str_clsid, str_clsid_type, size);
+ printf("Found object '%s' - %s", len ? name : "", debugstr_guid(&clsid));
+ printf(" - %s - %lu\n", debugstr_guid(&clsid_type), size);
if (size)
{
diff --git a/dlls/d3dxof/tests/d3dxof.c b/dlls/d3dxof/tests/d3dxof.c
index f4ab68a..b53c57c 100644
--- a/dlls/d3dxof/tests/d3dxof.c
+++ b/dlls/d3dxof/tests/d3dxof.c
@@ -40,14 +40,6 @@
#define SEMICOLON_5X TOKEN_SEMICOLON, TOKEN_SEMICOLON, TOKEN_SEMICOLON, TOKEN_SEMICOLON, TOKEN_SEMICOLON
-static inline void debugstr_guid( char *buf, const GUID *id )
-{
- sprintf(buf, "{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}",
- id->Data1, id->Data2, id->Data3,
- id->Data4[0], id->Data4[1], id->Data4[2], id->Data4[3],
- id->Data4[4], id->Data4[5], id->Data4[6], id->Data4[7] );
-}
-
static HMODULE hd3dxof;
static HRESULT (WINAPI *pDirectXFileCreate)(LPDIRECTXFILE*);
@@ -1120,8 +1112,6 @@ static void process_data(LPDIRECTXFILEDATA lpDirectXFileData, int level)
char name[100];
GUID clsid;
const GUID *clsid_type = NULL;
- char str_clsid[40];
- char str_clsid_type[40];
DWORD len = 100;
LPDIRECTXFILEOBJECT pChildObj;
int i;
@@ -1139,9 +1129,8 @@ static void process_data(LPDIRECTXFILEDATA lpDirectXFileData, int level)
ok(hr == DXFILE_OK, "IDirectXFileData_GetData: %x\n", hr);
for (i = 0; i < level; i++)
printf(" ");
- debugstr_guid(str_clsid, &clsid);
- debugstr_guid(str_clsid_type, clsid_type);
- printf("Found object '%s' - %s - %s - %d\n", len ? name : "", str_clsid, str_clsid_type, size);
+ printf("Found object '%s' - %s", len ? name : "", debugstr_guid(&clsid));
+ printf(" - %s - %d\n", debugstr_guid(clsid_type), size);
if (EXPAND_STRING && size == 4)
{
diff --git a/dlls/dmime/tests/performance.c b/dlls/dmime/tests/performance.c
index 591ae1f..a3cea53 100644
--- a/dlls/dmime/tests/performance.c
+++ b/dlls/dmime/tests/performance.c
@@ -31,18 +31,6 @@
DEFINE_GUID(GUID_NULL,0,0,0,0,0,0,0,0,0,0,0);
DEFINE_GUID(GUID_Bunk,0xFFFFFFFF,0xFFFF,0xFFFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF);
-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 test_InitAudio(void)
{
IDirectMusicPerformance8 *idmusicperformance;
diff --git a/dlls/dmusic/tests/dmusic.c b/dlls/dmusic/tests/dmusic.c
index 4291d71..e2bd86f 100644
--- a/dlls/dmusic/tests/dmusic.c
+++ b/dlls/dmusic/tests/dmusic.c
@@ -29,16 +29,6 @@
#include "dmusici.h"
#include "dmksctrl.h"
-static inline const char* debugstr_guid(const GUID *id)
-{
- static char string[39];
- sprintf(string, "{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}",
- id->Data1, id->Data2, id->Data3,
- id->Data4[0], id->Data4[1], id->Data4[2], id->Data4[3],
- id->Data4[4], id->Data4[5], id->Data4[6], id->Data4[7] );
- return string;
-}
-
static inline const char* debugstr_longlong(ULONGLONG ll)
{
static char string[17];
diff --git a/dlls/hlink/tests/hlink.c b/dlls/hlink/tests/hlink.c
index f4e3d5c..1003411 100644
--- a/dlls/hlink/tests/hlink.c
+++ b/dlls/hlink/tests/hlink.c
@@ -79,18 +79,6 @@ DEFINE_EXPECT(HLF_UpdateHlink);
DEFINE_GUID(IID_IHlinkHistory,0x79eac9c8,0xbaf9,0x11ce,0x8c,0x82,0x00,0xaa,0x00,0x4b,0xa9,0x0b);
-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 void test_HlinkIsShortcut(void)
{
UINT i;
diff --git a/dlls/ieframe/tests/webbrowser.c b/dlls/ieframe/tests/webbrowser.c
index d045658..4ca6a3e 100644
--- a/dlls/ieframe/tests/webbrowser.c
+++ b/dlls/ieframe/tests/webbrowser.c
@@ -213,18 +213,6 @@ static BOOL iface_cmp(IUnknown *iface1, IUnknown *iface2)
return unk1 == unk2;
}
-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 BSTR a2bstr(const char *str)
{
BSTR ret;
diff --git a/dlls/jscript/tests/activex.c b/dlls/jscript/tests/activex.c
index b4a8bdc..95e35fe 100644
--- a/dlls/jscript/tests/activex.c
+++ b/dlls/jscript/tests/activex.c
@@ -116,18 +116,6 @@ const GUID GUID_CUSTOM_CONFIRMOBJECTSAFETY =
#define DISPID_GLOBAL_OK 0x2000
-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 BSTR a2bstr(const char *str)
{
BSTR ret;
diff --git a/dlls/kernel32/tests/actctx.c b/dlls/kernel32/tests/actctx.c
index 5795e18..fff9d31 100644
--- a/dlls/kernel32/tests/actctx.c
+++ b/dlls/kernel32/tests/actctx.c
@@ -49,18 +49,6 @@ static const char* strw(LPCWSTR x)
return buffer;
}
-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;
-}
-
#ifdef __i386__
#define ARCH "x86"
#elif defined __x86_64__
diff --git a/dlls/mscoree/tests/debugging.c b/dlls/mscoree/tests/debugging.c
index bd961ed..020ee39 100644
--- a/dlls/mscoree/tests/debugging.c
+++ b/dlls/mscoree/tests/debugging.c
@@ -36,21 +36,6 @@ static HRESULT (WINAPI *pCreateDebuggingInterfaceFromVersion)(int, LPCWSTR, IUnk
const WCHAR v2_0[] = {'v','2','.','0','.','5','0','7','2','7',0};
-static const char *debugstr_guid(REFIID riid)
-{
- static char buf[50];
-
- if(!riid)
- return "(null)";
-
- 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 WINAPI ManagedCallback2_QueryInterface(ICorDebugManagedCallback2 *iface, REFIID riid, void **ppv)
{
if(IsEqualGUID(&IID_IUnknown, riid) || IsEqualGUID(&IID_ICorDebugManagedCallback2, riid))
diff --git a/dlls/mshtml/tests/activex.c b/dlls/mshtml/tests/activex.c
index 147c9a7..bdec6b6 100644
--- a/dlls/mshtml/tests/activex.c
+++ b/dlls/mshtml/tests/activex.c
@@ -164,18 +164,6 @@ static REFIID pluginhost_iids[] = {
NULL
};
-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 BOOL iface_cmp(IUnknown *iface1, IUnknown *iface2)
{
IUnknown *unk1, *unk2;
diff --git a/dlls/mshtml/tests/events.c b/dlls/mshtml/tests/events.c
index f1542f5..be5925f 100644
--- a/dlls/mshtml/tests/events.c
+++ b/dlls/mshtml/tests/events.c
@@ -125,18 +125,6 @@ static const char form_doc_str[] =
"<input type=\"submit\" id=\"submitid\" />"
"</form></body></html>";
-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 int strcmp_wa(LPCWSTR strw, const char *stra)
{
CHAR buf[512];
diff --git a/dlls/mshtml/tests/htmldoc.c b/dlls/mshtml/tests/htmldoc.c
index c3990bf..cec9bb0 100644
--- a/dlls/mshtml/tests/htmldoc.c
+++ b/dlls/mshtml/tests/htmldoc.c
@@ -261,21 +261,6 @@ static const WCHAR wszTimesNewRoman[] =
static const WCHAR wszArial[] =
{'A','r','i','a','l',0};
-static const char *debugstr_guid(REFIID riid)
-{
- static char buf[50];
-
- if(!riid)
- return "(null)";
-
- 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 int strcmp_wa(LPCWSTR strw, const char *stra)
{
CHAR buf[512];
diff --git a/dlls/mshtml/tests/protocol.c b/dlls/mshtml/tests/protocol.c
index b4a6fc7..a3f4d28 100644
--- a/dlls/mshtml/tests/protocol.c
+++ b/dlls/mshtml/tests/protocol.c
@@ -77,18 +77,6 @@ static const WCHAR javascript_test_url[] = {'j','a','v','a','s','c','r','i','p',
static WCHAR res_url_base[INTERNET_MAX_URL_LENGTH] = {'r','e','s',':','/','/'};
static unsigned res_url_base_len;
-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 WINAPI ProtocolSink_QueryInterface(IInternetProtocolSink *iface, REFIID riid, void **ppv)
{
if(IsEqualGUID(&IID_IUnknown, riid) || IsEqualGUID(&IID_IInternetProtocolSink, riid)) {
diff --git a/dlls/mshtml/tests/script.c b/dlls/mshtml/tests/script.c
index c0602d8..cf7664c 100644
--- a/dlls/mshtml/tests/script.c
+++ b/dlls/mshtml/tests/script.c
@@ -161,18 +161,6 @@ static HRESULT ax_getopt_hres = S_OK, ax_setopt_dispex_hres = S_OK;
static HRESULT ax_setopt_disp_caller_hres = S_OK, ax_setopt_disp_data_hres = S_OK;
static BOOL skip_loadobject_tests;
-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 int strcmp_wa(LPCWSTR strw, const char *stra)
{
CHAR buf[512];
diff --git a/dlls/msxml3/tests/domdoc.c b/dlls/msxml3/tests/domdoc.c
index 9c698c2..6459a7f 100644
--- a/dlls/msxml3/tests/domdoc.c
+++ b/dlls/msxml3/tests/domdoc.c
@@ -45,21 +45,6 @@
DEFINE_GUID(GUID_NULL,0,0,0,0,0,0,0,0,0,0,0);
-static const char *debugstr_guid(REFIID riid)
-{
- static char buf[50];
-
- if(!riid)
- return "(null)";
-
- 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 int g_unexpectedcall, g_expectedcall;
struct msxmlsupported_data_t
diff --git a/dlls/msxml3/tests/httpreq.c b/dlls/msxml3/tests/httpreq.c
index ad074de..69f04a5 100644
--- a/dlls/msxml3/tests/httpreq.c
+++ b/dlls/msxml3/tests/httpreq.c
@@ -87,21 +87,6 @@ DEFINE_EXPECT(htmldoc2_get_all);
DEFINE_EXPECT(htmldoc2_get_url);
DEFINE_EXPECT(collection_get_length);
-static const char *debugstr_guid(REFIID riid)
-{
- static char buf[50];
-
- if(!riid)
- return "(null)";
-
- 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 int g_unexpectedcall, g_expectedcall;
static BSTR alloc_str_from_narrow(const char *str)
diff --git a/dlls/ole32/tests/compobj.c b/dlls/ole32/tests/compobj.c
index b615034..896c09a 100644
--- a/dlls/ole32/tests/compobj.c
+++ b/dlls/ole32/tests/compobj.c
@@ -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(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 void LockModule(void)
diff --git a/dlls/ole32/tests/defaulthandler.c b/dlls/ole32/tests/defaulthandler.c
index efbd431..9543782 100644
--- a/dlls/ole32/tests/defaulthandler.c
+++ b/dlls/ole32/tests/defaulthandler.c
@@ -64,18 +64,6 @@ DEFINE_EXPECT(CF_QueryInterface_ClassFactory);
DEFINE_EXPECT(CF_CreateInstance);
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)
{
HRESULT hr;
diff --git a/dlls/ole32/tests/ole_server.c b/dlls/ole32/tests/ole_server.c
index 7a9dc30..5b1fc0a 100644
--- a/dlls/ole32/tests/ole_server.c
+++ b/dlls/ole32/tests/ole_server.c
@@ -63,7 +63,7 @@ static const struct
static LONG obj_ref, class_ref, server_locks;
-static const char *debugstr_guid(const GUID *guid)
+static const char *my_debugstr_guid(const GUID *guid)
{
static char buf[50];
int i;
@@ -100,7 +100,7 @@ static HRESULT WINAPI UnknownImpl_QueryInterface(IUnknown *iface,
{
UnknownImpl *This = impl_from_IUnknown(iface);
- trace("server: unknown_QueryInterface: %p,%s,%p\n", iface, debugstr_guid(iid), ppv);
+ trace("server: unknown_QueryInterface: %p,%s,%p\n", iface, my_debugstr_guid(iid), ppv);
if (!ppv) return E_INVALIDARG;
@@ -161,7 +161,7 @@ static HRESULT WINAPI ClassFactoryImpl_QueryInterface(IClassFactory *iface,
{
ClassFactoryImpl *This = impl_from_IClassFactory(iface);
- trace("server: factory_QueryInterface: %p,%s,%p\n", iface, debugstr_guid(iid), ppv);
+ trace("server: factory_QueryInterface: %p,%s,%p\n", iface, my_debugstr_guid(iid), ppv);
if (!ppv) return E_INVALIDARG;
@@ -205,7 +205,7 @@ static HRESULT WINAPI ClassFactoryImpl_CreateInstance(IClassFactory *iface,
UnknownImpl *unknown;
HRESULT hr;
- trace("server: factory_CreateInstance: %p,%s,%p\n", iface, debugstr_guid(iid), ppv);
+ trace("server: factory_CreateInstance: %p,%s,%p\n", iface, my_debugstr_guid(iid), ppv);
if (punkouter) return CLASS_E_NOAGGREGATION;
diff --git a/dlls/oleaut32/tests/vartype.c b/dlls/oleaut32/tests/vartype.c
index bc74e2e..ae9a407 100644
--- a/dlls/oleaut32/tests/vartype.c
+++ b/dlls/oleaut32/tests/vartype.c
@@ -510,18 +510,6 @@ static HRESULT (WINAPI *pVarBstrCat)(BSTR,BSTR,BSTR*);
static INT (WINAPI *pSystemTimeToVariantTime)(LPSYSTEMTIME,double*);
static void (WINAPI *pClearCustData)(LPCUSTDATA);
-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;
-}
-
/* Internal representation of a BSTR */
typedef struct tagINTERNAL_BSTR
{
diff --git a/dlls/oledb32/tests/database.c b/dlls/oledb32/tests/database.c
index fa56e56..c27b066 100644
--- a/dlls/oledb32/tests/database.c
+++ b/dlls/oledb32/tests/database.c
@@ -40,21 +40,6 @@ DEFINE_GUID(CSLID_MSDAER, 0xc8b522cf,0x5cf3,0x11ce,0xad,0xe5,0x00,0xaa,0x00,0x44
static WCHAR initstring_default[] = {'D','a','t','a',' ','S','o','u','r','c','e','=','d','u','m','m','y',';',0};
-static const char *debugstr_guid(REFIID riid)
-{
- static char buf[50];
-
- if(!riid)
- return "(null)";
-
- 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 void test_GetDataSource(WCHAR *initstring)
{
IDataInitialize *datainit = NULL;
diff --git a/dlls/qcap/tests/qcap.c b/dlls/qcap/tests/qcap.c
index b403a74..a63e51e 100644
--- a/dlls/qcap/tests/qcap.c
+++ b/dlls/qcap/tests/qcap.c
@@ -61,18 +61,6 @@ DEFINE_EXPECT(NotifyAllocator);
DEFINE_EXPECT(Reconnect);
DEFINE_EXPECT(Read_FccHandler);
-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 int strcmp_wa(LPCWSTR strw, const char *stra)
{
CHAR buf[512];
diff --git a/dlls/riched20/tests/txtsrv.c b/dlls/riched20/tests/txtsrv.c
index 566381c..654549f 100644
--- a/dlls/riched20/tests/txtsrv.c
+++ b/dlls/riched20/tests/txtsrv.c
@@ -42,21 +42,6 @@ static IID *pIID_ITextHost;
static IID *pIID_ITextHost2;
static PCreateTextServices pCreateTextServices;
-static const char *debugstr_guid(REFIID riid)
-{
- static char buf[50];
-
- if(!riid)
- return "(null)";
-
- 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;
-}
-
/* Define C Macros for ITextServices calls. */
/* Use a special table for x86 machines to convert the thiscall
diff --git a/dlls/shell32/tests/ebrowser.c b/dlls/shell32/tests/ebrowser.c
index 07f5019..081e091 100644
--- a/dlls/shell32/tests/ebrowser.c
+++ b/dlls/shell32/tests/ebrowser.c
@@ -121,21 +121,6 @@ static void process_msgs(void)
}
}
-static const char *debugstr_guid(REFIID riid)
-{
- static char buf[50];
-
- if(!riid)
- return "(null)";
-
- 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;
-}
-
/*********************************************************************
* IExplorerBrowserEvents implementation
*/
diff --git a/dlls/shell32/tests/shellole.c b/dlls/shell32/tests/shellole.c
index af07545..78e311a 100644
--- a/dlls/shell32/tests/shellole.c
+++ b/dlls/shell32/tests/shellole.c
@@ -75,18 +75,6 @@ static HRESULT (WINAPI *pSHPropStgWriteMultiple)(IPropertyStorage*, UINT*,
ULONG, const PROPSPEC*, PROPVARIANT*, PROPID);
static HRESULT (WINAPI *pSHCreateQueryCancelAutoPlayMoniker)(IMoniker**);
-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 void init(void)
{
HMODULE hmod = GetModuleHandleA("shell32.dll");
diff --git a/dlls/shell32/tests/shlfolder.c b/dlls/shell32/tests/shlfolder.c
index f692837..ee6d6ab 100644
--- a/dlls/shell32/tests/shlfolder.c
+++ b/dlls/shell32/tests/shlfolder.c
@@ -75,18 +75,6 @@ static HRESULT (WINAPI *pSHCreateDefaultContextMenu)(const DEFCONTEXTMENU*,REFII
static HRESULT (WINAPI *pSHCreateShellFolderView)(const SFV_CREATE *pcsfv, IShellView **ppsv);
static HRESULT (WINAPI *pSHCreateShellFolderViewEx)(LPCSFV psvcbi, IShellView **ppv);
-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 WCHAR *make_wstr(const char *str)
{
WCHAR *ret;
diff --git a/dlls/urlmon/tests/protocol.c b/dlls/urlmon/tests/protocol.c
index 25f78d0..0d87f8b 100644
--- a/dlls/urlmon/tests/protocol.c
+++ b/dlls/urlmon/tests/protocol.c
@@ -197,18 +197,6 @@ static const WCHAR binding_urls[][130] = {
static const CHAR post_data[] = "mode=Test";
-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 int strcmp_wa(LPCWSTR strw, const char *stra)
{
CHAR buf[512];
diff --git a/dlls/urlmon/tests/url.c b/dlls/urlmon/tests/url.c
index 83c5c8d..2f7aabc 100644
--- a/dlls/urlmon/tests/url.c
+++ b/dlls/urlmon/tests/url.c
@@ -211,18 +211,6 @@ static enum {
END_DOWNLOAD
} download_state;
-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 BOOL proxy_active(void)
{
HKEY internet_settings;
diff --git a/dlls/vbscript/tests/createobj.c b/dlls/vbscript/tests/createobj.c
index 3fffb5f..4be158e 100644
--- a/dlls/vbscript/tests/createobj.c
+++ b/dlls/vbscript/tests/createobj.c
@@ -117,18 +117,6 @@ const GUID GUID_CUSTOM_CONFIRMOBJECTSAFETY =
#define VB_E_CANNOT_CREATE_OBJ 0x800a01ad
-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 BSTR a2bstr(const char *str)
{
BSTR ret;
diff --git a/dlls/vbscript/tests/run.c b/dlls/vbscript/tests/run.c
index 6d4b38a..6002c1a 100644
--- a/dlls/vbscript/tests/run.c
+++ b/dlls/vbscript/tests/run.c
@@ -146,18 +146,6 @@ static int strcmp_wa(LPCWSTR strw, const char *stra)
return lstrcmpA(buf, stra);
}
-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 const char *vt2a(VARIANT *v)
{
if(V_VT(v) == (VT_BYREF|VT_VARIANT)) {
diff --git a/dlls/windowscodecs/tests/bitmap.c b/dlls/windowscodecs/tests/bitmap.c
index 14726f1..de81e54 100644
--- a/dlls/windowscodecs/tests/bitmap.c
+++ b/dlls/windowscodecs/tests/bitmap.c
@@ -32,18 +32,6 @@
static IWICImagingFactory *factory;
-static const char *debugstr_guid(const GUID *guid)
-{
- static char buf[50];
-
- if (!guid) return "(null)";
- sprintf(buf, "{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}",
- 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;
-}
-
static HRESULT WINAPI bitmapsource_QueryInterface(IWICBitmapSource *iface, REFIID iid, void **ppv)
{
if (IsEqualIID(&IID_IUnknown, iid) ||
diff --git a/dlls/windowscodecs/tests/gifformat.c b/dlls/windowscodecs/tests/gifformat.c
index 0ff0f61..6ad1ba8 100644
--- a/dlls/windowscodecs/tests/gifformat.c
+++ b/dlls/windowscodecs/tests/gifformat.c
@@ -57,18 +57,6 @@ static const char gif_local_palette[] = {
static IWICImagingFactory *factory;
-static const char *debugstr_guid(const GUID *guid)
-{
- static char buf[50];
-
- if (!guid) return "(null)";
- sprintf(buf, "{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}",
- 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;
-}
-
static IWICBitmapDecoder *create_decoder(const void *image_data, UINT image_size)
{
HGLOBAL hmem;
diff --git a/dlls/windowscodecs/tests/info.c b/dlls/windowscodecs/tests/info.c
index da8d6b8..1c120c4 100644
--- a/dlls/windowscodecs/tests/info.c
+++ b/dlls/windowscodecs/tests/info.c
@@ -31,21 +31,6 @@
#include "initguid.h"
DEFINE_GUID(GUID_NULL,0,0,0,0,0,0,0,0,0,0,0);
-static const char *debugstr_guid(GUID *guid)
-{
- static char buf[50];
-
- if(!guid)
- return "(null)";
-
- sprintf(buf, "{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}",
- 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;
-}
-
static HRESULT get_component_info(const GUID *clsid, IWICComponentInfo **result)
{
IWICImagingFactory *factory;
diff --git a/dlls/windowscodecs/tests/metadata.c b/dlls/windowscodecs/tests/metadata.c
index be700ad..243f627 100644
--- a/dlls/windowscodecs/tests/metadata.c
+++ b/dlls/windowscodecs/tests/metadata.c
@@ -177,21 +177,6 @@ static const char animatedgif[] = {
0x21,0x01,0x0C,'p','l','a','i','n','t','e','x','t',' ','#','2',0x00,0x3B
};
-static const char *debugstr_guid(REFIID riid)
-{
- static char buf[50];
-
- if(!riid)
- return "(null)";
-
- 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 IStream *create_stream(const char *data, int data_size)
{
HRESULT hr;
diff --git a/dlls/windowscodecs/tests/pngformat.c b/dlls/windowscodecs/tests/pngformat.c
index a222ebc..38a1e20 100644
--- a/dlls/windowscodecs/tests/pngformat.c
+++ b/dlls/windowscodecs/tests/pngformat.c
@@ -275,18 +275,6 @@ static const char png_color_profile[] = {
static IWICImagingFactory *factory;
-static const char *debugstr_guid(const GUID *guid)
-{
- static char buf[50];
-
- if (!guid) return "(null)";
- sprintf(buf, "{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}",
- 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;
-}
-
static IWICBitmapDecoder *create_decoder(const void *image_data, UINT image_size)
{
HGLOBAL hmem;
diff --git a/dlls/windowscodecs/tests/tiffformat.c b/dlls/windowscodecs/tests/tiffformat.c
index f32f6a5..02fc1e0 100644
--- a/dlls/windowscodecs/tests/tiffformat.c
+++ b/dlls/windowscodecs/tests/tiffformat.c
@@ -96,18 +96,6 @@ static const struct tiff_1bpp_data
static IWICImagingFactory *factory;
-static const char *debugstr_guid(const GUID *guid)
-{
- static char buf[50];
-
- if (!guid) return "(null)";
- sprintf(buf, "{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}",
- 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;
-}
-
static IStream *create_stream(const void *data, int data_size)
{
HRESULT hr;
diff --git a/dlls/xmllite/tests/reader.c b/dlls/xmllite/tests/reader.c
index 0888a7e..2083163 100644
--- a/dlls/xmllite/tests/reader.c
+++ b/dlls/xmllite/tests/reader.c
@@ -40,17 +40,6 @@ static HRESULT (WINAPI *pCreateXmlReaderInputWithEncodingName)(IUnknown *stream,
BOOL hint,
LPCWSTR base_uri,
IXmlReaderInput **ppInput);
-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 WCHAR *a2w(const char *str)
{
diff --git a/include/wine/test.h b/include/wine/test.h
index 373fe76..d7ce8c1 100644
--- a/include/wine/test.h
+++ b/include/wine/test.h
@@ -65,6 +65,7 @@ extern void winetest_add_failures( LONG new_failures );
extern void winetest_wait_child_process( HANDLE process );
extern const char *wine_dbgstr_wn( const WCHAR *str, int n );
+extern const char *debugstr_guid( const GUID *guid );
static inline const char *wine_dbgstr_w( const WCHAR *s ) { return wine_dbgstr_wn( s, -1 ); }
/* strcmpW is available for tests compiled under Wine, but not in standalone
@@ -523,6 +524,21 @@ const char *wine_dbgstr_wn( const WCHAR *str, int n )
return res;
}
+const char *debugstr_guid( const GUID *guid )
+{
+ static char buf[50];
+
+ if (!guid)
+ return "(null)";
+
+ sprintf(buf, "{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}",
+ 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;
+}
+
/* Find a test by name */
static const struct test *find_test( const char *name )
{
--
1.8.5.2
More information about the wine-patches
mailing list