Commit 066dba13 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

ucrtbase/tests: Build without -DWINE_NO_LONG_TYPES.

parent d81afa52
TESTDLL = ucrtbase.dll TESTDLL = ucrtbase.dll
IMPORTS = ucrtbase IMPORTS = ucrtbase
EXTRADEFS = -DWINE_NO_LONG_TYPES -fno-builtin EXTRADEFS = -fno-builtin
SOURCES = \ SOURCES = \
cpp.c \ cpp.c \
......
...@@ -1168,17 +1168,17 @@ static void test_exit(const char *argv0) ...@@ -1168,17 +1168,17 @@ static void test_exit(const char *argv0)
ret = WaitForSingleObject(proc.hProcess, INFINITE); ret = WaitForSingleObject(proc.hProcess, INFINITE);
ok(ret == WAIT_OBJECT_0, "child process wait failed\n"); ok(ret == WAIT_OBJECT_0, "child process wait failed\n");
GetExitCodeProcess(proc.hProcess, &ret); GetExitCodeProcess(proc.hProcess, &ret);
ok(ret == 1, "child process exited with code %d\n", ret); ok(ret == 1, "child process exited with code %ld\n", ret);
CloseHandle(proc.hProcess); CloseHandle(proc.hProcess);
CloseHandle(proc.hThread); CloseHandle(proc.hThread);
ok(!*failures, "%d tests failed in child process\n", *failures); ok(!*failures, "%ld tests failed in child process\n", *failures);
free_failures_counter(failures, failures_map); free_failures_counter(failures, failures_map);
ret = WaitForSingleObject(exit_event, 0); ret = WaitForSingleObject(exit_event, 0);
ok(ret == WAIT_OBJECT_0, "exit_event was not set (%x)\n", ret); ok(ret == WAIT_OBJECT_0, "exit_event was not set (%lx)\n", ret);
ret = WaitForSingleObject(quick_exit_event, 0); ret = WaitForSingleObject(quick_exit_event, 0);
ok(ret == WAIT_TIMEOUT, "quick_exit_event should not have be set (%x)\n", ret); ok(ret == WAIT_TIMEOUT, "quick_exit_event should not have be set (%lx)\n", ret);
CloseHandle(exit_event); CloseHandle(exit_event);
CloseHandle(quick_exit_event); CloseHandle(quick_exit_event);
...@@ -1190,7 +1190,7 @@ static void CDECL at_exit_func1(void) ...@@ -1190,7 +1190,7 @@ static void CDECL at_exit_func1(void)
{ {
HANDLE exit_event = CreateEventA(NULL, FALSE, FALSE, "exit_event"); HANDLE exit_event = CreateEventA(NULL, FALSE, FALSE, "exit_event");
ok(exit_event != NULL, "CreateEvent failed: %d\n", GetLastError()); ok(exit_event != NULL, "CreateEvent failed: %ld\n", GetLastError());
ok(atexit_called == 1, "atexit_called = %d\n", atexit_called); ok(atexit_called == 1, "atexit_called = %d\n", atexit_called);
atexit_called++; atexit_called++;
SetEvent(exit_event); SetEvent(exit_event);
...@@ -1211,7 +1211,7 @@ static void CDECL at_quick_exit_func1(void) ...@@ -1211,7 +1211,7 @@ static void CDECL at_quick_exit_func1(void)
{ {
HANDLE quick_exit_event = CreateEventA(NULL, FALSE, FALSE, "quick_exit_event"); HANDLE quick_exit_event = CreateEventA(NULL, FALSE, FALSE, "quick_exit_event");
ok(quick_exit_event != NULL, "CreateEvent failed: %d\n", GetLastError()); ok(quick_exit_event != NULL, "CreateEvent failed: %ld\n", GetLastError());
ok(atquick_exit_called == 1, "atquick_exit_called = %d\n", atquick_exit_called); ok(atquick_exit_called == 1, "atquick_exit_called = %d\n", atquick_exit_called);
atquick_exit_called++; atquick_exit_called++;
SetEvent(quick_exit_event); SetEvent(quick_exit_event);
...@@ -1269,16 +1269,16 @@ static void test_quick_exit(const char *argv0) ...@@ -1269,16 +1269,16 @@ static void test_quick_exit(const char *argv0)
ret = WaitForSingleObject(proc.hProcess, INFINITE); ret = WaitForSingleObject(proc.hProcess, INFINITE);
ok(ret == WAIT_OBJECT_0, "child process wait failed\n"); ok(ret == WAIT_OBJECT_0, "child process wait failed\n");
GetExitCodeProcess(proc.hProcess, &ret); GetExitCodeProcess(proc.hProcess, &ret);
ok(ret == 2, "child process exited with code %d\n", ret); ok(ret == 2, "child process exited with code %ld\n", ret);
CloseHandle(proc.hProcess); CloseHandle(proc.hProcess);
CloseHandle(proc.hThread); CloseHandle(proc.hThread);
ok(!*failures, "%d tests failed in child process\n", *failures); ok(!*failures, "%ld tests failed in child process\n", *failures);
free_failures_counter(failures, failures_map); free_failures_counter(failures, failures_map);
ret = WaitForSingleObject(quick_exit_event, 0); ret = WaitForSingleObject(quick_exit_event, 0);
ok(ret == WAIT_OBJECT_0, "quick_exit_event was not set (%x)\n", ret); ok(ret == WAIT_OBJECT_0, "quick_exit_event was not set (%lx)\n", ret);
ret = WaitForSingleObject(exit_event, 0); ret = WaitForSingleObject(exit_event, 0);
ok(ret == WAIT_TIMEOUT, "exit_event should not have be set (%x)\n", ret); ok(ret == WAIT_TIMEOUT, "exit_event should not have be set (%lx)\n", ret);
CloseHandle(exit_event); CloseHandle(exit_event);
CloseHandle(quick_exit_event); CloseHandle(quick_exit_event);
......
...@@ -74,7 +74,7 @@ static void __cdecl test_invalid_parameter_handler(const wchar_t *expression, ...@@ -74,7 +74,7 @@ static void __cdecl test_invalid_parameter_handler(const wchar_t *expression,
ok(function == NULL, "function is not NULL\n"); ok(function == NULL, "function is not NULL\n");
ok(file == NULL, "file is not NULL\n"); ok(file == NULL, "file is not NULL\n");
ok(line == 0, "line = %u\n", line); ok(line == 0, "line = %u\n", line);
ok(arg == 0, "arg = %lx\n", (UINT_PTR)arg); ok(arg == 0, "arg = %Ix\n", arg);
} }
static int WINAPIV vsprintf_wrapper(unsigned __int64 options, char *str, static int WINAPIV vsprintf_wrapper(unsigned __int64 options, char *str,
...@@ -838,7 +838,7 @@ static void test_printf_fp(void) ...@@ -838,7 +838,7 @@ static void test_printf_fp(void)
r = vsprintf_wrapper(flags[j], buf, sizeof(buf), tests[i].fmt, tests[i].d); r = vsprintf_wrapper(flags[j], buf, sizeof(buf), tests[i].fmt, tests[i].d);
ok(r == strlen(res) || broken(broken_res && r == strlen(broken_res)), ok(r == strlen(res) || broken(broken_res && r == strlen(broken_res)),
"%d,%d) r = %d, expected %d\n", i, j, r, strlen(res)); "%d,%d) r = %d, expected %Id\n", i, j, r, strlen(res));
ok(!strcmp(buf, res) || broken(broken_res && !strcmp(buf, broken_res)), ok(!strcmp(buf, res) || broken(broken_res && !strcmp(buf, broken_res)),
"%d,%d) buf = %s, expected %s\n", i, j, buf, res); "%d,%d) buf = %s, expected %s\n", i, j, buf, res);
} }
......
...@@ -66,7 +66,7 @@ static void __cdecl test_invalid_parameter_handler(const wchar_t *expression, ...@@ -66,7 +66,7 @@ static void __cdecl test_invalid_parameter_handler(const wchar_t *expression,
ok(function == NULL, "function is not NULL\n"); ok(function == NULL, "function is not NULL\n");
ok(file == NULL, "file is not NULL\n"); ok(file == NULL, "file is not NULL\n");
ok(line == 0, "line = %u\n", line); ok(line == 0, "line = %u\n", line);
ok(arg == 0, "arg = %lx\n", (UINT_PTR)arg); ok(arg == 0, "arg = %Ix\n", arg);
} }
_ACRTIMP int __cdecl _o_tolower(int); _ACRTIMP int __cdecl _o_tolower(int);
......
...@@ -45,11 +45,11 @@ static char *get_thread_dll_path(void) ...@@ -45,11 +45,11 @@ static char *get_thread_dll_path(void)
strcat(path, dll_name); strcat(path, dll_name);
file = CreateFileA(path, GENERIC_READ|GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, 0); file = CreateFileA(path, GENERIC_READ|GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, 0);
ok(file != INVALID_HANDLE_VALUE, "Failed to create file %s: %u.\n", ok(file != INVALID_HANDLE_VALUE, "Failed to create file %s: %lu.\n",
debugstr_a(path), GetLastError()); debugstr_a(path), GetLastError());
res = FindResourceA(NULL, dll_name, "TESTDLL"); res = FindResourceA(NULL, dll_name, "TESTDLL");
ok(!!res, "Failed to load resource: %u\n", GetLastError()); ok(!!res, "Failed to load resource: %lu\n", GetLastError());
ptr = LockResource(LoadResource(GetModuleHandleA(NULL), res)); ptr = LockResource(LoadResource(GetModuleHandleA(NULL), res));
WriteFile(file, ptr, SizeofResource( GetModuleHandleA(NULL), res), &written, NULL); WriteFile(file, ptr, SizeofResource( GetModuleHandleA(NULL), res), &written, NULL);
ok(written == SizeofResource(GetModuleHandleA(NULL), res), "Failed to write resource\n"); ok(written == SizeofResource(GetModuleHandleA(NULL), res), "Failed to write resource\n");
...@@ -62,7 +62,7 @@ static void set_thead_dll_detach_event(HANDLE dll, HANDLE event) ...@@ -62,7 +62,7 @@ static void set_thead_dll_detach_event(HANDLE dll, HANDLE event)
{ {
void WINAPI (*_set_detach_event)(HANDLE event); void WINAPI (*_set_detach_event)(HANDLE event);
_set_detach_event = (void*) GetProcAddress(dll, "set_detach_event"); _set_detach_event = (void*) GetProcAddress(dll, "set_detach_event");
ok(_set_detach_event != NULL, "Failed to get set_detach_event: %u\n", GetLastError()); ok(_set_detach_event != NULL, "Failed to get set_detach_event: %lu\n", GetLastError());
_set_detach_event(event); _set_detach_event(event);
} }
...@@ -79,52 +79,52 @@ static void test_thread_library_reference(char *thread_dll, ...@@ -79,52 +79,52 @@ static void test_thread_library_reference(char *thread_dll,
args.exit_method = exit_method; args.exit_method = exit_method;
detach_event = CreateEventA(NULL, FALSE, FALSE, NULL); detach_event = CreateEventA(NULL, FALSE, FALSE, NULL);
ok(detach_event != NULL, "Failed to create an event: %u\n", GetLastError()); ok(detach_event != NULL, "Failed to create an event: %lu\n", GetLastError());
args.confirm_running = CreateEventA(NULL, FALSE, FALSE, NULL); args.confirm_running = CreateEventA(NULL, FALSE, FALSE, NULL);
ok(args.confirm_running != NULL, "Failed to create an event: %u\n", GetLastError()); ok(args.confirm_running != NULL, "Failed to create an event: %lu\n", GetLastError());
args.past_free = CreateEventA(NULL, FALSE, FALSE, NULL); args.past_free = CreateEventA(NULL, FALSE, FALSE, NULL);
ok(args.past_free != NULL, "Failed to create an event: %u\n", GetLastError()); ok(args.past_free != NULL, "Failed to create an event: %lu\n", GetLastError());
dll = LoadLibraryA(thread_dll); dll = LoadLibraryA(thread_dll);
ok(dll != NULL, "Failed to load the test dll: %u\n", GetLastError()); ok(dll != NULL, "Failed to load the test dll: %lu\n", GetLastError());
set_thead_dll_detach_event(dll, detach_event); set_thead_dll_detach_event(dll, detach_event);
if (beginthread_method == use_beginthreadex) if (beginthread_method == use_beginthreadex)
{ {
_beginthreadex_start_routine_t proc = (void*) GetProcAddress(dll, "stdcall_thread_proc"); _beginthreadex_start_routine_t proc = (void*) GetProcAddress(dll, "stdcall_thread_proc");
ok(proc != NULL, "Failed to get stdcall_thread_proc: %u\n", GetLastError()); ok(proc != NULL, "Failed to get stdcall_thread_proc: %lu\n", GetLastError());
thread_handle = _beginthreadex(NULL, 0, proc, &args, 0, NULL); thread_handle = _beginthreadex(NULL, 0, proc, &args, 0, NULL);
} }
else else
{ {
_beginthread_start_routine_t proc = (void*) GetProcAddress(dll, "cdecl_thread_proc"); _beginthread_start_routine_t proc = (void*) GetProcAddress(dll, "cdecl_thread_proc");
ok(proc != NULL, "Failed to get stdcall_thread_proc: %u\n", GetLastError()); ok(proc != NULL, "Failed to get stdcall_thread_proc: %lu\n", GetLastError());
thread_handle = _beginthread(proc, 0, &args); thread_handle = _beginthread(proc, 0, &args);
} }
ok(thread_handle != -1 && thread_handle != 0, "Failed to begin thread: %u\n", errno); ok(thread_handle != -1 && thread_handle != 0, "Failed to begin thread: %u\n", errno);
ret = FreeLibrary(dll); ret = FreeLibrary(dll);
ok(ret, "Failed to free the library: %u\n", GetLastError()); ok(ret, "Failed to free the library: %lu\n", GetLastError());
ret = WaitForSingleObject(args.confirm_running, 200); ret = WaitForSingleObject(args.confirm_running, 200);
ok(ret == WAIT_OBJECT_0, "Event was not signaled, ret: %u, err: %u\n", ret, GetLastError()); ok(ret == WAIT_OBJECT_0, "Event was not signaled, ret: %lu, err: %lu\n", ret, GetLastError());
ret = WaitForSingleObject(detach_event, 0); ret = WaitForSingleObject(detach_event, 0);
ok(ret == WAIT_TIMEOUT, "Thread detach happened unexpectedly signaling an event, ret: %d, err: %u\n", ret, GetLastError()); ok(ret == WAIT_TIMEOUT, "Thread detach happened unexpectedly signaling an event, ret: %ld, err: %lu\n", ret, GetLastError());
ret = SetEvent(args.past_free); ret = SetEvent(args.past_free);
ok(ret, "Failed to signal event: %d\n", GetLastError()); ok(ret, "Failed to signal event: %ld\n", GetLastError());
if (beginthread_method == use_beginthreadex) if (beginthread_method == use_beginthreadex)
{ {
ret = WaitForSingleObject((HANDLE)thread_handle, 200); ret = WaitForSingleObject((HANDLE)thread_handle, 200);
ok(ret == WAIT_OBJECT_0, "Thread has not exited, ret: %d, err: %u\n", ret, GetLastError()); ok(ret == WAIT_OBJECT_0, "Thread has not exited, ret: %ld, err: %lu\n", ret, GetLastError());
} }
ret = WaitForSingleObject(detach_event, 200); ret = WaitForSingleObject(detach_event, 200);
ok(ret == WAIT_OBJECT_0, "Detach event was not signaled, ret: %d, err: %u\n", ret, GetLastError()); ok(ret == WAIT_OBJECT_0, "Detach event was not signaled, ret: %ld, err: %lu\n", ret, GetLastError());
if (beginthread_method == use_beginthreadex) if (beginthread_method == use_beginthreadex)
CloseHandle((HANDLE)thread_handle); CloseHandle((HANDLE)thread_handle);
...@@ -153,14 +153,14 @@ static void test_thread_invalid_params(void) ...@@ -153,14 +153,14 @@ static void test_thread_invalid_params(void)
errno = 0; errno = 0;
handler_called = FALSE; handler_called = FALSE;
hThread = _beginthreadex(NULL, 0, NULL, NULL, 0, NULL); hThread = _beginthreadex(NULL, 0, NULL, NULL, 0, NULL);
ok(hThread == 0, "_beginthreadex unexpected ret: %d\n", hThread); ok(hThread == 0, "_beginthreadex unexpected ret: %Iu\n", hThread);
ok(errno == EINVAL, "_beginthreadex unexpected errno: %d\n", errno); ok(errno == EINVAL, "_beginthreadex unexpected errno: %d\n", errno);
ok(handler_called, "Expected invalid_parameter_handler to be called\n"); ok(handler_called, "Expected invalid_parameter_handler to be called\n");
errno = 0; errno = 0;
handler_called = FALSE; handler_called = FALSE;
hThread = _beginthread(NULL, 0, NULL); hThread = _beginthread(NULL, 0, NULL);
ok(hThread == -1, "_beginthread unexpected ret: %d\n", hThread); ok(hThread == -1, "_beginthread unexpected ret: %Iu\n", hThread);
ok(errno == EINVAL, "_beginthread unexpected errno: %d\n", errno); ok(errno == EINVAL, "_beginthread unexpected errno: %d\n", errno);
ok(handler_called, "Expected invalid_parameter_handler to be called\n"); ok(handler_called, "Expected invalid_parameter_handler to be called\n");
...@@ -178,7 +178,7 @@ START_TEST(thread) ...@@ -178,7 +178,7 @@ START_TEST(thread)
test_thread_library_reference(thread_dll, use_beginthreadex, thread_exit_endthreadex); test_thread_library_reference(thread_dll, use_beginthreadex, thread_exit_endthreadex);
ret = DeleteFileA(thread_dll); ret = DeleteFileA(thread_dll);
ok(ret, "Failed to remove the test dll, err: %u\n", GetLastError()); ok(ret, "Failed to remove the test dll, err: %lu\n", GetLastError());
test_thread_invalid_params(); test_thread_invalid_params();
} }
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