diff options
author | Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org> | 2019-10-31 15:02:27 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2019-11-02 11:06:07 +0100 |
commit | 075a3c5b71611159786ea5f5b69324986c08bfdf (patch) | |
tree | cceeea60724c48e576413efc9513b95d99d050e6 | |
parent | 4ea000ef8a1a1183ce9d58509864fd9a3806965c (diff) |
Update dependencies on 'dev' in qt/qtwebglplugin
Fix test case to not rely on stable references
Change-Id: Ied0b2c0f81b0402be40eb1a0c41e3a6e3d276d01
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
-rw-r--r-- | dependencies.yaml | 6 | ||||
-rw-r--r-- | tests/plugins/platforms/webgl/tst_webgl.cpp | 30 |
2 files changed, 18 insertions, 18 deletions
diff --git a/dependencies.yaml b/dependencies.yaml index 2d2db9f..8eaf0a5 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -1,10 +1,10 @@ dependencies: ../qtbase: - ref: 7b3bdcbfe8a920c4c156e91324eb0b374533d42c + ref: 89f1f14c5e9a49f25345a65d81b3518d58ecb91a required: true ../qtdeclarative: - ref: c7e67202d5e720f0b085d7f71477fd1c96fb7304 + ref: be5849947dcca4c0a451e7ca53814ace155d1ac6 required: false ../qtwebsockets: - ref: 644272199791444e312b57529b8a3c3f05afb30d + ref: e692eaa707633e541f74ffa6d78ab6abf9b0c70d required: true diff --git a/tests/plugins/platforms/webgl/tst_webgl.cpp b/tests/plugins/platforms/webgl/tst_webgl.cpp index 478a2e9..cfb618c 100644 --- a/tests/plugins/platforms/webgl/tst_webgl.cpp +++ b/tests/plugins/platforms/webgl/tst_webgl.cpp @@ -84,11 +84,11 @@ class tst_WebGL : public QObject Program *program = nullptr; }; - QList<Context> contexts; - QList<Buffer> buffers; - QList<Program> programs; - QList<Shader> shaders; - QList<Texture> textures; + QHash<int, Context> contexts; + QHash<int, Buffer> buffers; + QHash<int, Program> programs; + QHash<int, Shader> shaders; + QHash<int, Texture> textures; Context *currentContext = nullptr; QNetworkAccessManager manager; @@ -102,12 +102,12 @@ class tst_WebGL : public QObject void sendMouseClick(quint32 x, quint32 y, int winId); template <typename Struct> - Struct *pointer(const QVariant &id, QList<Struct> &container) + Struct *pointer(const QVariant &id, QHash<int, Struct> &container) { const auto handle = id.toInt(); - if (handle > 0 && handle <= container.size()) - return &container[handle - 1]; - return nullptr; + if (!container.contains(handle - 1)) + return nullptr; + return &container[handle - 1]; } bool findSwapBuffers(const QSignalSpy &spy); @@ -220,7 +220,7 @@ void tst_WebGL::parseTextMessage(const QString &text) }, }; webSocket.sendTextMessage(defaultValuesMessage.toJson()); - contexts.append(Context(document["winId"].toInt())); + contexts.insert(contexts.size(), Context(document["winId"].toInt())); } } @@ -332,22 +332,22 @@ void tst_WebGL::parseBinaryMessage(const QByteArray &data) static QMap<QString, int> nextIds; if (function == "createProgram") { - programs.append(Program{}); + programs.insert(programs.size(), Program{}); retval = programs.size(); } else if (function == "createShader") { - shaders.append(Shader(parameters[0].toUInt())); + shaders.insert(shaders.size(), parameters[0].toUInt()); retval = shaders.size(); } else if (function == "genBuffers") { QJsonArray array; for (int i = 0, count = parameters.first().toInt(); i < count; ++i) { - buffers.append(Buffer{}); + buffers.insert(buffers.size(), Buffer{}); array.append(buffers.size()); } retval = array; } else if (function == "genTextures") { QJsonArray array; for (int i = 0, count = parameters.first().toInt(); i < count; ++i) { - textures.append(Texture{}); + textures.insert(textures.size(), Texture{}); array.append(textures.size()); } retval = array; @@ -489,7 +489,7 @@ void tst_WebGL::reload_data() { QTest::addColumn<QString>("scene"); // Fetched in tst_WebGL::init QTest::newRow("Basic scene") << QFINDTESTDATA("basic_scene.qml"); - QTest::newRow("Colors") << QFINDTESTDATA("colors.qml");; + QTest::newRow("Colors") << QFINDTESTDATA("colors.qml"); } void tst_WebGL::reload() |