| 91 | } |
| 92 | |
| 93 | static 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 | |
| 123 | static bool testCreateFromSet() |
| 124 | { |
nothing calls this directly
no test coverage detected
searching dependent graphs…