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

Method testDisableBreakpoint

plugins/debuggercommon/tests/debuggertestbase.cpp:439–481  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

437}
438
439void DebuggerTestBase::testDisableBreakpoint()
440{
441 auto* const session = createTestDebugSession();
442 TestLaunchConfiguration cfg;
443
444 // Description: we must stop only on the third breakpoint.
445 const auto firstBreakLine = 29;
446 const auto secondBreakLine = 24;
447 const auto thirdBreakLine = 25;
448 const auto fourthBreakLine = 32;
449
450 Breakpoint* breakpoint;
451
452 breakpoint = addDebugeeBreakpoint(firstBreakLine);
453 breakpoint->setData(Breakpoint::EnableColumn, Qt::Unchecked);
454
455 // This is needed to emulate debug from GUI. If we are in edit mode, the debugSession doesn't exist.
456 Breakpoint* thirdBreak;
457 {
458 QSignalBlocker signalBlocker(breakpoints());
459
460 breakpoint = addDebugeeBreakpoint(secondBreakLine);
461 breakpoint->setData(Breakpoint::EnableColumn, Qt::Unchecked);
462 // all disabled breakpoints were added
463
464 thirdBreak = addDebugeeBreakpoint(thirdBreakLine);
465 }
466
467 ActiveStateSessionSpy sessionSpy(session);
468 START_DEBUGGING_AND_WAIT_FOR_PAUSED_STATE_E(session, cfg, sessionSpy);
469 QCOMPARE(session->currentLine(), thirdBreak->line());
470
471 // disable existing breakpoint
472 thirdBreak->setData(Breakpoint::EnableColumn, Qt::Unchecked);
473
474 // add another disabled breakpoint
475 breakpoint = addDebugeeBreakpoint(fourthBreakLine);
476 WAIT_FOR_STATE_AND_IDLE(session, IDebugSession::PausedState);
477 breakpoint->setData(Breakpoint::EnableColumn, Qt::Unchecked);
478
479 session->run();
480 WAIT_FOR_STATE(session, IDebugSession::EndedState);
481}
482
483void DebuggerTestBase::testChangeLocationBreakpoint()
484{

Callers

nothing calls this directly

Calls 4

currentLineMethod · 0.80
setDataMethod · 0.45
lineMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected