diff options
| author | Berke Güzel <wenekar1@gmail.com> | 2026-10-12 00:09:38 +0300 |
|---|---|---|
| committer | Berke Güzel <wenekar1@gmail.com> | 2026-10-12 00:09:38 +0300 |
| commit | 624d1371304a5ae4b3429ad5e4267aac7cd03dfd (patch) | |
| tree | 32de069f6eec83686521fc4bf39cc9874b123e93 /tests/wayland/test_input.c | |
| parent | e813252e685d761235ad45e170d97c9375f51958 (diff) | |
missing impls and hardening
Diffstat (limited to 'tests/wayland/test_input.c')
| -rw-r--r-- | tests/wayland/test_input.c | 26 |
1 files changed, 26 insertions, 0 deletions
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 <assert.h> + +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; +} |
