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

Function testVariablesRegistration

Tests/CMakeLib/testDebuggerVariablesManager.cxx:17–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15#include "testCommon.h"
16
17static 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
45int testDebuggerVariablesManager(int, char*[])
46{

Callers

nothing calls this directly

Calls 4

GetIdMethod · 0.45
sizeMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…