acl  3.5.3.0
acl_test_macro.h
浏览该文件的文档.
1 #ifndef ACL_TEST_MACRO_INCLUDE_H
2 #define ACL_TEST_MACRO_INCLUDE_H
3 
4 #ifdef __cplusplus
5 extern "C" {
6 #endif
7 
8 #define AUT_SET_STR(__test_line__, __name__, __value__) do { \
9  __value__ = aut_line_getvalue(__test_line__, __name__); \
10  if (__value__ == NULL) { \
11  printf("%s(%d): getvalue error for %s, line=%d\n", \
12  __FILE__, __LINE__, \
13  __name__, aut_line_number(__test_line__)); \
14  return (-1); \
15  } \
16 } while (0)
17 
18 #define AUT_SET_INT(__test_line__, __name__, __value__) do { \
19  const char *__ptr__; \
20  __ptr__ = aut_line_getvalue(__test_line__, __name__); \
21  if (__ptr__ == NULL) { \
22  printf("%s(%d): getvalue error for %s, line=%d\n", \
23  __FILE__, __LINE__, \
24  __name__, aut_line_number(__test_line__)); \
25  return (-1); \
26  } \
27  __value__ = atoi(__ptr__); \
28 } while (0)
29 
30 #define AUT_RETURN_ERROR(__test_line__) do { \
31  printf("%s(%d): %s error, line=%d\n", \
32  __FILE__, __LINE__, \
33  aut_line_cmdname(__test_line__), \
34  aut_line_number(__test_line__)); \
35  return (-1); \
36 } while (0)
37 
38 #ifdef __cplusplus
39 }
40 #endif
41 
42 #endif
43