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

Method getTCCall

lib/tcanalysis/TCTCallWriter.cpp:6–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4using namespace ftg;
5
6std::string TCTCallWriter::getTCCall(const Unittest &TC,
7 std::string Indent) const {
8 std::string PreTestFunc, TestMainFunc, PostTestFunc;
9 bool PreAction = true;
10 for (const auto &TestFunc : TC.getTestSequence()) {
11 if (TestFunc.getName().empty())
12 continue;
13
14 if (TestFunc.isTestBody()) {
15 TestMainFunc = TestFunc.getName() + "();";
16 PreAction = false;
17 continue;
18 }
19
20 if (PreAction) {
21 PreTestFunc = TestFunc.getName() + "();";
22 continue;
23 }
24
25 PostTestFunc = TestFunc.getName() + "();";
26 }
27
28 std::string Result;
29 if (!PreTestFunc.empty())
30 Result += Indent + PreTestFunc + "\n";
31 if (!TestMainFunc.empty())
32 Result += Indent + TestMainFunc + "\n";
33 if (!PostTestFunc.empty())
34 Result += Indent + PostTestFunc + "\n";
35 return Result;
36}

Callers 4

generateBottomMethod · 0.45
TEST_FFunction · 0.45
TEST_FFunction · 0.45
TEST_FFunction · 0.45

Calls 4

getTestSequenceMethod · 0.80
emptyMethod · 0.80
getNameMethod · 0.45
isTestBodyMethod · 0.45

Tested by 3

TEST_FFunction · 0.36
TEST_FFunction · 0.36
TEST_FFunction · 0.36