From 624d1371304a5ae4b3429ad5e4267aac7cd03dfd Mon Sep 17 00:00:00 2001 From: Berke Güzel Date: Mon, 12 Oct 2026 00:09:38 +0300 Subject: missing impls and hardening --- tests/wayland/test_input.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 tests/wayland/test_input.c (limited to 'tests/wayland/test_input.c') diff --git a/tests/wayland/test_input.c b/tests/wayland/test_input.c new file mode 100644 index 0000000..f421e6c --- /dev/null +++ b/tests/wayland/test_input.c @@ -0,0 +1,26 @@ +#include "wayland/internal.h" +#include + +int main(void) +{ + struct wayland_surface w = {0}; + struct seat seat = {.ime_focus = &w}; + wayland_surface_set_callbacks(&w, NULL, NULL); + for (int i = 0; i < 600; i++) { + char text[32]; + snprintf(text, sizeof(text), "commit-%d", i); + text_input_listener.commit_string(&seat, NULL, text); + text_input_listener.done(&seat, NULL, (uint32_t)i); + assert(!w.ime_commit); + } + for (int i = 0; i < 600; i++) { + char text[32]; + snprintf(text, sizeof(text), "commit-%d", i); + struct yasl_input_event event; + assert(wayland_surface_input_poll(&w, &event)); + assert(event.kind == YASL_INPUT_TEXT && event.surface == &w.base); + assert(strcmp(event.text.text, text) == 0); + } + input_queue_clear(&w.input); + return 0; +} -- cgit v1.2.3