tc: fix the macros for logging. 08/259708/2
authorSooChan Lim <sc1.lim@samsung.com>
Fri, 11 Jun 2021 06:33:43 +0000 (15:33 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Fri, 11 Jun 2021 07:23:50 +0000 (07:23 +0000)
fix the build break when it uses the log macro of logging

Change-Id: I6dff92297fcf0de224c32477df163b90d604353d

haltests/tc_tbm.h

index 801847e..f4e05dd 100644 (file)
 #include <stdlib.h>
 #include <tbm_bufmgr_int.h>
 #include <wayland-server-protocol.h>
+#include <tbm_log.h>
+
+#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())
 #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; \
        } \
 }