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

Function testCreateFromPairVector

Tests/CMakeLib/testDebuggerVariablesHelper.cxx:93–121  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

91}
92
93static bool testCreateFromPairVector()
94{
95 auto variablesManager =
96 std::make_shared<cmDebugger::cmDebuggerVariablesManager>();
97
98 std::vector<std::pair<std::string, std::string>> pairs = {
99 { "Foo1", "Bar1" }, { "Foo2", "Bar2" }
100 };
101
102 auto vars = cmDebugger::cmDebuggerVariablesHelper::CreateIfAny(
103 variablesManager, "Locals", true, pairs);
104
105 dap::array<dap::Variable> variables =
106 variablesManager->HandleVariablesRequest(
107 CreateVariablesRequest(vars->GetId()));
108
109 ASSERT_TRUE(vars->GetValue() == std::to_string(pairs.size()));
110 ASSERT_TRUE(variables.size() == 2);
111 ASSERT_VARIABLE(variables[0], "Foo1", "Bar1", "string");
112 ASSERT_VARIABLE(variables[1], "Foo2", "Bar2", "string");
113
114 auto none = cmDebugger::cmDebuggerVariablesHelper::CreateIfAny(
115 variablesManager, "Locals", true,
116 std::vector<std::pair<std::string, std::string>>());
117
118 ASSERT_TRUE(none == nullptr);
119
120 return true;
121}
122
123static bool testCreateFromSet()
124{

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…