utest: add log tests 20/174820/1
authorSooChan Lim <sc1.lim@samsung.com>
Wed, 4 Apr 2018 09:26:46 +0000 (18:26 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Wed, 4 Apr 2018 09:35:32 +0000 (18:35 +0900)
Change-Id: I8bfe896c183a7bf2c0f6e87720a896ec8fba853e

src/tbm_log.h
utests/ut_tbm_log.cpp

index c806e02..2d29dd8 100644 (file)
@@ -60,6 +60,7 @@ void tbm_log_set_debug_level(int level);
 void tbm_log_set_assert_level(int level);
 void tbm_log_set_path(const char *path);
 void tbm_log_print(int level, const char *fmt, ...);
+void tbm_log_print_stdout(int level, const char *fmt, ...);
 
 #define TBM_DBG(fmt, args...) \
        do { \
index 2e76d21..3bc2227 100644 (file)
@@ -87,3 +87,19 @@ TEST(TBMLog, logDlogUnknownLevel)
        tbm_log_print(UT_TBM_INVALID_VALUE, "utest");
 }
 
+TEST(TBMLog, logSetAssertLevel)
+{
+       tbm_log_enable_dlog(1);
+       tbm_log_set_assert_level(TBM_LOG_LEVEL_ERR);
+       tbm_log_set_assert_level(TBM_LOG_LEVEL_WRN);
+       tbm_log_set_assert_level(TBM_LOG_LEVEL_INFO);
+       tbm_log_set_assert_level(TBM_LOG_LEVEL_DBG);
+}
+
+TEST(TBMLog, logPrintStdout)
+{
+       tbm_log_print_stdout(TBM_LOG_LEVEL_ERR, "utest");
+       tbm_log_print_stdout(TBM_LOG_LEVEL_WRN, "utest");
+       tbm_log_print_stdout(TBM_LOG_LEVEL_INFO, "utest");
+       tbm_log_print_stdout(TBM_LOG_LEVEL_DBG, "utest");
+}
\ No newline at end of file