MCPcopy Create free account
hub / github.com/SakuraEngine/SakuraEngine / Subcase

Method Subcase

tests/framework/src/doctest.cpp:1117–1147  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1115 }
1116
1117 Subcase::Subcase(const String& name, const char* file, int line)
1118 : m_signature({name, file, line}) {
1119 if (!g_cs->reachedLeaf) {
1120 if (g_cs->nextSubcaseStack.size() <= g_cs->subcaseStack.size()
1121 || g_cs->nextSubcaseStack[g_cs->subcaseStack.size()] == m_signature) {
1122 // Going down.
1123 if (checkFilters()) { return; }
1124
1125 g_cs->subcaseStack.push_back(m_signature);
1126 g_cs->currentSubcaseDepth++;
1127 m_entered = true;
1128 DOCTEST_ITERATE_THROUGH_REPORTERS(subcase_start, m_signature);
1129 }
1130 } else {
1131 if (g_cs->subcaseStack[g_cs->currentSubcaseDepth] == m_signature) {
1132 // This subcase is reentered via control flow.
1133 g_cs->currentSubcaseDepth++;
1134 m_entered = true;
1135 DOCTEST_ITERATE_THROUGH_REPORTERS(subcase_start, m_signature);
1136 } else if (g_cs->nextSubcaseStack.size() <= g_cs->currentSubcaseDepth
1137 && g_cs->fullyTraversedSubcases.find(hash(hash(g_cs->subcaseStack, g_cs->currentSubcaseDepth), hash(m_signature)))
1138 == g_cs->fullyTraversedSubcases.end()) {
1139 if (checkFilters()) { return; }
1140 // This subcase is part of the one to be executed next.
1141 g_cs->nextSubcaseStack.clear();
1142 g_cs->nextSubcaseStack.insert(g_cs->nextSubcaseStack.end(),
1143 g_cs->subcaseStack.begin(), g_cs->subcaseStack.begin() + g_cs->currentSubcaseDepth);
1144 g_cs->nextSubcaseStack.push_back(m_signature);
1145 }
1146 }
1147 }
1148
1149 DOCTEST_MSVC_SUPPRESS_WARNING_WITH_PUSH(4996) // std::uncaught_exception is deprecated in C++17
1150 DOCTEST_GCC_SUPPRESS_WARNING_WITH_PUSH("-Wdeprecated-declarations")

Callers

nothing calls this directly

Calls 8

hashFunction · 0.70
sizeMethod · 0.45
push_backMethod · 0.45
findMethod · 0.45
endMethod · 0.45
clearMethod · 0.45
insertMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected