From 482f799d356a8fbb8f585c4de7cc0992b8dc6fd3 Mon Sep 17 00:00:00 2001 From: Berke Güzel Date: Tue, 13 Oct 2026 15:41:39 +0300 Subject: Migrate tests to the unified event API Port backend, input, tablet and app tests from yasl_input_event and YASL_INPUT_* to struct yasl_event and YASL_EVENT_*. The input allocation test links input.c on its own, so it stubs yasl_loop_now_ns() for the new event timestamps. Co-Authored-By: Claude Opus 5.5 --- tests/benchmark.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'tests/benchmark.c') diff --git a/tests/benchmark.c b/tests/benchmark.c index 7431715..1cea614 100644 --- a/tests/benchmark.c +++ b/tests/benchmark.c @@ -135,9 +135,9 @@ static void bench_input_queue_resize(void) { for (int b = 0; b < batches; b++) { struct input_queue q = {0}; for (int i = 0; i < size; i++) { - struct yasl_input_event ev = { - .kind = YASL_INPUT_MOUSE, - .mouse = { .pos = { .x = i, .y = b } }, + struct yasl_event ev = { + .type = YASL_EVENT_POINTER_MOTION, + .pointer = { .pos = { .x = i, .y = b } }, }; input_queue_push(&q, &ev); } @@ -160,13 +160,13 @@ static void bench_input_queue_push_pop(void) { uint64_t t0 = get_time_ns(); for (int r = 0; r < rounds; r++) { for (int i = 0; i < events_per_round; i++) { - struct yasl_input_event ev = { - .kind = YASL_INPUT_MOUSE, - .mouse = { .pos = { .x = i, .y = r }, .button = 1 }, + struct yasl_event ev = { + .type = YASL_EVENT_POINTER_DOWN, + .pointer = { .pos = { .x = i, .y = r }, .button = YASL_BUTTON_MIDDLE }, }; input_queue_push(&q, &ev); } - struct yasl_input_event out; + struct yasl_event out; while (input_queue_pop(&q, &out)) { /* consume */ } -- cgit v1.2.3