aboutsummaryrefslogtreecommitdiff
path: root/test/test.h
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2025-04-15 15:51:40 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2025-04-15 15:51:40 +0200
commitb25a939e2d8b045c083caf3264c4e5aac1cf88fb (patch)
tree37b862c82389ceddcf4624b5e26536390d6b8265 /test/test.h
parentb02c083a3545b6e6b36ab62680128edec619a804 (diff)
downloadnissy-core-b25a939e2d8b045c083caf3264c4e5aac1cf88fb.tar.gz
nissy-core-b25a939e2d8b045c083caf3264c4e5aac1cf88fb.zip
Better logging function
Now it is possible to provide some data together with the logging function. This is useful for example in C++, where I can now provide an arbitrary callable object as data, and a simple wrapper function that call the callable object as logging function.
Diffstat (limited to '')
-rw-r--r--test/test.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/test.h b/test/test.h
index 0b12fb7..97f229b 100644
--- a/test/test.h
+++ b/test/test.h
@@ -31,13 +31,13 @@ int64_t writecube(const char *, cube_t, size_t n, char [n]);
31/* Test function to be implemented by all tests */ 31/* Test function to be implemented by all tests */
32void run(void); 32void run(void);
33 33
34void log_stderr(const char *str) 34void log_stderr(const char *str, void *unused)
35{ 35{
36 fprintf(stderr, "%s", str); 36 fprintf(stderr, "%s", str);
37} 37}
38 38
39int main(void) { 39int main(void) {
40 nissy_setlogger(log_stderr); 40 nissy_setlogger(log_stderr, NULL);
41 run(); 41 run();
42 return 0; 42 return 0;
43} 43}

Generated with cgit - Back to sebastiano.tronto.net