]> git.ipfire.org Git - people/ms/libloc.git/commitdiff
Enable debug logging for all tests
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 15 Jun 2020 16:48:04 +0000 (16:48 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 15 Jun 2020 16:48:04 +0000 (16:48 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/test-as.c
src/test-country.c
src/test-database.c
src/test-libloc.c
src/test-network.c
src/test-signature.c
src/test-stringpool.c

index a2d0ed588f037b03a268827a07978b04f335ed7e..839a04ce2623718147d787256b084b66b59f5b0c 100644 (file)
@@ -17,6 +17,7 @@
 #include <errno.h>
 #include <stdlib.h>
 #include <string.h>
+#include <syslog.h>
 
 #include <loc/libloc.h>
 #include <loc/database.h>
@@ -32,6 +33,9 @@ int main(int argc, char** argv) {
        if (err < 0)
                exit(EXIT_FAILURE);
 
+       // Enable debug logging
+       loc_set_log_priority(ctx, LOG_DEBUG);
+
        // Create a database
        struct loc_writer* writer;
        err = loc_writer_new(ctx, &writer, NULL, NULL);
index 4a9c9c1dcd2c8f03351205da1fcaf2e5c8fe3c9c..d78c773b07a7a18bbeb0ae2fd6f6f21037c58c4c 100644 (file)
@@ -19,6 +19,7 @@
 #include <stddef.h>
 #include <stdlib.h>
 #include <string.h>
+#include <syslog.h>
 
 #include <loc/libloc.h>
 #include <loc/country.h>
@@ -47,6 +48,9 @@ int main(int argc, char** argv) {
        if (err < 0)
                exit(EXIT_FAILURE);
 
+       // Enable debug logging
+       loc_set_log_priority(ctx, LOG_DEBUG);
+
        // Create a database
        struct loc_writer* writer;
        err = loc_writer_new(ctx, &writer, NULL, NULL);
index 4fdb774f7fc853128153c94e31ede21df08b5218..b4a75c43880be8c47e2ba73b7a61bd3e8d1c359a 100644 (file)
@@ -22,6 +22,7 @@
 #include <ctype.h>
 #include <errno.h>
 #include <unistd.h>
+#include <syslog.h>
 
 #include <loc/libloc.h>
 #include <loc/database.h>
@@ -66,6 +67,9 @@ int main(int argc, char** argv) {
        if (err < 0)
                exit(EXIT_FAILURE);
 
+       // Enable debug logging
+       loc_set_log_priority(ctx, LOG_DEBUG);
+
        // Try opening an empty file
        err = attempt_to_open(ctx, "/dev/null");
        if (err == 0)
index fbbcfa0000c044d8bd904e170123da5a59d1d6ce..e8c2ebf558ea3ccd0872446b339480533687777f 100644 (file)
@@ -22,6 +22,7 @@
 #include <ctype.h>
 #include <errno.h>
 #include <unistd.h>
+#include <syslog.h>
 
 #include <loc/libloc.h>
 
@@ -32,6 +33,9 @@ int main(int argc, char** argv) {
        if (err < 0)
                exit(EXIT_FAILURE);
 
+       // Enable debug logging
+       loc_set_log_priority(ctx, LOG_DEBUG);
+
        printf("version %s\n", VERSION);
 
        loc_unref(ctx);
index 24355a986565b793fc3ab5b90ed843760cf76d5f..364099d51d8fc2064f962f8f5e849a2fd067b8c3 100644 (file)
@@ -19,6 +19,7 @@
 #include <stddef.h>
 #include <stdlib.h>
 #include <string.h>
+#include <syslog.h>
 
 #include <loc/libloc.h>
 #include <loc/database.h>
@@ -33,6 +34,9 @@ int main(int argc, char** argv) {
        if (err < 0)
                exit(EXIT_FAILURE);
 
+       // Enable debug logging
+       loc_set_log_priority(ctx, LOG_DEBUG);
+
        struct loc_network_tree* tree;
        err = loc_network_tree_new(ctx, &tree);
        if (err) {
index cbbe15f7f7fc0578ed490a17c2c3feb6843f1767..620517c922469708976f5afe41398043c0d92758 100644 (file)
@@ -22,6 +22,7 @@
 #include <ctype.h>
 #include <errno.h>
 #include <unistd.h>
+#include <syslog.h>
 
 #include <loc/libloc.h>
 #include <loc/database.h>
@@ -55,6 +56,9 @@ int main(int argc, char** argv) {
        if (err < 0)
                exit(EXIT_FAILURE);
 
+       // Enable debug logging
+       loc_set_log_priority(ctx, LOG_DEBUG);
+
        // Create an empty database
        struct loc_writer* writer;
        err = loc_writer_new(ctx, &writer, private_key1, private_key2);
index 3cde27a68fb275911be3f473eade9612987a5bc0..3c2890a0ae9fe7f599e61a99b336b224b24fe5c6 100644 (file)
@@ -24,6 +24,7 @@
 #include <errno.h>
 #include <unistd.h>
 #include <time.h>
+#include <syslog.h>
 
 #include <loc/libloc.h>
 #include <loc/stringpool.h>
@@ -54,6 +55,9 @@ int main(int argc, char** argv) {
        if (err < 0)
                exit(EXIT_FAILURE);
 
+       // Enable debug logging
+       loc_set_log_priority(ctx, LOG_DEBUG);
+
        // Create the stringpool
        struct loc_stringpool* pool;
        err = loc_stringpool_new(ctx, &pool);