summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/common/test_hello_example.c2
-rw-r--r--tests/wayland/test_app_input.c14
2 files changed, 15 insertions, 1 deletions
diff --git a/tests/common/test_hello_example.c b/tests/common/test_hello_example.c
index c648038..101e2d4 100644
--- a/tests/common/test_hello_example.c
+++ b/tests/common/test_hello_example.c
@@ -14,7 +14,7 @@ int main(void)
struct yasl_window_spec window = {.title = "Hello YASL", .size = {640, 480}};
struct yasl_app_desc desc = {
.app_id = "org.yasl.test.hello", .window = &window,
- .event = event, .frame = draw_once,
+ .frame = draw_once,
};
return yasl_run(&desc) || failed ? 1 : 0;
}
diff --git a/tests/wayland/test_app_input.c b/tests/wayland/test_app_input.c
index 843f38d..88f9ead 100644
--- a/tests/wayland/test_app_input.c
+++ b/tests/wayland/test_app_input.c
@@ -26,6 +26,15 @@ static void push_key(struct yasl_surface *s)
static enum yasl_app_result on_init(void *ud, struct yasl_display *d)
{
struct test_state *state = ud;
+ if (state->end == 3) {
+ /* With no event callback, a close request alone stops the runner. */
+ struct yasl_surface *s = yasl_surface_create_toplevel(d,
+ &(struct yasl_window_spec){ .title = "App Close Test", .size = {64, 64} });
+ assert(s);
+ struct wayland_surface *w = (struct wayland_surface *)s;
+ w->cbs->close(s, w->ud);
+ return YASL_APP_CONTINUE;
+ }
if (state->end) {
struct wayland_display *display = (struct wayland_display *)d;
if (state->end == 1)
@@ -107,5 +116,10 @@ int main(void)
});
assert(end == 1 ? res == 0 : res < 0);
}
+ state = (struct test_state){.end = 3};
+ res = yasl_run(&(struct yasl_app_desc){
+ .backend = YASL_BACKEND_WAYLAND, .userdata = &state, .init = on_init,
+ });
+ assert(res == 0);
return 0;
}