house keeping

add some more logic for enum task
This commit is contained in:
hathach
2013-02-01 14:21:22 +07:00
parent 7fc3e4f8fe
commit a25da9d3ee
5 changed files with 37 additions and 14 deletions

View File

@@ -70,7 +70,8 @@ extern "C"
//--------------------------------------------------------------------+
#define ASSERT_FILENAME __FILE__
#define ASSERT_FUNCTION __PRETTY_FUNCTION__
#define ASSERT_STATEMENT _PRINTF("assert at %s: %s :%d :\n", ASSERT_FILENAME, ASSERT_FUNCTION, __LINE__)
#define ASSERT_STATEMENT(format, ...)\
_PRINTF("Assert at %s: %s:%d: " format "\n", ASSERT_FILENAME, ASSERT_FUNCTION, __LINE__, __VA_ARGS__)
#ifndef _TEST_ASSERT_
#define ASSERT_ERROR_HANDLE(x) return (x)
@@ -82,7 +83,7 @@ extern "C"
do{\
setup_statement;\
if (!(condition)) {\
_PRINTF("Assert at %s: %s:%d: " format "\n", ASSERT_FILENAME, ASSERT_FUNCTION, __LINE__, __VA_ARGS__);\
ASSERT_STATEMENT(format, __VA_ARGS__);\
ASSERT_ERROR_HANDLE(error);\
}\
}while(0)