From 3307a8f4f0aca3ed470930ec1239189beb03f2b5 Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Fri, 28 Jun 2024 13:51:36 +0200 Subject: [PATCH] tests/unit/test_xasprintf.c: Cosmetic This is in preparation for the following commit. Signed-off-by: Alejandro Colomar --- tests/unit/test_xasprintf.c | 37 +++++++++++++++---------------------- 1 file changed, 15 insertions(+), 22 deletions(-) diff --git a/tests/unit/test_xasprintf.c b/tests/unit/test_xasprintf.c index 4b5d0935c..de22aca6d 100644 --- a/tests/unit/test_xasprintf.c +++ b/tests/unit/test_xasprintf.c @@ -28,13 +28,25 @@ static jmp_buf jmpb; -/********************** - * WRAPPERS - **********************/ int __real_vasprintf(char **restrict p, const char *restrict fmt, va_list ap); int __wrap_vasprintf(char **restrict p, const char *restrict fmt, va_list ap); void __wrap_exit(int status); +static void test_xasprintf_exit(void **state); +static void test_xasprintf_ok(void **state); + + +int +main(void) +{ + const struct CMUnitTest tests[] = { + cmocka_unit_test(test_xasprintf_exit), + cmocka_unit_test(test_xasprintf_ok), + }; + + return cmocka_run_group_tests(tests, NULL, NULL); +} + int __wrap_vasprintf(char **restrict p, const char *restrict fmt, va_list ap) @@ -50,13 +62,6 @@ __wrap_exit(int status) } -/********************** - * TEST - **********************/ -static void test_xasprintf_exit(void **state); -static void test_xasprintf_ok(void **state); - - static void test_xasprintf_exit(void **state) { @@ -100,15 +105,3 @@ test_xasprintf_ok(void **state) assert_string_equal(p, "foo1bar"); free(p); } - - -int -main(void) -{ - const struct CMUnitTest tests[] = { - cmocka_unit_test(test_xasprintf_exit), - cmocka_unit_test(test_xasprintf_ok), - }; - - return cmocka_run_group_tests(tests, NULL, NULL); -} -- 2.47.3