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

Method getGtestFuzzClassDeclString

lib/tcanalysis/GoogleTestCallWriter.cpp:48–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46}
47
48std::string GoogleTestCallWriter::getGtestFuzzClassDeclString(
49 const std::string &ParentClassName,
50 const std::vector<FunctionNode> &TestSequence,
51 const std::string &Indent) const {
52 std::string ClassDefinition = (Indent + "class " + FuzzGtestClassName +
53 " : public " + ParentClassName + " {\n");
54 ClassDefinition += (Indent + "public:\n");
55 ClassDefinition +=
56 (Indent + util::getIndent(1) + "void " + FuzzGtestMethodName + "() {\n");
57 for (const auto &TestFunc : TestSequence) {
58 if (TestFunc.isEnvironment())
59 continue;
60 ClassDefinition +=
61 (Indent + util::getIndent(2) + "try {\n" + Indent + util::getIndent(3) +
62 TestFunc.getFunctionName() + "();\n" + Indent + util::getIndent(2) +
63 "} catch (std::exception &E) {}\n");
64 }
65 ClassDefinition += (Indent + util::getIndent(1) + "}\n");
66 ClassDefinition += (Indent + "};\n");
67 return ClassDefinition;
68}
69
70std::string GoogleTestCallWriter::getInstanceNameFromClass(
71 const std::string &ClassName) const {

Callers

nothing calls this directly

Calls 3

getIndentFunction · 0.85
isEnvironmentMethod · 0.80
getFunctionNameMethod · 0.45

Tested by

no test coverage detected