diff options
author | Kevin Ottens <kevin.ottens@kdab.com> | 2015-12-15 16:48:51 +0100 |
---|---|---|
committer | Kevin Ottens <kevin.ottens@kdab.com> | 2015-12-18 15:55:39 +0000 |
commit | 985d8b47a62c7c21a7fd65f9ffe813ec3d6e13ad (patch) | |
tree | 48c41ba8749a1c0edf635dfc316d465af6d3216a /tests | |
parent | ed910f364c0730cf2c16c1f59516115761cf8720 (diff) |
Make parentEntityId private
It is used only once in the whole of Qt3D and looks rather foreign to
the rest of the nodes API.
Change-Id: I6d8d40590a1f8a5c2019a8d16a7abff4f19ae9bb
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/core/qentity/qentity.pro | 2 | ||||
-rw-r--r-- | tests/auto/core/qentity/tst_qentity.cpp | 17 |
2 files changed, 13 insertions, 6 deletions
diff --git a/tests/auto/core/qentity/qentity.pro b/tests/auto/core/qentity/qentity.pro index 639ec0972..175c6d3c8 100644 --- a/tests/auto/core/qentity/qentity.pro +++ b/tests/auto/core/qentity/qentity.pro @@ -4,4 +4,4 @@ TEMPLATE = app SOURCES += tst_qentity.cpp -QT += testlib 3dcore +QT += testlib 3dcore 3dcore-private core-private diff --git a/tests/auto/core/qentity/tst_qentity.cpp b/tests/auto/core/qentity/tst_qentity.cpp index 042b62386..ef03af176 100644 --- a/tests/auto/core/qentity/tst_qentity.cpp +++ b/tests/auto/core/qentity/tst_qentity.cpp @@ -36,6 +36,7 @@ #include <QtTest/QtTest> #include <Qt3DCore/qentity.h> +#include <Qt3DCore/private/qentity_p.h> #include <Qt3DCore/qcomponent.h> #include <QtCore/qscopedpointer.h> @@ -565,6 +566,12 @@ void tst_Entity::removeSeveralTimesSameComponent() QCOMPARE(comp->entities().size(), 0); } +Qt3DCore::QNodeId parentEntityId(Qt3DCore::QEntity *entity) +{ + Qt3DCore::QEntityPrivate *d = static_cast<Qt3DCore::QEntityPrivate*>(Qt3DCore::QNodePrivate::get(entity)); + return d->parentEntityId(); +} + void tst_Entity::verifyCopy() { // GIVEN @@ -577,9 +584,9 @@ void tst_Entity::verifyCopy() // THEN QVERIFY(root->id() != parentLessEntity->id()); QVERIFY(root->id() != parentedEntity->id()); - QVERIFY(root->parentEntityId().isNull()); - QVERIFY(!parentedEntity->parentEntityId().isNull()); - QVERIFY(parentLessEntity->parentEntityId().isNull()); + QVERIFY(parentEntityId(root.data()).isNull()); + QVERIFY(!parentEntityId(parentedEntity).isNull()); + QVERIFY(parentEntityId(parentLessEntity).isNull()); // WHEN MyEntity *parentedEntityCopy = new MyEntity(); @@ -587,7 +594,7 @@ void tst_Entity::verifyCopy() // THEN QVERIFY(parentedEntityCopy->id() == parentedEntity->id()); - QVERIFY(parentedEntityCopy->parentEntityId() == parentedEntity->parentEntityId()); + QVERIFY(parentEntityId(parentedEntityCopy) == parentEntityId(parentedEntity)); // WHEN MyEntity *parentLessEntityCopy = new MyEntity(); @@ -595,7 +602,7 @@ void tst_Entity::verifyCopy() // THEN QVERIFY(parentLessEntityCopy->id() == parentLessEntity->id()); - QVERIFY(parentLessEntityCopy->parentEntityId() == parentLessEntity->parentEntityId()); + QVERIFY(parentEntityId(parentLessEntityCopy) == parentEntityId(parentLessEntity)); } |