From 3ea974dd51b1f01483bad6a4d115189928bbf4db Mon Sep 17 00:00:00 2001 From: Andrew Opalach Date: Mon, 23 Jun 2025 15:16:00 -0400 Subject: Buffer API refactor, C++ compat - Add common_close() to tests. Signed-off-by: Andrew Opalach --- tests/condition_variable.c | 4 +++- tests/fs_event_local.c | 4 +++- tests/loop_sleep.c | 4 +++- tests/misc_file.c | 4 +++- tests/stdin_lines.c | 4 +++- tests/timer_loop.c | 4 +++- tests/timer_thread.c | 4 +++- 7 files changed, 21 insertions(+), 7 deletions(-) (limited to 'tests') diff --git a/tests/condition_variable.c b/tests/condition_variable.c index 6bc5435..7313784 100644 --- a/tests/condition_variable.c +++ b/tests/condition_variable.c @@ -19,7 +19,7 @@ static nn_thread_result NNWT_THREADCALL test_thread(void *userdata) s32 main(void) { - if (!nn_common_init()) return EXIT_FAILURE; + if (!nn_common_init(NULL)) return EXIT_FAILURE; nn_mutex_init(&mutex); nn_cond_init(&cond); @@ -35,5 +35,7 @@ s32 main(void) nn_thread_join(&thread); + nn_common_close(); + return EXIT_SUCCESS; } diff --git a/tests/fs_event_local.c b/tests/fs_event_local.c index cded733..89aa282 100644 --- a/tests/fs_event_local.c +++ b/tests/fs_event_local.c @@ -18,7 +18,7 @@ static void fs_event_callback(void *userdata, struct inotify_event *event) s32 main(void) { - if (!nn_common_init()) return EXIT_FAILURE; + if (!nn_common_init(NULL)) return EXIT_FAILURE; nn_event_loop_init(&loop); @@ -33,5 +33,7 @@ s32 main(void) nn_event_loop_run(&loop); + nn_common_close(); + return EXIT_SUCCESS; } diff --git a/tests/loop_sleep.c b/tests/loop_sleep.c index 0fe16fd..03deb53 100644 --- a/tests/loop_sleep.c +++ b/tests/loop_sleep.c @@ -30,7 +30,7 @@ static void timer_callback(void *userdata, struct nn_timer *timer) s32 main(void) { - if (!nn_common_init()) return EXIT_FAILURE; + if (!nn_common_init(NULL)) return EXIT_FAILURE; nn_event_loop_init(&loop); @@ -43,5 +43,7 @@ s32 main(void) nn_event_loop_run(&loop); + nn_common_close(); + return EXIT_SUCCESS; } diff --git a/tests/misc_file.c b/tests/misc_file.c index efbd833..f2b5af6 100644 --- a/tests/misc_file.c +++ b/tests/misc_file.c @@ -3,7 +3,7 @@ s32 main(s32 argc, char *argv[]) { - if (!nn_common_init()) return EXIT_FAILURE; + if (!nn_common_init(NULL)) return EXIT_FAILURE; if (argc < 2) { al_printf("No argument\n"); @@ -16,5 +16,7 @@ s32 main(s32 argc, char *argv[]) al_printf("File does not exist.\n"); } + nn_common_close(); + return EXIT_SUCCESS; } diff --git a/tests/stdin_lines.c b/tests/stdin_lines.c index e032a54..19a3da9 100644 --- a/tests/stdin_lines.c +++ b/tests/stdin_lines.c @@ -14,7 +14,7 @@ static u8 line_callback(void *userdata, str *line) s32 main(void) { - if (!nn_common_init()) return EXIT_FAILURE; + if (!nn_common_init(NULL)) return EXIT_FAILURE; nn_event_loop_init(&loop); @@ -27,5 +27,7 @@ s32 main(void) nn_event_loop_run(&loop); nn_event_loop_destroy(&loop); + nn_common_close(); + return EXIT_SUCCESS; } diff --git a/tests/timer_loop.c b/tests/timer_loop.c index 5b9aab8..a9ce283 100644 --- a/tests/timer_loop.c +++ b/tests/timer_loop.c @@ -25,7 +25,7 @@ static void timer_callback(void *userdata, struct nn_timer *timer) s32 main(void) { - if (!nn_common_init()) return EXIT_FAILURE; + if (!nn_common_init(NULL)) return EXIT_FAILURE; nn_event_loop_init(&loop); @@ -37,5 +37,7 @@ s32 main(void) nn_event_loop_run(&loop); nn_event_loop_destroy(&loop); + nn_common_close(); + return EXIT_SUCCESS; } diff --git a/tests/timer_thread.c b/tests/timer_thread.c index 3f68ae4..8ffbbc2 100644 --- a/tests/timer_thread.c +++ b/tests/timer_thread.c @@ -24,10 +24,12 @@ static nn_thread_result NNWT_THREADCALL test_thread(void *userdata) s32 main(void) { - if (!nn_common_init()) return EXIT_FAILURE; + if (!nn_common_init(NULL)) return EXIT_FAILURE; nn_thread_create(&thread, test_thread, NULL); nn_thread_join(&thread); + nn_common_close(); + return EXIT_SUCCESS; } -- cgit v1.2.3-101-g0448