-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathmini_test.h
39 lines (37 loc) · 1.18 KB
/
mini_test.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/**----------------------------------------------------------------------------
* _mini_test.h
*-----------------------------------------------------------------------------
*
*-----------------------------------------------------------------------------
* All rights reserved by Noh,Yonghwan ([email protected], [email protected])
*-----------------------------------------------------------------------------
* 2014:3:2 22:51 created
**---------------------------------------------------------------------------*/
#define assert_bool(expected_bool, return_bool_test_func) \
{ \
ret = return_bool_test_func(); \
if (expected_bool == ret) \
{ \
log_info "[pass] %s", #return_bool_test_func log_end \
_pass_count ++; \
} \
else \
{ \
log_err "[fail] %s", #return_bool_test_func log_end \
_fail_count ++; \
} \
}
#define assert_bool_with_param(expected_bool, return_bool_test_func, param) \
{ \
ret = return_bool_test_func(param); \
if (expected_bool == ret) \
{ \
log_info "[pass] %s", #return_bool_test_func log_end \
_pass_count ++; \
} \
else \
{ \
log_err "[fail] %s", #return_bool_test_func log_end \
_fail_count ++; \
} \
}