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

Function testSortTheResult

Tests/CMakeLib/testDebuggerVariables.cxx:141–175  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

139}
140
141static bool testSortTheResult()
142{
143 auto variablesManager =
144 std::make_shared<cmDebugger::cmDebuggerVariablesManager>();
145
146 auto vars = std::make_shared<cmDebugger::cmDebuggerVariables>(
147 variablesManager, "Variables", true, []() {
148 return std::vector<cmDebugger::cmDebuggerVariableEntry>{
149 { "4", "4" }, { "2", "2" }, { "1", "1" }, { "3", "3" }, { "5", "5" },
150 };
151 });
152
153 dap::array<dap::Variable> variables =
154 variablesManager->HandleVariablesRequest(
155 CreateVariablesRequest(vars->GetId()));
156 ASSERT_TRUE(variables.size() == 5);
157 ASSERT_VARIABLE(variables[0], "1", "1", "string");
158 ASSERT_VARIABLE(variables[1], "2", "2", "string");
159 ASSERT_VARIABLE(variables[2], "3", "3", "string");
160 ASSERT_VARIABLE(variables[3], "4", "4", "string");
161 ASSERT_VARIABLE(variables[4], "5", "5", "string");
162
163 vars->SetEnableSorting(false);
164
165 variables = variablesManager->HandleVariablesRequest(
166 CreateVariablesRequest(vars->GetId()));
167 ASSERT_TRUE(variables.size() == 5);
168 ASSERT_VARIABLE(variables[0], "4", "4", "string");
169 ASSERT_VARIABLE(variables[1], "2", "2", "string");
170 ASSERT_VARIABLE(variables[2], "1", "1", "string");
171 ASSERT_VARIABLE(variables[3], "3", "3", "string");
172 ASSERT_VARIABLE(variables[4], "5", "5", "string");
173
174 return true;
175}
176
177static bool testNoSupportsVariableType()
178{

Callers

nothing calls this directly

Calls 5

SetEnableSortingMethod · 0.80
CreateVariablesRequestFunction · 0.70
GetIdMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…