@@ -29,8 +29,7 @@ static VIDEO_EME_CBCS_MP4: &str = "tests/bipbop_cbcs_video_init.mp4";
29
29
static VIDEO_AV1_MP4 : & str = "tests/tiny_av1.mp4" ;
30
30
static IMAGE_AVIF : & str = "av1-avif/testFiles/Microsoft/Monochrome.avif" ;
31
31
static IMAGE_AVIF_GRID : & str = "av1-avif/testFiles/Microsoft/Summer_in_Tomsk_720p_5x4_grid.avif" ;
32
- static MICROSOFT_AVIF_TEST_DIR : & str = "av1-avif/testFiles/Microsoft" ;
33
- static NETFLIX_AVIF_TEST_DIR : & str = "av1-avif/testFiles/Netflix/avif" ;
32
+ static AVIF_TEST_DIR : & str = "av1-avif/testFiles" ;
34
33
35
34
// Adapted from https://github.com/GuillaumeGomez/audio-video-metadata/blob/9dff40f565af71d5502e03a2e78ae63df95cfd40/src/metadata.rs#L53
36
35
#[ test]
@@ -640,22 +639,19 @@ fn public_avif_primary_item_is_grid() {
640
639
#[ test]
641
640
fn public_avif_read_samples ( ) {
642
641
env_logger:: init ( ) ;
643
- let microsoft = Path :: new ( MICROSOFT_AVIF_TEST_DIR )
644
- . read_dir ( )
645
- . expect ( "Cannot read AVIF test dir" ) ;
646
- let netflix = Path :: new ( NETFLIX_AVIF_TEST_DIR )
647
- . read_dir ( )
648
- . expect ( "Cannot read AVIF test dir" ) ;
649
- for entry in microsoft. chain ( netflix) {
650
- let path = entry. expect ( "AVIF entry" ) . path ( ) ;
651
- if path. extension ( ) . expect ( "no extension" ) != "avif" {
642
+
643
+ for entry in walkdir:: WalkDir :: new ( AVIF_TEST_DIR ) {
644
+ let entry = entry. expect ( "AVIF entry" ) ;
645
+ let path = entry. path ( ) ;
646
+ if !path. is_file ( ) || path. extension ( ) . unwrap_or_default ( ) != "avif" {
652
647
eprintln ! ( "Skipping {:?}" , path) ;
653
- continue ; // Skip ReadMe.txt, etc.
648
+ continue ; // Skip directories, ReadMe.txt, etc.
654
649
}
655
650
if path == Path :: new ( IMAGE_AVIF_GRID ) {
656
651
eprintln ! ( "Skipping {:?}" , path) ;
657
652
continue ; // Remove when public_avif_primary_item_is_grid passes
658
653
}
654
+ println ! ( "parsing {:?}" , path) ;
659
655
let context = & mut mp4:: AvifContext :: new ( ) ;
660
656
let input = & mut File :: open ( path) . expect ( "Unknow file" ) ;
661
657
mp4:: read_avif ( input, context) . expect ( "read_avif failed" ) ;
0 commit comments