summaryrefslogtreecommitdiff
path: root/pjsip/src/test
diff options
context:
space:
mode:
authorLiong Sauw Ming <ming@teluu.com>2011-03-15 05:09:29 +0000
committerLiong Sauw Ming <ming@teluu.com>2011-03-15 05:09:29 +0000
commit2db53631ab7583e95c0a3a7d27096af651afe753 (patch)
tree65e2ed9f50ebbb5bd28e0fd4b62b99e8eb628c33 /pjsip/src/test
parent61099d5ef6ff79b6ef03391b03dd0a3594ec2d4e (diff)
Misc (re #1175) (thanks to Seth Hinze for the patch):
* uri_test: Fixes a divide by zero error when the benchmark is run on a really fast machine. * presence: Fixes a compiler warning about potential referencing of an uninitialized variable. * echo_speex: Allow for compilation when PJMEDIA_HAS_SPEEX_AEC is not defined. git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@3443 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip/src/test')
-rw-r--r--pjsip/src/test/uri_test.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/pjsip/src/test/uri_test.c b/pjsip/src/test/uri_test.c
index 7807f506..d59a136d 100644
--- a/pjsip/src/test/uri_test.c
+++ b/pjsip/src/test/uri_test.c
@@ -952,6 +952,8 @@ static int uri_benchmark(unsigned *p_parse, unsigned *p_print, unsigned *p_cmp)
avg_parse = pj_elapsed_usec(&zero, &var.parse_time);
pj_highprec_mul(avg_parse, AVERAGE_URL_LEN);
pj_highprec_div(avg_parse, var.parse_len);
+ if (avg_parse == 0)
+ avg_parse = 1;
avg_parse = 1000000 / avg_parse;
PJ_LOG(3,(THIS_FILE,
@@ -969,6 +971,8 @@ static int uri_benchmark(unsigned *p_parse, unsigned *p_print, unsigned *p_cmp)
avg_print = pj_elapsed_usec(&zero, &var.print_time);
pj_highprec_mul(avg_print, AVERAGE_URL_LEN);
pj_highprec_div(avg_print, var.parse_len);
+ if (avg_print == 0)
+ avg_print = 1;
avg_print = 1000000 / avg_print;
PJ_LOG(3,(THIS_FILE,
@@ -986,6 +990,8 @@ static int uri_benchmark(unsigned *p_parse, unsigned *p_print, unsigned *p_cmp)
avg_cmp = pj_elapsed_usec(&zero, &var.cmp_time);
pj_highprec_mul(avg_cmp, AVERAGE_URL_LEN);
pj_highprec_div(avg_cmp, var.cmp_len);
+ if (avg_cmp == 0)
+ avg_cmp = 1;
avg_cmp = 1000000 / avg_cmp;
PJ_LOG(3,(THIS_FILE,