Recomputes the inputs in the corpus that should be favored.
(&mut self)
| 122 | |
| 123 | /// Recomputes the inputs in the corpus that should be favored. |
| 124 | pub fn recompute_input_prioritization(&mut self) { |
| 125 | tracing::debug!("recomputing input prioritization"); |
| 126 | |
| 127 | self.test_cases.iter_mut().for_each(|x| { |
| 128 | x.favored = false; |
| 129 | x.has_unique_edge = false; |
| 130 | }); |
| 131 | |
| 132 | for group in self.coverage_hits.values().filter(|x| !x.is_empty()) { |
| 133 | let Some(&min) = group.iter().min_by_key(|id| self.test_cases[**id].favored_metric()) |
| 134 | else { |
| 135 | continue; |
| 136 | }; |
| 137 | self.test_cases[min].favored = true; |
| 138 | if group.len() == 1 { |
| 139 | self.test_cases[min].has_unique_edge = true; |
| 140 | } |
| 141 | } |
| 142 | } |
| 143 | |
| 144 | fn is_favored(&self, id: usize) -> bool { |
| 145 | self.test_cases[id].favored |
no test coverage detected