Changeset 129 for pjproject/trunk/pjmedia/src/test/test.c
- Timestamp:
- Feb 2, 2006 7:16:07 PM (19 years ago)
- File:
-
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/test/test.c
r112 r129 17 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 18 */ 19 #include <pj/os.h> 20 #include <pj/pool.h> 21 #include <pjmedia/sound.h> 19 #include "test.h" 22 20 23 pj_status_t session_test (pj_pool_factory *pf); 24 pj_status_t rtp_test (pj_pool_factory *pf); 25 pj_status_t sdp_test(pj_pool_factory *pf); 26 int jbuf_main(pj_pool_factory *pf); 21 #define THIS_FILE "test.c" 27 22 28 int main() 23 #define DO_TEST(test) do { \ 24 PJ_LOG(3, (THIS_FILE, "Running %s...", #test)); \ 25 rc = test; \ 26 PJ_LOG(3, (THIS_FILE, \ 27 "%s(%d)", \ 28 (rc ? "..ERROR" : "..success"), rc)); \ 29 if (rc!=0) goto on_return; \ 30 } while (0) 31 32 33 pj_pool_factory *mem; 34 35 36 void app_perror(pj_status_t status, const char *msg) 29 37 { 38 char errbuf[PJMEDIA_ERR_MSG_SIZE]; 39 40 pjmedia_strerror(status, errbuf, sizeof(errbuf)); 41 42 PJ_LOG(3,(THIS_FILE, "%s: %s", msg, errbuf)); 43 } 44 45 int test_main(void) 46 { 47 int rc; 30 48 pj_caching_pool caching_pool; 31 49 … … 33 51 pj_caching_pool_init(&caching_pool, &pj_pool_factory_default_policy, 0); 34 52 35 sdp_test (&caching_pool.factory); 36 rtp_test(&caching_pool.factory); 37 session_test (&caching_pool.factory); 53 pj_log_set_decor(PJ_LOG_HAS_NEWLINE); 54 55 mem = &caching_pool.factory; 56 57 DO_TEST(sdp_neg_test()); 58 //sdp_test (&caching_pool.factory); 59 //rtp_test(&caching_pool.factory); 60 //session_test (&caching_pool.factory); 38 61 //jbuf_main(&caching_pool.factory); 39 62 63 PJ_LOG(3,(THIS_FILE," ")); 64 65 on_return: 66 67 if (rc != 0) { 68 PJ_LOG(3,(THIS_FILE,"Test completed with error(s)!")); 69 } else { 70 PJ_LOG(3,(THIS_FILE,"Looks like everything is okay!")); 71 } 72 40 73 pj_caching_pool_destroy(&caching_pool); 41 return 0;74 return rc; 42 75 }
Note: See TracChangeset
for help on using the changeset viewer.