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

Method changesModel

kdevplatform/shell/tests/test_projectcontroller.cpp:488–500  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

486}
487
488void TestProjectController::changesModel()
489{
490 QCOMPARE_EQ(m_projCtrl->changesModel(), nullptr); // the changes model is created only on demand
491 QCOMPARE_EQ(m_projCtrl->changesModel(), nullptr); // calling changesModel() does not create the model
492
493 auto model = m_projCtrl->makeChangesModel();
494 QVERIFY(model); // makeChangesModel() creates and returns the model
495 QCOMPARE_EQ(m_projCtrl->makeChangesModel(), model); // makeChangesModel() returns the existent model if possible
496 QCOMPARE_EQ(m_projCtrl->changesModel(), model); // changesModel() returns the existent model if available
497
498 model.reset();
499 QCOMPARE_EQ(m_projCtrl->changesModel(), nullptr); // resetting the shared pointer destroys the model
500}
501
502////////////////////// Helpers ///////////////////////////////////////////////
503

Callers

nothing calls this directly

Calls 2

makeChangesModelMethod · 0.80
resetMethod · 0.45

Tested by

no test coverage detected