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

Function testCreateFromSet

Tests/CMakeLib/testDebuggerVariablesHelper.cxx:123–148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

121}
122
123static bool testCreateFromSet()
124{
125 auto variablesManager =
126 std::make_shared<cmDebugger::cmDebuggerVariablesManager>();
127
128 std::set<std::string> set = { "Foo", "Bar" };
129
130 auto vars = cmDebugger::cmDebuggerVariablesHelper::CreateIfAny(
131 variablesManager, "Locals", true, set);
132
133 dap::array<dap::Variable> variables =
134 variablesManager->HandleVariablesRequest(
135 CreateVariablesRequest(vars->GetId()));
136
137 ASSERT_TRUE(vars->GetValue() == std::to_string(set.size()));
138 ASSERT_TRUE(variables.size() == 2);
139 ASSERT_VARIABLE(variables[0], "[0]", "Bar", "string");
140 ASSERT_VARIABLE(variables[1], "[1]", "Foo", "string");
141
142 auto none = cmDebugger::cmDebuggerVariablesHelper::CreateIfAny(
143 variablesManager, "Locals", true, std::set<std::string>());
144
145 ASSERT_TRUE(none == nullptr);
146
147 return true;
148}
149
150static bool testCreateFromStringVector()
151{

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…