edith_codecs
Clone
https://git.tahinli.com/Tahinli/edith_codecs.git
0 watching0 forksRust370.3 MiB9b67700Tahinli3 days ago4021 commits
| 1 | //! No-panic robustness: truncated and corrupted streams must come back as |
| 2 | //! `Ok` or `Err`, never as a panic. Every mutation comes from a fixed-seed |
| 3 | //! generator, so a reported case replays bit-for-bit. |
| 4 | //! |
| 5 | //! The inputs are the crate's own committed fixtures (`tests/data/*.ivf`), |
| 6 | //! so the test needs no fixtures checkout. |
| 7 | |
| 8 | use crateivf; |
| 9 | |
| 10 | use Decoder; |
| 11 | use decode_stream; |
| 12 | use ; |
| 13 | use ; |
| 14 | |
| 15 | /// Fixed seed: a failing case is reproduced by re-running with the same seed. |
| 16 | const SEED: u64 = 0x5EED_00F0_0009; |
| 17 | /// Random container-level truncations per fixture. |
| 18 | const STREAM_CUTS: usize = 24; |
| 19 | /// Random container-level byte corruptions per fixture. |
| 20 | const STREAM_FLIPS: usize = 24; |
| 21 | /// Frames probed per fixture (the first few, where the reference state is |
| 22 | /// still small enough to replay cheaply). |
| 23 | const FRAMES_PER_FIXTURE: usize = 3; |
| 24 | /// Random mutations applied to each probed frame. |
| 25 | const FRAME_MUTATIONS: usize = 24; |
| 26 | |
| 27 | /// xorshift64*: small, deterministic, dependency-free. |
| 28 | ; |
| 29 | |
| 30 | |
| 31 | |
| 32 | |
| 33 | |
| 34 | |
| 35 | |
| 36 | |
| 37 | |
| 38 | |
| 39 | |
| 40 | |
| 41 | |
| 42 | |
| 43 | |
| 44 | |
| 45 | |
| 46 | |
| 47 | |
| 48 | |
| 49 | |
| 50 | |
| 51 | |
| 52 | |
| 53 | |
| 54 | |
| 55 | |
| 56 | |
| 57 | |
| 58 | |
| 59 | |
| 60 | |
| 61 | /// Every `*.ivf` in the crate's `tests/data`, sorted for a stable order. |
| 62 | |
| 63 | |
| 64 | |
| 65 | |
| 66 | |
| 67 | |
| 68 | |
| 69 | |
| 70 | |
| 71 | |
| 72 | |
| 73 | |
| 74 | /// The panic payload as text, for the failure report. |
| 75 | |
| 76 | |
| 77 | |
| 78 | |
| 79 | |
| 80 | |
| 81 | |
| 82 | |
| 83 | |
| 84 | |
| 85 | /// Run `f` and record a failure if it panics. The decoder's result is |
| 86 | /// discarded: `Ok` and `Err` are both acceptable outcomes here. |
| 87 | |
| 88 | |
| 89 | |
| 90 | |
| 91 | |
| 92 | |
| 93 | |
| 94 | |
| 95 | |
| 96 | |
| 97 | |
| 98 | |
| 99 | |
| 100 | |
| 101 | |
| 102 | |
| 103 | |
| 104 | |
| 105 | |
| 106 | |
| 107 | |
| 108 | |
| 109 | |
| 110 | |
| 111 | |
| 112 | |
| 113 | |
| 114 | |
| 115 | |
| 116 | |
| 117 | |
| 118 | |
| 119 | |
| 120 | |
| 121 | |
| 122 | |
| 123 | |
| 124 | |
| 125 | |
| 126 | |
| 127 | |
| 128 | |
| 129 | |
| 130 | |
| 131 | |
| 132 | |
| 133 | |
| 134 | |
| 135 | |
| 136 | |
| 137 | |
| 138 | |
| 139 | |
| 140 | |
| 141 | |
| 142 | |
| 143 | |
| 144 | |
| 145 | |
| 146 | |
| 147 | |
| 148 | |
| 149 | |
| 150 |