| 15 | #include "testCommon.h" |
| 16 | |
| 17 | static bool testVariablesRegistration() |
| 18 | { |
| 19 | auto variablesManager = |
| 20 | std::make_shared<cmDebugger::cmDebuggerVariablesManager>(); |
| 21 | |
| 22 | int64_t line = 5; |
| 23 | auto local = std::make_shared<cmDebugger::cmDebuggerVariables>( |
| 24 | variablesManager, "Local", true, [=]() { |
| 25 | return std::vector<cmDebugger::cmDebuggerVariableEntry>{ { "CurrentLine", |
| 26 | line } }; |
| 27 | }); |
| 28 | |
| 29 | dap::VariablesRequest variableRequest; |
| 30 | variableRequest.variablesReference = local->GetId(); |
| 31 | |
| 32 | dap::array<dap::Variable> variables = |
| 33 | variablesManager->HandleVariablesRequest(variableRequest); |
| 34 | |
| 35 | ASSERT_TRUE(variables.size() == 1); |
| 36 | |
| 37 | local.reset(); |
| 38 | |
| 39 | variables = variablesManager->HandleVariablesRequest(variableRequest); |
| 40 | ASSERT_TRUE(variables.size() == 0); |
| 41 | |
| 42 | return true; |
| 43 | } |
| 44 | |
| 45 | int testDebuggerVariablesManager(int, char*[]) |
| 46 | { |
nothing calls this directly
no test coverage detected
searching dependent graphs…