summaryrefslogtreecommitdiff
path: root/pjsip/src/test
diff options
context:
space:
mode:
authorNanang Izzuddin <nanang@teluu.com>2009-04-28 19:38:43 +0000
committerNanang Izzuddin <nanang@teluu.com>2009-04-28 19:38:43 +0000
commit7a0ee1a7208ddfe8575d1f1179f66fda2fa99339 (patch)
treea21e4846fd4d08aa06d2f5424cf52042d6d1d9e1 /pjsip/src/test
parentcd00a93db99d842d8fcadb60aeb20ba47b4b4165 (diff)
Ticket #706: Merged branch vs-reorg2 into trunk:
- Currently supported platforms are: Win32, WM6 std & pro, WM5 SP & PPC, WM2003 SP & PPC. - Added libpjproject into solution, this is a single 'combo' library that bundles all PJSIP libraries. - Cleaned up most of compile warnings, note that warning level of libgsmcodec has been reduced from 4 to 3. git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2660 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip/src/test')
-rw-r--r--pjsip/src/test/inv_offer_answer_test.c14
-rw-r--r--pjsip/src/test/main.c2
-rw-r--r--pjsip/src/test/msg_err_test.c3
-rw-r--r--pjsip/src/test/msg_test.c3
-rw-r--r--pjsip/src/test/test.c2
-rw-r--r--pjsip/src/test/transport_test.c17
-rw-r--r--pjsip/src/test/tsx_uac_test.c14
-rw-r--r--pjsip/src/test/tsx_uas_test.c28
-rw-r--r--pjsip/src/test/uri_test.c2
9 files changed, 62 insertions, 23 deletions
diff --git a/pjsip/src/test/inv_offer_answer_test.c b/pjsip/src/test/inv_offer_answer_test.c
index 22809ddf..419a9ee3 100644
--- a/pjsip/src/test/inv_offer_answer_test.c
+++ b/pjsip/src/test/inv_offer_answer_test.c
@@ -194,6 +194,8 @@ static void on_rx_offer(pjsip_inv_session *inv,
{
pjmedia_sdp_session *sdp;
+ PJ_UNUSED_ARG(offer);
+
sdp = create_sdp(inv->dlg->pool, oa_sdp[inv_test.oa_index].answer);
pjsip_inv_set_sdp_answer(inv, sdp);
@@ -210,12 +212,17 @@ static void on_rx_offer(pjsip_inv_session *inv,
static void on_create_offer(pjsip_inv_session *inv,
pjmedia_sdp_session **p_offer)
{
+ PJ_UNUSED_ARG(inv);
+ PJ_UNUSED_ARG(p_offer);
+
pj_assert(!"Should not happen");
}
static void on_media_update(pjsip_inv_session *inv_ses,
pj_status_t status)
{
+ PJ_UNUSED_ARG(status);
+
if (inv_ses == inv_test.uas) {
inv_test.uas_update_cnt++;
pj_assert(inv_test.uas_update_cnt - inv_test.uac_update_cnt <= 1);
@@ -257,6 +264,8 @@ static void on_state_changed(pjsip_inv_session *inv, pjsip_event *e)
{
const char *who = NULL;
+ PJ_UNUSED_ARG(e);
+
if (inv->state == PJSIP_INV_STATE_DISCONNECTED) {
TRACE_((THIS_FILE, " %s call disconnected",
(inv==inv_test.uas ? "Callee" : "Caller")));
@@ -611,12 +620,17 @@ static inv_test_param_t test_params[] =
static pjsip_dialog* on_dlg_forked(pjsip_dialog *first_set, pjsip_rx_data *res)
{
+ PJ_UNUSED_ARG(first_set);
+ PJ_UNUSED_ARG(res);
+
return NULL;
}
static void on_new_session(pjsip_inv_session *inv, pjsip_event *e)
{
+ PJ_UNUSED_ARG(inv);
+ PJ_UNUSED_ARG(e);
}
diff --git a/pjsip/src/test/main.c b/pjsip/src/test/main.c
index 044cd51a..2289f696 100644
--- a/pjsip/src/test/main.c
+++ b/pjsip/src/test/main.c
@@ -39,6 +39,8 @@ int main(int argc, char *argv[])
int retval;
char **opt_arg;
+ PJ_UNUSED_ARG(argc);
+
/* Parse arguments. */
opt_arg = argv+1;
while (*opt_arg) {
diff --git a/pjsip/src/test/msg_err_test.c b/pjsip/src/test/msg_err_test.c
index 46d28f15..e04a9150 100644
--- a/pjsip/src/test/msg_err_test.c
+++ b/pjsip/src/test/msg_err_test.c
@@ -27,6 +27,9 @@
static pj_bool_t verify_success(pjsip_msg *msg,
pjsip_parser_err_report *err_list)
{
+ PJ_UNUSED_ARG(msg);
+ PJ_UNUSED_ARG(err_list);
+
return PJ_TRUE;
}
diff --git a/pjsip/src/test/msg_test.c b/pjsip/src/test/msg_test.c
index 840c40ff..0d922a5b 100644
--- a/pjsip/src/test/msg_test.c
+++ b/pjsip/src/test/msg_test.c
@@ -837,13 +837,12 @@ static pj_status_t simple_test(void)
static int msg_benchmark(unsigned *p_detect, unsigned *p_parse,
unsigned *p_print)
{
- pj_status_t status;
pj_pool_t *pool;
int i, loop;
pj_timestamp zero;
pj_time_val elapsed;
pj_highprec_t avg_detect, avg_parse, avg_print, kbytes;
-
+ pj_status_t status = PJ_SUCCESS;
pj_bzero(&var, sizeof(var));
zero.u64 = 0;
diff --git a/pjsip/src/test/test.c b/pjsip/src/test/test.c
index 5ce2b71a..df5523a7 100644
--- a/pjsip/src/test/test.c
+++ b/pjsip/src/test/test.c
@@ -88,6 +88,8 @@ void flush_events(unsigned duration)
pj_status_t register_static_modules(pj_size_t *count, pjsip_module **modules)
{
+ PJ_UNUSED_ARG(modules);
+
*count = 0;
return PJ_SUCCESS;
}
diff --git a/pjsip/src/test/transport_test.c b/pjsip/src/test/transport_test.c
index 9f19b68f..a17dca82 100644
--- a/pjsip/src/test/transport_test.c
+++ b/pjsip/src/test/transport_test.c
@@ -159,6 +159,8 @@ static pj_bool_t my_on_rx_response(pjsip_rx_data *rdata)
static void send_msg_callback(pjsip_send_state *stateless_data,
pj_ssize_t sent, pj_bool_t *cont)
{
+ PJ_UNUSED_ARG(stateless_data);
+
if (sent < 1) {
/* Obtain the error code. */
send_status = -sent;
@@ -184,6 +186,9 @@ int transport_send_recv_test( pjsip_transport_type_e tp_type,
pjsip_tx_data *tdata;
pj_time_val timeout;
+ PJ_UNUSED_ARG(tp_type);
+ PJ_UNUSED_ARG(ref_tp);
+
PJ_LOG(3,(THIS_FILE, " single message round-trip test..."));
/* Register out test module to receive the message (if necessary). */
@@ -490,6 +495,8 @@ static int rt_worker_thread(void *arg)
int i;
pj_time_val poll_delay = { 0, 10 };
+ PJ_UNUSED_ARG(arg);
+
/* Sleep to allow main threads to run. */
pj_thread_sleep(10);
@@ -520,6 +527,9 @@ int transport_rt_test( pjsip_transport_type_e tp_type,
unsigned total_sent;
unsigned total_recv;
+ PJ_UNUSED_ARG(tp_type);
+ PJ_UNUSED_ARG(ref_tp);
+
PJ_LOG(3,(THIS_FILE, " multithreaded round-trip test (%d threads)...",
THREADS));
PJ_LOG(3,(THIS_FILE, " this will take approx %d seconds, please wait..",
@@ -550,8 +560,9 @@ int transport_rt_test( pjsip_transport_type_e tp_type,
/* Initialize thread data. */
for (i=0; i<THREADS; ++i) {
char buf[1];
- pj_str_t str_id = { buf, 1 };
-
+ pj_str_t str_id;
+
+ pj_strset(&str_id, buf, 1);
pj_bzero(&rt_test_data[i], sizeof(rt_test_data[i]));
/* Init timer entry */
@@ -563,7 +574,7 @@ int transport_rt_test( pjsip_transport_type_e tp_type,
/* Generate Call-ID for each thread. */
rt_test_data[i].call_id.ptr = (char*) pj_pool_alloc(pool, rt_call_id.slen+1);
pj_strcpy(&rt_test_data[i].call_id, &rt_call_id);
- buf[0] = '0' + i;
+ buf[0] = '0' + (char)i;
pj_strcat(&rt_test_data[i].call_id, &str_id);
/* Init mutex. */
diff --git a/pjsip/src/test/tsx_uac_test.c b/pjsip/src/test/tsx_uac_test.c
index f725114a..f6f9c2fe 100644
--- a/pjsip/src/test/tsx_uac_test.c
+++ b/pjsip/src/test/tsx_uac_test.c
@@ -551,6 +551,8 @@ static void send_response_callback( pj_timer_heap_t *timer_heap,
struct response *r = (struct response*) entry->user_data;
pjsip_transport *tp = r->res_addr.transport;
+ PJ_UNUSED_ARG(timer_heap);
+
pjsip_endpt_send_response(endpt, &r->res_addr, r->tdata, NULL, NULL);
if (tp)
pjsip_transport_dec_ref(tp);
@@ -564,6 +566,8 @@ static void terminate_tsx_callback( pj_timer_heap_t *timer_heap,
pjsip_transaction *tsx = pjsip_tsx_layer_find_tsx(&m->tsx_key, PJ_FALSE);
int status_code = entry->id;
+ PJ_UNUSED_ARG(timer_heap);
+
if (tsx) {
pjsip_tsx_terminate(tsx, status_code);
}
@@ -947,6 +951,8 @@ static int perform_tsx_test(int dummy, char *target_uri, char *from_uri,
pj_time_val timeout;
pj_status_t status;
+ PJ_UNUSED_ARG(dummy);
+
PJ_LOG(3,(THIS_FILE,
" please standby, this will take at most %d seconds..",
test_time));
@@ -1077,7 +1083,7 @@ static int perform_tsx_test(int dummy, char *target_uri, char *from_uri,
*/
static int tsx_uac_retransmit_test(void)
{
- int status, enabled;
+ int status = 0, enabled;
int i;
struct {
const pjsip_method *method;
@@ -1141,7 +1147,7 @@ static int tsx_uac_retransmit_test(void)
*/
static int tsx_resolve_error_test(void)
{
- int status;
+ int status = 0;
PJ_LOG(3,(THIS_FILE, " test2: resolve error test"));
@@ -1226,7 +1232,7 @@ static int tsx_retransmit_fail_test(void)
{
int i;
unsigned delay[] = {0, 10};
- pj_status_t status;
+ pj_status_t status = PJ_SUCCESS;
PJ_LOG(3,(THIS_FILE,
" test4: transport fails after several retransmissions test"));
@@ -1297,7 +1303,7 @@ static int perform_generic_test( const char *title,
char *branch_id,
const pjsip_method *method)
{
- int i, status;
+ int i, status = 0;
unsigned delay[] = { 1, 200 };
PJ_LOG(3,(THIS_FILE, " %s", title));
diff --git a/pjsip/src/test/tsx_uas_test.c b/pjsip/src/test/tsx_uas_test.c
index 813e4e50..f397ea78 100644
--- a/pjsip/src/test/tsx_uas_test.c
+++ b/pjsip/src/test/tsx_uas_test.c
@@ -95,19 +95,19 @@
**
**/
-static char *TEST1_BRANCH_ID = PJSIP_RFC3261_BRANCH_ID "-UAS-Test1";
-static char *TEST2_BRANCH_ID = PJSIP_RFC3261_BRANCH_ID "-UAS-Test2";
-static char *TEST3_BRANCH_ID = PJSIP_RFC3261_BRANCH_ID "-UAS-Test3";
-static char *TEST4_BRANCH_ID = PJSIP_RFC3261_BRANCH_ID "-UAS-Test4";
-static char *TEST5_BRANCH_ID = PJSIP_RFC3261_BRANCH_ID "-UAS-Test5";
-static char *TEST6_BRANCH_ID = PJSIP_RFC3261_BRANCH_ID "-UAS-Test6";
-static char *TEST7_BRANCH_ID = PJSIP_RFC3261_BRANCH_ID "-UAS-Test7";
-static char *TEST8_BRANCH_ID = PJSIP_RFC3261_BRANCH_ID "-UAS-Test8";
-static char *TEST9_BRANCH_ID = PJSIP_RFC3261_BRANCH_ID "-UAS-Test9";
-static char *TEST10_BRANCH_ID = PJSIP_RFC3261_BRANCH_ID "-UAS-Test10";
-static char *TEST11_BRANCH_ID = PJSIP_RFC3261_BRANCH_ID "-UAS-Test11";
-static char *TEST12_BRANCH_ID = PJSIP_RFC3261_BRANCH_ID "-UAS-Test12";
-//static char *TEST13_BRANCH_ID = PJSIP_RFC3261_BRANCH_ID "-UAS-Test13";
+#define TEST1_BRANCH_ID (PJSIP_RFC3261_BRANCH_ID "-UAS-Test1")
+#define TEST2_BRANCH_ID (PJSIP_RFC3261_BRANCH_ID "-UAS-Test2")
+#define TEST3_BRANCH_ID (PJSIP_RFC3261_BRANCH_ID "-UAS-Test3")
+#define TEST4_BRANCH_ID (PJSIP_RFC3261_BRANCH_ID "-UAS-Test4")
+#define TEST5_BRANCH_ID (PJSIP_RFC3261_BRANCH_ID "-UAS-Test5")
+#define TEST6_BRANCH_ID (PJSIP_RFC3261_BRANCH_ID "-UAS-Test6")
+#define TEST7_BRANCH_ID (PJSIP_RFC3261_BRANCH_ID "-UAS-Test7")
+#define TEST8_BRANCH_ID (PJSIP_RFC3261_BRANCH_ID "-UAS-Test8")
+#define TEST9_BRANCH_ID (PJSIP_RFC3261_BRANCH_ID "-UAS-Test9")
+#define TEST10_BRANCH_ID (PJSIP_RFC3261_BRANCH_ID "-UAS-Test10")
+#define TEST11_BRANCH_ID (PJSIP_RFC3261_BRANCH_ID "-UAS-Test11")
+#define TEST12_BRANCH_ID (PJSIP_RFC3261_BRANCH_ID "-UAS-Test12")
+//#define TEST13_BRANCH_ID (PJSIP_RFC3261_BRANCH_ID "-UAS-Test13")
#define TEST1_STATUS_CODE 200
#define TEST2_STATUS_CODE 301
@@ -212,6 +212,8 @@ static void send_response_timer( pj_timer_heap_t *timer_heap,
struct response *r = (struct response*) entry->user_data;
pj_status_t status;
+ PJ_UNUSED_ARG(timer_heap);
+
tsx = pjsip_tsx_layer_find_tsx(&r->tsx_key, PJ_TRUE);
if (!tsx) {
PJ_LOG(3,(THIS_FILE," error: timer unable to find transaction"));
diff --git a/pjsip/src/test/uri_test.c b/pjsip/src/test/uri_test.c
index d51c6fe5..7807f506 100644
--- a/pjsip/src/test/uri_test.c
+++ b/pjsip/src/test/uri_test.c
@@ -917,7 +917,7 @@ static int simple_uri_test(void)
static int uri_benchmark(unsigned *p_parse, unsigned *p_print, unsigned *p_cmp)
{
unsigned i, loop;
- pj_status_t status;
+ pj_status_t status = PJ_SUCCESS;
pj_timestamp zero;
pj_time_val elapsed;
pj_highprec_t avg_parse, avg_print, avg_cmp, kbytes;