Commit e017d9bc authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

dpnet/tests: Skip tests if dpnet is a stub dll.

parent a24b8b2b
TESTDLL = dpnet.dll
IMPORTS = dxguid uuid dpnet ole32
IMPORTS = dxguid uuid dpnet ole32 version
C_SRCS = \
address.c \
......
......@@ -353,10 +353,44 @@ static void address_duplicate(void)
}
}
/* taken from programs/winetest/main.c */
static BOOL is_stub_dll(const char *filename)
{
DWORD size, ver;
BOOL isstub = FALSE;
char *p, *data;
size = GetFileVersionInfoSizeA(filename, &ver);
if (!size) return FALSE;
data = HeapAlloc(GetProcessHeap(), 0, size);
if (!data) return FALSE;
if (GetFileVersionInfoA(filename, ver, size, data))
{
char buf[256];
sprintf(buf, "\\StringFileInfo\\%04x%04x\\OriginalFilename", MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), 1200);
if (VerQueryValueA(data, buf, (void**)&p, &size))
isstub = !lstrcmpiA("wcodstub.dll", p);
}
HeapFree(GetProcessHeap(), 0, data);
return isstub;
}
START_TEST(address)
{
HRESULT hr;
if (!winetest_interactive &&
(is_stub_dll("c:\\windows\\system32\\dpnet.dll") ||
is_stub_dll("c:\\windows\\syswow64\\dpnet.dll")))
{
win_skip("dpnet is a stub dll, skipping tests\n");
return;
}
hr = CoInitialize(0);
ok(hr == S_OK, "failed to init com\n");
if(hr != S_OK)
......
......@@ -606,8 +606,42 @@ static void test_cleanup_dp_peer(void)
CoUninitialize();
}
/* taken from programs/winetest/main.c */
static BOOL is_stub_dll(const char *filename)
{
DWORD size, ver;
BOOL isstub = FALSE;
char *p, *data;
size = GetFileVersionInfoSizeA(filename, &ver);
if (!size) return FALSE;
data = HeapAlloc(GetProcessHeap(), 0, size);
if (!data) return FALSE;
if (GetFileVersionInfoA(filename, ver, size, data))
{
char buf[256];
sprintf(buf, "\\StringFileInfo\\%04x%04x\\OriginalFilename", MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), 1200);
if (VerQueryValueA(data, buf, (void**)&p, &size))
isstub = !lstrcmpiA("wcodstub.dll", p);
}
HeapFree(GetProcessHeap(), 0, data);
return isstub;
}
START_TEST(client)
{
if (!winetest_interactive &&
(is_stub_dll("c:\\windows\\system32\\dpnet.dll") ||
is_stub_dll("c:\\windows\\syswow64\\dpnet.dll")))
{
win_skip("dpnet is a stub dll, skipping tests\n");
return;
}
if(!test_init_dp())
return;
......
......@@ -180,10 +180,44 @@ static void test_server_info(void)
}
}
/* taken from programs/winetest/main.c */
static BOOL is_stub_dll(const char *filename)
{
DWORD size, ver;
BOOL isstub = FALSE;
char *p, *data;
size = GetFileVersionInfoSizeA(filename, &ver);
if (!size) return FALSE;
data = HeapAlloc(GetProcessHeap(), 0, size);
if (!data) return FALSE;
if (GetFileVersionInfoA(filename, ver, size, data))
{
char buf[256];
sprintf(buf, "\\StringFileInfo\\%04x%04x\\OriginalFilename", MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), 1200);
if (VerQueryValueA(data, buf, (void**)&p, &size))
isstub = !lstrcmpiA("wcodstub.dll", p);
}
HeapFree(GetProcessHeap(), 0, data);
return isstub;
}
START_TEST(server)
{
HRESULT hr;
if (!winetest_interactive &&
(is_stub_dll("c:\\windows\\system32\\dpnet.dll") ||
is_stub_dll("c:\\windows\\syswow64\\dpnet.dll")))
{
win_skip("dpnet is a stub dll, skipping tests\n");
return;
}
hr = CoInitialize(0);
ok( hr == S_OK, "failed to init com\n");
if (hr != S_OK)
......
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