Commit c0096afd authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

kernelbase/tests: Enable compilation with long types.

parent 510542bd
EXTRADEFS = -DWINE_NO_LONG_TYPES
TESTDLL = kernelbase.dll
C_SRCS = \
......
......@@ -44,46 +44,46 @@ static void test_CompareObjectHandles(void)
}
ret = pCompareObjectHandles( GetCurrentProcess(), GetCurrentProcess() );
ok( ret, "comparing GetCurrentProcess() to self failed with %u\n", GetLastError() );
ok( ret, "comparing GetCurrentProcess() to self failed with %lu\n", GetLastError() );
ret = pCompareObjectHandles( GetCurrentThread(), GetCurrentThread() );
ok( ret, "comparing GetCurrentThread() to self failed with %u\n", GetLastError() );
ok( ret, "comparing GetCurrentThread() to self failed with %lu\n", GetLastError() );
SetLastError(0);
ret = pCompareObjectHandles( GetCurrentProcess(), GetCurrentThread() );
ok( !ret && GetLastError() == ERROR_NOT_SAME_OBJECT,
"comparing GetCurrentProcess() to GetCurrentThread() returned %u\n", GetLastError() );
"comparing GetCurrentProcess() to GetCurrentThread() returned %lu\n", GetLastError() );
h1 = NULL;
ret = DuplicateHandle( GetCurrentProcess(), GetCurrentProcess(), GetCurrentProcess(),
&h1, 0, FALSE, DUPLICATE_SAME_ACCESS );
ok( ret, "failed to duplicate current process handle: %u\n", GetLastError() );
ok( ret, "failed to duplicate current process handle: %lu\n", GetLastError() );
ret = pCompareObjectHandles( GetCurrentProcess(), h1 );
ok( ret, "comparing GetCurrentProcess() with %p failed with %u\n", h1, GetLastError() );
ok( ret, "comparing GetCurrentProcess() with %p failed with %lu\n", h1, GetLastError() );
CloseHandle( h1 );
h1 = CreateFileA( "\\\\.\\NUL", GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, 0 );
ok( h1 != INVALID_HANDLE_VALUE, "CreateFile failed (%d)\n", GetLastError() );
ok( h1 != INVALID_HANDLE_VALUE, "CreateFile failed (%ld)\n", GetLastError() );
h2 = NULL;
ret = DuplicateHandle( GetCurrentProcess(), h1, GetCurrentProcess(),
&h2, 0, FALSE, DUPLICATE_SAME_ACCESS );
ok( ret, "failed to duplicate handle %p: %u\n", h1, GetLastError() );
ok( ret, "failed to duplicate handle %p: %lu\n", h1, GetLastError() );
ret = pCompareObjectHandles( h1, h2 );
ok( ret, "comparing %p with %p failed with %u\n", h1, h2, GetLastError() );
ok( ret, "comparing %p with %p failed with %lu\n", h1, h2, GetLastError() );
CloseHandle( h2 );
h2 = CreateFileA( "\\\\.\\NUL", GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, 0 );
ok( h2 != INVALID_HANDLE_VALUE, "CreateFile failed (%d)\n", GetLastError() );
ok( h2 != INVALID_HANDLE_VALUE, "CreateFile failed (%ld)\n", GetLastError() );
SetLastError(0);
ret = pCompareObjectHandles( h1, h2 );
ok( !ret && GetLastError() == ERROR_NOT_SAME_OBJECT,
"comparing %p with %p returned %u\n", h1, h2, GetLastError() );
"comparing %p with %p returned %lu\n", h1, h2, GetLastError() );
CloseHandle( h2 );
CloseHandle( h1 );
......
......@@ -48,7 +48,7 @@ static DWORD WINAPI test_WaitOnAddress_func(void *arg)
ret = pWaitOnAddress(&address, &compare, sizeof(compare), INFINITE);
ok(ret, "wait failed\n");
ok(GetLastError() == 0xdeadbeef || broken(GetLastError() == ERROR_SUCCESS) /* Win 8 */,
"got error %d\n", GetLastError());
"got error %ld\n", GetLastError());
}
} while (InterlockedCompareExchange(&address, compare - 1, compare) != compare);
......@@ -81,17 +81,17 @@ static void test_WaitOnAddress(void)
SetLastError(0xdeadbeef);
pWakeByAddressSingle(NULL);
gle = GetLastError();
ok(gle == 0xdeadbeef, "got %d\n", gle);
ok(gle == 0xdeadbeef, "got %ld\n", gle);
SetLastError(0xdeadbeef);
pWakeByAddressAll(NULL);
gle = GetLastError();
ok(gle == 0xdeadbeef, "got %d\n", gle);
ok(gle == 0xdeadbeef, "got %ld\n", gle);
SetLastError(0xdeadbeef);
ret = pWaitOnAddress(NULL, NULL, 0, 0);
gle = GetLastError();
ok(gle == ERROR_INVALID_PARAMETER, "got %d\n", gle);
ok(gle == ERROR_INVALID_PARAMETER, "got %ld\n", gle);
ok(!ret, "got %d\n", ret);
address = 0;
......@@ -99,7 +99,7 @@ static void test_WaitOnAddress(void)
SetLastError(0xdeadbeef);
ret = pWaitOnAddress(&address, &compare, 5, 0);
gle = GetLastError();
ok(gle == ERROR_INVALID_PARAMETER, "got %d\n", gle);
ok(gle == ERROR_INVALID_PARAMETER, "got %ld\n", gle);
ok(!ret, "got %d\n", ret);
ok(address == 0, "got %s\n", wine_dbgstr_longlong(address));
ok(compare == 0, "got %s\n", wine_dbgstr_longlong(compare));
......@@ -109,13 +109,13 @@ static void test_WaitOnAddress(void)
SetLastError(0xdeadbeef);
pWakeByAddressSingle(&address);
gle = GetLastError();
ok(gle == 0xdeadbeef, "got %d\n", gle);
ok(gle == 0xdeadbeef, "got %ld\n", gle);
ok(address == 0, "got %s\n", wine_dbgstr_longlong(address));
SetLastError(0xdeadbeef);
pWakeByAddressAll(&address);
gle = GetLastError();
ok(gle == 0xdeadbeef, "got %d\n", gle);
ok(gle == 0xdeadbeef, "got %ld\n", gle);
ok(address == 0, "got %s\n", wine_dbgstr_longlong(address));
/* different address size */
......@@ -124,13 +124,13 @@ static void test_WaitOnAddress(void)
SetLastError(0xdeadbeef);
ret = pWaitOnAddress(&address, &compare, 2, 0);
gle = GetLastError();
ok(gle == 0xdeadbeef || broken(gle == ERROR_SUCCESS) /* Win 8 */, "got %d\n", gle);
ok(gle == 0xdeadbeef || broken(gle == ERROR_SUCCESS) /* Win 8 */, "got %ld\n", gle);
ok(ret, "got %d\n", ret);
SetLastError(0xdeadbeef);
ret = pWaitOnAddress(&address, &compare, 1, 0);
gle = GetLastError();
ok(gle == ERROR_TIMEOUT, "got %d\n", gle);
ok(gle == ERROR_TIMEOUT, "got %ld\n", gle);
ok(!ret, "got %d\n", ret);
/* simple wait case */
......@@ -139,7 +139,7 @@ static void test_WaitOnAddress(void)
SetLastError(0xdeadbeef);
ret = pWaitOnAddress(&address, &compare, 4, 0);
gle = GetLastError();
ok(gle == 0xdeadbeef || broken(gle == ERROR_SUCCESS) /* Win 8 */, "got %d\n", gle);
ok(gle == 0xdeadbeef || broken(gle == ERROR_SUCCESS) /* Win 8 */, "got %ld\n", gle);
ok(ret, "got %d\n", ret);
/* WakeByAddressAll */
......@@ -151,7 +151,7 @@ static void test_WaitOnAddress(void)
address = ARRAY_SIZE(threads);
pWakeByAddressAll(&address);
val = WaitForMultipleObjects(ARRAY_SIZE(threads), threads, TRUE, 5000);
ok(val == WAIT_OBJECT_0, "got %d\n", val);
ok(val == WAIT_OBJECT_0, "got %ld\n", val);
for (i = 0; i < ARRAY_SIZE(threads); i++)
CloseHandle(threads[i]);
ok(!address, "got unexpected value %s\n", wine_dbgstr_longlong(address));
......@@ -168,7 +168,7 @@ static void test_WaitOnAddress(void)
{
pWakeByAddressSingle(&address);
val = WaitForMultipleObjects(nthreads, threads, FALSE, 2000);
ok(val < WAIT_OBJECT_0 + nthreads, "got %u\n", val);
ok(val < WAIT_OBJECT_0 + nthreads, "got %lu\n", val);
CloseHandle(threads[val]);
memmove(&threads[val], &threads[val+1], (nthreads - val - 1) * sizeof(threads[0]));
nthreads--;
......@@ -195,7 +195,7 @@ static void test_Sleep(void)
/* Get the timer resolution before... */
r1 = 156250;
status = NtQueryTimerResolution(&dummy, &dummy, &r1);
ok(status == STATUS_SUCCESS, "NtQueryTimerResolution() failed (%x)\n", status);
ok(status == STATUS_SUCCESS, "NtQueryTimerResolution() failed (%lx)\n", status);
for (i = 0; i < 50; i++) {
Sleep(1);
......@@ -207,7 +207,7 @@ static void test_Sleep(void)
/* ...and after in case some other process changes it during this test */
r2 = 156250;
status = NtQueryTimerResolution(&dummy, &dummy, &r2);
ok(status == STATUS_SUCCESS, "NtQueryTimerResolution() failed (%x)\n", status);
ok(status == STATUS_SUCCESS, "NtQueryTimerResolution() failed (%lx)\n", status);
elapsed_time = (t2.QuadPart - t1.QuadPart) / (double)frequency.QuadPart;
min = 50.0 * (r1 < r2 ? r1 : r2) / 10000000.0;
......
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