diff options
author | Liang Qi <liang.qi@qt.io> | 2019-05-13 13:56:09 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2019-05-13 13:56:09 +0200 |
commit | 829675b65b8a9d661828b18bbd2703744d4c3db7 (patch) | |
tree | 9ed2b9fd867e34ef534f79f10e3493a17bd24b76 /tests | |
parent | e9642824244fa9fe55dca2cef8e002192a4f1b17 (diff) | |
parent | 2b0f52bd4c2c9035d5ca1672e4ce4229490eb655 (diff) |
Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts:
tests/auto/render/shaderbuilder/tst_shaderbuilder.cpp
Change-Id: I27de9b83fa6ef6bb319e4b11c932f91f9ff92dc3
Diffstat (limited to 'tests')
7 files changed, 8 insertions, 69 deletions
diff --git a/tests/auto/animation/animationutils/tst_animationutils.cpp b/tests/auto/animation/animationutils/tst_animationutils.cpp index 7a7abb1b3..36f1cbe2f 100644 --- a/tests/auto/animation/animationutils/tst_animationutils.cpp +++ b/tests/auto/animation/animationutils/tst_animationutils.cpp @@ -145,7 +145,6 @@ public: ChannelMapping *createChannelMapping(Handler *handler, const QString &channelName, const Qt3DCore::QNodeId targetId, - const QString &property, const char *propertyName, int type, int componentCount) @@ -155,7 +154,6 @@ public: setPeerId(channelMapping, channelMappingId); channelMapping->setHandler(handler); channelMapping->setTargetId(targetId); - channelMapping->setProperty(property); channelMapping->setPropertyName(propertyName); channelMapping->setChannelName(channelName); channelMapping->setType(type); @@ -292,7 +290,6 @@ private Q_SLOTS: auto channelMapping = createChannelMapping(handler, QLatin1String("Location"), Qt3DCore::QNodeId::createId(), - QLatin1String("translation"), "translation", static_cast<int>(QVariant::Vector3D), 3); @@ -376,7 +373,6 @@ private Q_SLOTS: auto locationMapping = createChannelMapping(handler, QLatin1String("Location"), Qt3DCore::QNodeId::createId(), - QLatin1String("translation"), "translation", static_cast<int>(QVariant::Vector3D), 3); @@ -384,7 +380,6 @@ private Q_SLOTS: auto metalnessMapping = createChannelMapping(handler, QLatin1String("Metalness"), Qt3DCore::QNodeId::createId(), - QLatin1String("metalness"), "metalness", static_cast<int>(QVariant::Double), 1); @@ -392,7 +387,6 @@ private Q_SLOTS: auto baseColorMapping = createChannelMapping(handler, QLatin1String("BaseColor"), Qt3DCore::QNodeId::createId(), - QLatin1String("baseColor"), "baseColor", static_cast<int>(QVariant::Vector3D), 3); @@ -400,7 +394,6 @@ private Q_SLOTS: auto roughnessMapping = createChannelMapping(handler, QLatin1String("Roughness"), Qt3DCore::QNodeId::createId(), - QLatin1String("roughness"), "roughness", static_cast<int>(QVariant::Double), 1); @@ -408,7 +401,6 @@ private Q_SLOTS: auto rotationMapping = createChannelMapping(handler, QLatin1String("Rotation"), Qt3DCore::QNodeId::createId(), - QLatin1String("rotation"), "rotation", static_cast<int>(QVariant::Quaternion), 4); @@ -416,7 +408,6 @@ private Q_SLOTS: auto morphTargetMapping = createChannelMapping(handler, QLatin1String("MorphTargetWeights"), Qt3DCore::QNodeId::createId(), - QLatin1String("weights"), "weights", static_cast<int>(QVariant::List), 5); @@ -2558,7 +2549,6 @@ private Q_SLOTS: auto channelMapping = createChannelMapping(handler, QLatin1String("Location"), Qt3DCore::QNodeId::createId(), - QLatin1String("translation"), "translation", static_cast<int>(QVariant::Vector3D), 3); @@ -2582,14 +2572,12 @@ private Q_SLOTS: auto channelMapping1 = createChannelMapping(handler, QLatin1String("Location"), Qt3DCore::QNodeId::createId(), - QLatin1String("translation"), "translation", static_cast<int>(QVariant::Vector3D), 3); auto channelMapping2 = createChannelMapping(handler, QLatin1String("Rotation"), Qt3DCore::QNodeId::createId(), - QLatin1String("rotatrion"), "rotation", static_cast<int>(QVariant::Quaternion), 4); @@ -2621,28 +2609,24 @@ private Q_SLOTS: auto channelMapping1 = createChannelMapping(handler, QLatin1String("Location"), Qt3DCore::QNodeId::createId(), - QLatin1String("translation"), "translation", static_cast<int>(QVariant::Vector3D), 3); auto channelMapping2 = createChannelMapping(handler, QLatin1String("Rotation"), Qt3DCore::QNodeId::createId(), - QLatin1String("rotation"), "rotation", static_cast<int>(QVariant::Quaternion), 4); auto channelMapping3 = createChannelMapping(handler, QLatin1String("Location"), Qt3DCore::QNodeId::createId(), - QLatin1String("translation"), "translation", static_cast<int>(QVariant::Vector3D), 3); auto channelMapping4 = createChannelMapping(handler, QLatin1String("Location"), Qt3DCore::QNodeId::createId(), - QLatin1String("translation"), "translation", static_cast<int>(QVariant::Vector3D), 3); @@ -3124,7 +3108,6 @@ private Q_SLOTS: auto channelMapping = createChannelMapping(handler, QLatin1String("Location"), Qt3DCore::QNodeId::createId(), - QLatin1String("translation"), "translation", static_cast<int>(QVariant::Vector3D), 3); @@ -3141,7 +3124,6 @@ private Q_SLOTS: auto channelMapping = createChannelMapping(handler, QLatin1String("Rotation"), Qt3DCore::QNodeId::createId(), - QLatin1String("rotation"), "rotation", static_cast<int>(QVariant::Quaternion), 4); @@ -3158,7 +3140,6 @@ private Q_SLOTS: auto channelMapping = createChannelMapping(handler, QLatin1String("Scale"), Qt3DCore::QNodeId::createId(), - QLatin1String("scale"), "scale", static_cast<int>(QVariant::Vector3D), 3); diff --git a/tests/auto/animation/channelmapping/tst_channelmapping.cpp b/tests/auto/animation/channelmapping/tst_channelmapping.cpp index 5c04c7f89..35ffcb10a 100644 --- a/tests/auto/animation/channelmapping/tst_channelmapping.cpp +++ b/tests/auto/animation/channelmapping/tst_channelmapping.cpp @@ -79,7 +79,7 @@ private Q_SLOTS: QCOMPARE(backendMapping.isEnabled(), mapping.isEnabled()); QCOMPARE(backendMapping.channelName(), mapping.channelName()); QCOMPARE(backendMapping.targetId(), mapping.target()->id()); - QCOMPARE(backendMapping.property(), mapping.property()); + QVERIFY(qstrcmp(backendMapping.propertyName(), mapping.property().toLatin1().constData()) == 0); QVERIFY(qstrcmp(backendMapping.propertyName(), "foo") == 0); QCOMPARE(backendMapping.componentCount(), 2); QCOMPARE(backendMapping.type(), static_cast<int>(QVariant::Vector2D)); @@ -114,7 +114,6 @@ private Q_SLOTS: QCOMPARE(backendMapping.isEnabled(), false); QCOMPARE(backendMapping.channelName(), QString()); QCOMPARE(backendMapping.targetId(), Qt3DCore::QNodeId()); - QCOMPARE(backendMapping.property(), QString()); QCOMPARE(backendMapping.propertyName(), nullptr); QCOMPARE(backendMapping.componentCount(), 0); QCOMPARE(backendMapping.type(), static_cast<int>(QVariant::Invalid)); @@ -137,7 +136,6 @@ private Q_SLOTS: QCOMPARE(backendMapping.isEnabled(), false); QCOMPARE(backendMapping.channelName(), QString()); QCOMPARE(backendMapping.targetId(), Qt3DCore::QNodeId()); - QCOMPARE(backendMapping.property(), QString()); QCOMPARE(backendMapping.propertyName(), nullptr); QCOMPARE(backendMapping.componentCount(), 0); QCOMPARE(backendMapping.type(), static_cast<int>(QVariant::Invalid)); @@ -183,16 +181,6 @@ private Q_SLOTS: QCOMPARE(backendMapping.targetId(), id); // WHEN - const QString property(QLatin1String("bar")); - updateChange = QSharedPointer<Qt3DCore::QPropertyUpdatedChange>::create(Qt3DCore::QNodeId()); - updateChange->setPropertyName("property"); - updateChange->setValue(property); - backendMapping.sceneChangeEvent(updateChange); - - // THEN - QCOMPARE(backendMapping.property(), property); - - // WHEN updateChange = QSharedPointer<Qt3DCore::QPropertyUpdatedChange>::create(Qt3DCore::QNodeId()); updateChange->setPropertyName("type"); updateChange->setValue(QVariant(static_cast<int>(QVariant::Vector3D))); diff --git a/tests/auto/animation/findrunningclipanimatorsjob/tst_findrunningclipanimatorsjob.cpp b/tests/auto/animation/findrunningclipanimatorsjob/tst_findrunningclipanimatorsjob.cpp index cc09c7941..5d71b7dc6 100644 --- a/tests/auto/animation/findrunningclipanimatorsjob/tst_findrunningclipanimatorsjob.cpp +++ b/tests/auto/animation/findrunningclipanimatorsjob/tst_findrunningclipanimatorsjob.cpp @@ -59,7 +59,6 @@ public: ChannelMapping *createChannelMapping(Handler *handler, const QString &channelName, const Qt3DCore::QNodeId targetId, - const QString &property, const char *propertyName, int type, int componentCount) @@ -69,7 +68,6 @@ public: setPeerId(channelMapping, channelMappingId); channelMapping->setHandler(handler); channelMapping->setTargetId(targetId); - channelMapping->setProperty(property); channelMapping->setPropertyName(propertyName); channelMapping->setChannelName(channelName); channelMapping->setType(type); @@ -143,7 +141,6 @@ private Q_SLOTS: auto channelMapping = createChannelMapping(handler, QLatin1String("Location"), Qt3DCore::QNodeId::createId(), - QLatin1String("translation"), "translation", static_cast<int>(QVariant::Vector3D), 3); @@ -189,7 +186,6 @@ private Q_SLOTS: auto channelMapping = createChannelMapping(handler, QLatin1String("Location"), Qt3DCore::QNodeId::createId(), - QLatin1String("translation"), "translation", static_cast<int>(QVariant::Vector3D), 3); diff --git a/tests/auto/animation/qchannelmapping/tst_qchannelmapping.cpp b/tests/auto/animation/qchannelmapping/tst_qchannelmapping.cpp index 091876d09..a6e4e5eb8 100644 --- a/tests/auto/animation/qchannelmapping/tst_qchannelmapping.cpp +++ b/tests/auto/animation/qchannelmapping/tst_qchannelmapping.cpp @@ -202,7 +202,7 @@ private Q_SLOTS: QCOMPARE(creationChangeData->type(), Qt3DAnimation::QChannelMappingCreatedChangeBase::ChannelMapping); QCOMPARE(mapping.channelName(), data.channelName); QCOMPARE(mapping.target()->id(), data.targetId); - QCOMPARE(mapping.property(), data.property); + QVERIFY(qstrcmp(mapping.property().toLatin1().constData(), data.propertyName) == 0); QCOMPARE(data.type, static_cast<int>(QVariant::Vector3D)); QCOMPARE(data.componentCount, 3); } @@ -229,7 +229,7 @@ private Q_SLOTS: QCOMPARE(creationChangeData->type(), Qt3DAnimation::QChannelMappingCreatedChangeBase::ChannelMapping); QCOMPARE(mapping.channelName(), data.channelName); QCOMPARE(mapping.target()->id(), data.targetId); - QCOMPARE(mapping.property(), data.property); + QVERIFY(qstrcmp(mapping.property().toLatin1().constData(), data.propertyName) == 0); QCOMPARE(data.type, static_cast<int>(QVariant::Vector3D)); QCOMPARE(data.componentCount, 3); } @@ -294,13 +294,9 @@ private Q_SLOTS: QCoreApplication::processEvents(); // THEN - QCOMPARE(arbiter.events.size(), 4); - auto change = arbiter.events.takeFirst().staticCast<Qt3DCore::QPropertyUpdatedChange>(); - QCOMPARE(change->propertyName(), "property"); - QCOMPARE(change->type(), Qt3DCore::PropertyUpdated); - QCOMPARE(change->value().toString(), mapping.property()); + QCOMPARE(arbiter.events.size(), 3); - change = arbiter.events.takeFirst().staticCast<Qt3DCore::QPropertyUpdatedChange>(); + auto change = arbiter.events.takeFirst().staticCast<Qt3DCore::QPropertyUpdatedChange>(); QCOMPARE(change->propertyName(), "type"); QCOMPARE(change->type(), Qt3DCore::PropertyUpdated); QCOMPARE(change->value().toInt(), static_cast<int>(QVariant::Vector3D)); @@ -367,7 +363,7 @@ private Q_SLOTS: QCoreApplication::processEvents(); // THEN - QCOMPARE(arbiter.events.size(), 5); + QCOMPARE(arbiter.events.size(), 4); // Automatic notification change when property is updated auto change = arbiter.events.takeFirst().staticCast<Qt3DCore::QPropertyUpdatedChange>(); @@ -376,11 +372,6 @@ private Q_SLOTS: QCOMPARE(change->value(), value); change = arbiter.events.takeFirst().staticCast<Qt3DCore::QPropertyUpdatedChange>(); - QCOMPARE(change->propertyName(), "property"); - QCOMPARE(change->type(), Qt3DCore::PropertyUpdated); - QCOMPARE(change->value().toString(), mapping.property()); - - change = arbiter.events.takeFirst().staticCast<Qt3DCore::QPropertyUpdatedChange>(); QCOMPARE(change->propertyName(), "type"); QCOMPARE(change->type(), Qt3DCore::PropertyUpdated); QCOMPARE(change->value().toInt(), expectedType); diff --git a/tests/auto/render/shaderbuilder/output.es2 b/tests/auto/render/shaderbuilder/output.es2 index b543bc5ee..0298e7e51 100644 --- a/tests/auto/render/shaderbuilder/output.es2 +++ b/tests/auto/render/shaderbuilder/output.es2 @@ -24,13 +24,5 @@ highp vec4 lightModel(const in highp vec3 baseColor, void main() { - highp vec2 v2 = texCoord; - sampler2D v1 = texture; - highp float v3 = lightIntensity; - highp vec4 v5 = texture2D(v1, v2); - highp vec3 v0 = worldPosition; - highp float v4 = exposure; - highp vec4 v6 = lightModel(v5, v0, v3); - highp vec4 v7 = v6 * pow(2.0, v4); - gl_fragColor = v7; + gl_fragColor = (((((lightModel(((texture2D(texture, texCoord))), worldPosition, lightIntensity)))) * pow(2.0, exposure))); } diff --git a/tests/auto/render/shaderbuilder/output.gl3 b/tests/auto/render/shaderbuilder/output.gl3 index 95a9c53fd..4c9fd1064 100644 --- a/tests/auto/render/shaderbuilder/output.gl3 +++ b/tests/auto/render/shaderbuilder/output.gl3 @@ -25,13 +25,5 @@ vec4 lightModel(const in vec3 baseColor, void main() { - vec2 v2 = texCoord; - sampler2D v1 = texture; - float v3 = lightIntensity; - vec4 v5 = texture2D(v1, v2); - vec3 v0 = worldPosition; - float v4 = exposure; - vec4 v6 = lightModel(v5, v0, v3); - vec4 v7 = v6 * pow(2.0, v4); - fragColor = v7; + fragColor = (((((lightModel(((texture2D(texture, texCoord))), worldPosition, lightIntensity)))) * pow(2.0, exposure))); } diff --git a/tests/auto/render/shaderbuilder/tst_shaderbuilder.cpp b/tests/auto/render/shaderbuilder/tst_shaderbuilder.cpp index a7c81ca20..e365256cc 100644 --- a/tests/auto/render/shaderbuilder/tst_shaderbuilder.cpp +++ b/tests/auto/render/shaderbuilder/tst_shaderbuilder.cpp @@ -474,7 +474,6 @@ private slots: void shouldHandleShaderCodeGeneration() { - QSKIP("Disabled for Qt Base QShaderGenerator Integration"); // GIVEN Qt3DRender::Render::ShaderBuilder::setPrototypesFile(":/prototypes.json"); QVERIFY(!Qt3DRender::Render::ShaderBuilder::getPrototypeNames().isEmpty()); |