summaryrefslogtreecommitdiff
path: root/src/test/logging
diff options
context:
space:
mode:
authorsanine <sanine.not@pm.me>2021-09-23 23:11:23 -0500
committersanine <sanine.not@pm.me>2021-09-23 23:11:23 -0500
commit1ca109e1770b56095bdf4c664f3b99b7ac93776d (patch)
tree15d6d7812a9c921c87eede2c451a96af6b13cdf2 /src/test/logging
parent6f92e9da2f6b0223c34728da34be65d76d5db485 (diff)
add honey_log_level_str_()
Diffstat (limited to 'src/test/logging')
-rw-r--r--src/test/logging/logging_tests.c40
1 files changed, 38 insertions, 2 deletions
diff --git a/src/test/logging/logging_tests.c b/src/test/logging/logging_tests.c
index 2e92d68..2a07d30 100644
--- a/src/test/logging/logging_tests.c
+++ b/src/test/logging/logging_tests.c
@@ -1,6 +1,42 @@
-#include "../minunit.h"
-#include "../suites.h"
+#include "test/minunit.h"
+#include "test/suites.h"
+
+#include "logging/logging.h"
+
+
+/* test declarations */
+
+mu_test test_log_get_level();
+
+
+/* main suite */
void honey_logging_tests()
{
+ mu_run_test("get log level strings", test_log_get_level);
+}
+
+
+/* test definitions */
+
+mu_test test_log_get_level()
+{
+ struct honey_log_info info;
+
+ info.log_level = DEBUG;
+ mu_assert_streq("DEBUG", honey_log_level_str_(&info));
+
+ info.log_level = INFO;
+ mu_assert_streq("INFO", honey_log_level_str_(&info));
+
+ info.log_level = WARN;
+ mu_assert_streq("WARN", honey_log_level_str_(&info));
+
+ info.log_level = ERROR;
+ mu_assert_streq("ERROR", honey_log_level_str_(&info));
+
+ info.log_level = FATAL;
+ mu_assert_streq("FATAL", honey_log_level_str_(&info));
+
+ return 0;
}