diff options
Diffstat (limited to 'tests/wayland')
| -rw-r--r-- | tests/wayland/test_clipboard.c | 8 | ||||
| -rw-r--r-- | tests/wayland/test_reconnect.c | 5 |
2 files changed, 7 insertions, 6 deletions
diff --git a/tests/wayland/test_clipboard.c b/tests/wayland/test_clipboard.c index 0ee74b6..f1427ab 100644 --- a/tests/wayland/test_clipboard.c +++ b/tests/wayland/test_clipboard.c @@ -39,7 +39,7 @@ static void receive(const char *text, size_t len, bool uri_list, int main(void) { struct received received = {0}; - struct clipboard c = {.loop = yasl_private_loop_create(), .receive = receive, .ud = &received}; + struct clipboard c = {.loop = yasl_loop_create(), .receive = receive, .ud = &received}; received.clipboard = &c; assert(c.loop); const struct { const char *bytes; size_t len; bool valid; } cases[] = { @@ -62,7 +62,7 @@ int main(void) assert(write(fds[1], cases[i].bytes, cases[i].len) == (ssize_t)cases[i].len); close(fds[1]); for (int steps = 0; c.transfers && steps < 10; steps++) - assert(yasl_private_loop_step(c.loop, 0) >= 0); + assert(yasl_loop_step(c.loop, 0) >= 0); assert(!c.transfers); assert(!yasl_private_loop_timer_armed(c.loop, timeout_id)); assert(received.count == 1); @@ -100,11 +100,11 @@ int main(void) struct wl_surface *timeout_target = (struct wl_surface *)(uintptr_t)2; timed->drop_surface = timeout_target; yasl_private_timer_id timeout_id = timed->timeout; - assert(yasl_private_loop_del_timer(c.loop, timeout_id)); + assert(yasl_loop_del_timer(c.loop, timeout_id)); (void)transfer_timeout(timed, timeout_id, CLIPBOARD_TRANSFER_TIMEOUT_NS); close(timeout_fds[1]); assert(!c.transfers && received.count == 1); assert(received.request_id == 100 && received.status == YASL_PRIVATE_TRANSFER_FAILED); - yasl_private_loop_destroy(c.loop); + yasl_loop_destroy(c.loop); return 0; } diff --git a/tests/wayland/test_reconnect.c b/tests/wayland/test_reconnect.c index 891d98b..6bd6967 100644 --- a/tests/wayland/test_reconnect.c +++ b/tests/wayland/test_reconnect.c @@ -55,7 +55,7 @@ static VkSurfaceKHR vulkan_surface(void) int main(void) { - CHECK(yasl_init(YASL_BACKEND_WAYLAND, NULL) == 0, "selecting Wayland"); + CHECK(yasl_init(&(struct yasl_options){.backend = YASL_BACKEND_WAYLAND}) == 0, "selecting Wayland"); cpu = yasl_surface_create(&(struct yasl_surface_options){.title="reconnect CPU", .width=160, .height=120}); CHECK(cpu, "creating CPU window"); gl = yasl_surface_create(&(struct yasl_surface_options){.title="reconnect GL", .width=160, .height=120, .type=YASL_SURFACE_GL}); @@ -84,7 +84,8 @@ int main(void) puts("ready"); fflush(stdout); - expect(YASL_EVENT_DISPLAY_LOST, NULL, 10000); + yasl_event lost = expect(YASL_EVENT_DISPLAY_LOST, NULL, 10000); + CHECK(lost.action == YASL_LOST_RECONNECTING, "reporting a loss that reconnects"); struct yasl_native native; CHECK(yasl_surface_get_native(cpu, &native) == -ENOTCONN && !native.wl_display && !native.wl_surface, "rejecting native handles while offline"); |
