summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorPaul Lemire <paul.lemire350@gmail.com>2015-08-10 14:21:51 +0200
committerSean Harmer <sean.harmer@kdab.com>2015-08-11 17:28:58 +0000
commit2a491e627162ed10ac0d64b8b48ce7195d5c828f (patch)
tree4801b97a3a6ceb4fb5b03384767f7f35f8d73d36 /tests
parented145776205d5e1adcf95802468d2a1fe8c8bc13 (diff)
QGeometry: add verticesPerPath property
Change-Id: I62989438ce1713d5b10174804346862310138bff Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/render/qgeometry/tst_qgeometry.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/auto/render/qgeometry/tst_qgeometry.cpp b/tests/auto/render/qgeometry/tst_qgeometry.cpp
index 3214981a8..d7fb2c3de 100644
--- a/tests/auto/render/qgeometry/tst_qgeometry.cpp
+++ b/tests/auto/render/qgeometry/tst_qgeometry.cpp
@@ -142,6 +142,7 @@ private Q_SLOTS:
QTest::newRow("defaultConstructed") << defaultConstructed << 0;
Qt3D::QGeometry *geometry1 = new Qt3D::QGeometry();
+ geometry1->setVerticesPerPatch(2);
geometry1->addAttribute(new Qt3D::QAttribute(Q_NULLPTR, QStringLiteral("Attr1"), Qt3D::QAttribute::Float, 3, 454));
geometry1->addAttribute(new Qt3D::QAttribute(Q_NULLPTR, QStringLiteral("Attr2"), Qt3D::QAttribute::Float, 4, 555));
QTest::newRow("2 attributes") << geometry1 << 2;
@@ -153,6 +154,7 @@ private Q_SLOTS:
geometry2->addAttribute(attribute);
geometry2->addAttribute(new Qt3D::QAttribute(Q_NULLPTR, QStringLiteral("Attr3"), Qt3D::QAttribute::Float, 2, 327));
geometry2->removeAttribute(attribute);
+ geometry2->setVerticesPerPatch(3);
QTest::newRow("3 - 1 attributes") << geometry2 << 2;
}
@@ -171,6 +173,7 @@ private Q_SLOTS:
QCOMPARE(geometry->id(), clone->id());
QCOMPARE(attributeCount, geometry->attributes().count());
QCOMPARE(attributeCount, clone->attributes().count());
+ QCOMPARE(geometry->verticesPerPatch(), clone->verticesPerPatch());
for (int i = 0; i < attributeCount; ++i) {
Qt3D::QAttribute *originalAttribute = static_cast<Qt3D::QAttribute *>(geometry->attributes()[i]);
@@ -226,6 +229,19 @@ private Q_SLOTS:
QCOMPARE(change->type(), Qt3D::NodeRemoved);
arbiter.events.clear();
+
+ // WHEN
+ geometry->setVerticesPerPatch(2);
+ QCoreApplication::processEvents();
+
+ // THEN
+ QCOMPARE(arbiter.events.size(), 1);
+ change = arbiter.events.first().staticCast<Qt3D::QScenePropertyChange>();
+ QCOMPARE(change->propertyName(), "verticesPerPatch");
+ QCOMPARE(change->value().toInt(), 2);
+ QCOMPARE(change->type(), Qt3D::NodeUpdated);
+
+ arbiter.events.clear();
}
protected: