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

Method testDocumentEditAndSave

kdevplatform/debugger/tests/test_breakpointmodel.cpp:450–472  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

448}
449
450void TestBreakpointModel::testDocumentEditAndSave()
451{
452 const auto [url, doc, b1, b2] = setupEditAndCheckPrimaryDocumentAndBreakpoints();
453 RETURN_IF_TEST_FAILED();
454
455 // save() shall make the breakpoint tracked line numbers persistent.
456 // After saving, close() should have no effect on the line numbers
457 // other than detaching all moving cursors from the document.
458 QVERIFY(doc->save());
459 QVERIFY(doc->close());
460 QCOMPARE(doc->state(), IDocument::Clean);
461
462 // Wait needed for BreakpointModel::save() to complete.
463 QTest::qWait(1);
464
465 // verify.
466 VERIFY_UNTRACKED_BREAKPOINT(b1, 23, );
467 VERIFY_UNTRACKED_BREAKPOINT(b2, 24, );
468 const auto savedBreakpoints = readBreakpointsFromConfig();
469 QCOMPARE(savedBreakpoints.size(), 2);
470 QCOMPARE(savedBreakpoints.at(0)->line(), 23);
471 QCOMPARE(savedBreakpoints.at(1)->line(), 24);
472}
473
474void TestBreakpointModel::testDocumentEditAndDiscard()
475{

Callers

nothing calls this directly

Calls 7

saveMethod · 0.45
closeMethod · 0.45
stateMethod · 0.45
sizeMethod · 0.45
lineMethod · 0.45
atMethod · 0.45

Tested by

no test coverage detected