diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2024-06-17 17:39:06 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2024-06-17 17:39:30 +0200 |
| commit | e986713657bc5f9880e91ed49dd9b0d0227f048d (patch) | |
| tree | 908d371e60546795c4ca1f9a3b67571b964203c5 /test/test.h | |
| parent | 02ce9adf6a9168ec66c322ce9e5a5cb9fe1e60a5 (diff) | |
| download | nissy-core-e986713657bc5f9880e91ed49dd9b0d0227f048d.tar.gz nissy-core-e986713657bc5f9880e91ed49dd9b0d0227f048d.zip | |
Use callback function to log to stderr
Diffstat (limited to 'test/test.h')
| -rw-r--r-- | test/test.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/test.h b/test/test.h index 1bbb9fc..415e093 100644 --- a/test/test.h +++ b/test/test.h | |||
| @@ -1,4 +1,5 @@ | |||
| 1 | #include <inttypes.h> | 1 | #include <inttypes.h> |
| 2 | #include <stdarg.h> | ||
| 2 | #include <stdbool.h> | 3 | #include <stdbool.h> |
| 3 | #include <stdio.h> | 4 | #include <stdio.h> |
| 4 | #include <stdlib.h> | 5 | #include <stdlib.h> |
| @@ -24,3 +25,15 @@ bool issolvable(cube_t); | |||
| 24 | bool issolved(cube_t); | 25 | bool issolved(cube_t); |
| 25 | cube_t readcube(char *, char *); | 26 | cube_t readcube(char *, char *); |
| 26 | void writecube(char *, cube_t, char *); | 27 | void writecube(char *, cube_t, char *); |
| 28 | void nissy_setlogger(void (*logger_function)(const char *, va_list)); | ||
| 29 | |||
| 30 | /* Test function to be implemented by all tests */ | ||
| 31 | void run(void); | ||
| 32 | |||
| 33 | void log_stderr(const char *str, va_list vl) { vfprintf(stderr, str, vl); } | ||
| 34 | |||
| 35 | int main(void) { | ||
| 36 | nissy_setlogger(log_stderr); | ||
| 37 | run(); | ||
| 38 | return 0; | ||
| 39 | } | ||
