]> pilppa.org Git - libplp.git/blobdiff - src_test/test_logs.c
added new helper function for getting byte array as hex-str.
[libplp.git] / src_test / test_logs.c
index 3d01b2ff319fce37c0e0d5d97335f0bb9c678879..1b0059c77fd3d26e780b2839755d076b797a43d5 100644 (file)
@@ -13,8 +13,9 @@
 
 #include "log.h"
 
-int main(int argc, char** argv)
-{
+#include "../src/str_util.h"
+
+void test_logging() {
        log_debug("debug");
        log_debug("debug v%d\n", 2);
        log_info("info\n");
@@ -23,5 +24,20 @@ int main(int argc, char** argv)
        log_warning("warning v%d\n", 2);
        log_error("error\n");
        log_error("error v%d\n", 2);
+}
+
+void test_str_util() {
+       char    *res_str;
+       char    b_arr[] = {0x1, 0x11, 0x21, 0x31};
+
+       res_str = get_as_hex_str(b_arr, 4);
+       log_info("bytes: %s\n", res_str);
+       free(res_str);
+}
+
+int main(int argc, char** argv)
+{
+       test_logging();
+       test_str_util();
        return 0;
 }