[IPHLPAPI_WINETEST]

sync iphlpapi_winetest to wine 1.1.39

svn path=/trunk/; revision=45841
This commit is contained in:
Christoph von Wittich 2010-03-04 20:55:41 +00:00
parent a327cb39e8
commit f793b1390f

View file

@ -775,11 +775,12 @@ GetBestRoute
IpReleaseAddress IpReleaseAddress
IpRenewAddress IpRenewAddress
*/ */
static void testWin98Functions(void) static DWORD CALLBACK testWin98Functions(void *p)
{ {
testGetInterfaceInfo(); testGetInterfaceInfo();
testGetAdaptersInfo(); testGetAdaptersInfo();
testGetNetworkParams(); testGetNetworkParams();
return 0;
} }
static void testGetPerAdapterInfo(void) static void testGetPerAdapterInfo(void)
@ -839,6 +840,7 @@ static void test_GetAdaptersAddresses(void)
ret = gGetAdaptersAddresses(AF_UNSPEC, 0, NULL, NULL, NULL); ret = gGetAdaptersAddresses(AF_UNSPEC, 0, NULL, NULL, NULL);
ok(ret == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER got %u\n", ret); ok(ret == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER got %u\n", ret);
size = 0;
ret = gGetAdaptersAddresses(AF_UNSPEC, 0, NULL, NULL, &size); ret = gGetAdaptersAddresses(AF_UNSPEC, 0, NULL, NULL, &size);
ok(ret == ERROR_BUFFER_OVERFLOW, "expected ERROR_BUFFER_OVERFLOW, got %u\n", ret); ok(ret == ERROR_BUFFER_OVERFLOW, "expected ERROR_BUFFER_OVERFLOW, got %u\n", ret);
if (ret != ERROR_BUFFER_OVERFLOW) return; if (ret != ERROR_BUFFER_OVERFLOW) return;
@ -849,16 +851,16 @@ static void test_GetAdaptersAddresses(void)
while (!ret && winetest_debug > 1 && aa) while (!ret && winetest_debug > 1 && aa)
{ {
trace("Length: %u\n", aa->Length); trace("Length: %u\n", S(U(*aa)).Length);
trace("IfIndex: %u\n", aa->IfIndex); trace("IfIndex: %u\n", S(U(*aa)).IfIndex);
trace("Next: %p\n", aa->Next); trace("Next: %p\n", aa->Next);
trace("AdapterName: %s\n", aa->AdapterName); trace("AdapterName: %s\n", aa->AdapterName);
trace("FirstUnicastAddress: %p\n", aa->FirstUnicastAddress); trace("FirstUnicastAddress: %p\n", aa->FirstUnicastAddress);
ua = aa->FirstUnicastAddress; ua = aa->FirstUnicastAddress;
while (ua) while (ua)
{ {
trace("\tLength: %u\n", ua->Length); trace("\tLength: %u\n", S(U(*ua)).Length);
trace("\tFlags: 0x%08x\n", ua->Flags); trace("\tFlags: 0x%08x\n", S(U(*ua)).Flags);
trace("\tNext: %p\n", ua->Next); trace("\tNext: %p\n", ua->Next);
trace("\tAddress.lpSockaddr: %p\n", ua->Address.lpSockaddr); trace("\tAddress.lpSockaddr: %p\n", ua->Address.lpSockaddr);
trace("\tAddress.iSockaddrLength: %d\n", ua->Address.iSockaddrLength); trace("\tAddress.iSockaddrLength: %d\n", ua->Address.iSockaddrLength);
@ -894,9 +896,16 @@ START_TEST(iphlpapi)
loadIPHlpApi(); loadIPHlpApi();
if (hLibrary) { if (hLibrary) {
HANDLE thread;
testWin98OnlyFunctions(); testWin98OnlyFunctions();
testWinNT4Functions(); testWinNT4Functions();
testWin98Functions();
/* run testGetXXXX in two threads at once to make sure we don't crash in that case */
thread = CreateThread(NULL, 0, testWin98Functions, NULL, 0, NULL);
testWin98Functions(NULL);
WaitForSingleObject(thread, INFINITE);
testWin2KFunctions(); testWin2KFunctions();
test_GetAdaptersAddresses(); test_GetAdaptersAddresses();
freeIPHlpApi(); freeIPHlpApi();