diff options
Diffstat (limited to 'src/test/logging/logging_tests.c')
-rw-r--r-- | src/test/logging/logging_tests.c | 40 |
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; } |