summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMike Krus <mike.krus@kdab.com>2020-06-27 17:16:51 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2020-06-29 21:29:46 +0000
commitc2ac6426b88fde714f421ed9ee5d5a68a52a3ac3 (patch)
tree96930c8c52377f9ddd1755d91b3d76ef1e9c559c /tests
parent8befa03fb8bc1cdf51d83706ed83c2db82681bc9 (diff)
Fix incorrect use of QString vs QByteArray
Change-Id: I206fc781de5e4f281c9850c7d9f89c2ef3e588a0 Reviewed-by: Liang Qi <liang.qi@qt.io> (cherry picked from commit 0a69fa7279e6f9bbc77483247c2742005675d6a8) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/render/shader/tst_shader.cpp8
-rw-r--r--tests/auto/render/shaderbuilder/tst_shaderbuilder.cpp6
2 files changed, 8 insertions, 6 deletions
diff --git a/tests/auto/render/shader/tst_shader.cpp b/tests/auto/render/shader/tst_shader.cpp
index 212fdff4d..11f84389d 100644
--- a/tests/auto/render/shader/tst_shader.cpp
+++ b/tests/auto/render/shader/tst_shader.cpp
@@ -155,7 +155,7 @@ void tst_RenderShader::dealWithPropertyChanges()
backend.syncFromFrontEnd(&shader, false);
// THEN
- QCOMPARE(backend.shaderCode().at(type), QStringLiteral("foo"));
+ QCOMPARE(backend.shaderCode().at(type), QByteArrayLiteral("foo"));
QCOMPARE(renderer.dirtyBits(), Qt3DRender::Render::AbstractRenderer::ShadersDirty);
QCOMPARE(backend.isDirty(), true);
@@ -259,7 +259,7 @@ void tst_RenderShader::allowToChangeShaderCode()
backend.setShaderCode(type, QByteArrayLiteral("foo"));
// THEN
- QCOMPARE(backend.shaderCode().at(type), QStringLiteral("foo"));
+ QCOMPARE(backend.shaderCode().at(type), QByteArrayLiteral("foo"));
QCOMPARE(renderer.dirtyBits(), Qt3DRender::Render::AbstractRenderer::ShadersDirty);
renderer.resetDirty();
@@ -267,7 +267,7 @@ void tst_RenderShader::allowToChangeShaderCode()
backend.setShaderCode(type, QByteArrayLiteral("foo"));
// THEN
- QCOMPARE(backend.shaderCode().at(type), QStringLiteral("foo"));
+ QCOMPARE(backend.shaderCode().at(type), QByteArrayLiteral("foo"));
QCOMPARE(renderer.dirtyBits(), 0);
renderer.resetDirty();
@@ -275,7 +275,7 @@ void tst_RenderShader::allowToChangeShaderCode()
backend.setShaderCode(type, QByteArrayLiteral("bar"));
// THEN
- QCOMPARE(backend.shaderCode().at(type), QStringLiteral("bar"));
+ QCOMPARE(backend.shaderCode().at(type), QByteArrayLiteral("bar"));
QCOMPARE(renderer.dirtyBits(), Qt3DRender::Render::AbstractRenderer::ShadersDirty);
renderer.resetDirty();
}
diff --git a/tests/auto/render/shaderbuilder/tst_shaderbuilder.cpp b/tests/auto/render/shaderbuilder/tst_shaderbuilder.cpp
index 24dbe514a..9be7db5f1 100644
--- a/tests/auto/render/shaderbuilder/tst_shaderbuilder.cpp
+++ b/tests/auto/render/shaderbuilder/tst_shaderbuilder.cpp
@@ -36,6 +36,8 @@
#include "testrenderer.h"
#include "testpostmanarbiter.h"
+#include <QByteArray>
+
Q_DECLARE_METATYPE(Qt3DRender::QShaderProgram::ShaderType)
class tst_ShaderBuilder : public Qt3DCore::QBackendNodeTester
@@ -489,7 +491,7 @@ private slots:
return api;
}();
- const auto readCode = [](const QString &suffix) -> QString {
+ const auto readCode = [](const QString &suffix) -> QByteArray {
const auto filePath = QStringLiteral(":/output.") + suffix;
QFile file(filePath);
if (!file.open(QFile::ReadOnly | QFile::Text))
@@ -571,7 +573,7 @@ private slots:
return api;
}();
- const auto readCode = [](const QString &suffix) -> QString {
+ const auto readCode = [](const QString &suffix) -> QByteArray {
const auto filePath = QStringLiteral(":/output.") + suffix;
QFile file(filePath);
if (!file.open(QFile::ReadOnly | QFile::Text))