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

Function testIgnoreEmptyStringEntries

Tests/CMakeLib/testDebuggerVariables.cxx:108–139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

106}
107
108static bool testIgnoreEmptyStringEntries()
109{
110 auto variablesManager =
111 std::make_shared<cmDebugger::cmDebuggerVariablesManager>();
112
113 auto vars = std::make_shared<cmDebugger::cmDebuggerVariables>(
114 variablesManager, "Variables", true, []() {
115 return std::vector<cmDebugger::cmDebuggerVariableEntry>{
116 { "IntValue1", 5 }, { "StringValue1", "" },
117 { "StringValue2", "foo" }, { "StringValue3", "" },
118 { "StringValue4", "bar" }, { "StringValue5", "" },
119 { "IntValue2", int64_t(99) }, { "BooleanTrue", true },
120 { "BooleanFalse", false },
121 };
122 });
123
124 vars->SetIgnoreEmptyStringEntries(true);
125 vars->SetEnableSorting(false);
126
127 dap::array<dap::Variable> variables =
128 variablesManager->HandleVariablesRequest(
129 CreateVariablesRequest(vars->GetId()));
130 ASSERT_TRUE(variables.size() == 6);
131 ASSERT_VARIABLE(variables[0], "IntValue1", "5", "int");
132 ASSERT_VARIABLE(variables[1], "StringValue2", "foo", "string");
133 ASSERT_VARIABLE(variables[2], "StringValue4", "bar", "string");
134 ASSERT_VARIABLE(variables[3], "IntValue2", "99", "int");
135 ASSERT_VARIABLE(variables[4], "BooleanTrue", "TRUE", "bool");
136 ASSERT_VARIABLE(variables[5], "BooleanFalse", "FALSE", "bool");
137
138 return true;
139}
140
141static bool testSortTheResult()
142{

Callers

nothing calls this directly

Calls 6

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…