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
remotes/origin/turn
Benny Prijono 17 years ago
parent 2501e1345a
commit 91a5a3af26

@ -637,7 +637,7 @@ static int fingerprint_test_vector()
} }
pos = cmp_buf(buf, (const pj_uint8_t*)v->pdu, len); 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)); PJ_LOG(1,(THIS_FILE, " Message mismatch at byte %d", pos));
rc = -1060; rc = -1060;
goto on_return; goto on_return;

@ -200,7 +200,8 @@ static pj_status_t set_contact( pjsip_regc *regc,
pj_str_t tmp; pj_str_t tmp;
pj_strdup_with_null(regc->pool, &tmp, &contact[i]); 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) { if (hdr == NULL) {
PJ_LOG(4,(THIS_FILE, "Invalid Contact URI: \"%.*s\"", PJ_LOG(4,(THIS_FILE, "Invalid Contact URI: \"%.*s\"",
(int)tmp.slen, tmp.ptr)); (int)tmp.slen, tmp.ptr));

@ -1085,7 +1085,7 @@ static int hdr_test_cid(pjsip_hdr *h)
if (h->type != PJSIP_H_CALL_ID) if (h->type != PJSIP_H_CALL_ID)
return -1510; return -1510;
if (pj_strcmp2(&hdr->id, "-.!%*_+`'~()<>:\\\"/[]?{}\r\n")) if (pj_strcmp2(&hdr->id, "-.!%*_+`'~()<>:\\\"/[]?{}"))
return -1520; return -1520;
return 0; return 0;

@ -14,7 +14,9 @@ PJSUA_OPT=--null-audio
build_test: distclean rm_build_mak build_mak everything cpp_prep cpp_test cpp_post everything 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 CPP_DIR=pjlib pjlib-util pjnath pjmedia pjsip
@ -57,6 +59,7 @@ cpp_post:
make -f c++-build.mak clean 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 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: pjsua_config_file:
touch testconfig.cfg touch testconfig.cfg

Loading…
Cancel
Save