summaryrefslogtreecommitdiff
path: root/tests/common/test_events.c
diff options
context:
space:
mode:
authorBerke Güzel <berke.guzel@gdh.digital>2026-10-14 09:38:31 +0300
committerBerke Güzel <berke.guzel@gdh.digital>2026-10-14 09:38:31 +0300
commit5ef6ca21ab9e1cf4f69254234d190a634b777d52 (patch)
tree974d3797a6d9487e54a811e224bf78a3f52dda85 /tests/common/test_events.c
parent563b23a33726289387193b85d90fb569631ee05f (diff)
Remove deprecated Cocoa OpenGL and private compatibility APIs
Diffstat (limited to 'tests/common/test_events.c')
-rw-r--r--tests/common/test_events.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/tests/common/test_events.c b/tests/common/test_events.c
index fcfc118..e9f61da 100644
--- a/tests/common/test_events.c
+++ b/tests/common/test_events.c
@@ -179,20 +179,23 @@ static void test_failures(void)
}
-static void test_legacy_poll_does_not_spin(void)
+static void test_fifo_preserves_notifications(void)
{
struct yasl_private_display d;
struct yasl_surface a, b;
setup(&d, &a, &b);
yasl_private_surface_notify_state(&a, YASL_PRIVATE_STATE_ACTIVATED);
yasl_private_surface_notify_close(&b);
- assert(yasl_private_events_pending(&d));
+ yasl_private_surface_notify_composition(&a, "preedit", 0, 7);
+ assert(input_queue_push(&b.input, &(struct yasl_private_event){
+ .type = YASL_PRIVATE_EVENT_PEN, .surface = &b}));
+ const enum yasl_private_event_type types[] = {YASL_PRIVATE_EVENT_WINDOW_STATE,
+ YASL_PRIVATE_EVENT_WINDOW_CLOSE, YASL_PRIVATE_EVENT_COMPOSITION, YASL_PRIVATE_EVENT_PEN};
struct yasl_private_event ev;
- assert(!yasl_private_surface_poll_event(&a, &ev));
- assert(!yasl_private_events_pending(&d));
- assert(input_queue_push(&b.input, &(struct yasl_private_event){.type = YASL_PRIVATE_EVENT_KEY, .surface = &b}));
- assert(!yasl_private_surface_poll_event(&a, &ev));
- assert(yasl_private_surface_poll_event(&b, &ev) && ev.surface == &b);
+ for (size_t i = 0; i < sizeof(types) / sizeof(*types); ++i) {
+ assert(yasl_private_display_poll_event(&d, &ev));
+ assert(ev.type == types[i] && ev.surface == (i % 2 ? &b : &a));
+ }
assert(!yasl_private_events_pending(&d));
teardown(&d, &a, &b);
}
@@ -203,6 +206,6 @@ int main(void)
test_post_cleanup();
test_damage();
test_failures();
- test_legacy_poll_does_not_spin();
+ test_fifo_preserves_notifications();
return 0;
}