diff options
author | Sean Harmer <sean.harmer@kdab.com> | 2017-09-26 11:10:27 +0100 |
---|---|---|
committer | Sean Harmer <sean.harmer@kdab.com> | 2017-09-27 12:50:53 +0000 |
commit | a286529cbe2ae51e6bf19aaea4203afd6b4884de (patch) | |
tree | 10fffea1dbd9d99a8b2f2d84d9c22f5cc7fb6db9 /tests/auto/render/meshfunctors/tst_meshfunctors.cpp | |
parent | 8f2ced29ceedacd2f23f19af1813a5f351b43eec (diff) |
Ensure meshName gets used in the functor
Change-Id: I9015546607b5663f1feada64bc03cb73d3538ef2
Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
Diffstat (limited to 'tests/auto/render/meshfunctors/tst_meshfunctors.cpp')
-rw-r--r-- | tests/auto/render/meshfunctors/tst_meshfunctors.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/auto/render/meshfunctors/tst_meshfunctors.cpp b/tests/auto/render/meshfunctors/tst_meshfunctors.cpp index bf5f0d55f..e2877b24b 100644 --- a/tests/auto/render/meshfunctors/tst_meshfunctors.cpp +++ b/tests/auto/render/meshfunctors/tst_meshfunctors.cpp @@ -27,8 +27,11 @@ ****************************************************************************/ #include <QtTest/QtTest> +#include <Qt3DCore/qcomponent.h> #include <Qt3DRender/qgeometryfactory.h> #include <Qt3DRender/qgeometry.h> +#include <Qt3DRender/qmesh.h> +#include <Qt3DRender/private/qmesh_p.h> class MeshFunctorA : public Qt3DRender::QGeometryFactory { @@ -117,6 +120,31 @@ private Q_SLOTS: QVERIFY(*functorB == *functorB); QVERIFY(*functorASub == *functorASub); } + + void checkMeshFunctorEquality() + { + // GIVEN + const Qt3DRender::MeshFunctor functorA(QUrl::fromLocalFile(QLatin1String("/foo")), + QLatin1String("bar")); + const Qt3DRender::MeshFunctor functorB(QUrl::fromLocalFile(QLatin1String("/foo")), + QLatin1String("baz")); + const Qt3DRender::MeshFunctor functorC(QUrl::fromLocalFile(QLatin1String("/baz")), + QLatin1String("bar")); + const Qt3DRender::MeshFunctor functorD(QUrl::fromLocalFile(QLatin1String("/foo")), + QLatin1String("bar")); + + // WHEN + const bool selfEquality = (functorA == functorA); + const bool sameSource = (functorA == functorB); + const bool sameMeshName = (functorA == functorC); + const bool perfectMatch = (functorA == functorD); + + // THEN + QCOMPARE(selfEquality, true); + QCOMPARE(sameSource, false); + QCOMPARE(sameMeshName, false); + QCOMPARE(perfectMatch, true); + } }; QTEST_APPLESS_MAIN(tst_MeshFunctors) |