summaryrefslogtreecommitdiffstats
path: root/tests/auto/render/qframegraphnode
diff options
context:
space:
mode:
authorSean Harmer <sean.harmer@kdab.com>2016-04-19 17:16:52 +0100
committerPaul Lemire <paul.lemire@kdab.com>2016-04-29 16:22:24 +0000
commit948d0357850918596b56f38a6dc6e25cd186f5a0 (patch)
tree2a522442757660b6eadecd3a6decde1f34ab5740 /tests/auto/render/qframegraphnode
parentae5ac1128bc61176f797f6e248d18b9ced051ad9 (diff)
Strip out cloning subsystem
Change-Id: I4def54a11de0f9c676ef6b2d7bd8e723ded25ab9 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'tests/auto/render/qframegraphnode')
-rw-r--r--tests/auto/render/qframegraphnode/tst_qframegraphnode.cpp35
1 files changed, 12 insertions, 23 deletions
diff --git a/tests/auto/render/qframegraphnode/tst_qframegraphnode.cpp b/tests/auto/render/qframegraphnode/tst_qframegraphnode.cpp
index 9b3a35521..5b15d73c2 100644
--- a/tests/auto/render/qframegraphnode/tst_qframegraphnode.cpp
+++ b/tests/auto/render/qframegraphnode/tst_qframegraphnode.cpp
@@ -30,8 +30,10 @@
#include <Qt3DCore/private/qnode_p.h>
#include <Qt3DCore/private/qscene_p.h>
#include <Qt3DCore/qentity.h>
+#include <Qt3DCore/private/qnodecreatedchangegenerator_p.h>
#include <Qt3DRender/qframegraphnode.h>
+#include <Qt3DRender/private/qframegraphnode_p.h>
#include "testpostmanarbiter.h"
@@ -43,21 +45,11 @@ public:
: QFrameGraphNode(parent)
{
}
-
-private:
- QT3D_CLONEABLE(MyFrameGraphNode)
};
-// We need to call QNode::clone which is protected
-// So we sublcass QNode instead of QObject
-class tst_QFrameGraphNode: public Qt3DCore::QNode
+class tst_QFrameGraphNode: public QObject
{
Q_OBJECT
-public:
- ~tst_QFrameGraphNode()
- {
- QMetaObject::invokeMethod(this, "_q_cleanup", Qt::DirectConnection);
- }
private Q_SLOTS:
@@ -92,15 +84,19 @@ private Q_SLOTS:
QCOMPARE(frameGraphNode->isEnabled(), enabled);
// WHEN
- Qt3DRender::QFrameGraphNode *clone = static_cast<Qt3DRender::QFrameGraphNode *>(QNode::clone(frameGraphNode));
+ Qt3DCore::QNodeCreatedChangeGenerator creationChangeGenerator(frameGraphNode);
+ QVector<Qt3DCore::QNodeCreatedChangeBasePtr> creationChanges = creationChangeGenerator.creationChanges();
// THEN
- QVERIFY(clone != Q_NULLPTR);
- QCOMPARE(frameGraphNode->id(), clone->id());
- QCOMPARE(frameGraphNode->isEnabled(), enabled);
+ QCOMPARE(creationChanges.size(), 1);
+ const Qt3DCore::QNodeCreatedChangeBasePtr creationChangeData = creationChanges.first();
+
+ // THEN
+ QCOMPARE(frameGraphNode->id(), creationChangeData->subjectId());
+ QCOMPARE(frameGraphNode->isEnabled(), creationChangeData->isNodeEnabled());
+ QCOMPARE(frameGraphNode->metaObject(), creationChangeData->metaObject());
delete frameGraphNode;
- delete clone;
}
void checkPropertyUpdates()
@@ -185,13 +181,6 @@ private Q_SLOTS:
QVERIFY(child211->parent() == child21);
QVERIFY(child211->parentFrameGraphNode() == child2);
}
-
-protected:
- Qt3DCore::QNode *doClone() const Q_DECL_OVERRIDE
- {
- return Q_NULLPTR;
- }
-
};
QTEST_MAIN(tst_QFrameGraphNode)