MCPcopy Create free account
hub / github.com/Kitware/CMake / testCreateFromStringVector

Function testCreateFromStringVector

Tests/CMakeLib/testDebuggerVariablesHelper.cxx:150–175  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

148}
149
150static bool testCreateFromStringVector()
151{
152 auto variablesManager =
153 std::make_shared<cmDebugger::cmDebuggerVariablesManager>();
154
155 std::vector<std::string> list = { "Foo", "Bar" };
156
157 auto vars = cmDebugger::cmDebuggerVariablesHelper::CreateIfAny(
158 variablesManager, "Locals", true, list);
159
160 dap::array<dap::Variable> variables =
161 variablesManager->HandleVariablesRequest(
162 CreateVariablesRequest(vars->GetId()));
163
164 ASSERT_TRUE(vars->GetValue() == std::to_string(list.size()));
165 ASSERT_TRUE(variables.size() == 2);
166 ASSERT_VARIABLE(variables[0], "[0]", "Foo", "string");
167 ASSERT_VARIABLE(variables[1], "[1]", "Bar", "string");
168
169 auto none = cmDebugger::cmDebuggerVariablesHelper::CreateIfAny(
170 variablesManager, "Locals", true, std::vector<std::string>());
171
172 ASSERT_TRUE(none == nullptr);
173
174 return true;
175}
176
177static bool testCreateFromTarget()
178{

Callers

nothing calls this directly

Calls 6

to_stringFunction · 0.85
CreateVariablesRequestFunction · 0.70
GetIdMethod · 0.45
GetValueMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…