From: SooChan Lim Date: Fri, 11 Jun 2021 06:33:43 +0000 (+0900) Subject: tc: fix the macros for logging. X-Git-Tag: submit/tizen/20210611.072439~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;ds=sidebyside;h=19a5f222171e00daa13301f81e72609c49427ebc;p=platform%2Fcore%2Fuifw%2Flibtbm.git tc: fix the macros for logging. fix the build break when it uses the log macro of logging Change-Id: I6dff92297fcf0de224c32477df163b90d604353d --- diff --git a/haltests/tc_tbm.h b/haltests/tc_tbm.h index 801847e..f4e05dd 100644 --- a/haltests/tc_tbm.h +++ b/haltests/tc_tbm.h @@ -39,6 +39,20 @@ #include #include #include +#include + +#undef TBM_DBG +#undef TBM_INFO +#undef TBM_WRN +#undef TBM_ERR +#define TBM_DBG(fmt, args...) tbm_log_print(TBM_LOG_LEVEL_DBG, fmt, ##args) +#define TBM_INFO(fmt, args...) tbm_log_print(TBM_LOG_LEVEL_INFO, fmt, ##args) +#define TBM_WRN(fmt, args...) tbm_log_print(TBM_LOG_LEVEL_WRN, fmt, ##args) +#define TBM_ERR(fmt, args...) tbm_log_print(TBM_LOG_LEVEL_ERR, fmt, ##args) + +#define TBM_UT_INFO(fmt, args...) tbm_log_print_stdout(TBM_LOG_LEVEL_INFO, fmt, ##args) +#define TBM_UT_WRN(fmt, args...) tbm_log_print_stdout(TBM_LOG_LEVEL_WRN, fmt, ##args) +#define TBM_UT_ERR(fmt, args...) tbm_log_print_stdout(TBM_LOG_LEVEL_ERR, fmt, ##args) #define TBM_UT_ENTRY() \ TBM_INFO("--------------------------------------------- %s", typeid(*this).name()) @@ -46,36 +60,38 @@ #define TBM_UT_CHECK_FLAG(FLAG) \ do {\ if(!(FLAG)) \ - TBM_INFO("[ ] not supported");\ + TBM_UT_INFO(" [ ] not supported");\ + EXPECT_TRUE(0);\ } while(0) #define TBM_UT_SKIP_FLAG(FLAG) \ do {\ - if(!(FLAG)) {\ - TBM_INFO("[ SKIPPED ] not supported");\ + if((FLAG)) {\ + TBM_UT_INFO(" [ SKIPPED ] not supported");\ + EXPECT_TRUE(1);\ return;\ }\ } while(0) #define TBM_UT_NEVER_GET_HERE() \ do {\ - TBM_INFO("!!! TBM UT NEVER GET HERE !!!");\ + TBM_UT_INFO("!!! TBM UT NEVER GET HERE !!!");\ } while(0) #define TBM_UT_RETURN_IF_FAIL(cond) { \ if (!(cond)) { \ - TBM_ERR("[%s,%d] '%s' failed", __FUNCTION__, __LINE__, #cond); \ + TBM_UT_ERR("[%s,%d] '%s' failed", __FUNCTION__, __LINE__, #cond); \ return; \ } \ } #define TBM_UT_RETURN_FALSE_IF_FAIL(cond) { \ if (!(cond)) { \ - TBM_ERR("[%s,%d] '%s' failed", __FUNCTION__, __LINE__, #cond); \ + TBM_UT_ERR("[%s,%d] '%s' failed", __FUNCTION__, __LINE__, #cond); \ return false; \ } \ } #define TBM_UT_GOTO_IF_FAIL(cond, dst) { \ if (!(cond)) { \ - TBM_ERR("[%s,%d] '%s' failed", __FUNCTION__, __LINE__, #cond); \ + TBM_UT_ERR("[%s,%d] '%s' failed", __FUNCTION__, __LINE__, #cond); \ goto dst; \ } \ }