aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qjsengine
diff options
context:
space:
mode:
authorDavid Skoland <david.skoland@qt.io>2020-11-03 18:48:13 +0100
committerDavid Skoland <david.skoland@qt.io>2020-11-04 11:12:25 +0100
commit89ee1a33cb373709af9de565902e97c0299d3bee (patch)
tree1f37375d0360cc9032e4825293537b16ccf1457a /tests/auto/qml/qjsengine
parent8ae632bbbc12f9751c8a55692687aff73ca01d77 (diff)
Update MetaType things in tests
Also fix some minute errors. Change-Id: I1815224a6efdd7e619dfe5a5911d8b1166a3b3c8 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'tests/auto/qml/qjsengine')
-rw-r--r--tests/auto/qml/qjsengine/tst_qjsengine.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/auto/qml/qjsengine/tst_qjsengine.cpp b/tests/auto/qml/qjsengine/tst_qjsengine.cpp
index 1be35aef75..d98a5ec51a 100644
--- a/tests/auto/qml/qjsengine/tst_qjsengine.cpp
+++ b/tests/auto/qml/qjsengine/tst_qjsengine.cpp
@@ -563,9 +563,9 @@ void tst_QJSEngine::toScriptValue()
QVariant output = engine.fromScriptValue<QVariant>(outputJS);
if (input.metaType().id() == QMetaType::QChar) {
- if (!input.convert(QMetaType::QString))
+ if (!input.convert(QMetaType(QMetaType::QString)))
QFAIL("cannot convert to the original value");
- } else if (!output.convert(input.metaType().id()) && input.isValid())
+ } else if (!output.convert(input.metaType()) && input.isValid())
QFAIL("cannot convert to the original value");
QCOMPARE(input, output);
}
@@ -3758,7 +3758,8 @@ class TranslationScope
public:
TranslationScope(const QString &fileName)
{
- translator.load(fileName);
+ if (!translator.load(fileName))
+ QFAIL("failed to load translation");
QCoreApplication::instance()->installTranslator(&translator);
}
~TranslationScope()
@@ -4947,7 +4948,7 @@ void tst_QJSEngine::interrupt()
Q_UNUSED(threshold);
QJSEngine *engineInThread = nullptr;
- QScopedPointer<QThread> worker(QThread::create([&engineInThread, &code, jitThreshold](){
+ QScopedPointer<QThread> worker(QThread::create([&engineInThread, &code](){
QJSEngine jsEngine;
engineInThread = &jsEngine;
QJSValue result = jsEngine.evaluate(code);