Skip to content

Commit

Permalink
Add a testcase for #46
Browse files Browse the repository at this point in the history
Prior commit fixed the bug, now we add a testcase.

Closes #46
  • Loading branch information
est31 committed Mar 3, 2019
1 parent adb2d6e commit 4057d42
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 6 additions & 2 deletions dev/cmp/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ pub fn get_xiph_asset_defs_5() -> [TestAssetDef; 5] {
/// The test files are licensed under CC-0:
/// * https://github.com/RustAudio/lewton/issues/33#issuecomment-419640709
/// * http://web.archive.org/web/20180910135020/https://github.com/RustAudio/lewton/issues/33
pub fn get_fuzzed_asset_defs() -> [TestAssetDef; 11] {
pub fn get_fuzzed_asset_defs() -> [TestAssetDef; 12] {
return [
TestAssetDef {
filename : format!("27_really_minimized_testcase_crcfix.ogg"),
Expand Down Expand Up @@ -669,6 +669,10 @@ pub fn get_fuzzed_asset_defs() -> [TestAssetDef; 11] {
hash : format!("b8bd42831a8922c4c78ff1ea5b42ecbb874135ba7e7fcd60c4fff7a419d857a4"),
url : format!("https://github.com/RustAudio/lewton/files/2922512/bug-44-sample060.ogg.zip"),
},

TestAssetDef {
filename : format!("bug-46-sample001.ogg"),
hash : format!("d5015f9a3b79a28bf621ecc2e96286c20ef742e936e256f77b8978e6bce66aad"),
url : format!("https://github.com/RustAudio/lewton/files/2923287/bug-46-sample001.ogg.zip"),
},
];
}
2 changes: 2 additions & 0 deletions dev/cmp/tests/fuzzed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ fn test_malformed_fuzzed() {

ensure_malformed!("bug-44-sample059.ogg", BadHeader(HeaderBadFormat));
ensure_malformed!("bug-44-sample060.ogg", BadHeader(HeaderBadFormat));

ensure_malformed!("bug-46-sample001.ogg", BadAudio(AudioBadFormat));
}

#[test]
Expand Down

0 comments on commit 4057d42

Please sign in to comment.