summaryrefslogtreecommitdiffstats
path: root/tests/auto/render/material/tst_material.cpp
diff options
context:
space:
mode:
authorPaul Lemire <paul.lemire@kdab.com>2015-10-12 16:59:18 +0200
committerPaul Lemire <paul.lemire@kdab.com>2015-10-14 18:53:10 +0000
commit52bcbd19273842c7b46d353a2cc52d3d0229c00d (patch)
tree7eb094f79bdc645215071b46fd1ea12bba0a32d7 /tests/auto/render/material/tst_material.cpp
parent6cf4712bda7d3453ddf728f5903374abd2f4efc9 (diff)
QMaterial: remove NodeAdded/Remove notifications on Effect
Rely on the parent being set for inline declaration and the emit effectChanged to automatically send notifications. Updated unit tests accordingly. Change-Id: I7304309ea248da5e15db3dea4d556162af5e940e Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
Diffstat (limited to 'tests/auto/render/material/tst_material.cpp')
-rw-r--r--tests/auto/render/material/tst_material.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/auto/render/material/tst_material.cpp b/tests/auto/render/material/tst_material.cpp
index abf74c823..48733d03b 100644
--- a/tests/auto/render/material/tst_material.cpp
+++ b/tests/auto/render/material/tst_material.cpp
@@ -59,6 +59,7 @@ private slots:
void shouldHavePropertiesMirroringFromItsPeer();
void shouldHandleParametersPropertyChange();
void shouldHandleEnablePropertyChange();
+ void shouldHandleEffectPropertyChange();
};
@@ -181,6 +182,23 @@ void tst_RenderMaterial::shouldHandleEnablePropertyChange()
// THEN
QVERIFY(backend.isEnabled());
+
+}
+
+void tst_RenderMaterial::shouldHandleEffectPropertyChange()
+{
+ // GIVEN
+ Material backend;
+
+ // WHEN
+ QScenePropertyChangePtr updateChange(new Qt3DCore::QScenePropertyChange(Qt3DCore::NodeUpdated, Qt3DCore::QSceneChange::Node, Qt3DCore::QNodeId()));
+ Qt3DCore::QNodeId effectId = Qt3DCore::QNodeId::createId();
+ updateChange->setValue(QVariant::fromValue(effectId));
+ updateChange->setPropertyName("effect");
+ backend.sceneChangeEvent(updateChange);
+
+ // THEN
+ QCOMPARE(backend.effect(), effectId);
}
QTEST_APPLESS_MAIN(tst_RenderMaterial)