mirror of
https://gitee.com/acl-dev/acl.git
synced 2024-12-13 16:35:35 +08:00
9697f95b8f
This reverts commit 15d999759e
.
44 lines
1.1 KiB
C
44 lines
1.1 KiB
C
#ifndef ACL_TEST_MACRO_INCLUDE_H
|
|
#define ACL_TEST_MACRO_INCLUDE_H
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#define AUT_SET_STR(__test_line__, __name__, __value__) do { \
|
|
__value__ = aut_line_getvalue(__test_line__, __name__); \
|
|
if (__value__ == NULL) { \
|
|
printf("%s(%d): getvalue error for %s, line=%d\n", \
|
|
__FILE__, __LINE__, \
|
|
__name__, aut_line_number(__test_line__)); \
|
|
return (-1); \
|
|
} \
|
|
} while (0)
|
|
|
|
#define AUT_SET_INT(__test_line__, __name__, __value__) do { \
|
|
const char *__ptr__; \
|
|
__ptr__ = aut_line_getvalue(__test_line__, __name__); \
|
|
if (__ptr__ == NULL) { \
|
|
printf("%s(%d): getvalue error for %s, line=%d\n", \
|
|
__FILE__, __LINE__, \
|
|
__name__, aut_line_number(__test_line__)); \
|
|
return (-1); \
|
|
} \
|
|
__value__ = atoi(__ptr__); \
|
|
} while (0)
|
|
|
|
#define AUT_RETURN_ERROR(__test_line__) do { \
|
|
printf("%s(%d): %s error, line=%d\n", \
|
|
__FILE__, __LINE__, \
|
|
aut_line_cmdname(__test_line__), \
|
|
aut_line_number(__test_line__)); \
|
|
return (-1); \
|
|
} while (0)
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif
|
|
|