(&mut self, corpus: &CorpusStore<MultiStream>)
| 454 | |
| 455 | impl InputSource for CoverageQueue { |
| 456 | fn next_input(&mut self, corpus: &CorpusStore<MultiStream>) -> Option<InputId> { |
| 457 | let id = match self.new.pop() { |
| 458 | // Fuzz small, new entries first, but ensure we haven't already found a better input. |
| 459 | Some(entry) => { |
| 460 | if corpus.is_favored(entry.id) { |
| 461 | entry.id |
| 462 | } |
| 463 | else { |
| 464 | self.queue.push_back(entry.id); |
| 465 | self.queue.pop_front()? |
| 466 | } |
| 467 | } |
| 468 | // Fallback to the next scheduled input, |
| 469 | None => self.queue.pop_front()?, |
| 470 | }; |
| 471 | |
| 472 | if id == 0 { |
| 473 | self.cycles += 1; |
| 474 | } |
| 475 | |
| 476 | self.queue.push_back(id); |
| 477 | Some(id) |
| 478 | } |
| 479 | } |
| 480 | |
| 481 | impl InputQueue for CoverageQueue { |
no test coverage detected