summaryrefslogtreecommitdiff
path: root/test/basic.c
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2017-06-11 11:14:40 +0100
committerDaniel Silverstone <dsilvers@digital-scurf.org>2017-06-11 11:14:40 +0100
commit43f7f54dadecb1d11b4fd9cd2af4889043865490 (patch)
treeaf12882b778ed23ceac476ae8aba645701046815 /test/basic.c
parent8b4ce0ba86d0396bde2546dd248c863876da4106 (diff)
downloadlibnslog-43f7f54dadecb1d11b4fd9cd2af4889043865490.tar.gz
libnslog-43f7f54dadecb1d11b4fd9cd2af4889043865490.tar.bz2
Switch to a check based test suite, start fixing bugs
Diffstat (limited to 'test/basic.c')
-rw-r--r--test/basic.c41
1 files changed, 0 insertions, 41 deletions
diff --git a/test/basic.c b/test/basic.c
deleted file mode 100644
index d514814..0000000
--- a/test/basic.c
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright 2017 Daniel Silverstone <dsilvers@netsurf-browser.org>
- *
- * This file is part of libnslog.
- *
- * Licensed under the MIT License,
- * http://www.opensource.org/licenses/mit-license.php
- */
-
-#include "nslog/nslog.h"
-
-#include <stdio.h>
-
-NSLOG_DEFINE_CATEGORY(test, "Test category");
-
-static void test_render_function(
- void *_ctx, nslog_entry_context_t *ctx,
- const char *fmt, va_list args)
-{
- (void)ctx;
- fprintf(stderr, "%s %s:%d [%s] %s() ",
- nslog_level_name(ctx->level),
- ctx->filename, ctx->lineno,
- ctx->category->name,
- ctx->funcname);
- vfprintf(stderr, fmt, args);
- fprintf(stderr, "\n");
-}
-
-int main(int argc, char **argv)
-{
- nslog_set_render_callback(test_render_function, NULL);
- NSLOG(test, INFO, "Pre-uncorking");
- fprintf(stderr, "About to nslog_uncork()\n");
- nslog_uncork();
- fprintf(stderr, "Uncorked now\n");
- NSLOG(test, WARN, "argc=%d", argc);
- for (int i = 0; i < argc; ++i)
- NSLOG(test, WARN, "argv[%d] = %s", i, argv[i]);
- return 0;
-}