tests/unit/test_xasprintf.c: Cosmetic
This is in preparation for the following commit. Signed-off-by: Alejandro Colomar <alx@kernel.org>
This commit is contained in:
committed by
Serge Hallyn
parent
d55367bb16
commit
3307a8f4f0
+15
-22
@@ -28,13 +28,25 @@
|
|||||||
static jmp_buf jmpb;
|
static jmp_buf jmpb;
|
||||||
|
|
||||||
|
|
||||||
/**********************
|
|
||||||
* WRAPPERS
|
|
||||||
**********************/
|
|
||||||
int __real_vasprintf(char **restrict p, const char *restrict fmt, va_list ap);
|
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);
|
int __wrap_vasprintf(char **restrict p, const char *restrict fmt, va_list ap);
|
||||||
void __wrap_exit(int status);
|
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
|
int
|
||||||
__wrap_vasprintf(char **restrict p, const char *restrict fmt, va_list ap)
|
__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
|
static void
|
||||||
test_xasprintf_exit(void **state)
|
test_xasprintf_exit(void **state)
|
||||||
{
|
{
|
||||||
@@ -100,15 +105,3 @@ test_xasprintf_ok(void **state)
|
|||||||
assert_string_equal(p, "foo1bar");
|
assert_string_equal(p, "foo1bar");
|
||||||
free(p);
|
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);
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user