fix ARM build w/--disable-intrinsics --enable-asm
[opus.git] / tests / test_opus_api.c
index 17b9629..1d00950 100644 (file)
@@ -1383,6 +1383,15 @@ opus_int32 test_enc_api(void)
    err=opus_encoder_ctl(enc,OPUS_SET_EXPERT_FRAME_DURATION(OPUS_FRAMESIZE_60_MS));
    if(err!=OPUS_OK)test_failed();
    cfgs++;
+   err=opus_encoder_ctl(enc,OPUS_SET_EXPERT_FRAME_DURATION(OPUS_FRAMESIZE_80_MS));
+   if(err!=OPUS_OK)test_failed();
+   cfgs++;
+   err=opus_encoder_ctl(enc,OPUS_SET_EXPERT_FRAME_DURATION(OPUS_FRAMESIZE_100_MS));
+   if(err!=OPUS_OK)test_failed();
+   cfgs++;
+   err=opus_encoder_ctl(enc,OPUS_SET_EXPERT_FRAME_DURATION(OPUS_FRAMESIZE_120_MS));
+   if(err!=OPUS_OK)test_failed();
+   cfgs++;
    CHECK_SETGET(OPUS_SET_EXPERT_FRAME_DURATION(i),OPUS_GET_EXPERT_FRAME_DURATION(&i),0,-1,
          OPUS_FRAMESIZE_60_MS,OPUS_FRAMESIZE_ARG,
      "    OPUS_SET_EXPERT_FRAME_DURATION ............... OK.\n",
@@ -1558,6 +1567,14 @@ int test_repacketizer_api(void)
                   cfgs++;
                   if(opus_packet_unpad(po,len+256)!=len)test_failed();
                   cfgs++;
+                  if(opus_multistream_packet_unpad(po,len,1)!=len)test_failed();
+                  cfgs++;
+                  if(opus_multistream_packet_pad(po,len,len+1,1)!=OPUS_OK)test_failed();
+                  cfgs++;
+                  if(opus_multistream_packet_pad(po,len+1,len+256,1)!=OPUS_OK)test_failed();
+                  cfgs++;
+                  if(opus_multistream_packet_unpad(po,len+256,1)!=len)test_failed();
+                  cfgs++;
                   if(opus_repacketizer_out(rp,po,len-1)!=OPUS_BUFFER_TOO_SMALL)test_failed();
                   cfgs++;
                   if(len>1)
@@ -1665,6 +1682,14 @@ int test_repacketizer_api(void)
          cfgs++;
          if(opus_packet_unpad(po,len+256)!=len)test_failed();
          cfgs++;
+         if(opus_multistream_packet_unpad(po,len,1)!=len)test_failed();
+         cfgs++;
+         if(opus_multistream_packet_pad(po,len,len+1,1)!=OPUS_OK)test_failed();
+         cfgs++;
+         if(opus_multistream_packet_pad(po,len+1,len+256,1)!=OPUS_OK)test_failed();
+         cfgs++;
+         if(opus_multistream_packet_unpad(po,len+256,1)!=len)test_failed();
+         cfgs++;
          if(opus_repacketizer_out(rp,po,len-1)!=OPUS_BUFFER_TOO_SMALL)test_failed();
          cfgs++;
          if(len>1)
@@ -1679,21 +1704,41 @@ int test_repacketizer_api(void)
 
    po[0]='O';
    po[1]='p';
-   if(opus_packet_pad(po,4,5)!=OPUS_BAD_ARG)test_failed();
+   if(opus_packet_pad(po,4,4)!=OPUS_OK)test_failed();
+   cfgs++;
+   if(opus_multistream_packet_pad(po,4,4,1)!=OPUS_OK)test_failed();
+   cfgs++;
+   if(opus_packet_pad(po,4,5)!=OPUS_INVALID_PACKET)test_failed();
+   cfgs++;
+   if(opus_multistream_packet_pad(po,4,5,1)!=OPUS_INVALID_PACKET)test_failed();
+   cfgs++;
+   if(opus_packet_pad(po,0,5)!=OPUS_BAD_ARG)test_failed();
+   cfgs++;
+   if(opus_multistream_packet_pad(po,0,5,1)!=OPUS_BAD_ARG)test_failed();
+   cfgs++;
+   if(opus_packet_unpad(po,0)!=OPUS_BAD_ARG)test_failed();
+   cfgs++;
+   if(opus_multistream_packet_unpad(po,0,1)!=OPUS_BAD_ARG)test_failed();
    cfgs++;
    if(opus_packet_unpad(po,4)!=OPUS_INVALID_PACKET)test_failed();
    cfgs++;
+   if(opus_multistream_packet_unpad(po,4,1)!=OPUS_INVALID_PACKET)test_failed();
+   cfgs++;
    po[0]=0;
    po[1]=0;
    po[2]=0;
    if(opus_packet_pad(po,5,4)!=OPUS_BAD_ARG)test_failed();
    cfgs++;
+   if(opus_multistream_packet_pad(po,5,4,1)!=OPUS_BAD_ARG)test_failed();
+   cfgs++;
 
    fprintf(stdout,"    opus_repacketizer_cat ........................ OK.\n");
    fprintf(stdout,"    opus_repacketizer_out ........................ OK.\n");
    fprintf(stdout,"    opus_repacketizer_out_range .................. OK.\n");
    fprintf(stdout,"    opus_packet_pad .............................. OK.\n");
    fprintf(stdout,"    opus_packet_unpad ............................ OK.\n");
+   fprintf(stdout,"    opus_multistream_packet_pad .................. OK.\n");
+   fprintf(stdout,"    opus_multistream_packet_unpad ................ OK.\n");
 
    opus_repacketizer_destroy(rp);
    cfgs++;
@@ -1717,7 +1762,7 @@ int test_repacketizer_api(void)
 #endif
 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
 
-typedef void *(*mhook)(size_t __size, __const __malloc_ptr_t);
+typedef void *(*mhook)(size_t __size, __const void *);
 #endif
 
 int test_malloc_fail(void)