summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/core/qifabstractfeature/tst_qifabstractfeature.cpp13
-rw-r--r--tests/auto/core/qifconfiguration/tst_qifconfiguration.cpp3
-rw-r--r--tests/auto/core/qiffilterandbrowsemodel/tst_qiffilterandbrowsemodel.cpp1
-rw-r--r--tests/auto/core/qifpagingmodel/tst_qifpagingmodel.cpp1
-rw-r--r--tests/auto/core/qifpendingreply/tst_qifpendingreply.cpp4
5 files changed, 13 insertions, 9 deletions
diff --git a/tests/auto/core/qifabstractfeature/tst_qifabstractfeature.cpp b/tests/auto/core/qifabstractfeature/tst_qifabstractfeature.cpp
index 71cbe9f1..e078d60a 100644
--- a/tests/auto/core/qifabstractfeature/tst_qifabstractfeature.cpp
+++ b/tests/auto/core/qifabstractfeature/tst_qifabstractfeature.cpp
@@ -218,9 +218,9 @@ private:
QIfFeatureTester *createTester(bool testBaseFunctions = false)
{
if (m_isModel)
- return new QIfFeatureTester(new TestFeatureListModel(testBaseFunctions));
+ return new QIfFeatureTester(new TestFeatureListModel(testBaseFunctions, this), this);
else
- return new QIfFeatureTester(new TestFeature(testBaseFunctions));
+ return new QIfFeatureTester(new TestFeature(testBaseFunctions, this), this);
}
QIfServiceManager *m_manager;
@@ -387,9 +387,9 @@ void BaseTest::testAutoDiscovery_qml()
QVERIFY2(obj, qPrintable(component.errorString()));
QIfFeatureTester *defaultItem;
if (m_isModel)
- defaultItem = new QIfFeatureTester(obj->findChild<TestFeatureListModel*>("default"));
+ defaultItem = new QIfFeatureTester(obj->findChild<TestFeatureListModel*>("default"), this);
else
- defaultItem = new QIfFeatureTester(obj->findChild<TestFeature*>("default"));
+ defaultItem = new QIfFeatureTester(obj->findChild<TestFeature*>("default"), this);
QVERIFY(defaultItem);
QCOMPARE(defaultItem->discoveryMode(), QIfAbstractFeature::AutoDiscovery);
QVERIFY(defaultItem->serviceObject());
@@ -397,9 +397,9 @@ void BaseTest::testAutoDiscovery_qml()
QIfFeatureTester *autoDiscoveryDisabledItem;
if (m_isModel)
- autoDiscoveryDisabledItem = new QIfFeatureTester(obj->findChild<TestFeatureListModel*>("autoDiscoveryDisabled"));
+ autoDiscoveryDisabledItem = new QIfFeatureTester(obj->findChild<TestFeatureListModel*>("autoDiscoveryDisabled"), this);
else
- autoDiscoveryDisabledItem = new QIfFeatureTester(obj->findChild<TestFeature*>("autoDiscoveryDisabled"));
+ autoDiscoveryDisabledItem = new QIfFeatureTester(obj->findChild<TestFeature*>("autoDiscoveryDisabled"), this);
QVERIFY(autoDiscoveryDisabledItem);
QSignalSpy autoDiscoveryChanged(autoDiscoveryDisabledItem, &QIfFeatureTester::discoveryModeChanged);
QSignalSpy serviceObjectChangedSpy(autoDiscoveryDisabledItem, &QIfFeatureTester::serviceObjectChanged);
@@ -414,6 +414,7 @@ void BaseTest::testAutoDiscovery_qml()
delete defaultItem;
delete autoDiscoveryDisabledItem;
+ delete obj;
}
void BaseTest::testProxyServiceObject()
diff --git a/tests/auto/core/qifconfiguration/tst_qifconfiguration.cpp b/tests/auto/core/qifconfiguration/tst_qifconfiguration.cpp
index 8d232e5f..80c63541 100644
--- a/tests/auto/core/qifconfiguration/tst_qifconfiguration.cpp
+++ b/tests/auto/core/qifconfiguration/tst_qifconfiguration.cpp
@@ -557,7 +557,7 @@ void tst_QIfConfiguration::testServiceObjects()
auto backend = new TestBackend;
QIfServiceManager::instance()->registerService(backend, QStringList({"testFeature"}));
- auto testFeature = new TestFeature;
+ std::unique_ptr<TestFeature> testFeature(new TestFeature);
testFeature->startAutoDiscovery();
QVERIFY(testFeature->serviceObject());
@@ -578,6 +578,7 @@ void tst_QIfConfiguration::testServiceObjects()
QVERIFY(testFeature2->serviceObject());
QCOMPARE(backend2->serviceSettings, QVariantMap({{"key1", "value1"}}));
+ delete testFeature2;
}
void tst_QIfConfiguration::simulationEngine()
diff --git a/tests/auto/core/qiffilterandbrowsemodel/tst_qiffilterandbrowsemodel.cpp b/tests/auto/core/qiffilterandbrowsemodel/tst_qiffilterandbrowsemodel.cpp
index fb7a6e7f..c9668684 100644
--- a/tests/auto/core/qiffilterandbrowsemodel/tst_qiffilterandbrowsemodel.cpp
+++ b/tests/auto/core/qiffilterandbrowsemodel/tst_qiffilterandbrowsemodel.cpp
@@ -352,6 +352,7 @@ public:
QIfServiceObject(parent)
{
m_backend = new TestBackend;
+ m_backend->setParent(this);
m_interfaces << QIfFilterAndBrowseModel_iid;
}
diff --git a/tests/auto/core/qifpagingmodel/tst_qifpagingmodel.cpp b/tests/auto/core/qifpagingmodel/tst_qifpagingmodel.cpp
index fc51e870..4c02ec4a 100644
--- a/tests/auto/core/qifpagingmodel/tst_qifpagingmodel.cpp
+++ b/tests/auto/core/qifpagingmodel/tst_qifpagingmodel.cpp
@@ -141,6 +141,7 @@ public:
QIfServiceObject(parent)
{
m_backend = new TestBackend;
+ m_backend->setParent(this);
m_interfaces << QIfPagingModel_iid;
}
diff --git a/tests/auto/core/qifpendingreply/tst_qifpendingreply.cpp b/tests/auto/core/qifpendingreply/tst_qifpendingreply.cpp
index 9ef54ec7..1914ccb3 100644
--- a/tests/auto/core/qifpendingreply/tst_qifpendingreply.cpp
+++ b/tests/auto/core/qifpendingreply/tst_qifpendingreply.cpp
@@ -14,7 +14,7 @@
#define TEST_FUNCTION(NAME, TYPE) QIfPendingReply<TYPE> TestObject::test_##NAME(TYPE result, bool fail) { \
QIfPendingReply<TYPE> reply; \
- auto timer = new QTimer(); \
+ auto timer = new QTimer(this); \
timer->setSingleShot(true); \
connect(timer, &QTimer::timeout, this, [reply, fail, result]() mutable { \
if (fail) \
@@ -90,7 +90,7 @@ Q_DECLARE_METATYPE(TestGadget)
QIfPendingReply<void> TestObject::test_void(bool fail) {
QIfPendingReply<void> reply;
- auto timer = new QTimer();
+ auto timer = new QTimer(this);
timer->setSingleShot(true);
connect(timer, &QTimer::timeout, this, [reply, fail]() mutable {
if (fail)