summaryrefslogtreecommitdiff
path: root/test/select.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/select.c')
-rw-r--r--test/select.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/select.c b/test/select.c
index f21d937..923bf38 100644
--- a/test/select.c
+++ b/test/select.c
@@ -231,6 +231,20 @@ printing_lwc_iterator(lwc_string *str, void *pw)
fail_because_lwc_leaked = true;
}
+static void test_logger(
+ void *_ctx, nslog_entry_context_t *ctx,
+ const char *fmt,
+ va_list args)
+{
+ UNUSED(_ctx);
+ fprintf(stderr, "%s: %s: %s:%i: ",
+ nslog_level_name(ctx->level),
+ ctx->category->description,
+ ctx->filename, ctx->lineno);
+ vfprintf(stderr, fmt, args);
+ fprintf(stderr, "\n");
+}
+
int main(int argc, char **argv)
{
line_ctx ctx;
@@ -240,6 +254,16 @@ int main(int argc, char **argv)
return 1;
}
+ if (nslog_set_render_callback(test_logger, NULL) != NSLOG_NO_ERROR) {
+ printf("Unable to set log render callback\n");
+ return 1;
+ }
+
+ if (nslog_uncork() != NSLOG_NO_ERROR) {
+ printf("Failed to uncork log.\n");
+ return 1;
+ }
+
memset(&ctx, 0, sizeof(ctx));
@@ -261,6 +285,8 @@ int main(int argc, char **argv)
assert(fail_because_lwc_leaked == false);
+ nslog_cleanup();
+
printf("PASS\n");
return 0;
}