diff --git a/vtest/util.c b/vtest/util.c index f389497..0ae37de 100644 --- a/vtest/util.c +++ b/vtest/util.c @@ -29,7 +29,6 @@ #include #include - int vtest_wait_for_fd_read(int fd) { fd_set read_fds; @@ -49,3 +48,15 @@ int vtest_wait_for_fd_read(int fd) return -1; } + +int __failed_call(const char* func, const char *called, int ret) +{ + fprintf(stderr, "%s called %s which failed (%d)\n", func, called, ret); + return ret; +} + +int __failure(const char* func, const char *reason, int ret) +{ + fprintf(stderr, "%s %s (%d)\n", func, reason, ret); + return ret; +} diff --git a/vtest/util.h b/vtest/util.h index 2c60bc5..c73f277 100644 --- a/vtest/util.h +++ b/vtest/util.h @@ -27,4 +27,14 @@ int vtest_wait_for_fd_read(int fd); +int __failed_call(const char* func, const char *called, int ret); + +int __failure(const char* func, const char *reason, int ret); + +#define report_failure(reason, ret) \ + __failure(__FUNCTION__, reason, ret) + +#define report_failed_call(called, ret) \ + __failed_call(__FUNCTION__, called, ret) + #endif /* VTEST_UTIL_H */ diff --git a/vtest/vtest_renderer.c b/vtest/vtest_renderer.c index f78d6e5..84f8d09 100644 --- a/vtest/vtest_renderer.c +++ b/vtest/vtest_renderer.c @@ -65,26 +65,6 @@ struct vtest_renderer { struct vtest_renderer renderer; -static int -__failed_call(const char* func, const char *called, int ret) -{ - fprintf(stderr, "%s called %s which failed (%d)\n", func, called, ret); - return ret; -} - -#define report_failed_call(called, ret) \ - __failed_call(__FUNCTION__, called, ret) - -static int -__failure(const char* func, const char *reason, int ret) -{ - fprintf(stderr, "%s %s (%d)\n", func, reason, ret); - return ret; -} - -#define report_failure(reason, ret) \ - __failure(__FUNCTION__, reason, ret) - static unsigned hash_func(void *key) {