summaryrefslogtreecommitdiff
path: root/tests
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
commit38533c81e7b7ebfc5f281c2523188aeaa38d09c3 (patch)
tree4ba509a81be479748b313e0935a01ae80cea3ae2 /tests
parent482f799d356a8fbb8f585c4de7cc0992b8dc6fd3 (diff)
Drop the app state struct from the hello example
hello only tracked a failure flag, so keep it as a file-scope static like simple_window and leave yasl_app_desc.userdata unset. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/common/test_hello_example.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/tests/common/test_hello_example.c b/tests/common/test_hello_example.c
index 6e0318f..7faa147 100644
--- a/tests/common/test_hello_example.c
+++ b/tests/common/test_hello_example.c
@@ -6,15 +6,14 @@
static void draw_once(void *ud, struct yasl_surface *surface, struct yasl_frame_context *frame)
{
draw(ud, surface, frame);
- if (!((struct app *)ud)->failed) yasl_surface_destroy(surface);
+ if (!failed) yasl_surface_destroy(surface);
}
int main(void)
{
- struct app app = {0};
struct yasl_app_desc desc = {
- .app_id = "org.yasl.test.hello", .userdata = &app,
+ .app_id = "org.yasl.test.hello",
.init = init, .event = event, .frame = draw_once,
};
- return yasl_run(&desc) || app.failed ? 1 : 0;
+ return yasl_run(&desc) || failed ? 1 : 0;
}