From 57b75697969b3cfd0cc5fe6ca3c98b38acc16608 Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Sat, 7 Jan 2006 18:44:25 +0000 Subject: Added test functions for UAC transaction git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@109 74dad513-b988-da41-8d7b-12977e46ad98 --- pjsip/src/test-pjsip/transport_udp_test.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'pjsip/src/test-pjsip/transport_udp_test.c') diff --git a/pjsip/src/test-pjsip/transport_udp_test.c b/pjsip/src/test-pjsip/transport_udp_test.c index 0fdbddae..ebc0557d 100644 --- a/pjsip/src/test-pjsip/transport_udp_test.c +++ b/pjsip/src/test-pjsip/transport_udp_test.c @@ -21,6 +21,8 @@ #include #include +#define THIS_FILE "transport_udp_test.c" + /* * UDP transport test. @@ -32,7 +34,7 @@ int transport_udp_test(void) pj_sockaddr_in addr, rem_addr; pj_str_t s; pj_status_t status; - int i; + int i, pkt_lost; pj_sockaddr_in_init(&addr, NULL, TEST_UDP_PORT); @@ -84,10 +86,14 @@ int transport_udp_test(void) /* Multi-threaded round-trip test. */ status = transport_rt_test(PJSIP_TRANSPORT_UDP, tp, - "sip:alice@127.0.0.1:"TEST_UDP_PORT_STR); + "sip:alice@127.0.0.1:"TEST_UDP_PORT_STR, + &pkt_lost); if (status != 0) return status; + if (pkt_lost != 0) + PJ_LOG(3,(THIS_FILE, " note: %d packet(s) was lost", pkt_lost)); + /* Check again that reference counter is 1. */ if (pj_atomic_get(udp_tp->ref_cnt) != 1) return -80; @@ -100,6 +106,9 @@ int transport_udp_test(void) if (status != PJ_SUCCESS) return -90; + /* Flush events. */ + PJ_LOG(3,(THIS_FILE, " Flushing events, 1 second...")); + flush_events(1000); /* Done */ return 0; -- cgit v1.2.3