Commit ebb16124 authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

ntoskrnl.exe/tests: Sync test utils with wine/test.h.

Adding support for thread local test data and context. Signed-off-by: 's avatarRémi Bernon <rbernon@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 7c7e77da
TESTDLL = ntoskrnl.exe
IMPORTS = advapi32 crypt32 newdev setupapi user32 wintrust ws2_32 hid
driver_IMPORTS = winecrt0 ntoskrnl
driver_IMPORTS = winecrt0 ntoskrnl hal
driver_EXTRADLLFLAGS = -nodefaultlibs -nostartfiles -Wl,--subsystem,native
driver2_IMPORTS = winecrt0 ntoskrnl
driver2_IMPORTS = winecrt0 ntoskrnl hal
driver2_EXTRADLLFLAGS = -nodefaultlibs -nostartfiles -Wl,--subsystem,native
driver3_IMPORTS = winecrt0 ntoskrnl
driver3_IMPORTS = winecrt0 ntoskrnl hal
driver3_EXTRADLLFLAGS = -nodefaultlibs -nostartfiles -Wl,--subsystem,native
driver_hid_IMPORTS = winecrt0 ntoskrnl hidclass
driver_hid_IMPORTS = winecrt0 ntoskrnl hal hidclass
driver_hid_EXTRADLLFLAGS = -nodefaultlibs -nostartfiles -Wl,--subsystem,native
driver_netio_IMPORTS = winecrt0 ntoskrnl netio
driver_netio_IMPORTS = winecrt0 ntoskrnl hal netio
driver_netio_EXTRADLLFLAGS = -nodefaultlibs -nostartfiles -Wl,--subsystem,native
driver_pnp_IMPORTS = winecrt0 ntoskrnl hal
driver_pnp_EXTRADLLFLAGS = -nodefaultlibs -nostartfiles -Wl,--subsystem,native
......
......@@ -998,41 +998,41 @@ static void test_call_driver(DEVICE_OBJECT *device)
irp = IoBuildAsynchronousFsdRequest(IRP_MJ_FLUSH_BUFFERS, device, NULL, 0, NULL, &iosb);
ok(irp->UserIosb == &iosb, "unexpected UserIosb\n");
ok(!irp->Cancel, "Cancel = %x\n", irp->Cancel);
ok(!irp->CancelRoutine, "CancelRoutine = %x\n", irp->CancelRoutine);
ok(!irp->CancelRoutine, "CancelRoutine = %p\n", irp->CancelRoutine);
ok(!irp->UserEvent, "UserEvent = %p\n", irp->UserEvent);
ok(irp->CurrentLocation == 2, "CurrentLocation = %u\n", irp->CurrentLocation);
ok(irp->Tail.Overlay.Thread == (PETHREAD)KeGetCurrentThread(),
"IRP thread is not the current thread\n");
ok(!irp->IoStatus.Status, "got status %#x\n", irp->IoStatus.Status);
ok(!irp->IoStatus.Information, "got information %#x\n", irp->IoStatus.Information);
ok(!irp->IoStatus.Information, "got information %#I64x\n", (UINT64)irp->IoStatus.Information);
ok(iosb.Status == 0xdeadbeef, "got status %#x\n", iosb.Status);
ok(iosb.Information == 0xdeadbeef, "got information %#x\n", iosb.Information);
ok(iosb.Information == 0xdeadbeef, "got information %#I64x\n", (UINT64)iosb.Information);
irpsp = IoGetNextIrpStackLocation(irp);
ok(irpsp->MajorFunction == IRP_MJ_FLUSH_BUFFERS, "MajorFunction = %u\n", irpsp->MajorFunction);
ok(!irpsp->DeviceObject, "DeviceObject = %u\n", irpsp->DeviceObject);
ok(!irpsp->FileObject, "FileObject = %u\n", irpsp->FileObject);
ok(!irpsp->DeviceObject, "DeviceObject = %p\n", irpsp->DeviceObject);
ok(!irpsp->FileObject, "FileObject = %p\n", irpsp->FileObject);
ok(!irpsp->CompletionRoutine, "CompletionRoutine = %p\n", irpsp->CompletionRoutine);
status = IoCallDriver(device, irp);
ok(status == STATUS_PENDING, "IoCallDriver returned %#x\n", status);
ok(!irp->IoStatus.Status, "got status %#x\n", irp->IoStatus.Status);
ok(!irp->IoStatus.Information, "got information %#x\n", irp->IoStatus.Information);
ok(!irp->IoStatus.Information, "got information %#I64x\n", (UINT64)irp->IoStatus.Information);
ok(iosb.Status == 0xdeadbeef, "got status %#x\n", iosb.Status);
ok(iosb.Information == 0xdeadbeef, "got information %#x\n", iosb.Information);
ok(iosb.Information == 0xdeadbeef, "got information %#I64x\n", (UINT64)iosb.Information);
irp->IoStatus.Status = STATUS_SUCCESS;
irp->IoStatus.Information = 123;
IoCompleteRequest(irp, IO_NO_INCREMENT);
ok(iosb.Status == STATUS_SUCCESS, "got status %#x\n", iosb.Status);
ok(iosb.Information == 123, "got information %#x\n", iosb.Information);
ok(iosb.Information == 123, "got information %#I64x\n", (UINT64)iosb.Information);
KeInitializeEvent(&event, NotificationEvent, FALSE);
irp = IoBuildSynchronousFsdRequest(IRP_MJ_FLUSH_BUFFERS, device, NULL, 0, NULL, &event, &iosb);
ok(irp->UserIosb == &iosb, "unexpected UserIosb\n");
ok(!irp->Cancel, "Cancel = %x\n", irp->Cancel);
ok(!irp->CancelRoutine, "CancelRoutine = %x\n", irp->CancelRoutine);
ok(!irp->CancelRoutine, "CancelRoutine = %p\n", irp->CancelRoutine);
ok(irp->UserEvent == &event, "UserEvent = %p\n", irp->UserEvent);
ok(irp->CurrentLocation == 2, "CurrentLocation = %u\n", irp->CurrentLocation);
ok(irp->Tail.Overlay.Thread == (PETHREAD)KeGetCurrentThread(),
......@@ -1040,8 +1040,8 @@ static void test_call_driver(DEVICE_OBJECT *device)
irpsp = IoGetNextIrpStackLocation(irp);
ok(irpsp->MajorFunction == IRP_MJ_FLUSH_BUFFERS, "MajorFunction = %u\n", irpsp->MajorFunction);
ok(!irpsp->DeviceObject, "DeviceObject = %u\n", irpsp->DeviceObject);
ok(!irpsp->FileObject, "FileObject = %u\n", irpsp->FileObject);
ok(!irpsp->DeviceObject, "DeviceObject = %p\n", irpsp->DeviceObject);
ok(!irpsp->FileObject, "FileObject = %p\n", irpsp->FileObject);
ok(!irpsp->CompletionRoutine, "CompletionRoutine = %p\n", irpsp->CompletionRoutine);
status = wait_single(&event, 0);
......@@ -1117,7 +1117,7 @@ static void test_cancel_irp(DEVICE_OBJECT *device)
ok(irp->CurrentLocation == 1, "CurrentLocation = %u\n", irp->CurrentLocation);
irpsp = IoGetCurrentIrpStackLocation(irp);
ok(irpsp->DeviceObject == device, "DeviceObject = %u\n", irpsp->DeviceObject);
ok(irpsp->DeviceObject == device, "DeviceObject = %p\n", irpsp->DeviceObject);
IoSetCancelRoutine(irp, cancel_irp);
cancel_cnt = 0;
......@@ -1431,16 +1431,16 @@ static void check_resource_(int line, ERESOURCE *resource, ULONG exclusive_waite
ULONG count;
count = ExGetExclusiveWaiterCount(resource);
ok_(__FILE__, line, count == exclusive_waiters,
ok_(__FILE__, line)(count == exclusive_waiters,
"expected %u exclusive waiters, got %u\n", exclusive_waiters, count);
count = ExGetSharedWaiterCount(resource);
ok_(__FILE__, line, count == shared_waiters,
ok_(__FILE__, line)(count == shared_waiters,
"expected %u shared waiters, got %u\n", shared_waiters, count);
ret = ExIsResourceAcquiredExclusiveLite(resource);
ok_(__FILE__, line, ret == exclusive,
ok_(__FILE__, line)(ret == exclusive,
"expected exclusive %u, got %u\n", exclusive, ret);
count = ExIsResourceAcquiredSharedLite(resource);
ok_(__FILE__, line, count == shared_count,
ok_(__FILE__, line)(count == shared_count,
"expected shared %u, got %u\n", shared_count, count);
}
#define check_resource(a,b,c,d,e) check_resource_(__LINE__,a,b,c,d,e)
......
......@@ -54,7 +54,8 @@ struct test_data
int running_under_wine;
int winetest_report_success;
int winetest_debug;
int successes, failures, skipped, todo_successes, todo_failures;
int failures;
int todo_failures;
};
struct main_test_input
......@@ -64,13 +65,6 @@ struct main_test_input
ULONG64 *modified_value;
};
static inline char *drv_strrchr( const char *str, char ch )
{
char *ret = NULL;
do { if (*str == ch) ret = (char *)(ULONG_PTR)str; } while (*str++);
return ret;
}
static const GUID control_class = {0xdeadbeef, 0x29ef, 0x4538, {0xa5, 0xfd, 0xb6, 0x95, 0x73, 0xa3, 0x62, 0xc0}};
#define SERVER_LISTEN_PORT 9374
......
......@@ -141,7 +141,7 @@ static void test_wsk_get_address_info(void)
{
struct sockaddr_in *addr = (struct sockaddr_in *)addr_info->ai_addr;
ok(addr_info->ai_addrlen == sizeof(*addr), "Got unexpected ai_addrlen %u.\n", addr_info->ai_addrlen);
ok(addr_info->ai_addrlen == sizeof(*addr), "Got unexpected ai_addrlen %I64u.\n", (UINT64)addr_info->ai_addrlen);
ok(addr->sin_family == AF_INET, "Got unexpected sin_family %u.\n", addr->sin_family);
ok(ntohs(addr->sin_port) == 12345, "Got unexpected sin_port %u.\n", ntohs(addr->sin_port));
ok(ntohl(addr->sin_addr.s_addr) == 0x7f000001, "Got unexpected sin_addr %#x.\n",
......
......@@ -386,6 +386,7 @@ static void cat_okfile(void)
SetEndOfFile(okfile);
winetest_add_failures(InterlockedExchange(&test_data->failures, 0));
winetest_add_failures(InterlockedExchange(&test_data->todo_failures, 0));
}
static ULONG64 modified_value;
......
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