| 121 | } |
| 122 | |
| 123 | static 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 | |
| 150 | static bool testCreateFromStringVector() |
| 151 | { |
nothing calls this directly
no test coverage detected
searching dependent graphs…