diff options
author | Mike Krus <mike.krus@kdab.com> | 2020-01-11 11:17:55 +0000 |
---|---|---|
committer | Mike Krus <mike.krus@kdab.com> | 2020-01-14 08:04:10 +0000 |
commit | 0dc38ecbbff992701756d92821e20f360821710f (patch) | |
tree | 37318a566d80d8fc54dfa1b421a62ec7ac6a7fd0 /tests/auto/core | |
parent | a40654ad451569a19b49bd2d6b9cfc4fa0cc12b8 (diff) |
Fix deprecation handling
Change-Id: If981333f7a3d78028d4f08c59867453d4192b955
Task-number: QTBUG-81058
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'tests/auto/core')
-rw-r--r-- | tests/auto/core/common/qbackendnodetester.cpp | 9 | ||||
-rw-r--r-- | tests/auto/core/common/testpostmanarbiter.cpp | 4 | ||||
-rw-r--r-- | tests/auto/core/common/testpostmanarbiter.h | 3 | ||||
-rw-r--r-- | tests/auto/core/nodes/tst_nodes.cpp | 4 | ||||
-rw-r--r-- | tests/auto/core/qchangearbiter/tst_qchangearbiter.cpp | 4 | ||||
-rw-r--r-- | tests/auto/core/qentity/tst_qentity.cpp | 4 | ||||
-rw-r--r-- | tests/auto/core/qpostman/tst_qpostman.cpp | 221 | ||||
-rw-r--r-- | tests/auto/core/qscene/tst_qscene.cpp | 4 | ||||
-rw-r--r-- | tests/auto/core/qtransform/tst_qtransform.cpp | 4 |
9 files changed, 36 insertions, 221 deletions
diff --git a/tests/auto/core/common/qbackendnodetester.cpp b/tests/auto/core/common/qbackendnodetester.cpp index a2685f556..13f4683d9 100644 --- a/tests/auto/core/common/qbackendnodetester.cpp +++ b/tests/auto/core/common/qbackendnodetester.cpp @@ -56,20 +56,29 @@ void QBackendNodeTester::simulateInitialization(QNode *frontend, QBackendNode *b { Q_ASSERT(frontend); Q_ASSERT(backend); + QT_WARNING_PUSH + QT_WARNING_DISABLE_DEPRECATED const auto change = frontend->createNodeCreationChange(); backend->setPeerId(change->subjectId()); backend->setEnabled(change->isNodeEnabled()); backend->initializeFromPeer(change); + QT_WARNING_POP } void QBackendNodeTester::sceneChangeEvent(QBackendNode *backend, const Qt3DCore::QSceneChangePtr &e) { + QT_WARNING_PUSH + QT_WARNING_DISABLE_DEPRECATED backend->sceneChangeEvent(e); + QT_WARNING_POP } QNodeCreatedChangeBasePtr QBackendNodeTester::creationChange(QNode *frontend) const { + QT_WARNING_PUSH + QT_WARNING_DISABLE_DEPRECATED return frontend->createNodeCreationChange(); + QT_WARNING_POP } } // namespace Qt3DCore diff --git a/tests/auto/core/common/testpostmanarbiter.cpp b/tests/auto/core/common/testpostmanarbiter.cpp index 5869cbad3..f0c362744 100644 --- a/tests/auto/core/common/testpostmanarbiter.cpp +++ b/tests/auto/core/common/testpostmanarbiter.cpp @@ -26,6 +26,10 @@ ** ****************************************************************************/ +// TODO Remove in Qt6 +#include <QtCore/qcompilerdetection.h> +QT_WARNING_DISABLE_DEPRECATED + #include "testpostmanarbiter.h" #include <Qt3DCore/private/qnode_p.h> diff --git a/tests/auto/core/common/testpostmanarbiter.h b/tests/auto/core/common/testpostmanarbiter.h index cecc24f93..e927c2489 100644 --- a/tests/auto/core/common/testpostmanarbiter.h +++ b/tests/auto/core/common/testpostmanarbiter.h @@ -70,7 +70,10 @@ public: void setArbiterOnNode(Qt3DCore::QNode *node); void addDirtyFrontEndNode(Qt3DCore::QNode *node) final; + QT_WARNING_PUSH + QT_WARNING_DISABLE_DEPRECATED void addDirtyFrontEndNode(Qt3DCore::QNode *node, Qt3DCore::QNode *subNode, const char *property, Qt3DCore::ChangeFlag change) final; + QT_WARNING_POP void removeDirtyFrontEndNode(Qt3DCore::QNode *node) final; private: diff --git a/tests/auto/core/nodes/tst_nodes.cpp b/tests/auto/core/nodes/tst_nodes.cpp index 87f66bab2..2e74acd61 100644 --- a/tests/auto/core/nodes/tst_nodes.cpp +++ b/tests/auto/core/nodes/tst_nodes.cpp @@ -26,6 +26,10 @@ ** ****************************************************************************/ +// TODO Remove in Qt6 +#include <QtCore/qcompilerdetection.h> +QT_WARNING_DISABLE_DEPRECATED + #include <QtTest/QTest> #include <Qt3DCore/qnode.h> #include <Qt3DCore/qentity.h> diff --git a/tests/auto/core/qchangearbiter/tst_qchangearbiter.cpp b/tests/auto/core/qchangearbiter/tst_qchangearbiter.cpp index e54193398..3e9b24408 100644 --- a/tests/auto/core/qchangearbiter/tst_qchangearbiter.cpp +++ b/tests/auto/core/qchangearbiter/tst_qchangearbiter.cpp @@ -26,6 +26,10 @@ ** ****************************************************************************/ +// TODO Remove in Qt6 +#include <QtCore/qcompilerdetection.h> +QT_WARNING_DISABLE_DEPRECATED + #include <QtTest/QTest> #include <Qt3DCore/private/qobserverinterface_p.h> #include <Qt3DCore/private/qobservableinterface_p.h> diff --git a/tests/auto/core/qentity/tst_qentity.cpp b/tests/auto/core/qentity/tst_qentity.cpp index 7770a2632..7b41c9783 100644 --- a/tests/auto/core/qentity/tst_qentity.cpp +++ b/tests/auto/core/qentity/tst_qentity.cpp @@ -26,6 +26,10 @@ ** ****************************************************************************/ +// TODO Remove in Qt6 +#include <QtCore/qcompilerdetection.h> +QT_WARNING_DISABLE_DEPRECATED + #include <QtTest/QtTest> #include <Qt3DCore/qentity.h> #include <Qt3DCore/private/qentity_p.h> diff --git a/tests/auto/core/qpostman/tst_qpostman.cpp b/tests/auto/core/qpostman/tst_qpostman.cpp index f548d38fa..d0dfa0f49 100644 --- a/tests/auto/core/qpostman/tst_qpostman.cpp +++ b/tests/auto/core/qpostman/tst_qpostman.cpp @@ -86,227 +86,6 @@ private Q_SLOTS: QCOMPARE(QPostmanPrivate::get(&postman)->m_scene, &scene); } - void checkSceneChangeEvent() - { - // GIVEN - QScopedPointer<QScene> scene(new QScene); - QPostman postman; - TestArbiter arbiter; - QNode rootNode; - NodeChangeReceiver *receiverNode = new NodeChangeReceiver(); - - QNodePrivate::get(&rootNode)->m_scene = scene.data(); - scene->setArbiter(&arbiter); - postman.setScene(scene.data()); - // Setting the parent (which has a scene) adds the node into the observable lookup - // table of the scene which is needed by the postman to distribute changes - static_cast<QNode *>(receiverNode)->setParent(&rootNode); - QCoreApplication::processEvents(); - - // THEN - QCOMPARE(receiverNode->hasReceivedChange(), false); - QCOMPARE(QNodePrivate::get(receiverNode)->m_scene, scene.data()); - - // WHEN - QPropertyUpdatedChangePtr updateChange(new QPropertyUpdatedChange(receiverNode->id())); - updateChange->setValue(1584); - updateChange->setPropertyName("someName"); - postman.sceneChangeEvent(updateChange); - QCoreApplication::processEvents(); - - // THEN - QCOMPARE(receiverNode->hasReceivedChange(), true); - } - - void checkNotifyBackend() - { - // GIVEN - QScopedPointer<QScene> scene(new QScene); - QPostman postman; - TestArbiter arbiter; - - scene->setArbiter(&arbiter); - postman.setScene(scene.data()); - - // THEN - QCOMPARE(arbiter.events.size(), 0); - - // WHEN - QPropertyUpdatedChangePtr updateChange(new QPropertyUpdatedChange(QNodeId())); - updateChange->setValue(1584); - updateChange->setPropertyName("someName"); - postman.notifyBackend(updateChange); - - QCoreApplication::processEvents(); - - // THEN - QCOMPARE(arbiter.events.size(), 1); - } - - void checkShouldNotifyFrontend() - { - // GIVEN - QScopedPointer<QScene> scene(new QScene); - QPostman postman; - TestArbiter arbiter; - QNode rootNode; - NodeChangeReceiver *receiverNode = new NodeChangeReceiver(); - - QNodePrivate::get(&rootNode)->m_scene = scene.data(); - scene->setArbiter(&arbiter); - postman.setScene(scene.data()); - // Setting the parent (which has a scene) adds the node into the observable lookup - // table of the scene which is needed by the postman to distribute changes - static_cast<QNode *>(receiverNode)->setParent(&rootNode); - QCoreApplication::processEvents(); - - { - // WHEN - auto updateChange = QPropertyUpdatedChangePtr::create(receiverNode->id()); - updateChange->setValue(1584); - updateChange->setPropertyName("someName"); - - - // THEN -> we do track properties by default QNode::DefaultTrackMode - // (unless marked as an intermediate change) - QCOMPARE(postman.shouldNotifyFrontend(updateChange), true); - } - - { - // WHEN - receiverNode->setDefaultPropertyTrackingMode(QNode::TrackAllValues); - - auto updateChange = QPropertyUpdatedChangePtr::create(receiverNode->id()); - updateChange->setValue(1584); - updateChange->setPropertyName("someName"); - QPropertyUpdatedChangeBasePrivate::get(updateChange.data())->m_isIntermediate - = true; - - // THEN -> we do track properties marked as intermediate when - // using TrackAllPropertiesMode - QCOMPARE(postman.shouldNotifyFrontend(updateChange), true); - } - - { - // GIVEN - receiverNode->setDefaultPropertyTrackingMode(QNode::DontTrackValues); - receiverNode->setPropertyTracking(QStringLiteral("vette"), Qt3DCore::QNode::TrackAllValues); - - { - // WHEN - auto updateChange = QPropertyUpdatedChangePtr::create(receiverNode->id()); - updateChange->setValue(1584); - updateChange->setPropertyName("someName"); - QPropertyUpdatedChangeBasePrivate::get(updateChange.data())->m_isIntermediate - = true; - - // THEN -> we don't track properties by default, unless named when - // using TrackNamedPropertiesMode - QCOMPARE(postman.shouldNotifyFrontend(updateChange), false); - } - - { - // WHEN - auto updateChange = QPropertyUpdatedChangePtr::create(receiverNode->id()); - updateChange->setValue(1584); - updateChange->setPropertyName("vette"); - QPropertyUpdatedChangeBasePrivate::get(updateChange.data())->m_isIntermediate - = true; - - // THEN - QCOMPARE(postman.shouldNotifyFrontend(updateChange), true); - } - } - - { - // GIVEN - receiverNode->setPropertyTracking(QStringLiteral("vette"), Qt3DCore::QNode::TrackAllValues); - receiverNode->setDefaultPropertyTrackingMode(QNode::TrackAllValues); - - { - // WHEN - auto updateChange = QPropertyUpdatedChangePtr::create(receiverNode->id()); - updateChange->setValue(1584); - updateChange->setPropertyName("someName"); - - // THEN -> we don't track properties by default - QCOMPARE(postman.shouldNotifyFrontend(updateChange), true); - } - - { - // WHEN - auto updateChange = QPropertyUpdatedChangePtr::create(receiverNode->id()); - updateChange->setValue(1584); - updateChange->setPropertyName("vette"); - - // THEN -> we don't track properties by default - QCOMPARE(postman.shouldNotifyFrontend(updateChange), true); - } - } - - { - // GIVEN - receiverNode->clearPropertyTrackings(); - receiverNode->setDefaultPropertyTrackingMode(QNode::TrackFinalValues); - - { - // WHEN - auto updateChange = QPropertyUpdatedChangePtr::create(receiverNode->id()); - updateChange->setValue(1584); - updateChange->setPropertyName("someName"); - - // THEN -> we do track properties by default, unless marked as intermediate - QCOMPARE(postman.shouldNotifyFrontend(updateChange), true); - } - - { - // WHEN - auto addedChange - = QPropertyNodeAddedChangePtr::create(receiverNode->id(), receiverNode); - - // THEN -> only QPropertyUpdatedChangePtr are filtered - QCOMPARE(postman.shouldNotifyFrontend(addedChange), true); - } - { - // WHEN - auto removedChange - = QPropertyNodeRemovedChangePtr::create(receiverNode->id(), receiverNode); - - // THEN -> only QPropertyUpdatedChangePtr are filtered - QCOMPARE(postman.shouldNotifyFrontend(removedChange), true); - } - } - - { - // GIVEN - receiverNode->clearPropertyTrackings(); - receiverNode->setDefaultPropertyTrackingMode(QNode::TrackFinalValues); - - { - // WHEN - auto updateChange = QPropertyUpdatedChangePtr::create(receiverNode->id()); - updateChange->setValue(1584); - updateChange->setPropertyName("someName"); - QPropertyUpdatedChangeBasePrivate::get(updateChange.data())->m_isIntermediate - = true; - - // THEN -> we don't track intermediate properties by default - QCOMPARE(postman.shouldNotifyFrontend(updateChange), false); - } - - { - // WHEN - auto updateChange = QPropertyUpdatedChangePtr::create(receiverNode->id()); - updateChange->setValue(1584); - updateChange->setPropertyName("someName"); - - // THEN - QCOMPARE(postman.shouldNotifyFrontend(updateChange), true); - } - - } - } - }; QTEST_MAIN(tst_QPostman) diff --git a/tests/auto/core/qscene/tst_qscene.cpp b/tests/auto/core/qscene/tst_qscene.cpp index ecc72e992..eb6a8c5ec 100644 --- a/tests/auto/core/qscene/tst_qscene.cpp +++ b/tests/auto/core/qscene/tst_qscene.cpp @@ -26,6 +26,10 @@ ** ****************************************************************************/ +// TODO Remove in Qt6 +#include <QtCore/qcompilerdetection.h> +QT_WARNING_DISABLE_DEPRECATED + #include <QtTest/QtTest> #include <Qt3DCore/private/qscene_p.h> #include <Qt3DCore/qnode.h> diff --git a/tests/auto/core/qtransform/tst_qtransform.cpp b/tests/auto/core/qtransform/tst_qtransform.cpp index 37848ffd6..18a906e4c 100644 --- a/tests/auto/core/qtransform/tst_qtransform.cpp +++ b/tests/auto/core/qtransform/tst_qtransform.cpp @@ -26,6 +26,10 @@ ** ****************************************************************************/ +// TODO Remove in Qt6 +#include <QtCore/qcompilerdetection.h> +QT_WARNING_DISABLE_DEPRECATED + #include <QtTest/QtTest> #include <Qt3DCore/qpropertyupdatedchange.h> #include <Qt3DCore/qtransform.h> |