mirror of
https://gitee.com/openharmony/third_party_libsnd
synced 2024-11-23 09:59:54 +00:00
Add string tests for ogg/vorbis.
This commit is contained in:
parent
acf57411ad
commit
c407bb63af
@ -292,6 +292,7 @@ wve-tests: lossy_comp_test
|
||||
vorbis-tests: lossy_comp_test ogg_test
|
||||
./ogg_test
|
||||
./lossy_comp_test ogg_vorbis
|
||||
./string_test ogg
|
||||
@echo "----------------------------------------------------------------------"
|
||||
@echo " `./sfversion` passed tests on OGG/VORBIS files."
|
||||
@echo "----------------------------------------------------------------------"
|
||||
|
@ -50,6 +50,7 @@ main (int argc, char *argv [])
|
||||
printf (" wav - test adding strings to WAV files\n") ;
|
||||
printf (" aiff - test adding strings to AIFF files\n") ;
|
||||
printf (" flac - test adding strings to FLAC files\n") ;
|
||||
printf (" ogg - test adding strings to OGG files\n") ;
|
||||
printf (" all - perform all tests\n") ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
@ -71,6 +72,11 @@ main (int argc, char *argv [])
|
||||
test_count++ ;
|
||||
} ;
|
||||
|
||||
if (do_all || ! strcmp (argv [1], "ogg"))
|
||||
{ string_start_test ("vorbis.oga", SF_FORMAT_OGG) ;
|
||||
test_count++ ;
|
||||
} ;
|
||||
|
||||
if (test_count == 0)
|
||||
{ printf ("Mono : ************************************\n") ;
|
||||
printf ("Mono : * No '%s' test defined.\n", argv [1]) ;
|
||||
@ -236,7 +242,16 @@ string_start_test (const char *filename, int typemajor)
|
||||
sfinfo.samplerate = 44100 ;
|
||||
sfinfo.channels = 1 ;
|
||||
sfinfo.frames = 0 ;
|
||||
sfinfo.format = typemajor | SF_FORMAT_PCM_16 ;
|
||||
|
||||
switch (typemajor)
|
||||
{ case SF_FORMAT_OGG :
|
||||
sfinfo.format = typemajor | SF_FORMAT_VORBIS ;
|
||||
break ;
|
||||
|
||||
default :
|
||||
sfinfo.format = typemajor | SF_FORMAT_PCM_16 ;
|
||||
break ;
|
||||
} ;
|
||||
|
||||
frames = BUFFER_LEN / sfinfo.channels ;
|
||||
|
||||
@ -330,7 +345,7 @@ string_start_test (const char *filename, int typemajor)
|
||||
if (cptr == NULL || strcmp (license, cptr) != 0)
|
||||
{ if (errors++ == 0)
|
||||
puts ("\n") ;
|
||||
printf (" Bad license : %s\n", cptr) ;
|
||||
printf (" Bad license : %s\n", cptr) ;
|
||||
} ;
|
||||
} ;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user