untitest decl
MODIFY
test/unittests/unit_list.c
test/unittests/unit_list.c
@@ -27,6 +27,7 @@ extern void mock_assert(const int result, const char* const expression,
(compile with `--wrap=exit`) */
extern void exit(int status);
extern void __real_exit(int status);
+void __wrap_exit(int status);
void __wrap_exit(int status) {
assert(0);
}
@@ -34,6 +35,7 @@ void __wrap_exit(int status) {
/* ignore all printfs */
extern int printf(const char *format, ...);
extern int __real_printf(const char *format, ...);
+int __wrap_printf(const char *format, ...);
int __wrap_printf(const char *format, ...) {
return 1;
}

MODIFY
test/unittests/unit_maybe_alloc.c
test/unittests/unit_maybe_alloc.c
@@ -22,6 +22,7 @@ extern void mock_assert(const int result, const char* const expression,
mock_assert((int)(expression), #expression, __FILE__, __LINE__);
#include "alloc-inl.h"
+void __wrap_exit(int status);
/* remap exit -> assert, then use cmocka's mock_assert
(compile with `--wrap=exit`) */
extern void exit(int status);
@@ -30,6 +31,7 @@ void __wrap_exit(int status) {
assert(0);
}
+int __wrap_printf(const char *format, ...);
/* ignore all printfs */
extern int printf(const char *format, ...);
extern int __real_printf(const char *format, ...);

MODIFY
test/unittests/unit_preallocable.c
test/unittests/unit_preallocable.c
@@ -27,6 +27,7 @@ extern void mock_assert(const int result, const char* const expression,
(compile with `--wrap=exit`) */
extern void exit(int status);
extern void __real_exit(int status);
+void __wrap_exit(int status);
void __wrap_exit(int status) {
assert(0);
}
@@ -34,6 +35,7 @@ void __wrap_exit(int status) {
/* ignore all printfs */
extern int printf(const char *format, ...);
extern int __real_printf(const char *format, ...);
+int __wrap_printf(const char *format, ...);
int __wrap_printf(const char *format, ...) {
return 1;
}

untitest decl