From 91a5a3af26ac63e44fb5baf505c7f67cc2cac3d5 Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Mon, 24 Sep 2007 21:16:48 +0000 Subject: [PATCH] Fixed several unit test failures: typecast error on C++ mode, SIP parsing, etc. git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@1451 74dad513-b988-da41-8d7b-12977e46ad98 --- pjnath/src/pjnath-test/stun.c | 2 +- pjsip/src/pjsip-ua/sip_reg.c | 3 ++- pjsip/src/test-pjsip/msg_test.c | 2 +- self-test.mak | 5 ++++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/pjnath/src/pjnath-test/stun.c b/pjnath/src/pjnath-test/stun.c index 29a8eb1af..32a31719b 100644 --- a/pjnath/src/pjnath-test/stun.c +++ b/pjnath/src/pjnath-test/stun.c @@ -637,7 +637,7 @@ static int fingerprint_test_vector() } pos = cmp_buf(buf, (const pj_uint8_t*)v->pdu, len); - if (pos != -1) { + if (pos != (unsigned)-1) { PJ_LOG(1,(THIS_FILE, " Message mismatch at byte %d", pos)); rc = -1060; goto on_return; diff --git a/pjsip/src/pjsip-ua/sip_reg.c b/pjsip/src/pjsip-ua/sip_reg.c index df42c5396..41065aa0a 100644 --- a/pjsip/src/pjsip-ua/sip_reg.c +++ b/pjsip/src/pjsip-ua/sip_reg.c @@ -200,7 +200,8 @@ static pj_status_t set_contact( pjsip_regc *regc, pj_str_t tmp; pj_strdup_with_null(regc->pool, &tmp, &contact[i]); - hdr = pjsip_parse_hdr(regc->pool, &CONTACT, tmp.ptr, tmp.slen, NULL); + hdr = (pjsip_hdr*) + pjsip_parse_hdr(regc->pool, &CONTACT, tmp.ptr, tmp.slen, NULL); if (hdr == NULL) { PJ_LOG(4,(THIS_FILE, "Invalid Contact URI: \"%.*s\"", (int)tmp.slen, tmp.ptr)); diff --git a/pjsip/src/test-pjsip/msg_test.c b/pjsip/src/test-pjsip/msg_test.c index 62f85fbe3..ce6c372f2 100644 --- a/pjsip/src/test-pjsip/msg_test.c +++ b/pjsip/src/test-pjsip/msg_test.c @@ -1085,7 +1085,7 @@ static int hdr_test_cid(pjsip_hdr *h) if (h->type != PJSIP_H_CALL_ID) return -1510; - if (pj_strcmp2(&hdr->id, "-.!%*_+`'~()<>:\\\"/[]?{}\r\n")) + if (pj_strcmp2(&hdr->id, "-.!%*_+`'~()<>:\\\"/[]?{}")) return -1520; return 0; diff --git a/self-test.mak b/self-test.mak index 502c6a6b1..7685f9eff 100644 --- a/self-test.mak +++ b/self-test.mak @@ -14,7 +14,9 @@ PJSUA_OPT=--null-audio build_test: distclean rm_build_mak build_mak everything cpp_prep cpp_test cpp_post everything -all: build_test pjlib_test pjlib_util_test pjnath_test pjsip_test pjsua_test +run_test: pjlib_test pjlib_util_test pjnath_test pjsip_test pjsua_test + +all: build_test run_test CPP_DIR=pjlib pjlib-util pjnath pjmedia pjsip @@ -57,6 +59,7 @@ cpp_post: make -f c++-build.mak clean pjsua_test: pjsua_config_file pjsua_local_port0 pjsua_ip_addr pjsua_no_tcp pjsua_no_udp pjsua_outbound pjsua_use_ice pjsua_add_codec pjsua_clock_rate pjsua_play_file pjsua_play_tone pjsua_rec_file pjsua_rtp_port pjsua_quality pjsua_ptime pjsua_ectail + @echo pjsua_test completed successfully pjsua_config_file: touch testconfig.cfg