diff options
| author | Berke Güzel <wenekar1@gmail.com> | 2026-10-13 15:41:39 +0300 |
|---|---|---|
| committer | Berke Güzel <wenekar1@gmail.com> | 2026-10-13 15:41:39 +0300 |
| commit | 482f799d356a8fbb8f585c4de7cc0992b8dc6fd3 (patch) | |
| tree | 85551a69e3c356da7b9b514224e25a6c2f8d29b9 /tests/common/test_app.c | |
| parent | 537b2d768b31deb0f95c5122e0d562e4406ae9a0 (diff) | |
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 <noreply@anthropic.com>
Diffstat (limited to 'tests/common/test_app.c')
| -rw-r--r-- | tests/common/test_app.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/common/test_app.c b/tests/common/test_app.c index 23c9a93..6972921 100644 --- a/tests/common/test_app.c +++ b/tests/common/test_app.c @@ -37,7 +37,7 @@ static uint64_t on_timer(void *ud, yasl_timer_id id, uint64_t interval_ns) return 0; /* one-shot */ } -static int on_init(void *ud, struct yasl_display *d) +static enum yasl_app_result on_init(void *ud, struct yasl_display *d) { struct test_state *state = ud; state->display = d; @@ -51,8 +51,8 @@ static int on_init(void *ud, struct yasl_display *d) assert(state->surface != NULL); yasl_surface_set_pacing(state->surface, YASL_PACING_ON_DEMAND); - yasl_surface_set_mouse_mode(state->surface, YASL_MOUSE_RELATIVE); - yasl_surface_set_mouse_mode(state->surface, YASL_MOUSE_NORMAL); + yasl_surface_set_pointer_mode(state->surface, YASL_POINTER_RELATIVE); + yasl_surface_set_pointer_mode(state->surface, YASL_POINTER_NORMAL); state->timer_id = yasl_app_add_timer(d, YASL_MS_TO_NS(20), on_timer, state); assert(state->timer_id > 0); @@ -66,15 +66,15 @@ static int on_init(void *ud, struct yasl_display *d) return YASL_APP_CONTINUE; } -static int on_event(void *ud, const struct yasl_event *ev) +static enum yasl_app_result on_event(void *ud, const struct yasl_event *ev) { struct test_state *state = ud; if (ev->type == YASL_EVENT_USER) { - assert(ev->user.type == 42); + assert(ev->user.code == 42); assert(ev->user.payload == (void *)0x1234); state->user_event_called = true; yasl_surface_request_frame(state->surface); - } else if (ev->type == YASL_EVENT_WINDOW_CLOSE_REQUEST) { + } else if (ev->type == YASL_EVENT_WINDOW_CLOSE) { return YASL_APP_QUIT; } return YASL_APP_CONTINUE; |
