diff --git a/autotests/libs/entitytreemodeltest.cpp b/autotests/libs/entitytreemodeltest.cpp --- a/autotests/libs/entitytreemodeltest.cpp +++ b/autotests/libs/entitytreemodeltest.cpp @@ -76,6 +76,7 @@ private Q_SLOTS: void initTestCase(); + void cleanupTestCase(); void testInitialFetch(); void testCollectionMove_data(); @@ -110,7 +111,7 @@ m_modelSpy = new ModelSpy{model, this}; - const auto serverData = new FakeServerData(model, m_fakeSession, fakeMonitor); + const auto serverData = new FakeServerData(model, m_fakeSession, fakeMonitor, this); serverData->setCommands(FakeJobResponse::interpret(serverData, serverContent)); // Give the model a chance to populate @@ -144,15 +145,20 @@ qRegisterMetaType("QModelIndex"); } +void EntityTreeModelTest::cleanupTestCase() +{ + delete m_fakeSession; +} + void EntityTreeModelTest::testInitialFetch() { const auto fakeMonitor = new FakeMonitor(this); fakeMonitor->setSession(m_fakeSession); fakeMonitor->setCollectionMonitored(Collection::root()); const auto model = new EntityTreeModel(fakeMonitor, this); - const auto serverData = new FakeServerData(model, m_fakeSession, fakeMonitor); + const auto serverData = new FakeServerData(model, m_fakeSession, fakeMonitor, this); serverData->setCommands(FakeJobResponse::interpret(serverData, serverContent1)); m_modelSpy = new ModelSpy(model, this); diff --git a/autotests/libs/tagmodeltest.cpp b/autotests/libs/tagmodeltest.cpp --- a/autotests/libs/tagmodeltest.cpp +++ b/autotests/libs/tagmodeltest.cpp @@ -43,6 +43,7 @@ Q_OBJECT private Q_SLOTS: void initTestCase(); + void cleanupTestCase(); void testInitialFetch(); @@ -71,7 +72,7 @@ m_modelSpy = new ModelSpy{model, this}; - const auto serverData = new FakeServerData(model, m_fakeSession, fakeMonitor); + const auto serverData = new FakeServerData(model, m_fakeSession, fakeMonitor, this); serverData->setCommands(FakeJobResponse::interpret(serverData, serverContent)); // Give the model a chance to populate @@ -104,15 +105,20 @@ qRegisterMetaType("QModelIndex"); } +void TagModelTest::cleanupTestCase() +{ + delete m_fakeSession; +} + void TagModelTest::testInitialFetch() { const auto fakeMonitor = new FakeMonitor(this); fakeMonitor->setSession(m_fakeSession); fakeMonitor->setCollectionMonitored(Collection::root()); const auto model = new TagModel(fakeMonitor, this); - const auto serverData = new FakeServerData(model, m_fakeSession, fakeMonitor); + const auto serverData = new FakeServerData(model, m_fakeSession, fakeMonitor, this); const auto initialFetchResponse = FakeJobResponse::interpret(serverData, serverContent1); serverData->setCommands(initialFetchResponse); diff --git a/tests/libs/etm_test_app/mainwindow.cpp b/tests/libs/etm_test_app/mainwindow.cpp --- a/tests/libs/etm_test_app/mainwindow.cpp +++ b/tests/libs/etm_test_app/mainwindow.cpp @@ -37,7 +37,7 @@ monitor->setSession(session); m_model = new EntityTreeModel(monitor, this); - m_serverData = new FakeServerData(m_model, session, monitor); + m_serverData = new FakeServerData(m_model, session, monitor, this); QList initialFetchResponse = FakeJobResponse::interpret(m_serverData, QStringLiteral( "- C (inode/directory) 'Col 1' 4"