Changeset 589
- Timestamp:
- Jul 6, 2006 2:28:45 PM (18 years ago)
- Location:
- pjproject/trunk/pjsip/src/test-pjsip
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/test-pjsip/test.c
r563 r589 244 244 pj_dump_config(); 245 245 246 pj_caching_pool_init( &caching_pool, &pj_pool_factory_default_policy, 0 ); 246 pj_caching_pool_init( &caching_pool, &pj_pool_factory_default_policy, 247 PJSIP_TEST_MEM_SIZE ); 247 248 248 249 rc = pjsip_endpt_create(&caching_pool.factory, "endpt", &endpt); … … 341 342 on_return: 342 343 flush_events(500); 344 345 /* Dumping memory pool usage */ 346 { 347 pj_pool_t *p; 348 unsigned sz = 0; 349 p = caching_pool.used_list.next; 350 while (p != (pj_pool_t*)&caching_pool.used_list) { 351 sz += pj_pool_get_capacity(p); 352 p = p->next; 353 } 354 PJ_LOG(3,(THIS_FILE, "Caching pool total capacity=%u", 355 caching_pool.capacity + sz)); 356 } 357 343 358 pjsip_endpt_destroy(endpt); 344 359 pj_caching_pool_destroy(&caching_pool); -
pjproject/trunk/pjsip/src/test-pjsip/test.h
r563 r589 26 26 #define TEST_UDP_PORT 15060 27 27 #define TEST_UDP_PORT_STR "15060" 28 29 /** 30 * Memory size to use in caching pool. 31 * Default: 2MB 32 */ 33 #ifndef PJSIP_TEST_MEM_SIZE 34 # define PJSIP_TEST_MEM_SIZE (2*1024*1024) 35 #endif 36 28 37 29 38 -
pjproject/trunk/pjsip/src/test-pjsip/uri_test.c
r587 r589 811 811 812 812 PJ_LOG(3,(THIS_FILE, " simple test")); 813 pool = pjsip_endpt_create_pool(endpt, "", POOL_SIZE, POOL_SIZE);814 813 for (i=0; i<PJ_ARRAY_SIZE(uri_test_array); ++i) { 814 pool = pjsip_endpt_create_pool(endpt, "", POOL_SIZE, POOL_SIZE); 815 815 status = do_uri_test(pool, &uri_test_array[i]); 816 pjsip_endpt_release_pool(endpt, pool); 816 817 if (status != PJ_SUCCESS) { 817 818 PJ_LOG(3,(THIS_FILE, " error %d when testing entry %d", … … 820 821 } 821 822 } 822 pjsip_endpt_release_pool(endpt, pool);823 823 824 824 return 0; … … 828 828 { 829 829 unsigned i, loop; 830 pj_pool_t *pool;831 830 pj_status_t status; 832 831 pj_timestamp zero; … … 843 842 var.cmp_time.u32.hi = var.cmp_time.u32.lo = 0; 844 843 for (loop=0; loop<LOOP_COUNT; ++loop) { 845 pool = pjsip_endpt_create_pool(endpt, "", POOL_SIZE, POOL_SIZE);846 844 for (i=0; i<PJ_ARRAY_SIZE(uri_test_array); ++i) { 845 pj_pool_t *pool; 846 pool = pjsip_endpt_create_pool(endpt, "", POOL_SIZE, POOL_SIZE); 847 847 status = do_uri_test(pool, &uri_test_array[i]); 848 pjsip_endpt_release_pool(endpt, pool); 848 849 if (status != PJ_SUCCESS) { 849 850 PJ_LOG(3,(THIS_FILE, " error %d when testing entry %d", … … 853 854 } 854 855 } 855 pjsip_endpt_release_pool(endpt, pool);856 856 } 857 857
Note: See TracChangeset
for help on using the changeset viewer.