summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJean-Marc Valin <jmvalin@jmvalin.ca>2016-10-04 22:07:52 -0400
committerJean-Marc Valin <jmvalin@jmvalin.ca>2016-10-05 00:09:00 -0400
commit386883179a68467ec35dd1c481100ad5915081f0 (patch)
tree66eec7a977ae7b38f997b94561b1e6084fa9fc67 /tests
parentae5f5cc1c5d9919cc66efec2eea97f673228da44 (diff)
downloadopus-386883179a68467ec35dd1c481100ad5915081f0.tar.gz
Fixing some opus_int vs opus_int32 mismatches
Reported by Mark Warner.
Diffstat (limited to 'tests')
-rw-r--r--tests/test_opus_decode.c6
-rw-r--r--tests/test_opus_encode.c7
2 files changed, 7 insertions, 6 deletions
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];