| 42 | } |
| 43 | |
| 44 | void Generator::assignUniqueName( |
| 45 | std::vector<std::shared_ptr<Fuzzer>> &Fuzzers) const { |
| 46 | |
| 47 | auto DuplicateGroups = getDuplicates(Fuzzers); |
| 48 | if (DuplicateGroups.size() == 0) |
| 49 | return; |
| 50 | |
| 51 | for (auto &DuplicateGroup : DuplicateGroups) { |
| 52 | for (auto &F : DuplicateGroup) { |
| 53 | assert(F && "Unexpected Program State"); |
| 54 | |
| 55 | auto NewName = F->getUT().getFilePath(); |
| 56 | NewName = fs::path(NewName).filename(); |
| 57 | NewName = NewName + "_" + F->getName(); |
| 58 | F->setName(NewName); |
| 59 | } |
| 60 | } |
| 61 | |
| 62 | DuplicateGroups = getDuplicates(Fuzzers); |
| 63 | |
| 64 | // Need more precise approach to distinguish every test function by its name |
| 65 | // if assert works. |
| 66 | assert(DuplicateGroups.size() == 0 && "Unexpected Program State"); |
| 67 | } |
| 68 | |
| 69 | std::vector<std::vector<std::shared_ptr<Fuzzer>>> |
| 70 | Generator::getDuplicates(std::vector<std::shared_ptr<Fuzzer>> &Fuzzers) const { |
nothing calls this directly
no test coverage detected