#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; \
} \
}