From 94df2efe2d2221bf0c4d77510142c95283d76f2b Mon Sep 17 00:00:00 2001 From: Alice Frosi Date: Wed, 10 May 2023 15:19:49 +0200 Subject: Clean-up error message and test Refactoring error messages: - standardize error messages and functions - return on error instead of exit - test error when target doesn't exist - include ability to capture stderr and stdout in the tests --- tests/unit/testutil.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'tests/unit/testutil.h') diff --git a/tests/unit/testutil.h b/tests/unit/testutil.h index ec881c7..861efb0 100644 --- a/tests/unit/testutil.h +++ b/tests/unit/testutil.h @@ -1,6 +1,6 @@ #ifndef TESTUTIL_H #define TESTUTIL_H - +#include #include #include #include @@ -67,6 +67,8 @@ extern struct args_target *at; extern int pipefd[2]; extern pid_t pid; extern char path[PATH_MAX]; +extern char stderr_buff[BUFSIZ]; +extern char stdout_buff[BUFSIZ]; extern struct gluten gluten; @@ -85,4 +87,7 @@ void continue_target(); void mock_syscall_target(); void set_args_no_check(struct args_target *at); void check_target_result_nonegative(); +void ck_error_msg(char *s); +void ck_stderr(); +void ck_stdout(); #endif /* TESTUTIL_H */ -- cgit v1.2.3