diff --git a/tests/taglib/test_aiff.rs b/tests/taglib/test_aiff.rs index 4c61db2ff..c1d15c00e 100644 --- a/tests/taglib/test_aiff.rs +++ b/tests/taglib/test_aiff.rs @@ -93,8 +93,9 @@ fn test_save_id3v2() { } #[test] -#[ignore] // TODO: Support writing ID3v2.3 tags -fn test_save_id3v23() {} +fn test_save_id3v23() { + todo!("Support writing ID3v2.3 tags") +} #[test] #[ignore] diff --git a/tests/taglib/test_ape.rs b/tests/taglib/test_ape.rs index de7261523..09c74d8a0 100644 --- a/tests/taglib/test_ape.rs +++ b/tests/taglib/test_ape.rs @@ -23,25 +23,21 @@ fn test_399(path: &str) { } #[test] -#[ignore] fn test_properties_399() { test_399("tests/taglib/data/mac-399.ape") } #[test] -#[ignore] fn test_properties_399_tagged() { test_399("tests/taglib/data/mac-399-tagged.ape") } #[test] -#[ignore] fn test_properties_399_id3v2() { test_399("tests/taglib/data/mac-399-id3v2.ape") } #[test] -#[ignore] fn test_properties_396() { let f = get_file::("tests/taglib/data/mac-396.ape"); let properties = f.properties(); @@ -57,7 +53,6 @@ fn test_properties_396() { } #[test] -#[ignore] fn test_properties_390() { let f = get_file::("tests/taglib/data/mac-390-hdr.ape"); let properties = f.properties(); diff --git a/tests/taglib/test_apetag.rs b/tests/taglib/test_apetag.rs index 2bc591abb..bc6116244 100644 --- a/tests/taglib/test_apetag.rs +++ b/tests/taglib/test_apetag.rs @@ -91,7 +91,6 @@ fn test_text_binary() { // TODO: Does not work! We fall for this collision. #[test] -#[ignore] fn test_id3v1_collision() { let mut file = temp_file!("tests/taglib/data/no-tags.mpc"); { diff --git a/tests/taglib/test_fileref.rs b/tests/taglib/test_fileref.rs index d2d25ff74..174c77aa1 100644 --- a/tests/taglib/test_fileref.rs +++ b/tests/taglib/test_fileref.rs @@ -78,7 +78,6 @@ fn file_ref_save(path: &str, expected_file_type: FileType) { } #[test] -#[ignore] fn test_musepack() { file_ref_save("click.mpc", FileType::Mpc); } @@ -202,7 +201,6 @@ fn test_create() { } #[test] -#[ignore] // TODO: We're off by over 200ms fn test_audio_properties() { let file = lofty::read_from_path("tests/taglib/data/xing.mp3").unwrap(); let properties = file.properties(); @@ -216,8 +214,8 @@ fn test_default_file_extensions() { // Marker test, Lofty does not replicate this API } +// TODO: We need to check resolvers *first* and then resort to our default implementations #[test] -#[ignore] // TODO: We need to check resolvers *first* and then resort to our default implementations fn test_file_resolver() { { let file = lofty::read_from_path("tests/taglib/data/xing.mp3").unwrap(); diff --git a/tests/taglib/test_flac.rs b/tests/taglib/test_flac.rs index 1b9073e51..6dd9bcf08 100644 --- a/tests/taglib/test_flac.rs +++ b/tests/taglib/test_flac.rs @@ -219,8 +219,8 @@ fn test_repeated_save_2() { // Marker test, this test relies on saving an ID3v2 tag in a FLAC file, something Lofty does not and will not support. } +// TODO: We don't make use of padding blocks yet #[test] -#[ignore] // TODO: We don't make use of padding blocks yet fn test_repeated_save_3() { let mut file = temp_file!("tests/taglib/data/no-tags.flac"); @@ -422,8 +422,8 @@ fn test_zero_sized_padding_2() { } } +// TODO: We don't make use of padding blocks yet #[test] -#[ignore] // TODO: We don't make use of padding blocks yet fn test_shrink_padding() { let mut file = temp_file!("tests/taglib/data/silence-44-s.flac"); { @@ -478,8 +478,8 @@ fn test_empty_id3v2() { } } +// TODO: TagLib doesn't fully remove Vorbis Comments when stripping. It will preserve the vendor string. Should we do the same? #[test] -#[ignore] // TODO: TagLib doesn't fully remove Vorbis Comments when stripping. It will preserve the vendor string. Should we do the same? fn test_strip_tags() { // NOTE: In the TagLib test suite, this also tests ID3v1 and ID3v2. That is not replicated here. diff --git a/tests/taglib/test_id3v2.rs b/tests/taglib/test_id3v2.rs index e835b2e7c..f4ba659f6 100644 --- a/tests/taglib/test_id3v2.rs +++ b/tests/taglib/test_id3v2.rs @@ -30,20 +30,24 @@ fn test_unsynch_decode() { } #[test] -#[ignore] // TODO: We don't support downgrading 2.4 tags to 2.3 -fn test_downgrade_utf8_for_id3v23_1() {} +fn test_downgrade_utf8_for_id3v23_1() { + todo!("We don't support downgrading 2.4 tags to 2.3") +} #[test] -#[ignore] // TODO: We don't support downgrading 2.4 tags to 2.3 -fn test_downgrade_utf8_for_id3v23_2() {} +fn test_downgrade_utf8_for_id3v23_2() { + todo!("We don't support downgrading 2.4 tags to 2.3") +} #[test] -#[ignore] // TODO: Need to think of a nice way to handle multiple UTF-16 values separated by null -fn test_utf16be_delimiter() {} +fn test_utf16be_delimiter() { + todo!("Need to think of a nice way to handle multiple UTF-16 values separated by null") +} #[test] -#[ignore] // TODO: Need to think of a nice way to handle multiple UTF-16 values separated by null -fn test_utf16_delimiter() {} +fn test_utf16_delimiter() { + todo!("Need to think of a nice way to handle multiple UTF-16 values separated by null") +} #[test] fn test_broken_frame1() { @@ -723,8 +727,8 @@ fn test_render_user_text_identification_frame() { ); } +// TODO: iTunes, being the great application it is writes unsynchronized integers for sizes. There's no *great* way to detect this. #[test] -#[ignore] // TODO: iTunes, being the great application it is writes unsynchronized integers for sizes. There's no *great* way to detect this. fn test_itunes_24_frame_size() { let mut file = temp_file!("tests/taglib/data/005411.id3"); let f = MpegFile::read_from(&mut file, ParseOptions::new().read_properties(false)).unwrap(); @@ -776,8 +780,9 @@ fn test_save_utf16_comment() { } #[test] -#[ignore] // TODO: We don't support downgrading to 2.3 tags yet -fn test_update_genre_23_1() {} +fn test_update_genre_23_1() { + todo!("We don't support downgrading to 2.3 tags yet") +} #[test] #[ignore] @@ -792,8 +797,12 @@ fn test_update_genre23_3() { } #[test] -#[ignore] // TODO: We currently just return the genre string as it is in the tag, need to think about whether or not to convert numerical strings -fn test_update_genre_24() {} +fn test_update_genre_24() { + todo!( + "We currently just return the genre string as it is in the tag, need to think about \ + whether or not to convert numerical strings" + ) +} #[test] fn test_update_date22() { @@ -803,8 +812,8 @@ fn test_update_date22() { assert_eq!(f.id3v2().unwrap().year(), Some(2010)); } +// TODO: Determine if this is even worth doing. It is just combining TYE+TDA when upgrading ID3v2.2 to 2.4 #[test] -#[ignore] // TODO: Determine if this is even worth doing. It is just combining TYE+TDA when upgrading ID3v2.2 to 2.4 fn test_update_full_date22() { let mut file = temp_file!("tests/taglib/data/id3v22-tda.mp3"); let f = MpegFile::read_from(&mut file, ParseOptions::new()).unwrap(); @@ -813,8 +822,9 @@ fn test_update_full_date22() { } #[test] -#[ignore] // TODO: We don't support downgrading 2.4 tags to 2.3 -fn test_downgrade_to_23() {} +fn test_downgrade_to_23() { + todo!("We don't support downgrading 2.4 tags to 2.3") +} #[test] fn test_compressed_frame_with_broken_length() { @@ -932,20 +942,24 @@ fn test_save_and_strip_id3v1_should_not_add_frame_from_id3v1_to_id3v2() { } #[test] -#[ignore] // TODO: We don't support CHAP frames yet -fn test_parse_chapter_frame() {} +fn test_parse_chapter_frame() { + todo!("We don't support CHAP frames yet") +} #[test] -#[ignore] // TODO: We don't support CHAP frames yet -fn test_render_chapter_frame() {} +fn test_render_chapter_frame() { + todo!("We don't support CHAP frames yet") +} #[test] -#[ignore] // TODO: We don't support CTOC frames yet -fn test_parse_table_of_contents_frame() {} +fn test_parse_table_of_contents_frame() { + todo!("We don't support CTOC frames yet") +} #[test] -#[ignore] // TODO: We don't support CTOC frames yet -fn test_render_table_of_contents_frame() {} +fn test_render_table_of_contents_frame() { + todo!("We don't support CTOC frames yet") +} #[test] #[ignore] @@ -960,5 +974,6 @@ fn test_duplicate_tags() { } #[test] -#[ignore] // TODO: We don't support CTOC frames yet -fn test_parse_toc_frame_with_many_children() {} +fn test_parse_toc_frame_with_many_children() { + todo!("We don't support CTOC frames yet") +} diff --git a/tests/taglib/test_mp4.rs b/tests/taglib/test_mp4.rs index 7e821f820..bab6d8eab 100644 --- a/tests/taglib/test_mp4.rs +++ b/tests/taglib/test_mp4.rs @@ -139,7 +139,7 @@ fn test_is_empty() { #[test] fn test_update_stco() { - // TODO: We don't update stco atoms + todo!("We don't update stco atoms") } #[test] @@ -234,8 +234,11 @@ fn test_save_existing_when_ilst_is_last() { } #[test] -#[ignore] // TODO: Maybe? This just checks the moov atom's length. We don't retain any atoms we don't need. -fn test_64bit_atom() {} +fn test_64bit_atom() { + todo!( + "Maybe? This just checks the moov atom's length. We don't retain any atoms we don't need." + ) +} #[test] fn test_gnre() { diff --git a/tests/taglib/test_mpeg.rs b/tests/taglib/test_mpeg.rs index 32fda916c..d3dda2868 100644 --- a/tests/taglib/test_mpeg.rs +++ b/tests/taglib/test_mpeg.rs @@ -11,7 +11,6 @@ use lofty::mpeg::MpegFile; use lofty::{Accessor, AudioFile, ParseOptions}; #[test] -#[ignore] fn test_audio_properties_xing_header_cbr() { let f = get_file::("tests/taglib/data/lame_cbr.mp3"); @@ -25,7 +24,6 @@ fn test_audio_properties_xing_header_cbr() { } #[test] -#[ignore] fn test_audio_properties_xing_header_vbr() { let f = get_file::("tests/taglib/data/lame_vbr.mp3"); @@ -39,7 +37,6 @@ fn test_audio_properties_xing_header_vbr() { } #[test] -#[ignore] fn test_audio_properties_vbri_header() { let f = get_file::("tests/taglib/data/rare_frames.mp3"); @@ -53,7 +50,6 @@ fn test_audio_properties_vbri_header() { } #[test] -#[ignore] fn test_audio_properties_no_vbr_headers() { let f = get_file::("tests/taglib/data/bladeenc.mp3"); @@ -79,7 +75,6 @@ fn test_skip_invalid_frames_1() { } #[test] -#[ignore] fn test_skip_invalid_frames_2() { let f = get_file::("tests/taglib/data/invalid-frames2.mp3"); @@ -91,7 +86,6 @@ fn test_skip_invalid_frames_2() { } #[test] -#[ignore] fn test_skip_invalid_frames_3() { let f = get_file::("tests/taglib/data/invalid-frames3.mp3"); @@ -103,7 +97,6 @@ fn test_skip_invalid_frames_3() { } #[test] -#[ignore] fn test_version_2_duration_with_xing_header() { let f = get_file::("tests/taglib/data/mpeg2.mp3"); assert_eq!(f.properties().duration().as_secs(), 5387); // TODO: Off by 15 @@ -141,8 +134,9 @@ fn test_save_id3v24_wrong_param() { // Marker test, Lofty does not replicate the TagLib saving API } +// TODO: We don't yet support writing an ID3v23 tag (#62) #[test] -#[ignore] // TODO: We don't yet support writing an ID3v23 tag (#62) +#[ignore] fn test_save_id3v23() { let mut file = temp_file!("tests/taglib/data/xing.mp3"); @@ -292,8 +286,8 @@ fn test_empty_ape() { // Marker test, Lofty accepts empty strings as valid values } +// TODO: We can't find an ID3v2 tag after saving with garbage #[test] -#[ignore] // TODO: We can't find an ID3v2 tag after saving with garbage fn test_ignore_garbage() { let mut file = temp_file!("tests/taglib/data/garbage.mp3"); diff --git a/tests/taglib/test_ogaflac.rs b/tests/taglib/test_ogaflac.rs index fe38b486d..58c2450dc 100644 --- a/tests/taglib/test_ogaflac.rs +++ b/tests/taglib/test_ogaflac.rs @@ -7,37 +7,37 @@ use lofty::ogg::VorbisComments; use lofty::{Accessor, AudioFile, ParseOptions}; #[test] -#[ignore] // TODO: We don't support FLAC in OGA fn test_framing_bit() { - let mut file = temp_file!("tests/taglib/data/empty_flac.oga"); - - { - let mut f = FlacFile::read_from(&mut file, ParseOptions::new()).unwrap(); - file.rewind().unwrap(); - - let mut vorbis_comments = VorbisComments::new(); - vorbis_comments.set_artist(String::from("The Artist")); - f.set_vorbis_comments(vorbis_comments); - f.save_to(&mut file).unwrap(); - } - file.rewind().unwrap(); - { - let f = FlacFile::read_from(&mut file, ParseOptions::new()).unwrap(); - assert_eq!( - f.vorbis_comments().unwrap().artist().as_deref(), - Some("The Artist") - ); - - assert_eq!(file.seek(SeekFrom::End(0)).unwrap(), 9134); - } + todo!("We don't support FLAC in OGA") + // let mut file = temp_file!("tests/taglib/data/empty_flac.oga"); + // + // { + // let mut f = FlacFile::read_from(&mut file, ParseOptions::new()).unwrap(); + // file.rewind().unwrap(); + // + // let mut vorbis_comments = VorbisComments::new(); + // vorbis_comments.set_artist(String::from("The Artist")); + // f.set_vorbis_comments(vorbis_comments); + // f.save_to(&mut file).unwrap(); + // } + // file.rewind().unwrap(); + // { + // let f = FlacFile::read_from(&mut file, ParseOptions::new()).unwrap(); + // assert_eq!( + // f.vorbis_comments().unwrap().artist().as_deref(), + // Some("The Artist") + // ); + // + // assert_eq!(file.seek(SeekFrom::End(0)).unwrap(), 9134); + // } } #[test] -#[ignore] // TODO fn test_fuzzed_file() { - let mut file = temp_file!("tests/taglib/data/segfault.oga"); - let f = FlacFile::read_from(&mut file, ParseOptions::new()); - assert!(f.is_err()); + todo!("We don't support FLAC in OGA") + // let mut file = temp_file!("tests/taglib/data/segfault.oga"); + // let f = FlacFile::read_from(&mut file, ParseOptions::new()); + // assert!(f.is_err()); } #[test] diff --git a/tests/taglib/test_ogg.rs b/tests/taglib/test_ogg.rs index a93433088..88369ec3b 100644 --- a/tests/taglib/test_ogg.rs +++ b/tests/taglib/test_ogg.rs @@ -87,8 +87,8 @@ fn test_audio_properties() { assert_eq!(f.properties().bitrate_min(), 0); } +// TODO: Need to look into this one, not sure why there's a difference in checksums #[test] -#[ignore] // TODO: Need to look into this one, not sure why there's a difference in checksums fn test_page_checksum() { let mut file = temp_file!("tests/taglib/data/empty.ogg"); diff --git a/tests/taglib/test_speex.rs b/tests/taglib/test_speex.rs index 10cc332fc..7f9edb33b 100644 --- a/tests/taglib/test_speex.rs +++ b/tests/taglib/test_speex.rs @@ -7,7 +7,6 @@ use lofty::ogg::{SpeexFile, VorbisComments}; use lofty::{Accessor, AudioFile, ParseOptions}; #[test] -#[ignore] fn test_audio_properties() { let f = get_file::("tests/taglib/data/empty.spx"); @@ -21,8 +20,8 @@ fn test_audio_properties() { assert_eq!(f.properties().sample_rate(), 44100); } +// TODO: This test doesn't work, it's very specific with file/packet sizes. Have to determine whether or not to even keep this one. #[test] -#[ignore] // TODO: This test doesn't work, it's very specific with file/packet sizes. Have to determine whether or not to even keep this one. fn test_split_packets() { let mut file = temp_file!("tests/taglib/data/empty.spx"); diff --git a/tests/taglib/test_wav.rs b/tests/taglib/test_wav.rs index a23424922..d662c41a4 100644 --- a/tests/taglib/test_wav.rs +++ b/tests/taglib/test_wav.rs @@ -106,28 +106,28 @@ fn test_id3v2_tag() { } #[test] -#[ignore] // TODO: Support writing ID3v2.3 fn test_save_id3v23() { - let mut file = temp_file!("tests/taglib/data/empty.wav"); - - let xxx = "X".repeat(254); - { - let mut f = WavFile::read_from(&mut file, ParseOptions::new()).unwrap(); - assert!(f.id3v2().is_none()); - - f.id3v2_mut().unwrap().set_title(xxx.clone()); - f.id3v2_mut().unwrap().set_artist(String::from("Artist A")); - - // f.save(RIFF::WAV::File::AllTags, File::StripOthers, ID3v2::v3); - // assert!(f.id3v2().is_some()); - } - { - let f2 = WavFile::read_from(&mut file, ParseOptions::new()).unwrap(); - let tag = f2.id3v2().unwrap(); - assert_eq!(tag.original_version(), Id3v2Version::V3); - assert_eq!(tag.artist().as_deref(), Some("Artist A")); - assert_eq!(tag.title().as_deref(), Some(&*xxx)); - } + todo!("Support writing ID3v2.3") + // let mut file = temp_file!("tests/taglib/data/empty.wav"); + // + // let xxx = "X".repeat(254); + // { + // let mut f = WavFile::read_from(&mut file, ParseOptions::new()).unwrap(); + // assert!(f.id3v2().is_none()); + // + // f.id3v2_mut().unwrap().set_title(xxx.clone()); + // f.id3v2_mut().unwrap().set_artist(String::from("Artist A")); + // + // // f.save(RIFF::WAV::File::AllTags, File::StripOthers, ID3v2::v3); + // // assert!(f.id3v2().is_some()); + // } + // { + // let f2 = WavFile::read_from(&mut file, ParseOptions::new()).unwrap(); + // let tag = f2.id3v2().unwrap(); + // assert_eq!(tag.original_version(), Id3v2Version::V3); + // assert_eq!(tag.artist().as_deref(), Some("Artist A")); + // assert_eq!(tag.title().as_deref(), Some(&*xxx)); + // } } #[test] @@ -275,49 +275,49 @@ fn test_fuzzed_file2() { } #[test] -#[ignore] // TODO: Doesn't pass, need to check what TagLib is doing here fn test_file_with_garbage_appended() { - let mut file = temp_file!("tests/taglib/data/empty.wav"); - let contents_before_modification; - { - file.seek(SeekFrom::End(0)).unwrap(); - - let garbage = b"12345678"; - file.write_all(garbage).unwrap(); - file.rewind().unwrap(); - - let mut file_contents = Vec::new(); - file.read_to_end(&mut file_contents).unwrap(); - - contents_before_modification = file_contents; - } - file.rewind().unwrap(); - { - let mut f = WavFile::read_from(&mut file, ParseOptions::new()).unwrap(); - file.rewind().unwrap(); - - let mut id3v2 = Id3v2Tag::default(); - id3v2.set_title(String::from("ID3v2 Title")); - f.set_id3v2(id3v2); - - let mut riff_info = RIFFInfoList::default(); - riff_info.set_title(String::from("INFO Title")); - f.set_riff_info(riff_info); - - f.save_to(&mut file).unwrap(); - } - file.rewind().unwrap(); - { - TagType::Id3v2.remove_from(&mut file).unwrap(); - file.rewind().unwrap(); - TagType::RiffInfo.remove_from(&mut file).unwrap(); - } - file.rewind().unwrap(); - { - let mut contents_after_modification = Vec::new(); - file.read_to_end(&mut contents_after_modification).unwrap(); - assert_eq!(contents_before_modification, contents_after_modification); - } + todo!("Doesn't pass, need to check what TagLib is doing here") + // let mut file = temp_file!("tests/taglib/data/empty.wav"); + // let contents_before_modification; + // { + // file.seek(SeekFrom::End(0)).unwrap(); + // + // let garbage = b"12345678"; + // file.write_all(garbage).unwrap(); + // file.rewind().unwrap(); + // + // let mut file_contents = Vec::new(); + // file.read_to_end(&mut file_contents).unwrap(); + // + // contents_before_modification = file_contents; + // } + // file.rewind().unwrap(); + // { + // let mut f = WavFile::read_from(&mut file, ParseOptions::new()).unwrap(); + // file.rewind().unwrap(); + // + // let mut id3v2 = Id3v2Tag::default(); + // id3v2.set_title(String::from("ID3v2 Title")); + // f.set_id3v2(id3v2); + // + // let mut riff_info = RIFFInfoList::default(); + // riff_info.set_title(String::from("INFO Title")); + // f.set_riff_info(riff_info); + // + // f.save_to(&mut file).unwrap(); + // } + // file.rewind().unwrap(); + // { + // TagType::Id3v2.remove_from(&mut file).unwrap(); + // file.rewind().unwrap(); + // TagType::RiffInfo.remove_from(&mut file).unwrap(); + // } + // file.rewind().unwrap(); + // { + // let mut contents_after_modification = Vec::new(); + // file.read_to_end(&mut contents_after_modification).unwrap(); + // assert_eq!(contents_before_modification, contents_after_modification); + // } } #[test]