aboutsummaryrefslogtreecommitdiff
path: root/test/test.h
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2024-06-17 17:39:06 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2024-06-17 17:39:30 +0200
commite986713657bc5f9880e91ed49dd9b0d0227f048d (patch)
tree908d371e60546795c4ca1f9a3b67571b964203c5 /test/test.h
parent02ce9adf6a9168ec66c322ce9e5a5cb9fe1e60a5 (diff)
downloadnissy-core-e986713657bc5f9880e91ed49dd9b0d0227f048d.tar.gz
nissy-core-e986713657bc5f9880e91ed49dd9b0d0227f048d.zip
Use callback function to log to stderr
Diffstat (limited to '')
-rw-r--r--test/test.h13
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);
24bool issolved(cube_t); 25bool issolved(cube_t);
25cube_t readcube(char *, char *); 26cube_t readcube(char *, char *);
26void writecube(char *, cube_t, char *); 27void writecube(char *, cube_t, char *);
28void nissy_setlogger(void (*logger_function)(const char *, va_list));
29
30/* Test function to be implemented by all tests */
31void run(void);
32
33void log_stderr(const char *str, va_list vl) { vfprintf(stderr, str, vl); }
34
35int main(void) {
36 nissy_setlogger(log_stderr);
37 run();
38 return 0;
39}

Generated with cgit - Back to sebastiano.tronto.net