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

Method testIgnoreHitsBreakpoint

plugins/debuggercommon/tests/debuggertestbase.cpp:602–642  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

600}
601
602void DebuggerTestBase::testIgnoreHitsBreakpoint()
603{
604 auto* const session = createTestDebugSession();
605 TestLaunchConfiguration cfg;
606
607 auto* const b1 = addDebugeeBreakpoint(23);
608 b1->setIgnoreHits(1);
609 auto* const b2 = addDebugeeBreakpoint(24);
610
611 QCOMPARE(b1->hitCount(), 0);
612 QCOMPARE(b2->hitCount(), 0);
613
614 ActiveStateSessionSpy sessionSpy(session);
615 START_DEBUGGING_AND_WAIT_FOR_PAUSED_STATE_E(session, cfg, sessionSpy);
616 // one b1 hit ignored
617 QCOMPARE(currentMiLine(session), 24); // b2
618
619 QEXPECT_FAIL_BREAKPOINT_HIT_COUNT_IF_LLDB();
620 QCOMPARE(b1->hitCount(), 1);
621 QEXPECT_FAIL_BREAKPOINT_HIT_COUNT_IF_LLDB();
622 QCOMPARE(b2->hitCount(), 1);
623
624 b2->setIgnoreHits(1);
625
626 CONTINUE_AND_WAIT_FOR_PAUSED_STATE(session, sessionSpy);
627 QCOMPARE(currentMiLine(session), 23); // b1
628
629 QEXPECT_FAIL_BREAKPOINT_HIT_COUNT_IF_LLDB();
630 QCOMPARE(b1->hitCount(), 2);
631 // LLDB-MI accidentally reports the correct hit count here
632 QCOMPARE(b2->hitCount(), 1);
633
634 session->run();
635 // one b2 hit ignored
636 WAIT_FOR_STATE(session, IDebugSession::EndedState);
637
638 QEXPECT_FAIL_BREAKPOINT_HIT_COUNT_IF_LLDB();
639 QCOMPARE(b1->hitCount(), 2);
640 QEXPECT_FAIL_BREAKPOINT_HIT_COUNT_IF_LLDB();
641 QCOMPARE(b2->hitCount(), 2);
642}
643
644void DebuggerTestBase::testConditionBreakpoint()
645{

Callers

nothing calls this directly

Calls 4

currentMiLineFunction · 0.85
hitCountMethod · 0.80
setIgnoreHitsMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected