Changeset 4360 for pjproject/trunk/pjnath/src/pjnath-test/test.c
- Timestamp:
- Feb 21, 2013 11:26:35 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjnath/src/pjnath-test/test.c
r3553 r4360 35 35 pj_ioqueue_t *ioqueue; 36 36 pj_timer_heap_t *timer_heap; 37 pj_lock_t *lock; 37 38 pj_status_t status; 38 39 … … 50 51 } 51 52 53 pj_lock_create_recursive_mutex(pool, NULL, &lock); 54 pj_timer_heap_set_lock(timer_heap, lock, PJ_TRUE); 55 52 56 pj_stun_config_init(stun_cfg, mem, 0, ioqueue, timer_heap); 53 57 … … 106 110 st->timer_cnt = pj_timer_heap_count(cfg->timer_heap); 107 111 108 cp = (pj_caching_pool*) mem;112 cp = (pj_caching_pool*)cfg->pf; 109 113 st->pool_used_cnt = cp->used_count; 110 114 } … … 121 125 PJ_LOG(3,("", " error: possibly leaking timer")); 122 126 rc |= ERR_TIMER_LEAK; 127 128 #if PJ_TIMER_DEBUG 129 pj_timer_heap_dump(cfg->timer_heap); 130 #endif 123 131 } 124 132 … … 149 157 PJ_LOG_HAS_MICRO_SEC; 150 158 159 pj_log_func *orig_log_func; 160 FILE *log_file; 161 162 static void test_log_func(int level, const char *data, int len) 163 { 164 if (log_file) { 165 fwrite(data, len, 1, log_file); 166 } 167 if (level <= 3) 168 orig_log_func(level, data, len); 169 } 170 151 171 static int test_inner(void) 152 172 { … … 159 179 pj_log_set_level(3); 160 180 pj_log_set_decor(param_log_decor); 181 #elif 1 182 log_file = fopen("pjnath-test.log", "wt"); 183 pj_log_set_level(5); 184 orig_log_func = pj_log_get_log_func(); 185 pj_log_set_log_func(&test_log_func); 161 186 #endif 162 187 … … 190 215 #endif 191 216 217 #if INCLUDE_CONCUR_TEST 218 DO_TEST(concur_test()); 219 #endif 220 192 221 on_return: 222 if (log_file) 223 fclose(log_file); 193 224 return rc; 194 225 }
Note: See TracChangeset
for help on using the changeset viewer.