MCPcopy Create free account
hub / github.com/KDE/kdevelop / testVariablesLocals

Method testVariablesLocals

plugins/gdb/unittests/test_gdb.cpp:225–252  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

223}
224
225void GdbTest::testVariablesLocals()
226{
227 auto *session = new TestDebugSession;
228 session->variableController()->setAutoUpdate(KDevelop::IVariableController::UpdateLocals);
229
230 TestLaunchConfiguration cfg;
231
232 breakpoints()->addCodeBreakpoint(debugeeUrl(), 22);
233 START_DEBUGGING_E(session, cfg);
234 WAIT_FOR_STATE(session, DebugSession::PausedState);
235
236 QCOMPARE(variableCollection()->rowCount(), 2);
237 QModelIndex i = variableCollection()->index(1, 0);
238 COMPARE_DATA(i, KDevelop::VariableCollection::defaultLocalsSectionTitle());
239 QCOMPARE(variableCollection()->rowCount(i), 2);
240 COMPARE_DATA(variableCollection()->index(0, 0, i), "i");
241 COMPARE_DATA(variableCollection()->index(0, 1, i), "0");
242 COMPARE_DATA(variableCollection()->index(1, 0, i), "j");
243 // COMPARE_DATA(variableCollection()->index(1, 1, i), "1"); // j is not initialized yet
244 session->run();
245 WAIT_FOR_STATE(session, DebugSession::PausedState);
246 COMPARE_DATA(variableCollection()->index(0, 0, i), "i");
247 COMPARE_DATA(variableCollection()->index(0, 1, i), "1");
248 COMPARE_DATA(variableCollection()->index(1, 0, i), "j");
249 COMPARE_DATA(variableCollection()->index(1, 1, i), "1");
250 session->run();
251 WAIT_FOR_STATE(session, DebugSession::EndedState);
252}
253
254void GdbTest::testVariablesWatchesQuotes()
255{

Callers

nothing calls this directly

Calls 7

variableCollectionFunction · 0.85
setAutoUpdateMethod · 0.80
variableControllerMethod · 0.45
addCodeBreakpointMethod · 0.45
rowCountMethod · 0.45
indexMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected