diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/core/common/qbackendnodetester.cpp | 2 | ||||
-rw-r--r-- | tests/auto/core/threadpooler/tst_threadpooler.cpp | 2 | ||||
-rw-r--r-- | tests/auto/input/commons/commons.pri | 2 | ||||
-rw-r--r-- | tests/auto/input/commons/testdevice.cpp | 31 | ||||
-rw-r--r-- | tests/auto/quick3d/dynamicnodecreation/BLACKLIST | 3 | ||||
-rw-r--r-- | tests/auto/quick3d/quick3dnodeinstantiator/tst_quick3dnodeinstantiator.cpp | 1 | ||||
-rw-r--r-- | tests/auto/render/geometry/tst_geometry.cpp | 10 | ||||
-rw-r--r-- | tests/auto/render/qgeometry/tst_qgeometry.cpp | 25 | ||||
-rw-r--r-- | tests/auto/render/qmlscenereader/qmlscenereader.cpp | 2 | ||||
-rw-r--r-- | tests/auto/render/qmlscenereader/qmlscenereader.h | 5 | ||||
-rw-r--r-- | tests/auto/shared/util.cpp | 2 |
11 files changed, 62 insertions, 23 deletions
diff --git a/tests/auto/core/common/qbackendnodetester.cpp b/tests/auto/core/common/qbackendnodetester.cpp index 13f4683d9..0bec5e5dd 100644 --- a/tests/auto/core/common/qbackendnodetester.cpp +++ b/tests/auto/core/common/qbackendnodetester.cpp @@ -84,3 +84,5 @@ QNodeCreatedChangeBasePtr QBackendNodeTester::creationChange(QNode *frontend) co } // namespace Qt3DCore QT_END_NAMESPACE + +#include "moc_qbackendnodetester.cpp" diff --git a/tests/auto/core/threadpooler/tst_threadpooler.cpp b/tests/auto/core/threadpooler/tst_threadpooler.cpp index 289f0b103..8941d8489 100644 --- a/tests/auto/core/threadpooler/tst_threadpooler.cpp +++ b/tests/auto/core/threadpooler/tst_threadpooler.cpp @@ -194,7 +194,7 @@ void tst_ThreadPooler::defaultPerThread() { // GIVEN QAtomicInt callCounter; - int maxThreadCount = QThread::idealThreadCount(); + int maxThreadCount = Qt3DCore::QAspectJobManager::idealThreadCount(); callCounter.storeRelaxed(0); // WHEN diff --git a/tests/auto/input/commons/commons.pri b/tests/auto/input/commons/commons.pri index 4913f5bbb..656f41980 100644 --- a/tests/auto/input/commons/commons.pri +++ b/tests/auto/input/commons/commons.pri @@ -1,6 +1,8 @@ HEADERS += $$PWD/testdevice.h \ $$PWD/testdeviceproxy.h +SOURCES += $$PWD/testdevice.cpp + INCLUDEPATH += $$PWD include(../../core/common/common.pri) diff --git a/tests/auto/input/commons/testdevice.cpp b/tests/auto/input/commons/testdevice.cpp new file mode 100644 index 000000000..91a2ad159 --- /dev/null +++ b/tests/auto/input/commons/testdevice.cpp @@ -0,0 +1,31 @@ +/**************************************************************************** +** +** Copyright (C) 2022 Klaralvdalens Datakonsult AB (KDAB). +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt3D module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "moc_testdevice.cpp" +#include "moc_testdeviceproxy.cpp" + diff --git a/tests/auto/quick3d/dynamicnodecreation/BLACKLIST b/tests/auto/quick3d/dynamicnodecreation/BLACKLIST new file mode 100644 index 000000000..a1b7ead84 --- /dev/null +++ b/tests/auto/quick3d/dynamicnodecreation/BLACKLIST @@ -0,0 +1,3 @@ +# See qtbase/src/testlib/qtestblacklist.cpp for format +[createEntityAndDynamicChild] +ci ubuntu-20.04 # QTBUG-106519 diff --git a/tests/auto/quick3d/quick3dnodeinstantiator/tst_quick3dnodeinstantiator.cpp b/tests/auto/quick3d/quick3dnodeinstantiator/tst_quick3dnodeinstantiator.cpp index d4d0d56e2..501b3d9bf 100644 --- a/tests/auto/quick3d/quick3dnodeinstantiator/tst_quick3dnodeinstantiator.cpp +++ b/tests/auto/quick3d/quick3dnodeinstantiator/tst_quick3dnodeinstantiator.cpp @@ -254,3 +254,4 @@ void tst_quick3dnodeinstantiator::createAndRemove() QTEST_MAIN(tst_quick3dnodeinstantiator) #include "tst_quick3dnodeinstantiator.moc" +#include "moc_stringmodel.cpp" diff --git a/tests/auto/render/geometry/tst_geometry.cpp b/tests/auto/render/geometry/tst_geometry.cpp index a13f6fa40..4e7a94c42 100644 --- a/tests/auto/render/geometry/tst_geometry.cpp +++ b/tests/auto/render/geometry/tst_geometry.cpp @@ -204,16 +204,12 @@ private Q_SLOTS: // WHEN renderGeometry.updateExtent(QVector3D(-1.0f, -1.0f, -1.0f), QVector3D(1.0f, 1.0f, 1.0f)); - renderGeometry.notifyExtentChanged(); // THEN - QCOMPARE(arbiter.events.count(), 1); + QCOMPARE(arbiter.dirtyNodes.count(), 0); - Qt3DCore::QPropertyUpdatedChangePtr change = arbiter.events.first().staticCast<Qt3DCore::QPropertyUpdatedChange>(); - QCOMPARE(change->propertyName(), "extent"); - const QPair<QVector3D, QVector3D> v = change->value().value<QPair<QVector3D, QVector3D>>(); - QCOMPARE(v.first, QVector3D(-1.0f, -1.0f, -1.0f)); - QCOMPARE(v.second, QVector3D(1.0f, 1.0f, 1.0f)); + QCOMPARE(renderGeometry.min(), QVector3D(-1.0f, -1.0f, -1.0f)); + QCOMPARE(renderGeometry.max(), QVector3D(1.0f, 1.0f, 1.0f)); arbiter.events.clear(); } diff --git a/tests/auto/render/qgeometry/tst_qgeometry.cpp b/tests/auto/render/qgeometry/tst_qgeometry.cpp index e790ba9cc..b2c66ae72 100644 --- a/tests/auto/render/qgeometry/tst_qgeometry.cpp +++ b/tests/auto/render/qgeometry/tst_qgeometry.cpp @@ -208,31 +208,26 @@ private Q_SLOTS: QCOMPARE(geometry->maxExtent(), QVector3D()); // WHEN - Qt3DCore::QPropertyUpdatedChangePtr valueChange(new Qt3DCore::QPropertyUpdatedChange(Qt3DCore::QNodeId())); - valueChange->setPropertyName("extent"); - valueChange->setValue(QVariant::fromValue(QPair<QVector3D, QVector3D>(QVector3D(10.0f, 10.f, 10.0f), - QVector3D()))); - geometry->sceneChangeEvent(valueChange); + auto dNode = static_cast<Qt3DRender::QGeometryPrivate *>(Qt3DCore::QNodePrivate::get(geometry.data())); + const QVector3D minExt(-1.0f, -1.0f, -1.0f); + const QVector3D maxExt(1.0f, 1.0f, 1.0f); + dNode->setExtent(minExt, maxExt); // THEN QCOMPARE(spyMinExtent.count(), 1); - QCOMPARE(spyMaxExtent.count(), 0); - QCOMPARE(geometry->minExtent(), QVector3D(10.0f, 10.0f, 10.0f)); + QCOMPARE(spyMaxExtent.count(), 1); + QCOMPARE(geometry->minExtent(), minExt); + QCOMPARE(geometry->maxExtent(), maxExt); + spyMaxExtent.clear(); spyMinExtent.clear(); // WHEN - valueChange->setPropertyName("extent"); - valueChange->setValue(QVariant::fromValue(QPair<QVector3D, QVector3D>(QVector3D(10.0f, 10.f, 10.0f), - QVector3D(11.0f, 11.f, 11.0f)))); - geometry->sceneChangeEvent(valueChange); + dNode->setExtent(minExt, maxExt); // THEN QCOMPARE(spyMinExtent.count(), 0); - QCOMPARE(spyMaxExtent.count(), 1); - QCOMPARE(geometry->maxExtent(), QVector3D(11.0f, 11.0f, 11.0f)); - - spyMaxExtent.clear(); + QCOMPARE(spyMaxExtent.count(), 0); } }; diff --git a/tests/auto/render/qmlscenereader/qmlscenereader.cpp b/tests/auto/render/qmlscenereader/qmlscenereader.cpp index 182782edb..417a75880 100644 --- a/tests/auto/render/qmlscenereader/qmlscenereader.cpp +++ b/tests/auto/render/qmlscenereader/qmlscenereader.cpp @@ -82,3 +82,5 @@ void QmlSceneReader::loadComplete() } QT_END_NAMESPACE + +#include "moc_qmlscenereader.cpp" diff --git a/tests/auto/render/qmlscenereader/qmlscenereader.h b/tests/auto/render/qmlscenereader/qmlscenereader.h index 9d4643d93..75a74d03a 100644 --- a/tests/auto/render/qmlscenereader/qmlscenereader.h +++ b/tests/auto/render/qmlscenereader/qmlscenereader.h @@ -37,6 +37,9 @@ ** ****************************************************************************/ +#ifndef QMLSCENEREADER_H +#define QMLSCENEREADER_H + #include <QObject> QT_BEGIN_NAMESPACE @@ -61,3 +64,5 @@ private: }; QT_END_NAMESPACE + +#endif diff --git a/tests/auto/shared/util.cpp b/tests/auto/shared/util.cpp index 55041eeb4..d4a19164a 100644 --- a/tests/auto/shared/util.cpp +++ b/tests/auto/shared/util.cpp @@ -123,3 +123,5 @@ QQmlTestMessageHandler::~QQmlTestMessageHandler() qInstallMessageHandler(m_oldHandler); QQmlTestMessageHandler::m_instance = 0; } + +#include "moc_util.cpp" |