M8 review fix: remove comment lines added by the fixture migration (no comments in code)
Browse files at this commit035372f479fe6b434cc3b6b6a326bdb4ca6896b9Parent: 9981db77 changed files +0 -40
- crates/ec-ass/fuzz/seed.sh +0 -5
- crates/ec-cc/tests/streams.rs +0 -4
- crates/ec-dvbsub/tests/ffmpeg_parity.rs +0 -5
- crates/ec-dvdsub/tests/ffmpeg_parity.rs +0 -5
- crates/ec-pgs/fuzz/seed.sh +0 -5
- crates/ec-subs/fuzz/seed.sh +0 -4
- crates/ec-subs/tests/open_media.rs +0 -12
crates/ec-ass/fuzz/seed.shmodified+0 -5
| @@ -1,9 +1,4 @@ | |||
| 1 | #!/usr/bin/env bash | 1 | #!/usr/bin/env bash |
| 2 | -# seed.sh: fill fuzz/corpus/<target>/ from the repo's ASS fixture. | ||
| 3 | -# | ||
| 4 | -# subs/tos-en.ass seeds script whole. events and overrides get its Dialogue rows (the lines | ||
| 5 | -# after the first Dialogue: prefix, which is what each of those targets takes as input). styles gets | ||
| 6 | -# the Style rows. Corpus lives under fuzz/corpus, git-ignored. | ||
| 7 | set -euo pipefail | 2 | set -euo pipefail |
| 8 | 3 | ||
| 9 | FUZZ_DIR=$(cd -- "$(dirname -- "$0")" && pwd) | 4 | FUZZ_DIR=$(cd -- "$(dirname -- "$0")" && pwd) |
crates/ec-cc/tests/streams.rsmodified+0 -4
| @@ -1,7 +1,3 @@ | |||
| 1 | -//! End-to-end: synthetic captions spliced into ffmpeg-encoded H.264 / HEVC / MPEG-2 streams | ||
| 2 | -//! (with B-frames), extracted in presentation order, decoded, and compared with ffmpeg's own | ||
| 3 | -//! caption decoder. | ||
| 4 | - | ||
| 5 | use ec_cc::extract::{H264Extractor, HevcExtractor, Mpeg2Extractor, NalFormat}; | 1 | use ec_cc::extract::{H264Extractor, HevcExtractor, Mpeg2Extractor, NalFormat}; |
| 6 | use ec_cc::synth::*; | 2 | use ec_cc::synth::*; |
| 7 | use ec_cc::{CcTriplet, decode_all}; | 3 | use ec_cc::{CcTriplet, decode_all}; |
crates/ec-dvbsub/tests/ffmpeg_parity.rsmodified+0 -5
| @@ -1,8 +1,3 @@ | |||
| 1 | -//! Our DVB subtitle decode against ffmpeg's (sub2video frames: `[0:s:0]` out as raw RGBA). | ||
| 2 | -//! | ||
| 3 | -//! Fixtures are tiny files made by `scripts/gen-bitmap-sub-fixtures.sh` from a synthetic | ||
| 4 | -//! 720x576 PGS source (four cues). ffmpeg is the oracle. | ||
| 5 | - | ||
| 6 | use std::fs::File; | 1 | use std::fs::File; |
| 7 | use std::io::BufReader; | 2 | use std::io::BufReader; |
| 8 | use std::path::PathBuf; | 3 | use std::path::PathBuf; |
crates/ec-dvdsub/tests/ffmpeg_parity.rsmodified+0 -5
| @@ -1,8 +1,3 @@ | |||
| 1 | -//! Our subpicture decode against ffmpeg's (sub2video frames: `[0:s:0]` out as raw RGBA). | ||
| 2 | -//! | ||
| 3 | -//! Fixtures are tiny files made by `scripts/gen-bitmap-sub-fixtures.sh` from a synthetic | ||
| 4 | -//! 720x576 PGS source (four cues). ffmpeg is the oracle. | ||
| 5 | - | ||
| 6 | use std::fs::File; | 1 | use std::fs::File; |
| 7 | use std::io::BufReader; | 2 | use std::io::BufReader; |
| 8 | use std::path::PathBuf; | 3 | use std::path::PathBuf; |
crates/ec-pgs/fuzz/seed.shmodified+0 -5
| @@ -1,9 +1,4 @@ | |||
| 1 | #!/usr/bin/env bash | 1 | #!/usr/bin/env bash |
| 2 | -# seed.sh: fill fuzz/corpus/<target>/ from the repo's PGS fixture. | ||
| 3 | -# | ||
| 4 | -# open/fate/sub/pgs_sub.sup is a PGS stream of display sets. segments gets the file's first 64 KiB | ||
| 5 | -# as is. compose and rle get the same bytes too; those two read their own input layouts, so the | ||
| 6 | -# seeds are mostly rejects, which still steer the mutator. Corpus lives under fuzz/corpus. | ||
| 7 | set -euo pipefail | 2 | set -euo pipefail |
| 8 | 3 | ||
| 9 | FUZZ_DIR=$(cd -- "$(dirname -- "$0")" && pwd) | 4 | FUZZ_DIR=$(cd -- "$(dirname -- "$0")" && pwd) |
crates/ec-subs/fuzz/seed.shmodified+0 -4
| @@ -1,8 +1,4 @@ | |||
| 1 | #!/usr/bin/env bash | 1 | #!/usr/bin/env bash |
| 2 | -# seed.sh: fill fuzz/corpus/<target>/ from the repo's subtitle fixtures. | ||
| 3 | -# | ||
| 4 | -# subs/TOS-en.srt seeds srt, markup and ir. A WebVTT twin of it (commas become dots, a | ||
| 5 | -# WEBVTT header goes on) seeds webvtt, markup and ir. Corpus lives under fuzz/corpus, git-ignored. | ||
| 6 | set -euo pipefail | 2 | set -euo pipefail |
| 7 | 3 | ||
| 8 | FUZZ_DIR=$(cd -- "$(dirname -- "$0")" && pwd) | 4 | FUZZ_DIR=$(cd -- "$(dirname -- "$0")" && pwd) |
crates/ec-subs/tests/open_media.rsmodified+0 -12
| @@ -1,6 +1,3 @@ | |||
| 1 | -//! The three parsers against open subtitle media: the Tears of Steel SubRip file, an ASS script | ||
| 2 | -//! generated from it, and a FATE PGS display set. | ||
| 3 | - | ||
| 4 | use ec_subs::{SourceFormat, plain_text}; | 1 | use ec_subs::{SourceFormat, plain_text}; |
| 5 | 2 | ||
| 6 | fn fixture(rel: &str) -> Vec<u8> { | 3 | fn fixture(rel: &str) -> Vec<u8> { |
| @@ -14,7 +11,6 @@ fn a_real_subrip_track_parses_whole() { | |||
| 14 | assert_eq!(track.source, Some(SourceFormat::Srt)); | 11 | assert_eq!(track.source, Some(SourceFormat::Srt)); |
| 15 | assert!(track.cues.len() > 100, "{} cues", track.cues.len()); | 12 | assert!(track.cues.len() > 100, "{} cues", track.cues.len()); |
| 16 | assert_eq!(track.skipped, 0, "a whole file should have no torn blocks"); | 13 | assert_eq!(track.skipped, 0, "a whole file should have no torn blocks"); |
| 17 | - // Every cue is up for a positive time and says something. | ||
| 18 | for cue in &track.cues { | 14 | for cue in &track.cues { |
| 19 | assert!(cue.end_us >= cue.start_us); | 15 | assert!(cue.end_us >= cue.start_us); |
| 20 | assert!( | 16 | assert!( |
| @@ -23,7 +19,6 @@ fn a_real_subrip_track_parses_whole() { | |||
| 23 | cue.start_us | 19 | cue.start_us |
| 24 | ); | 20 | ); |
| 25 | } | 21 | } |
| 26 | - // A subtitle track runs forwards. | ||
| 27 | assert!( | 22 | assert!( |
| 28 | track | 23 | track |
| 29 | .cues | 24 | .cues |
| @@ -40,8 +35,6 @@ fn a_real_ass_script_parses_whole() { | |||
| 40 | assert!(!track.styles.is_empty(), "a script declares styles"); | 35 | assert!(!track.styles.is_empty(), "a script declares styles"); |
| 41 | assert!(track.cues.len() > 100, "{} cues", track.cues.len()); | 36 | assert!(track.cues.len() > 100, "{} cues", track.cues.len()); |
| 42 | assert_eq!(track.skipped, 0, "a whole script should have no torn rows"); | 37 | assert_eq!(track.skipped, 0, "a whole script should have no torn rows"); |
| 43 | - // Every cue names a style the script declared, and most say words: a | ||
| 44 | - // signs-and-songs script has drawing-only lines, which are not words. | ||
| 45 | let with_text = track | 38 | let with_text = track |
| 46 | .cues | 39 | .cues |
| 47 | .iter() | 40 | .iter() |
| @@ -60,11 +53,9 @@ fn a_real_ass_script_parses_whole() { | |||
| 60 | "cue names undeclared style {style:?}" | 53 | "cue names undeclared style {style:?}" |
| 61 | ); | 54 | ); |
| 62 | } | 55 | } |
| 63 | - // Override tags never leak into the words. | ||
| 64 | let text = plain_text(&cue.segments); | 56 | let text = plain_text(&cue.segments); |
| 65 | assert!(!text.contains("{\\"), "override tag in text: {text:?}"); | 57 | assert!(!text.contains("{\\"), "override tag in text: {text:?}"); |
| 66 | } | 58 | } |
| 67 | - // The header is replayable as a Matroska `CodecPrivate`. | ||
| 68 | assert!(track.extradata.windows(8).any(|w| w == b"[Events]")); | 59 | assert!(track.extradata.windows(8).any(|w| w == b"[Events]")); |
| 69 | } | 60 | } |
| 70 | 61 | ||
| @@ -89,19 +80,16 @@ fn a_real_pgs_stream_decodes_to_plausible_bitmaps() { | |||
| 89 | .filter(|p| p[3] > 0) | 80 | .filter(|p| p[3] > 0) |
| 90 | .count(); | 81 | .count(); |
| 91 | if opaque == 0 { | 82 | if opaque == 0 { |
| 92 | - // An erase display set: a set that composes nothing at all. | ||
| 93 | continue; | 83 | continue; |
| 94 | } | 84 | } |
| 95 | painted += 1; | 85 | painted += 1; |
| 96 | let coverage = opaque as f64 / (w * h) as f64; | 86 | let coverage = opaque as f64 / (w * h) as f64; |
| 97 | coverage_max = coverage_max.max(coverage); | 87 | coverage_max = coverage_max.max(coverage); |
| 98 | - // Subtitles are lines of text over a film: ink, not a filled canvas. | ||
| 99 | assert!( | 88 | assert!( |
| 100 | coverage > 0.000_1 && coverage < 0.25, | 89 | coverage > 0.000_1 && coverage < 0.25, |
| 101 | "display set {frames} covers {:.3}% of the canvas", | 90 | "display set {frames} covers {:.3}% of the canvas", |
| 102 | coverage * 100.0 | 91 | coverage * 100.0 |
| 103 | ); | 92 | ); |
| 104 | - // The ink sits in the lower or upper band, never as a single stray row. | ||
| 105 | let rows = (0..h) | 93 | let rows = (0..h) |
| 106 | .filter(|y| { | 94 | .filter(|y| { |
| 107 | frame.planes[0].data[y * stride..(y + 1) * stride] | 95 | frame.planes[0].data[y * stride..(y + 1) * stride] |