rasapi32/tests: Enable compilation with long types.

Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Eric Pouech 2022-03-04 09:24:50 +01:00 committed by Alexandre Julliard
parent 65f36a9695
commit 8c5a301deb
2 changed files with 24 additions and 25 deletions

View file

@ -1,4 +1,3 @@
EXTRADEFS = -DWINE_NO_LONG_TYPES
TESTDLL = rasapi32.dll TESTDLL = rasapi32.dll
C_SRCS = \ C_SRCS = \

View file

@ -64,9 +64,9 @@ static void test_rasenum(void)
win_skip("RasEnumDevicesA found nothing to enumerate\n"); win_skip("RasEnumDevicesA found nothing to enumerate\n");
return; return;
} }
trace("RasEnumDevicesA: returned %d buffersize %d\n", result, bufsize); trace("RasEnumDevicesA: returned %ld buffersize %ld\n", result, bufsize);
ok(result == ERROR_BUFFER_TOO_SMALL, ok(result == ERROR_BUFFER_TOO_SMALL,
"Expected ERROR_BUFFER_TOO_SMALL, got %08d\n", result); "Expected ERROR_BUFFER_TOO_SMALL, got %08ld\n", result);
rasDevInfo = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, rasDevInfo = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
max(bufsize,sizeof(RASDEVINFOA))); max(bufsize,sizeof(RASDEVINFOA)));
@ -79,99 +79,99 @@ static void test_rasenum(void)
cb = bufsize; cb = bufsize;
cDevices = 0xdeadbeef; cDevices = 0xdeadbeef;
result = pRasEnumDevicesA(NULL, &cb, &cDevices); result = pRasEnumDevicesA(NULL, &cb, &cDevices);
ok(0 < cDevices && cDevices < 32, "expected 0 < cDevices < 32, got %u\n", cDevices); ok(0 < cDevices && cDevices < 32, "expected 0 < cDevices < 32, got %lu\n", cDevices);
ok(result == ERROR_BUFFER_TOO_SMALL || ok(result == ERROR_BUFFER_TOO_SMALL ||
result == ERROR_INVALID_USER_BUFFER, /* win98 */ result == ERROR_INVALID_USER_BUFFER, /* win98 */
"Expected ERROR_BUFFER_TOO_SMALL, got %08d\n", result); "Expected ERROR_BUFFER_TOO_SMALL, got %08ld\n", result);
rasDevInfo[0].dwSize = 0; rasDevInfo[0].dwSize = 0;
cb = bufsize; cb = bufsize;
cDevices = 0xdeadbeef; cDevices = 0xdeadbeef;
result = pRasEnumDevicesA(rasDevInfo, &cb, &cDevices); result = pRasEnumDevicesA(rasDevInfo, &cb, &cDevices);
ok(cDevices == 0xdeadbeef, "expected cDevices = 0xdeadbeef, got %u\n", cDevices); ok(cDevices == 0xdeadbeef, "expected cDevices = 0xdeadbeef, got %lu\n", cDevices);
ok(result == ERROR_INVALID_SIZE || ok(result == ERROR_INVALID_SIZE ||
result == ERROR_INVALID_USER_BUFFER, /* win98 */ result == ERROR_INVALID_USER_BUFFER, /* win98 */
"Expected ERROR_INVALID_SIZE, got %08d\n", result); "Expected ERROR_INVALID_SIZE, got %08ld\n", result);
rasDevInfo[0].dwSize = sizeof(RASDEVINFOA) -1; rasDevInfo[0].dwSize = sizeof(RASDEVINFOA) -1;
cb = bufsize; cb = bufsize;
cDevices = 0xdeadbeef; cDevices = 0xdeadbeef;
result = pRasEnumDevicesA(rasDevInfo, &cb, &cDevices); result = pRasEnumDevicesA(rasDevInfo, &cb, &cDevices);
ok(cDevices == 0xdeadbeef, "expected cDevices = 0xdeadbeef, got %u\n", cDevices); ok(cDevices == 0xdeadbeef, "expected cDevices = 0xdeadbeef, got %lu\n", cDevices);
ok(result == ERROR_INVALID_SIZE || ok(result == ERROR_INVALID_SIZE ||
result == ERROR_INVALID_USER_BUFFER, /* win98 */ result == ERROR_INVALID_USER_BUFFER, /* win98 */
"Expected ERROR_INVALID_SIZE, got %08d\n", result); "Expected ERROR_INVALID_SIZE, got %08ld\n", result);
rasDevInfo[0].dwSize = sizeof(RASDEVINFOA) +1; rasDevInfo[0].dwSize = sizeof(RASDEVINFOA) +1;
cb = bufsize; cb = bufsize;
cDevices = 0xdeadbeef; cDevices = 0xdeadbeef;
result = pRasEnumDevicesA(rasDevInfo, &cb, &cDevices); result = pRasEnumDevicesA(rasDevInfo, &cb, &cDevices);
ok(cDevices == 0xdeadbeef, "expected cDevices = 0xdeadbeef, got %u\n", cDevices); ok(cDevices == 0xdeadbeef, "expected cDevices = 0xdeadbeef, got %lu\n", cDevices);
ok(result == ERROR_INVALID_SIZE || ok(result == ERROR_INVALID_SIZE ||
result == ERROR_INVALID_USER_BUFFER, /* win98 */ result == ERROR_INVALID_USER_BUFFER, /* win98 */
"Expected ERROR_INVALID_SIZE, got %08d\n", result); "Expected ERROR_INVALID_SIZE, got %08ld\n", result);
/* test second parameter */ /* test second parameter */
rasDevInfo[0].dwSize = sizeof(RASDEVINFOA); rasDevInfo[0].dwSize = sizeof(RASDEVINFOA);
cDevices = 0xdeadbeef; cDevices = 0xdeadbeef;
result = pRasEnumDevicesA(rasDevInfo, NULL, &cDevices); result = pRasEnumDevicesA(rasDevInfo, NULL, &cDevices);
ok(cDevices == 0xdeadbeef, "expected cDevices = 0xdeadbeef, got %u\n", cDevices); ok(cDevices == 0xdeadbeef, "expected cDevices = 0xdeadbeef, got %lu\n", cDevices);
ok(result == ERROR_INVALID_PARAMETER, ok(result == ERROR_INVALID_PARAMETER,
"Expected ERROR_INVALID_PARAMETER, got %08d\n", result); "Expected ERROR_INVALID_PARAMETER, got %08ld\n", result);
rasDevInfo[0].dwSize = sizeof(RASDEVINFOA); rasDevInfo[0].dwSize = sizeof(RASDEVINFOA);
cb = 0; cb = 0;
cDevices = 0xdeadbeef; cDevices = 0xdeadbeef;
result = pRasEnumDevicesA(rasDevInfo, &cb, &cDevices); result = pRasEnumDevicesA(rasDevInfo, &cb, &cDevices);
todo_wine todo_wine
ok(cDevices == 0xdeadbeef, "expected cDevices = 0xdeadbeef, got %u\n", cDevices); ok(cDevices == 0xdeadbeef, "expected cDevices = 0xdeadbeef, got %lu\n", cDevices);
ok(result == ERROR_BUFFER_TOO_SMALL || ok(result == ERROR_BUFFER_TOO_SMALL ||
result == ERROR_INVALID_SIZE, /* vista, 2k8 */ result == ERROR_INVALID_SIZE, /* vista, 2k8 */
"Expected ERROR_BUFFER_TOO_SMALL/ERROR_INVALID_SIZE, got %08d\n", result); "Expected ERROR_BUFFER_TOO_SMALL/ERROR_INVALID_SIZE, got %08ld\n", result);
rasDevInfo[0].dwSize = sizeof(RASDEVINFOA); rasDevInfo[0].dwSize = sizeof(RASDEVINFOA);
cb = bufsize -1; cb = bufsize -1;
cDevices = 0xdeadbeef; cDevices = 0xdeadbeef;
result = pRasEnumDevicesA(rasDevInfo, &cb, &cDevices); result = pRasEnumDevicesA(rasDevInfo, &cb, &cDevices);
ok(0 < cDevices && cDevices < 32, "expected 0 < cDevices < 32, got %u\n", cDevices); ok(0 < cDevices && cDevices < 32, "expected 0 < cDevices < 32, got %lu\n", cDevices);
ok(result == ERROR_BUFFER_TOO_SMALL, ok(result == ERROR_BUFFER_TOO_SMALL,
"Expected ERROR_BUFFER_TOO_SMALL, got %08d\n", result); "Expected ERROR_BUFFER_TOO_SMALL, got %08ld\n", result);
rasDevInfo[0].dwSize = sizeof(RASDEVINFOA); rasDevInfo[0].dwSize = sizeof(RASDEVINFOA);
cb = bufsize +1; cb = bufsize +1;
cDevices = 0xdeadbeef; cDevices = 0xdeadbeef;
result = pRasEnumDevicesA(rasDevInfo, &cb, &cDevices); result = pRasEnumDevicesA(rasDevInfo, &cb, &cDevices);
ok(0 < cDevices && cDevices < 32, "expected 0 < cDevices < 32, got %u\n", cDevices); ok(0 < cDevices && cDevices < 32, "expected 0 < cDevices < 32, got %lu\n", cDevices);
ok(result == ERROR_SUCCESS, ok(result == ERROR_SUCCESS,
"Expected ERROR_SUCCESS, got %08d\n", result); "Expected ERROR_SUCCESS, got %08ld\n", result);
/* test third parameter */ /* test third parameter */
rasDevInfo[0].dwSize = sizeof(RASDEVINFOA); rasDevInfo[0].dwSize = sizeof(RASDEVINFOA);
cb = bufsize; cb = bufsize;
result = pRasEnumDevicesA(rasDevInfo, &cb, NULL); result = pRasEnumDevicesA(rasDevInfo, &cb, NULL);
ok(result == ERROR_INVALID_PARAMETER, ok(result == ERROR_INVALID_PARAMETER,
"Expected ERROR_INVALID_PARAMETER, got %08d\n", result); "Expected ERROR_INVALID_PARAMETER, got %08ld\n", result);
/* test combinations of invalid parameters */ /* test combinations of invalid parameters */
cDevices = 0xdeadbeef; cDevices = 0xdeadbeef;
result = pRasEnumDevicesA(NULL, NULL, &cDevices); result = pRasEnumDevicesA(NULL, NULL, &cDevices);
ok(cDevices == 0xdeadbeef, "expected cDevices = 0xdeadbeef, got %u\n", cDevices); ok(cDevices == 0xdeadbeef, "expected cDevices = 0xdeadbeef, got %lu\n", cDevices);
ok(result == ERROR_INVALID_PARAMETER, ok(result == ERROR_INVALID_PARAMETER,
"Expected ERROR_INVALID_PARAMETER, got %08d\n", result); "Expected ERROR_INVALID_PARAMETER, got %08ld\n", result);
result = pRasEnumDevicesA(NULL, &cb, NULL); result = pRasEnumDevicesA(NULL, &cb, NULL);
ok(result == ERROR_INVALID_PARAMETER || ok(result == ERROR_INVALID_PARAMETER ||
result == ERROR_INVALID_USER_BUFFER, /* win98 */ result == ERROR_INVALID_USER_BUFFER, /* win98 */
"Expected ERROR_INVALID_PARAMETER, got %08d\n", result); "Expected ERROR_INVALID_PARAMETER, got %08ld\n", result);
cb = 0; cb = 0;
rasDevInfo[0].dwSize = 0; rasDevInfo[0].dwSize = 0;
cDevices = 0xdeadbeef; cDevices = 0xdeadbeef;
result = pRasEnumDevicesA(rasDevInfo, &cb, &cDevices); result = pRasEnumDevicesA(rasDevInfo, &cb, &cDevices);
ok(cDevices == 0xdeadbeef, "expected cDevices = 0xdeadbeef, got %u\n", cDevices); ok(cDevices == 0xdeadbeef, "expected cDevices = 0xdeadbeef, got %lu\n", cDevices);
ok(result == ERROR_INVALID_SIZE || ok(result == ERROR_INVALID_SIZE ||
broken(result == ERROR_BUFFER_TOO_SMALL), /* win98 */ broken(result == ERROR_BUFFER_TOO_SMALL), /* win98 */
"Expected ERROR_INVALID_SIZE, got %08d\n", result); "Expected ERROR_INVALID_SIZE, got %08ld\n", result);
HeapFree(GetProcessHeap(), 0, rasDevInfo); HeapFree(GetProcessHeap(), 0, rasDevInfo);
} }