summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGregory Maxwell <greg@xiph.org>2013-11-17 08:52:00 -0800
committerGregory Maxwell <greg@xiph.org>2013-11-17 08:52:00 -0800
commit2632ef0396189e40c6415abad52ccbb774edf53f (patch)
tree88c5aa77184536fe1d025d92a20de7478be41291 /tests
parent0c7c4254313f49ad6c409baaee460787652286b4 (diff)
downloadopus-2632ef0396189e40c6415abad52ccbb774edf53f.tar.gz
Add some basic testing for OPUS_{GET|SET}_PREDICTION_DISABLED.
Diffstat (limited to 'tests')
-rw-r--r--tests/test_opus_api.c10
-rw-r--r--tests/test_opus_encode.c4
2 files changed, 13 insertions, 1 deletions
diff --git a/tests/test_opus_api.c b/tests/test_opus_api.c
index 6cbd2fa5..204cb2d2 100644
--- a/tests/test_opus_api.c
+++ b/tests/test_opus_api.c
@@ -1352,6 +1352,16 @@ opus_int32 test_enc_api(void)
" OPUS_SET_LSB_DEPTH ........................... OK.\n",
" OPUS_GET_LSB_DEPTH ........................... OK.\n")
+ err=opus_encoder_ctl(enc,OPUS_GET_PREDICTION_DISABLED(&i));
+ if(i!=0)test_failed();
+ cfgs++;
+ err=opus_encoder_ctl(enc,OPUS_GET_PREDICTION_DISABLED((opus_int32 *)NULL));
+ if(err!=OPUS_BAD_ARG)test_failed();
+ cfgs++;
+ CHECK_SETGET(OPUS_SET_PREDICTION_DISABLED(i),OPUS_GET_PREDICTION_DISABLED(&i),-1,2,1,0,
+ " OPUS_SET_PREDICTION_DISABLED ................. OK.\n",
+ " OPUS_GET_PREDICTION_DISABLED ................. OK.\n")
+
err=opus_encoder_ctl(enc,OPUS_GET_EXPERT_FRAME_DURATION((opus_int32 *)NULL));
if(err!=OPUS_BAD_ARG)test_failed();
cfgs++;
diff --git a/tests/test_opus_encode.c b/tests/test_opus_encode.c
index e9cda80f..0e544a44 100644
--- a/tests/test_opus_encode.c
+++ b/tests/test_opus_encode.c
@@ -308,7 +308,9 @@ 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 len,out_samples,frame_size,loss;
+ int pred,len,out_samples,frame_size,loss;
+ 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((fast_rand()&15)<(pred?11:4)))!=OPUS_OK)test_failed();
frame_size=frame[j];
if(opus_multistream_encoder_ctl(MSenc, OPUS_SET_COMPLEXITY((count>>2)%11))!=OPUS_OK)test_failed();
if(opus_multistream_encoder_ctl(MSenc, OPUS_SET_PACKET_LOSS_PERC((fast_rand()&15)&(fast_rand()%15)))!=OPUS_OK)test_failed();