| 46 | } |
| 47 | |
| 48 | std::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 | |
| 70 | std::string GoogleTestCallWriter::getInstanceNameFromClass( |
| 71 | const std::string &ClassName) const { |
nothing calls this directly
no test coverage detected