Skip to content

Commit 5abd2c1

Browse files
committed
Remove original test fixtures
1 parent 1033b29 commit 5abd2c1

100 files changed

Lines changed: 18 additions & 31 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CONTRIBUTING.md

Lines changed: 1 addition & 2 deletions

README.md

Lines changed: 1 addition & 1 deletion

crates/audiowaveform-cli/tests/cli.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ fn transcodes_audio_to_wav_output() {
192192

193193
assert_eq!(
194194
std::fs::read(output.path()).expect("read wav"),
195-
read_fixture("rust/test_file_mono_converted.wav")
195+
read_fixture("test_file_mono_converted.wav")
196196
);
197197
}
198198

crates/audiowaveform-cli/tests/support/mod.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,10 @@ use tempfile::{Builder, NamedTempFile};
88

99
pub fn fixture_path(name: &str) -> PathBuf {
1010
PathBuf::from(env!("CARGO_MANIFEST_DIR"))
11-
.join("../../test/data")
11+
.join("../../fixtures")
1212
.join(name)
1313
}
1414

15-
pub fn rust_png_fixture_path(name: &str) -> PathBuf {
16-
fixture_path("rust").join(name)
17-
}
18-
1915
pub fn read_fixture(name: &str) -> Vec<u8> {
2016
fs::read(fixture_path(name)).expect("fixture bytes")
2117
}
@@ -29,7 +25,7 @@ pub fn named_temp_file(suffix: &str) -> NamedTempFile {
2925

3026
pub fn assert_png_file_matches_fixture(actual: impl AsRef<Path>, fixture: &str) {
3127
let actual = image::open(actual).expect("open actual png").into_rgba8();
32-
let expected = image::open(rust_png_fixture_path(fixture))
28+
let expected = image::open(fixture_path(fixture))
3329
.expect("open expected png")
3430
.into_rgba8();
3531
assert_png_eq(&actual, &expected, fixture);
@@ -39,7 +35,7 @@ pub fn assert_png_bytes_match_fixture(actual: &[u8], fixture: &str) {
3935
let actual = load_from_memory(actual)
4036
.expect("decode actual png")
4137
.into_rgba8();
42-
let expected = image::open(rust_png_fixture_path(fixture))
38+
let expected = image::open(fixture_path(fixture))
4339
.expect("open expected png")
4440
.into_rgba8();
4541
assert_png_eq(&actual, &expected, fixture);

crates/audiowaveform/examples/generate_waveform.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
77
let mut args = env::args().skip(1);
88
let input = args
99
.next()
10-
.unwrap_or_else(|| "test/data/test_file_stereo.wav".to_string());
10+
.unwrap_or_else(|| "fixtures/test_file_stereo.wav".to_string());
1111
let output = args.next().unwrap_or_else(|| "output.dat".to_string());
1212

1313
let waveform = generate_waveform_from_path(&input, &GenerateOptions::default())?;

crates/audiowaveform/examples/render_waveform.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
77
let mut args = env::args().skip(1);
88
let input = args
99
.next()
10-
.unwrap_or_else(|| "test/data/test_file_stereo_8bit_64spp_wav.dat".to_string());
10+
.unwrap_or_else(|| "fixtures/test_file_stereo_8bit_64spp_wav.dat".to_string());
1111
let output = args.next().unwrap_or_else(|| "output.png".to_string());
1212

1313
let waveform = Waveform::load_from_path(&input, None)?;

crates/audiowaveform/examples/resample_waveform.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
77
let mut args = env::args().skip(1);
88
let input = args
99
.next()
10-
.unwrap_or_else(|| "test/data/test_file_stereo_8bit_64spp_wav.dat".to_string());
10+
.unwrap_or_else(|| "fixtures/test_file_stereo_8bit_64spp_wav.dat".to_string());
1111
let output = args.next().unwrap_or_else(|| "resampled.dat".to_string());
1212

1313
let waveform = Waveform::load_from_path(&input, None)?;

crates/audiowaveform/tests/generate.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,18 +57,18 @@ fn generates_expected_waveform_bytes_from_supported_audio_inputs() {
5757
),
5858
(
5959
"test_file_stereo.mp3",
60-
"rust/test_file_stereo_8bit_64spp_mp3.dat",
61-
"rust/test_file_stereo_8bit_64spp_mp3.json",
60+
"test_file_stereo_8bit_64spp_mp3.dat",
61+
"test_file_stereo_8bit_64spp_mp3.json",
6262
),
6363
(
6464
"test_file_stereo.flac",
65-
"rust/test_file_stereo_8bit_64spp_flac.dat",
66-
"rust/test_file_stereo_8bit_64spp_flac.json",
65+
"test_file_stereo_8bit_64spp_flac.dat",
66+
"test_file_stereo_8bit_64spp_flac.json",
6767
),
6868
(
6969
"test_file_stereo.oga",
70-
"rust/test_file_stereo_8bit_64spp_oga.dat",
71-
"rust/test_file_stereo_8bit_64spp_oga.json",
70+
"test_file_stereo_8bit_64spp_oga.dat",
71+
"test_file_stereo_8bit_64spp_oga.json",
7272
),
7373
];
7474

crates/audiowaveform/tests/support/mod.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,10 @@ use tempfile::{Builder, NamedTempFile};
99

1010
pub fn fixture_path(name: &str) -> PathBuf {
1111
PathBuf::from(env!("CARGO_MANIFEST_DIR"))
12-
.join("../../test/data")
12+
.join("../../fixtures")
1313
.join(name)
1414
}
1515

16-
pub fn rust_png_fixture_path(name: &str) -> PathBuf {
17-
fixture_path("rust").join(name)
18-
}
19-
2016
pub fn read_fixture(name: &str) -> Vec<u8> {
2117
fs::read(fixture_path(name)).expect("fixture bytes")
2218
}
@@ -54,7 +50,7 @@ pub fn assert_png_file_matches_fixture(actual: impl AsRef<Path>, fixture: &str)
5450
}
5551

5652
pub fn assert_png_image_matches_fixture(actual: &RgbaImage, fixture: &str) {
57-
let expected = image::open(rust_png_fixture_path(fixture))
53+
let expected = image::open(fixture_path(fixture))
5854
.expect("open expected png")
5955
.into_rgba8();
6056
assert_eq!(

crates/audiowaveform/tests/wav.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,6 @@ fn transcodes_audio_to_expected_wav_fixture() {
5050

5151
assert_bytes_eq(
5252
&std::fs::read(output.path()).expect("read wav"),
53-
"rust/test_file_mono_converted.wav",
53+
"test_file_mono_converted.wav",
5454
);
5555
}

0 commit comments

Comments
 (0)