| 486 | } |
| 487 | |
| 488 | void 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 |
nothing calls this directly
no test coverage detected