From 386883179a68467ec35dd1c481100ad5915081f0 Mon Sep 17 00:00:00 2001 From: Jean-Marc Valin Date: Tue, 4 Oct 2016 22:07:52 -0400 Subject: Fixing some opus_int vs opus_int32 mismatches Reported by Mark Warner. --- tests/test_opus_decode.c | 6 +++--- tests/test_opus_encode.c | 7 ++++--- 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'tests') diff --git a/tests/test_opus_decode.c b/tests/test_opus_decode.c index 14a8eef5..e703682f 100644 --- a/tests/test_opus_decode.c +++ b/tests/test_opus_decode.c @@ -104,7 +104,7 @@ int test_decoder_code0(int no_fuzz) int factor=48000/fsv[t>>1]; for(fec=0;fec<2;fec++) { - int dur; + opus_int32 dur; /*Test PLC on a fresh decoder*/ out_samples = opus_decode(dec[t], 0, 0, outbuf, 120/factor, fec); if(out_samples!=120/factor)test_failed(); @@ -160,7 +160,7 @@ int test_decoder_code0(int no_fuzz) /*Count code 0 tests*/ for(i=0;i<64;i++) { - int dur; + opus_int32 dur; int j,expected[5*2]; packet[0]=i<<2; packet[1]=255; @@ -314,7 +314,7 @@ int test_decoder_code0(int no_fuzz) if(opus_decode(decbak, 0, 0, outbuf, MAX_FRAME_SAMP, 0)<20)test_failed(); for(t=0;t<5*2;t++) { - int dur; + opus_int32 dur; out_samples = opus_decode(dec[t], packet, plen+1, outbuf, MAX_FRAME_SAMP, 0); if(out_samples!=expected[t])test_failed(); if(t==0)dec_final_range2=dec_final_range1; diff --git a/tests/test_opus_encode.c b/tests/test_opus_encode.c index 4e7ccf7d..c49a2adf 100644 --- a/tests/test_opus_encode.c +++ b/tests/test_opus_encode.c @@ -265,8 +265,8 @@ int run_test1(int no_fuzz) static const char *mstrings[3] = {" LP","Hybrid"," MDCT"}; unsigned char mapping[256] = {0,1,255}; unsigned char db62[36]; - opus_int32 i; - int rc,j,err; + opus_int32 i,j; + int rc,err; OpusEncoder *enc; OpusMSEncoder *MSenc; OpusDecoder *dec; @@ -482,7 +482,8 @@ int run_test1(int no_fuzz) if(opus_multistream_encoder_ctl(MSenc, OPUS_SET_BITRATE(rate))!=OPUS_OK)test_failed(); count=i=0; do { - int pred,len,out_samples,frame_size,loss; + int len,out_samples,frame_size,loss; + opus_int32 pred; if(opus_multistream_encoder_ctl(MSenc, OPUS_GET_PREDICTION_DISABLED(&pred))!=OPUS_OK)test_failed(); if(opus_multistream_encoder_ctl(MSenc, OPUS_SET_PREDICTION_DISABLED((int)(fast_rand()&15)<(pred?11:4)))!=OPUS_OK)test_failed(); frame_size=frame[j]; -- cgit v1.2.1