summaryrefslogtreecommitdiffstats
path: root/tests/auto/render/sortpolicy/tst_sortpolicy.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/render/sortpolicy/tst_sortpolicy.cpp')
-rw-r--r--tests/auto/render/sortpolicy/tst_sortpolicy.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/tests/auto/render/sortpolicy/tst_sortpolicy.cpp b/tests/auto/render/sortpolicy/tst_sortpolicy.cpp
index d79b0b4f7..a4811d82c 100644
--- a/tests/auto/render/sortpolicy/tst_sortpolicy.cpp
+++ b/tests/auto/render/sortpolicy/tst_sortpolicy.cpp
@@ -70,7 +70,7 @@ private Q_SLOTS:
// WHEN
backendNode.setRenderer(&renderer);
- simulateInitialization(&sortPolicy, &backendNode);
+ simulateInitializationSync(&sortPolicy, &backendNode);
// THEN
QCOMPARE(backendNode.peerId(), sortPolicy.id());
@@ -88,15 +88,14 @@ private Q_SLOTS:
Qt3DRender::Render::SortPolicy backendNode;
backendNode.setRenderer(&renderer);
+ Qt3DRender::QSortPolicy sortPolicy;
+ sortPolicy.setSortTypes(sortTypes);
+
+ simulateInitializationSync(&sortPolicy, &backendNode);
+
// WHEN
- auto sortTypeInts = QVector<int>();
- std::transform(sortTypes.constBegin(), sortTypes.constEnd(),
- std::back_inserter(sortTypeInts),
- [] (Qt3DRender::QSortPolicy::SortType type) -> int { return type; });
- Qt3DCore::QPropertyUpdatedChangePtr updateChange(new Qt3DCore::QPropertyUpdatedChange(Qt3DCore::QNodeId()));
- updateChange->setValue(QVariant::fromValue(sortTypeInts));
- updateChange->setPropertyName("sortTypes");
- backendNode.sceneChangeEvent(updateChange);
+ sortPolicy.setSortTypes(sortTypes);
+ backendNode.syncFromFrontEnd(&sortPolicy, false);
// THEN
QCOMPARE(backendNode.sortTypes(), sortTypes);