Commit 63cf3447 authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

wlanapi/tests: Enable compilation with long types.

parent 446bb1eb
EXTRADEFS = -DWINE_NO_LONG_TYPES
TESTDLL = wlanapi.dll TESTDLL = wlanapi.dll
IMPORTS = wlanapi IMPORTS = wlanapi
......
...@@ -35,73 +35,73 @@ static void test_WlanOpenHandle(void) ...@@ -35,73 +35,73 @@ static void test_WlanOpenHandle(void)
is_xp = ret == ERROR_SUCCESS; is_xp = ret == ERROR_SUCCESS;
if (!is_xp) /* the results in XP differ completely from all other versions */ if (!is_xp) /* the results in XP differ completely from all other versions */
{ {
ok(ret == ERROR_NOT_SUPPORTED, "Expected 50, got %d\n", ret); ok(ret == ERROR_NOT_SUPPORTED, "Expected 50, got %ld\n", ret);
ok(neg_version == 0xdeadbeef, "neg_version changed\n"); ok(neg_version == 0xdeadbeef, "neg_version changed\n");
ok(handle == bad_handle, "handle changed\n"); ok(handle == bad_handle, "handle changed\n");
ret = WlanOpenHandle(10, NULL, &neg_version, &handle); ret = WlanOpenHandle(10, NULL, &neg_version, &handle);
ok(ret == ERROR_NOT_SUPPORTED, "Expected 50, got %d\n", ret); ok(ret == ERROR_NOT_SUPPORTED, "Expected 50, got %ld\n", ret);
ok(neg_version == 0xdeadbeef, "neg_version changed\n"); ok(neg_version == 0xdeadbeef, "neg_version changed\n");
ok(handle == bad_handle, "handle changed\n"); ok(handle == bad_handle, "handle changed\n");
/* reserved parameter must not be used */ /* reserved parameter must not be used */
ret = WlanOpenHandle(1, &reserved, &neg_version, &handle); ret = WlanOpenHandle(1, &reserved, &neg_version, &handle);
ok(ret == ERROR_INVALID_PARAMETER, "Expected 87, got %d\n", ret); ok(ret == ERROR_INVALID_PARAMETER, "Expected 87, got %ld\n", ret);
ok(neg_version == 0xdeadbeef, "neg_version changed\n"); ok(neg_version == 0xdeadbeef, "neg_version changed\n");
ok(handle == bad_handle, "handle changed\n"); ok(handle == bad_handle, "handle changed\n");
/* invalid parameters */ /* invalid parameters */
ret = WlanOpenHandle(1, NULL, NULL, &handle); ret = WlanOpenHandle(1, NULL, NULL, &handle);
ok(ret == ERROR_INVALID_PARAMETER, "Expected 87, got %d\n", ret); ok(ret == ERROR_INVALID_PARAMETER, "Expected 87, got %ld\n", ret);
ok(handle == bad_handle, "bad handle\n"); ok(handle == bad_handle, "bad handle\n");
ret = WlanOpenHandle(1, NULL, &neg_version, NULL); ret = WlanOpenHandle(1, NULL, &neg_version, NULL);
ok(ret == ERROR_INVALID_PARAMETER, "Expected 87, got %d\n", ret); ok(ret == ERROR_INVALID_PARAMETER, "Expected 87, got %ld\n", ret);
ok(neg_version == 0xdeadbeef, "neg_version changed\n"); ok(neg_version == 0xdeadbeef, "neg_version changed\n");
} }
else else
{ {
ok(neg_version == 1, "Expected 1, got %d\n", neg_version); ok(neg_version == 1, "Expected 1, got %ld\n", neg_version);
ok(handle != bad_handle && handle, "handle changed\n"); ok(handle != bad_handle && handle, "handle changed\n");
ret = WlanCloseHandle(handle, NULL); ret = WlanCloseHandle(handle, NULL);
ok(ret == 0, "Expected 0, got %d\n", ret); ok(ret == 0, "Expected 0, got %ld\n", ret);
} }
/* good tests */ /* good tests */
ret = WlanOpenHandle(1, NULL, &neg_version, &handle); ret = WlanOpenHandle(1, NULL, &neg_version, &handle);
ok(ret == ERROR_SUCCESS, "Expected 0, got %d\n", ret); ok(ret == ERROR_SUCCESS, "Expected 0, got %ld\n", ret);
ok(neg_version == 1, "Expected 1, got %d\n", neg_version); ok(neg_version == 1, "Expected 1, got %ld\n", neg_version);
ok(handle != bad_handle && handle, "handle changed\n"); ok(handle != bad_handle && handle, "handle changed\n");
ret = WlanCloseHandle(handle, NULL); ret = WlanCloseHandle(handle, NULL);
ok(ret == 0, "Expected 0, got %d\n", ret); ok(ret == 0, "Expected 0, got %ld\n", ret);
ret = WlanOpenHandle(2, NULL, &neg_version, &handle); ret = WlanOpenHandle(2, NULL, &neg_version, &handle);
ok(ret == ERROR_SUCCESS, "Expected 0, got %d\n", ret); ok(ret == ERROR_SUCCESS, "Expected 0, got %ld\n", ret);
if (!is_xp) /* XP does not support client version 2 */ if (!is_xp) /* XP does not support client version 2 */
ok(neg_version == 2, "Expected 2, got %d\n", neg_version); ok(neg_version == 2, "Expected 2, got %ld\n", neg_version);
else else
ok(neg_version == 1, "Expected 1, got %d\n", neg_version); ok(neg_version == 1, "Expected 1, got %ld\n", neg_version);
ok(handle != bad_handle && handle, "bad handle\n"); ok(handle != bad_handle && handle, "bad handle\n");
ret = WlanCloseHandle(handle, NULL); ret = WlanCloseHandle(handle, NULL);
ok(ret == 0, "Expected 0, got %d\n", ret); ok(ret == 0, "Expected 0, got %ld\n", ret);
/* open twice */ /* open twice */
ret = WlanOpenHandle(1, NULL, &neg_version, &handle); ret = WlanOpenHandle(1, NULL, &neg_version, &handle);
ok(ret == ERROR_SUCCESS, "Expected 0, got %d\n", ret); ok(ret == ERROR_SUCCESS, "Expected 0, got %ld\n", ret);
ret = WlanOpenHandle(1, NULL, &neg_version, &handle2); ret = WlanOpenHandle(1, NULL, &neg_version, &handle2);
ok(ret == ERROR_SUCCESS, "Expected 0, got %d\n", ret); ok(ret == ERROR_SUCCESS, "Expected 0, got %ld\n", ret);
ret = WlanCloseHandle(handle, &reserved); ret = WlanCloseHandle(handle, &reserved);
ok(ret == ERROR_INVALID_PARAMETER, "Expected 87, got %d\n", ret); ok(ret == ERROR_INVALID_PARAMETER, "Expected 87, got %ld\n", ret);
ret = WlanCloseHandle(handle, NULL); ret = WlanCloseHandle(handle, NULL);
ok(ret == ERROR_SUCCESS, "Expected 0, got %d\n", ret); ok(ret == ERROR_SUCCESS, "Expected 0, got %ld\n", ret);
ret = WlanCloseHandle(handle2, NULL); ret = WlanCloseHandle(handle2, NULL);
ok(ret == ERROR_SUCCESS, "Expected 0, got %d\n", ret); ok(ret == ERROR_SUCCESS, "Expected 0, got %ld\n", ret);
ret = WlanCloseHandle(bad_handle, NULL); ret = WlanCloseHandle(bad_handle, NULL);
ok(ret == ERROR_INVALID_HANDLE, "Expected 6, got %d\n", ret); ok(ret == ERROR_INVALID_HANDLE, "Expected 6, got %ld\n", ret);
ret = WlanCloseHandle(NULL, NULL); ret = WlanCloseHandle(NULL, NULL);
ok(ret == ERROR_INVALID_PARAMETER, "Expected 87, got %d\n", ret); ok(ret == ERROR_INVALID_PARAMETER, "Expected 87, got %ld\n", ret);
} }
static void test_WlanAllocateFreeMemory(void) static void test_WlanAllocateFreeMemory(void)
...@@ -111,7 +111,7 @@ static void test_WlanAllocateFreeMemory(void) ...@@ -111,7 +111,7 @@ static void test_WlanAllocateFreeMemory(void)
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ptr = WlanAllocateMemory(0); ptr = WlanAllocateMemory(0);
ok(ptr == NULL, "Expected NULL, got %p\n", ptr); ok(ptr == NULL, "Expected NULL, got %p\n", ptr);
ok(GetLastError() == ERROR_INVALID_PARAMETER, "Expected 87, got %d\n", GetLastError()); ok(GetLastError() == ERROR_INVALID_PARAMETER, "Expected 87, got %ld\n", GetLastError());
ptr = WlanAllocateMemory(1024); ptr = WlanAllocateMemory(1024);
ok(ptr != NULL, "Expected non-NULL\n"); ok(ptr != NULL, "Expected non-NULL\n");
...@@ -130,23 +130,23 @@ static void test_WlanEnumInterfaces(void) ...@@ -130,23 +130,23 @@ static void test_WlanEnumInterfaces(void)
WLAN_INTERFACE_INFO *info; WLAN_INTERFACE_INFO *info;
ret = WlanOpenHandle(1, NULL, &neg_version, &handle); ret = WlanOpenHandle(1, NULL, &neg_version, &handle);
ok(ret == 0, "Expected 0, got %d\n", ret); ok(ret == 0, "Expected 0, got %ld\n", ret);
/* invalid parameters */ /* invalid parameters */
ret = WlanEnumInterfaces(NULL, NULL, &list); ret = WlanEnumInterfaces(NULL, NULL, &list);
ok(ret == ERROR_INVALID_PARAMETER, "Expected 87, got %d\n", ret); ok(ret == ERROR_INVALID_PARAMETER, "Expected 87, got %ld\n", ret);
ok(list == bad_list, "list changed\n"); ok(list == bad_list, "list changed\n");
ret = WlanEnumInterfaces(handle, &reserved, &list); ret = WlanEnumInterfaces(handle, &reserved, &list);
ok(ret == ERROR_INVALID_PARAMETER, "Expected 87, got %d\n", ret); ok(ret == ERROR_INVALID_PARAMETER, "Expected 87, got %ld\n", ret);
ok(list == bad_list, "list changed\n"); ok(list == bad_list, "list changed\n");
ret = WlanEnumInterfaces(handle, NULL, NULL); ret = WlanEnumInterfaces(handle, NULL, NULL);
ok(ret == ERROR_INVALID_PARAMETER, "Expected 87, got %d\n", ret); ok(ret == ERROR_INVALID_PARAMETER, "Expected 87, got %ld\n", ret);
ok(list == bad_list, "list changed\n"); ok(list == bad_list, "list changed\n");
/* good tests */ /* good tests */
list = NULL; list = NULL;
ret = WlanEnumInterfaces(handle, NULL, &list); ret = WlanEnumInterfaces(handle, NULL, &list);
ok(ret == ERROR_SUCCESS, "Expected 0, got %d\n", ret); ok(ret == ERROR_SUCCESS, "Expected 0, got %ld\n", ret);
ok(list != NULL, "bad interface list\n"); ok(list != NULL, "bad interface list\n");
if (!list || !list->dwNumberOfItems) if (!list || !list->dwNumberOfItems)
{ {
...@@ -156,11 +156,11 @@ static void test_WlanEnumInterfaces(void) ...@@ -156,11 +156,11 @@ static void test_WlanEnumInterfaces(void)
return; return;
} }
trace("Wireless interfaces: %d\n", list->dwNumberOfItems); trace("Wireless interfaces: %ld\n", list->dwNumberOfItems);
for (i = 0; i < list->dwNumberOfItems;i ++) for (i = 0; i < list->dwNumberOfItems;i ++)
{ {
info = &list->InterfaceInfo[i]; info = &list->InterfaceInfo[i];
trace(" Index[%d] GUID: %s\n", i, wine_dbgstr_guid(&info->InterfaceGuid)); trace(" Index[%ld] GUID: %s\n", i, wine_dbgstr_guid(&info->InterfaceGuid));
switch (info->isState) switch (info->isState)
{ {
case wlan_interface_state_disconnected: case wlan_interface_state_disconnected:
...@@ -179,7 +179,7 @@ static void test_WlanEnumInterfaces(void) ...@@ -179,7 +179,7 @@ static void test_WlanEnumInterfaces(void)
WlanFreeMemory(list); WlanFreeMemory(list);
ret = WlanCloseHandle(handle, NULL); ret = WlanCloseHandle(handle, NULL);
ok(ret == 0, "Expected 0, got %d\n", ret); ok(ret == 0, "Expected 0, got %ld\n", ret);
} }
START_TEST(wlanapi) START_TEST(wlanapi)
......
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