]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
tests/unit/test_xasprintf.c: Cosmetic
authorAlejandro Colomar <alx@kernel.org>
Fri, 28 Jun 2024 11:51:36 +0000 (13:51 +0200)
committerSerge Hallyn <serge@hallyn.com>
Fri, 28 Jun 2024 13:57:01 +0000 (08:57 -0500)
This is in preparation for the following commit.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
tests/unit/test_xasprintf.c

index 4b5d0935c4111c4e0798a3d61abda87c40445e70..de22aca6d02d078cc02a8a4c8569dd2db90e8b3f 100644 (file)
 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);
-}