forge
Explore
Log in

Don't you dare go Hollow

U6: ec-h264 high422 x264 sweeps: the four test fns become case builders, one test runs them all through one sweep

Browse files at this commit

89fe2e657ae493571d76aca665b04816e0393392Ahmet Kaan GümüşParent: b6998de
crates/ec-h264/tests/it/high422.rsmodified+18 -14
@@ -332,21 +332,17 @@ const SMALL: &[Case] = &[
332332 ];
333333
334334 /// Every case at 8 bits, progressive.
335-#[test]
336-fn x264_hi422_progressive_8bit() {
337- sweep(SMALL);
335+fn progressive_8bit_cases() -> Vec<Case> {
336+ SMALL.iter().map(|c| Case { ..*c }).collect()
338337 }
339338
340339 /// The same at 10 bits.
341-#[test]
342-fn x264_hi422_progressive_10bit() {
343- let cases: Vec<Case> = SMALL.iter().map(|c| ten(Case { ..*c })).collect();
344- sweep(&cases);
340+fn progressive_10bit_cases() -> Vec<Case> {
341+ SMALL.iter().map(|c| ten(Case { ..*c })).collect()
345342 }
346343
347344 /// MBAFF at 8 and 10 bits.
348-#[test]
349-fn x264_hi422_mbaff() {
345+fn mbaff_cases() -> Vec<Case> {
350346 let mut cases: Vec<Case> = Vec::new();
351347 for (i, c) in SMALL.iter().enumerate() {
352348 // Every other case keeps the sweep quick; the rest run progressive.
@@ -360,13 +356,12 @@ fn x264_hi422_mbaff() {
360356 format!("mbaff-{}{}", c.tag, if c.ten_bit { "-10" } else { "" }).into_boxed_str(),
361357 );
362358 }
363- sweep(&cases);
359+ cases
364360 }
365361
366362 /// 1920x1080 intra and long-GOP, progressive and MBAFF (slow).
367-#[test]
368-fn x264_hi422_hd() {
369- sweep(&[
363+fn hd_cases() -> Vec<Case> {
364+ vec![
370365 case("hd-i-cabac", "testsrc2", "1920x1080", 2, "keyint=1"),
371366 case(
372367 "hd-b-cabac",
@@ -403,7 +398,7 @@ fn x264_hi422_hd() {
403398 2,
404399 "keyint=1:cabac=0",
405400 ))),
406- ]);
401+ ]
407402 }
408403
409404 // ---- I_PCM in 4:2:2 (x264 never writes one) ----------------------------
@@ -530,3 +525,12 @@ fn hi422_pcm_macroblocks_round_trip() {
530525 assert_eq!(bytes, &expected, "{bd}-bit I_PCM 4:2:2");
531526 }
532527 }
528+
529+#[test]
530+fn x264_hi422_family() {
531+ let mut cases = progressive_8bit_cases();
532+ cases.extend(progressive_10bit_cases());
533+ cases.extend(mbaff_cases());
534+ cases.extend(hd_cases());
535+ sweep(&cases);
536+}