diff options
author | Mike Krus <mike.krus@kdab.com> | 2019-12-05 10:33:32 +0000 |
---|---|---|
committer | Mike Krus <mike.krus@kdab.com> | 2019-12-13 15:36:59 +0000 |
commit | ef886f79f99cdae94da8bf5a4ca6e94164d56677 (patch) | |
tree | 98caf12195cb24763292305326d40c6838066312 /tests | |
parent | 6e448dd5918c70ddfd0d52f62522fa49c02e8ba8 (diff) |
Make tracing a runtime option
- Moved most of the code QSystemInformationService (private class
for now)
- Tracing can be enabled by setting QT3D_TRACE_ENABLED or
calling QSystemInformationService::setTraceEnabled(bool)
- Introduced QTaskLogger class to easy logging (RAII)
Change-Id: I2a3e08e4371fcee3e9ef3cf575725f13f57d1a94
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/core/qservicelocator/tst_qservicelocator.cpp | 14 | ||||
-rw-r--r-- | tests/auto/core/threadpooler/tst_threadpooler.cpp | 2 |
2 files changed, 6 insertions, 10 deletions
diff --git a/tests/auto/core/qservicelocator/tst_qservicelocator.cpp b/tests/auto/core/qservicelocator/tst_qservicelocator.cpp index cde9834b4..04e6881aa 100644 --- a/tests/auto/core/qservicelocator/tst_qservicelocator.cpp +++ b/tests/auto/core/qservicelocator/tst_qservicelocator.cpp @@ -54,9 +54,6 @@ public: DummySystemInfoService() : QSystemInformationService(QStringLiteral("Dummy System Information Service")) {} - - QStringList aspectNames() const final { return QStringList(); } - int threadPoolThreadCount() const final { return 4; } }; @@ -90,8 +87,8 @@ void tst_QServiceLocator::defaultServices() QSystemInformationService *sysInfo = locator.systemInformation(); QVERIFY(sysInfo != nullptr); - QVERIFY(sysInfo->description() == QStringLiteral("Null System Information Service")); - QVERIFY(sysInfo->threadPoolThreadCount() == 0); + QVERIFY(sysInfo->description() == QStringLiteral("Default System Information Service")); + QVERIFY(sysInfo->threadPoolThreadCount() != 0); } void tst_QServiceLocator::addRemoveDefaultService() @@ -105,7 +102,6 @@ void tst_QServiceLocator::addRemoveDefaultService() // Get the service from the locator and check it works as expected QSystemInformationService *service = locator.systemInformation(); QVERIFY(service == dummy.data()); - QVERIFY(service->threadPoolThreadCount() == 4); // Ensure the other default services work QOpenGLInformationService *glInfo = locator.openGLInformation(); @@ -118,7 +114,7 @@ void tst_QServiceLocator::addRemoveDefaultService() QVERIFY(locator.serviceCount() == QServiceLocator::DefaultServiceCount); // Check the dummy service still exists - QVERIFY(dummy->threadPoolThreadCount() == 4); + QVERIFY(!dummy.isNull()); } void tst_QServiceLocator::addRemoveUserService() @@ -138,8 +134,8 @@ void tst_QServiceLocator::addRemoveUserService() // Ensure the default services work QSystemInformationService *sysInfo = locator.systemInformation(); QVERIFY(sysInfo != nullptr); - QVERIFY(sysInfo->description() == QStringLiteral("Null System Information Service")); - QVERIFY(sysInfo->threadPoolThreadCount() == 0); + QVERIFY(sysInfo->description() == QStringLiteral("Default System Information Service")); + QVERIFY(sysInfo->threadPoolThreadCount() != 0); // Remove custom service locator.unregisterServiceProvider(dummy->type()); diff --git a/tests/auto/core/threadpooler/tst_threadpooler.cpp b/tests/auto/core/threadpooler/tst_threadpooler.cpp index cfe3480ee..289f0b103 100644 --- a/tests/auto/core/threadpooler/tst_threadpooler.cpp +++ b/tests/auto/core/threadpooler/tst_threadpooler.cpp @@ -182,7 +182,7 @@ void massTestFunction(QVector3D *data) void tst_ThreadPooler::initTestCase() { - m_jobManager = new JobManager(this); + m_jobManager = new JobManager(nullptr); } void tst_ThreadPooler::cleanupTestCase() |