diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-09-24 03:00:47 +0200 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-09-24 03:00:54 +0200 |
commit | c5f12acd27dee5fdec38b78a02a95cf7debfe9a5 (patch) | |
tree | 0dbb89ecc77e9401eb3f2200dcbc9f3a6ea9dd68 /tests/auto/render/qmaterial/tst_qmaterial.cpp | |
parent | 4106737900476f9c98325252ec9fedcad602af92 (diff) | |
parent | 25ecd0881ded8e4f265a4eb01ab775eafcee65d8 (diff) |
Merge "Merge remote-tracking branch 'origin/5.15' into dev"
Diffstat (limited to 'tests/auto/render/qmaterial/tst_qmaterial.cpp')
-rw-r--r-- | tests/auto/render/qmaterial/tst_qmaterial.cpp | 39 |
1 files changed, 12 insertions, 27 deletions
diff --git a/tests/auto/render/qmaterial/tst_qmaterial.cpp b/tests/auto/render/qmaterial/tst_qmaterial.cpp index 5b24c6127..501d50556 100644 --- a/tests/auto/render/qmaterial/tst_qmaterial.cpp +++ b/tests/auto/render/qmaterial/tst_qmaterial.cpp @@ -295,13 +295,9 @@ private Q_SLOTS: QCOMPARE(param->parent(), material); // THEN - QCOMPARE(arbiter.events.size(), 1); - Qt3DCore::QPropertyNodeAddedChangePtr change = arbiter.events.first().staticCast<Qt3DCore::QPropertyNodeAddedChange>(); - QCOMPARE(change->propertyName(), "parameter"); - QCOMPARE(change->addedNodeId(), param->id()); - QCOMPARE(change->type(), Qt3DCore::PropertyValueAdded); - - arbiter.events.clear(); + QCOMPARE(arbiter.events.size(), 0); + QCOMPARE(arbiter.dirtyNodes.size(), 1); + QVERIFY(material->parameters().contains(param)); // WHEN (add parameter to effect) param = new Qt3DRender::QParameter("testParamEffect", QVariant::fromValue(383.0f)); @@ -309,13 +305,9 @@ private Q_SLOTS: QCoreApplication::processEvents(); // THEN - QCOMPARE(arbiter.events.size(), 1); - change = arbiter.events.first().staticCast<Qt3DCore::QPropertyNodeAddedChange>(); - QCOMPARE(change->propertyName(), "parameter"); - QCOMPARE(change->addedNodeId(), param->id()); - QCOMPARE(change->type(), Qt3DCore::PropertyValueAdded); - - arbiter.events.clear(); + QCOMPARE(arbiter.events.size(), 0); + QCOMPARE(arbiter.dirtyNodes.size(), 2); + QVERIFY(material->effect()->parameters().contains(param)); // WHEN (add parameter to technique) param = new Qt3DRender::QParameter("testParamTechnique", QVariant::fromValue(383.0f)); @@ -323,13 +315,10 @@ private Q_SLOTS: QCoreApplication::processEvents(); // THEN - QCOMPARE(arbiter.events.size(), 1); - change = arbiter.events.first().staticCast<Qt3DCore::QPropertyNodeAddedChange>(); - QCOMPARE(change->propertyName(), "parameter"); - QCOMPARE(change->addedNodeId(), param->id()); - QCOMPARE(change->type(), Qt3DCore::PropertyValueAdded); + QCOMPARE(arbiter.events.size(), 0); + QCOMPARE(arbiter.dirtyNodes.size(), 3); + QVERIFY(material->m_technique->parameters().contains(param)); - arbiter.events.clear(); // WHEN (add parameter to renderpass) param = new Qt3DRender::QParameter("testParamRenderPass", QVariant::fromValue(383.0f)); @@ -337,13 +326,9 @@ private Q_SLOTS: QCoreApplication::processEvents(); // THEN - QCOMPARE(arbiter.events.size(), 1); - change = arbiter.events.first().staticCast<Qt3DCore::QPropertyNodeAddedChange>(); - QCOMPARE(change->propertyName(), "parameter"); - QCOMPARE(change->addedNodeId(), param->id()); - QCOMPARE(change->type(), Qt3DCore::PropertyValueAdded); - - arbiter.events.clear(); + QCOMPARE(arbiter.events.size(), 0); + QCOMPARE(arbiter.dirtyNodes.size(), 4); + QVERIFY(material->m_renderPass->parameters().contains(param)); } void checkShaderProgramUpdates() |