Skip to content

Commit 0b7ff7d

Browse files
committed
Tests: Fix paths in TagLib tests
1 parent 872e817 commit 0b7ff7d

File tree

6 files changed

+7
-9
lines changed

6 files changed

+7
-9
lines changed

tests/taglib/data/excessive_alloc.mp3

925 Bytes
Binary file not shown.

tests/taglib/data/sinewave.flac

63.1 KB
Binary file not shown.
4.41 KB
Binary file not shown.

tests/taglib/test_flac.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -390,23 +390,21 @@ fn test_invalid() {
390390

391391
#[test]
392392
fn test_audio_properties() {
393-
let mut file = temp_file!("tests/taglib/data/silence-44-s.flac");
393+
let mut file = temp_file!("tests/taglib/data/sinewave.flac");
394394
let f = FlacFile::read_from(&mut file, ParseOptions::new()).unwrap();
395395

396396
let properties = f.properties();
397397
assert_eq!(properties.duration().as_secs(), 3);
398-
// NOTE: This is the number reported by `ffprobe`, TagLib is off here.
399-
assert_eq!(properties.duration().as_millis(), 3684);
400-
// TODO: We report 101, ffprobe reports 110, and TagLib reports 145
401-
// assert_eq!(properties.audio_bitrate(), 145);
398+
assert_eq!(properties.duration().as_millis(), 3550);
399+
assert_eq!(properties.audio_bitrate(), 145);
402400
assert_eq!(properties.sample_rate(), 44100);
403401
assert_eq!(properties.channels(), 2);
404402
assert_eq!(properties.bit_depth(), 16);
405403
// TODO
406404
// CPPUNIT_ASSERT_EQUAL(156556ULL, f.audioProperties()->sampleFrames());
407405
assert_eq!(
408406
format!("{:X}", f.properties().signature()),
409-
"6291DBD8DCB7DC480132E4C4BA154A17"
407+
"CFE3D9DABADEAB2CBF2CA235274B7F76"
410408
);
411409
}
412410

tests/taglib/test_mp4.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ fn test_properties_alac() {
6262
#[test]
6363
#[allow(clippy::needless_range_loop)]
6464
fn test_properties_alac_without_bitrate() {
65-
let mut file = temp_file!("tests/taglib/data/has-tags.m4a");
65+
let mut file = temp_file!("tests/taglib/data/empty_alac.m4a");
6666
let mut alac_data = Vec::new();
6767
file.read_to_end(&mut alac_data).unwrap();
6868

@@ -386,7 +386,7 @@ fn test_repeated_save() {
386386

387387
#[test]
388388
fn test_with_zero_length_atom() {
389-
let mut file = temp_file!("tests/taglib/data/infloop.m4a");
389+
let mut file = temp_file!("tests/taglib/data/zero-length-mdat.m4a");
390390
let f = Mp4File::read_from(&mut file, ParseOptions::new()).unwrap();
391391
assert_eq!(f.properties().duration().as_millis(), 1115);
392392
assert_eq!(f.properties().sample_rate(), 22050);

tests/taglib/test_mpeg.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ fn test_duplicate_id3v2() {
183183

184184
#[test]
185185
fn test_fuzzed_file() {
186-
let mut file = File::open("tests/taglib/data/invalid-frames3.mp3").unwrap();
186+
let mut file = File::open("tests/taglib/data/excessive_alloc.mp3").unwrap();
187187
let _ = MpegFile::read_from(&mut file, ParseOptions::new()).unwrap();
188188
}
189189

0 commit comments

Comments
 (0)