Changeset 1088:1d1a20a0779d in freeDiameter for tests/tests.h
- Timestamp:
- May 5, 2013, 4:25:27 AM (11 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/tests.h
r1078 r1088 68 68 /* Define the macro to fail a test with a message */ 69 69 #define FAILTEST( message... ){ \ 70 TRACE_ERROR(message); \ 71 TRACE_ERROR("FAILED: %s ", __STRIPPED_FILE__); \ 70 LOG_F(message); \ 71 LOG_F("FAILED: %s ", __STRIPPED_FILE__); \ 72 free(tbuf); \ 72 73 exit(FAIL); \ 73 74 } … … 75 76 /* Define the macro to pass a test */ 76 77 #define PASSTEST( ){ \ 77 TRACE_NOTICE("PASS: %s", __STRIPPED_FILE__);\78 LOG_N("PASS: %s", __STRIPPED_FILE__); \ 78 79 (void)fd_core_shutdown(); \ 79 80 (void)fd_core_wait_shutdown_complete(); \ 80 81 (void)fd_thr_term(&signal_thr); \ 82 free(tbuf); \ 81 83 exit(PASS); \ 82 84 } 83 85 84 static int test_verbo = 0;85 86 static struct fd_config conf; 86 87 extern struct fd_config * fd_g_config; 87 88 89 /* for dumps */ 90 static char * tbuf = NULL; size_t tbuflen = 0; 91 #define FD_DUMP_TEST_PARAMS &tbuf, &tbuflen, NULL 92 93 88 94 /* Define the standard check routines */ 89 95 #define CHECK( _val, _assert ){ \ 90 if (test_verbo > 0) { \ 91 TRACE_NOTICE("CHECK( %s == %s )", \ 96 LOG_D("CHECK( %s == %s )", \ 92 97 #_assert, \ 93 98 #_val); \ 94 }{ \99 { \ 95 100 __typeof__ (_val) __ret = (_assert); \ 96 101 if (__ret != (_val)) { \ … … 143 148 switch (c) { 144 149 case 'd': /* Increase verbosity of debug messages. */ 145 test_verbo++;150 fd_g_debug_lvl--; 146 151 break; 147 152 148 153 case 'q': /* Decrease verbosity. */ 149 test_verbo--;154 fd_g_debug_lvl++; 150 155 break; 151 156 … … 178 183 } 179 184 } 180 fd_g_debug_lvl = (test_verbo > 0) ? (test_verbo - 1) : 0;181 185 if (!no_timeout) { 182 186 alarm(TEST_TIMEOUT);
Note: See TracChangeset
for help on using the changeset viewer.