Skip to content

Commit

Permalink
Tests: Unignore TagLib tests, replacing with todo!() panics
Browse files Browse the repository at this point in the history
  • Loading branch information
Serial-ATA committed Jul 27, 2023
1 parent e013ca3 commit 6a94a78
Show file tree
Hide file tree
Showing 12 changed files with 148 additions and 144 deletions.
5 changes: 3 additions & 2 deletions tests/taglib/test_aiff.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
5 changes: 0 additions & 5 deletions tests/taglib/test_ape.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<ApeFile>("tests/taglib/data/mac-396.ape");
let properties = f.properties();
Expand All @@ -57,7 +53,6 @@ fn test_properties_396() {
}

#[test]
#[ignore]
fn test_properties_390() {
let f = get_file::<ApeFile>("tests/taglib/data/mac-390-hdr.ape");
let properties = f.properties();
Expand Down
1 change: 0 additions & 1 deletion tests/taglib/test_apetag.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
{
Expand Down
4 changes: 1 addition & 3 deletions tests/taglib/test_fileref.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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();
Expand All @@ -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();
Expand Down
6 changes: 3 additions & 3 deletions tests/taglib/test_flac.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down Expand Up @@ -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");
{
Expand Down Expand Up @@ -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.

Expand Down
67 changes: 41 additions & 26 deletions tests/taglib/test_id3v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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]
Expand All @@ -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() {
Expand All @@ -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();
Expand All @@ -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() {
Expand Down Expand Up @@ -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]
Expand All @@ -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")
}
9 changes: 6 additions & 3 deletions tests/taglib/test_mp4.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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() {
Expand Down
12 changes: 3 additions & 9 deletions tests/taglib/test_mpeg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<MpegFile>("tests/taglib/data/lame_cbr.mp3");

Expand All @@ -25,7 +24,6 @@ fn test_audio_properties_xing_header_cbr() {
}

#[test]
#[ignore]
fn test_audio_properties_xing_header_vbr() {
let f = get_file::<MpegFile>("tests/taglib/data/lame_vbr.mp3");

Expand All @@ -39,7 +37,6 @@ fn test_audio_properties_xing_header_vbr() {
}

#[test]
#[ignore]
fn test_audio_properties_vbri_header() {
let f = get_file::<MpegFile>("tests/taglib/data/rare_frames.mp3");

Expand All @@ -53,7 +50,6 @@ fn test_audio_properties_vbri_header() {
}

#[test]
#[ignore]
fn test_audio_properties_no_vbr_headers() {
let f = get_file::<MpegFile>("tests/taglib/data/bladeenc.mp3");

Expand All @@ -79,7 +75,6 @@ fn test_skip_invalid_frames_1() {
}

#[test]
#[ignore]
fn test_skip_invalid_frames_2() {
let f = get_file::<MpegFile>("tests/taglib/data/invalid-frames2.mp3");

Expand All @@ -91,7 +86,6 @@ fn test_skip_invalid_frames_2() {
}

#[test]
#[ignore]
fn test_skip_invalid_frames_3() {
let f = get_file::<MpegFile>("tests/taglib/data/invalid-frames3.mp3");

Expand All @@ -103,7 +97,6 @@ fn test_skip_invalid_frames_3() {
}

#[test]
#[ignore]
fn test_version_2_duration_with_xing_header() {
let f = get_file::<MpegFile>("tests/taglib/data/mpeg2.mp3");
assert_eq!(f.properties().duration().as_secs(), 5387); // TODO: Off by 15
Expand Down Expand Up @@ -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");

Expand Down Expand Up @@ -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");

Expand Down
Loading

0 comments on commit 6a94a78

Please sign in to comment.