| 91 | |
| 92 | impl<D> CorpusStore<D> { |
| 93 | fn add_data(&mut self, data: D) -> InputId { |
| 94 | let id = self.test_cases.len(); |
| 95 | self.test_cases.push(TestCase { |
| 96 | data, |
| 97 | stage_data: HashMap::new(), |
| 98 | metadata: InputMetadata { |
| 99 | id, |
| 100 | found_at: self.start_time.elapsed().as_millis() as u64, |
| 101 | ..Default::default() |
| 102 | }, |
| 103 | blocks: None, |
| 104 | // Inputs are added when they cover new coverage bits, so they are always favoured |
| 105 | // initially. |
| 106 | favored: true, |
| 107 | has_unique_edge: false, |
| 108 | is_import: false, |
| 109 | }); |
| 110 | id |
| 111 | } |
| 112 | |
| 113 | /// Returns the total number of test cases in the corpus |
| 114 | pub fn inputs(&self) -> usize { |