summaryrefslogtreecommitdiff
path: root/tests/cocoa/test_ownership.m
diff options
context:
space:
mode:
authorBerke Güzel <wenekar1@gmail.com>2026-10-13 15:41:39 +0300
committerBerke Güzel <wenekar1@gmail.com>2026-10-13 15:41:39 +0300
commit482f799d356a8fbb8f585c4de7cc0992b8dc6fd3 (patch)
tree85551a69e3c356da7b9b514224e25a6c2f8d29b9 /tests/cocoa/test_ownership.m
parent537b2d768b31deb0f95c5122e0d562e4406ae9a0 (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/cocoa/test_ownership.m')
-rw-r--r--tests/cocoa/test_ownership.m16
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/cocoa/test_ownership.m b/tests/cocoa/test_ownership.m
index 4e3bbd6..5fd5cbf 100644
--- a/tests/cocoa/test_ownership.m
+++ b/tests/cocoa/test_ownership.m
@@ -19,8 +19,8 @@ int main(void)
assert(yasl_cocoa_surface_get_window(s) == window);
assert(yasl_cocoa_surface_get_view(s) == window.contentView);
assert([window isKindOfClass:[NSWindow class]] && window.contentView);
- struct yasl_input_event event;
- while (yasl_surface_input_poll(s, &event)) {}
+ struct yasl_event event;
+ while (yasl_surface_poll_event(s, &event)) {}
@autoreleasepool {
for (int i = 0; i < 600; i++) {
char text[32];
@@ -34,19 +34,19 @@ int main(void)
for (int i = 0; i < 600; i++) {
char text[32];
snprintf(text, sizeof(text), "paste-%d", i);
- assert(yasl_surface_input_poll(s, &event));
- assert(event.kind == YASL_INPUT_PASTE && strcmp(event.paste.text, text) == 0);
+ assert(yasl_surface_poll_event(s, &event));
+ assert(event.type == YASL_EVENT_PASTE && strcmp(event.text.data, text) == 0);
}
- const char *last = event.paste.text;
- assert(!yasl_surface_input_poll(s, &event));
+ const char *last = event.text.data;
+ assert(!yasl_surface_poll_event(s, &event));
@autoreleasepool { yasl_display_copy(d, YASL_CLIPBOARD, "new selection"); }
assert(strcmp(last, "paste-599") == 0);
@autoreleasepool {
yasl_display_copy(d, YASL_CLIPBOARD, "");
yasl_display_paste(d, YASL_CLIPBOARD, s);
}
- assert(yasl_surface_input_poll(s, &event));
- assert(event.kind == YASL_INPUT_PASTE && !event.paste.len && !event.paste.text[0]);
+ assert(yasl_surface_poll_event(s, &event));
+ assert(event.type == YASL_EVENT_PASTE && !event.text.len && !event.text.data[0]);
yasl_surface_destroy(s);
yasl_display_close(d);
return 0;