mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-18 08:15:29 +00:00
Merge pull request #2083 from FredApps/test/mxf-hostile-scheduling-778
test(media): schedule MXF hostile seeds independently
This commit is contained in:
1 file changed
+34
-8
@@ -51,27 +51,53 @@ fn sync_before_on_an_empty_track() {
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn hostile_input_never_panics() {
|
||||
// Keep each deterministic hammer independent so test runners can schedule the seeds separately.
|
||||
// The labels, mutation counts, every-truncation coverage and per-case watchdog stay unchanged.
|
||||
fn hostile_seeds() -> [Vec<u8>; 3] {
|
||||
let (to, flags) = ipbb();
|
||||
let seeds = [build(7, |i| vec![i as u8; 100 + i], &to, &flags), build(5, prores_like, &to, &flags), build(4, prores_like, &[], &flags)];
|
||||
for (i, s) in seeds.iter().enumerate() {
|
||||
craft_media_testkit::hostile::hammer(&format!("mxf seed {i}"), s, 6_000, exercise);
|
||||
}
|
||||
// The metadata sets and index segments, parsed directly.
|
||||
let seed = &seeds[0];
|
||||
[build(7, |i| vec![i as u8; 100 + i], &to, &flags), build(5, prores_like, &to, &flags), build(4, prores_like, &[], &flags)]
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn hostile_input_seed_0_never_panics() {
|
||||
craft_media_testkit::hostile::hammer("mxf seed 0", &hostile_seeds()[0], 6_000, exercise);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn hostile_input_seed_1_never_panics() {
|
||||
craft_media_testkit::hostile::hammer("mxf seed 1", &hostile_seeds()[1], 6_000, exercise);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn hostile_input_seed_2_never_panics() {
|
||||
craft_media_testkit::hostile::hammer("mxf seed 2", &hostile_seeds()[2], 6_000, exercise);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn hostile_index_segment_never_panics() {
|
||||
let seed = &hostile_seeds()[0];
|
||||
let index_key = [0x06, 0x0E, 0x2B, 0x34, 0x02, 0x53, 0x01, 0x01, 0x0D, 0x01, 0x02, 0x01, 0x01, 0x10, 0x01, 0x00];
|
||||
if let Some(v) = value_of(seed, &index_key) {
|
||||
craft_media_testkit::hostile::hammer("mxf index segment", v, 30_000, |d| {
|
||||
let _ = IndexSegment::parse(d);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn hostile_primer_never_panics() {
|
||||
let seed = &hostile_seeds()[0];
|
||||
let primer_key = [0x06, 0x0E, 0x2B, 0x34, 0x02, 0x05, 0x01, 0x01, 0x0D, 0x01, 0x02, 0x01, 0x01, 0x05, 0x01, 0x00];
|
||||
if let Some(v) = value_of(seed, &primer_key) {
|
||||
craft_media_testkit::hostile::hammer("mxf primer", v, 5_000, |d| {
|
||||
let _ = Primer::parse(d);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn hostile_set_never_panics() {
|
||||
let seed = &hostile_seeds()[0];
|
||||
let set = seed.windows(16).position(|w| w == set_key(0x18)).and_then(|at| value_of(&seed[at..], &set_key(0x18)));
|
||||
if let Some(v) = set {
|
||||
craft_media_testkit::hostile::hammer("mxf set", v, 20_000, |d| {
|
||||
|
||||
Reference in new issue
Block a user