summaryrefslogtreecommitdiffstats
path: root/tests/auto/render/qmaterial/tst_qmaterial.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/render/qmaterial/tst_qmaterial.cpp')
-rw-r--r--tests/auto/render/qmaterial/tst_qmaterial.cpp39
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()