Skip to content

Commit 8421534

Browse files
committed
Tests: Finish TagLib AIFF tests
1 parent a1d4b97 commit 8421534

File tree

2 files changed

+18
-16
lines changed

2 files changed

+18
-16
lines changed
7.93 KB
Binary file not shown.

tests/taglib/test_aiff.rs

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
use lofty::{Accessor, AudioFile, FileType, TaggedFileExt};
1+
use lofty::{Accessor, AudioFile, FileType, ParseOptions, TaggedFileExt};
22

3-
use std::io::Seek;
3+
use lofty::iff::aiff::AiffFile;
4+
use std::io::{Read, Seek};
45

56
use crate::util::get_filetype;
67
use crate::{assert_delta, temp_file};
@@ -74,7 +75,7 @@ fn test_save_id3v2() {
7475

7576
let mut tag = tfile.tag(lofty::TagType::Id3v2).unwrap().to_owned();
7677
assert_eq!(tag.title().as_deref(), Some("TitleXXX"));
77-
tag.set_title("".to_string());
78+
tag.set_title(String::new());
7879
tfile.insert_tag(tag);
7980
file.rewind().unwrap();
8081
tfile.save_to(&mut file).unwrap();
@@ -92,8 +93,15 @@ fn test_save_id3v2() {
9293
}
9394
}
9495

95-
// TODO: testSaveID3v23
96-
// TODO: testDuplicateID3v2
96+
#[test]
97+
#[ignore] // TODO: Support writing ID3v2.3 tags
98+
fn test_save_id3v23() {}
99+
100+
#[test]
101+
#[ignore]
102+
fn test_duplicate_id3v2() {
103+
// Marker test, Lofty will overwrite values in the original tag with any new values it finds in the next tag.
104+
}
97105

98106
#[test]
99107
#[ignore]
@@ -104,14 +112,8 @@ fn test_fuzzed_file1() {
104112
);
105113
}
106114

107-
// the file doesn't even have a valid signature
108-
// #[test]
109-
// #[ignore]
110-
// fn test_fuzzed_file2() {
111-
// let mut file = File::open("tests/taglib/data/excessive_alloc.aif").unwrap();
112-
//
113-
// let mut buf = [0; 12];
114-
// file.read_exact(&mut buf).unwrap();
115-
//
116-
// assert_eq!(FileType::from_buffer(&buf).unwrap(), FileType::AIFF);
117-
// }
115+
#[test]
116+
#[ignore]
117+
fn test_fuzzed_file2() {
118+
// Marker test, this file doesn't even have a valid signature. No idea how TagLib manages to read it.
119+
}

0 commit comments

Comments
 (0)