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

Method testQListContainer

plugins/lldb/unittests/test_lldbformatters.cpp:360–555  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

358}
359
360void LldbFormattersTest::testQListContainer()
361{
362 QFETCH(QString, container);
363 QFETCH(bool, unordered);
364
365 TestLaunchConfiguration cfg(QStringLiteral("debuggee_qlistcontainer"));
366 cfg.config().writeEntry(KDevMI::Config::BreakOnStartEntry, true);
367
368 auto watchRoot = variableCollection()->indexForItem(variableCollection()->watches(), 0);
369 variableCollection()->expanded(watchRoot);
370 variableCollection()->variableWidgetShown();
371
372 QVERIFY(m_session->startDebugging(&cfg, m_iface));
373 WAIT_FOR_STATE_AND_IDLE(m_session, DebugSession::PausedState);
374
375 m_session->addUserCommand(QStringLiteral("break set --func doStuff<%1>()").arg(container));
376 WAIT_FOR_A_WHILE_AND_IDLE(m_session, 50);
377
378 m_session->run();
379 WAIT_FOR_STATE_AND_IDLE(m_session, DebugSession::PausedState);
380
381 // <int>
382 m_session->stepOver();
383 WAIT_FOR_STATE_AND_IDLE(m_session, DebugSession::PausedState);
384 QCOMPARE(m_session->currentLine(), 33); // line 34: intList << 10 << 20;
385
386 auto var = variableCollection()->watches()->add(QStringLiteral("intList"));
387 WAIT_FOR_A_WHILE_AND_IDLE(m_session, 50);
388
389 if (!verifyVariable(0, QStringLiteral("intList"), QStringLiteral("<size=0>"), QStringList{},
390 __FILE__, __LINE__, false, false, unordered)) {
391 return;
392 }
393
394 m_session->stepOver();
395 WAIT_FOR_STATE_AND_IDLE(m_session, DebugSession::PausedState);
396 QCOMPARE(m_session->currentLine(), 34); // line 35: intList << 30;
397
398 variableCollection()->expanded(watchVariableIndexAt(0)); // expand this node for correct update.
399 WAIT_FOR_A_WHILE_AND_IDLE(m_session, 50);
400
401 if (!verifyVariable(0, QStringLiteral("intList"), QStringLiteral("<size=2>"), QStringList{"10", "20"},
402 __FILE__, __LINE__, false, false, unordered)) {
403 return;
404 }
405
406 m_session->stepOver();
407 WAIT_FOR_STATE_AND_IDLE(m_session, DebugSession::PausedState);
408 QCOMPARE(m_session->currentLine(), 36); // line 37: Container<QString> stringList;
409
410 if (!verifyVariable(0, QStringLiteral("intList"), QStringLiteral("<size=3>"), QStringList{"10", "20", "30"},
411 __FILE__, __LINE__, false, false, unordered)) {
412 return;
413 }
414 var->die();
415
416 // <QString>
417 m_session->stepOver();

Callers

nothing calls this directly

Calls 14

variableCollectionFunction · 0.85
writeEntryMethod · 0.80
indexForItemMethod · 0.80
variableWidgetShownMethod · 0.80
startDebuggingMethod · 0.80
addUserCommandMethod · 0.80
currentLineMethod · 0.80
runUntilMethod · 0.80
configMethod · 0.45
expandedMethod · 0.45
runMethod · 0.45
stepOverMethod · 0.45

Tested by

no test coverage detected