MCPcopy Create free account
hub / github.com/Samsung/UTopia / assignUniqueName

Method assignUniqueName

lib/generation/Generator.cpp:44–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42}
43
44void 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
69std::vector<std::vector<std::shared_ptr<Fuzzer>>>
70Generator::getDuplicates(std::vector<std::shared_ptr<Fuzzer>> &Fuzzers) const {

Callers

nothing calls this directly

Calls 4

sizeMethod · 0.80
getFilePathMethod · 0.45
getNameMethod · 0.45
setNameMethod · 0.45

Tested by

no test coverage detected