aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-04-18 01:00:17 +0200
committerUlf Hermann <ulf.hermann@qt.io>2019-04-18 08:01:45 +0200
commit934f25028a232c9bccdb842f53fa67959cc8dffc (patch)
treea78fef6197d63feab3194eb7f4cd2e10934b18ee /tests/auto
parentf8e90c61c5da4ca5e0aec24d42b2962877289ab2 (diff)
parent2bdbf216fe7b6cf9d404b80ac405bd3969f5c07f (diff)
Merge remote-tracking branch 'origin/5.13' into dev
Conflicts: src/qml/qml/qqmlimport.cpp Change-Id: I6add6267297ea50a646d43d212027a168dca8916
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/qml/qjsengine/tst_qjsengine.cpp28
-rw-r--r--tests/auto/qml/qmlmin/tst_qmlmin.cpp1
-rw-r--r--tests/auto/qml/qqmllanguage/data/cyclicAlias.errors.txt1
-rw-r--r--tests/auto/qml/qqmllanguage/data/cyclicAlias.qml5
-rw-r--r--tests/auto/qml/qqmllanguage/data/fuzzed.1.errors.txt2
-rw-r--r--tests/auto/qml/qqmllanguage/data/fuzzed.1.qml2
-rw-r--r--tests/auto/qml/qqmllanguage/data/fuzzed.2.errors.txt2
-rw-r--r--tests/auto/qml/qqmllanguage/data/fuzzed.2.qmlbin0 -> 404 bytes
-rw-r--r--tests/auto/qml/qqmllanguage/data/objectValueTypeProperty.errors.txt2
-rw-r--r--tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp7
-rw-r--r--tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp23
-rw-r--r--tests/auto/qml/qv4assembler/tst_qv4assembler.cpp23
-rw-r--r--tests/auto/quick/qquicklistview/BLACKLIST3
-rw-r--r--tests/auto/quick/qquickmultipointtoucharea/BLACKLIST2
-rw-r--r--tests/auto/quickwidgets/qquickwidget/tst_qquickwidget.cpp4
15 files changed, 101 insertions, 4 deletions
diff --git a/tests/auto/qml/qjsengine/tst_qjsengine.cpp b/tests/auto/qml/qjsengine/tst_qjsengine.cpp
index 02b7f79e42..9c3316e39f 100644
--- a/tests/auto/qml/qjsengine/tst_qjsengine.cpp
+++ b/tests/auto/qml/qjsengine/tst_qjsengine.cpp
@@ -4593,6 +4593,34 @@ void tst_QJSEngine::stringReplace()
val = engine.evaluate("'x'.replace(/()()()()()()()()()(x)/, '$10')");
QVERIFY(val.isString());
QCOMPARE(val.toString(), QString("x"));
+
+ val = engine.evaluate("'123'.replace(/\\.0*$|(\\.\\d*[1-9])(0+)$/, '$1')");
+ QVERIFY(val.isString());
+ QCOMPARE(val.toString(), QString("123"));
+
+ val = engine.evaluate("'123.00'.replace(/\\.0*$|(\\.\\d*[1-9])(0+)$/, '$1')");
+ QVERIFY(val.isString());
+ QCOMPARE(val.toString(), QString("123"));
+
+ val = engine.evaluate("'123.0'.replace(/\\.0*$|(\\.\\d*[1-9])(0+)$/, '$1')");
+ QVERIFY(val.isString());
+ QCOMPARE(val.toString(), QString("123"));
+
+ val = engine.evaluate("'123.'.replace(/\\.0*$|(\\.\\d*[1-9])(0+)$/, '$1')");
+ QVERIFY(val.isString());
+ QCOMPARE(val.toString(), QString("123"));
+
+ val = engine.evaluate("'123.50'.replace(/\\.0*$|(\\.\\d*[1-9])(0+)$/, '$1')");
+ QVERIFY(val.isString());
+ QCOMPARE(val.toString(), QString("123.5"));
+
+ val = engine.evaluate("'123.05'.replace(/\\.0*$|(\\.\\d*[1-9])(0+)$/, '$1')");
+ QVERIFY(val.isString());
+ QCOMPARE(val.toString(), QString("123.05"));
+
+ val = engine.evaluate("'0.050'.replace(/\\.0*$|(\\.\\d*[1-9])(0+)$/, '$1')");
+ QVERIFY(val.isString());
+ QCOMPARE(val.toString(), QString("0.05"));
}
void tst_QJSEngine::protoChanges_QTBUG68369()
diff --git a/tests/auto/qml/qmlmin/tst_qmlmin.cpp b/tests/auto/qml/qmlmin/tst_qmlmin.cpp
index c393149f59..d1e74aecef 100644
--- a/tests/auto/qml/qmlmin/tst_qmlmin.cpp
+++ b/tests/auto/qml/qmlmin/tst_qmlmin.cpp
@@ -128,6 +128,7 @@ void tst_qmlmin::initTestCase()
invalidFiles << "tests/auto/qml/parserstress/tests/ecma_3/FunExpr/fe-001.js";
invalidFiles << "tests/auto/qml/qjsengine/script/com/trolltech/syntaxerror/__init__.js";
invalidFiles << "tests/auto/qml/debugger/qqmlpreview/data/broken.qml";
+ invalidFiles << "tests/auto/qml/qqmllanguage/data/fuzzed.2.qml";
}
QStringList tst_qmlmin::findFiles(const QDir &d)
diff --git a/tests/auto/qml/qqmllanguage/data/cyclicAlias.errors.txt b/tests/auto/qml/qqmllanguage/data/cyclicAlias.errors.txt
new file mode 100644
index 0000000000..46951ef69f
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/cyclicAlias.errors.txt
@@ -0,0 +1 @@
+4:5:Cyclic alias
diff --git a/tests/auto/qml/qqmllanguage/data/cyclicAlias.qml b/tests/auto/qml/qqmllanguage/data/cyclicAlias.qml
new file mode 100644
index 0000000000..23129e210d
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/cyclicAlias.qml
@@ -0,0 +1,5 @@
+import QtQml 2.2
+QtObject {
+ id: o
+ property alias t: o.t
+}
diff --git a/tests/auto/qml/qqmllanguage/data/fuzzed.1.errors.txt b/tests/auto/qml/qqmllanguage/data/fuzzed.1.errors.txt
new file mode 100644
index 0000000000..e399799fe9
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/fuzzed.1.errors.txt
@@ -0,0 +1,2 @@
+2:8:Cannot assign to non-existent property "_G"
+
diff --git a/tests/auto/qml/qqmllanguage/data/fuzzed.1.qml b/tests/auto/qml/qqmllanguage/data/fuzzed.1.qml
new file mode 100644
index 0000000000..f80b9c3a2d
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/fuzzed.1.qml
@@ -0,0 +1,2 @@
+import QtQuick 2.4
+Item { _G.G.G:G }
diff --git a/tests/auto/qml/qqmllanguage/data/fuzzed.2.errors.txt b/tests/auto/qml/qqmllanguage/data/fuzzed.2.errors.txt
new file mode 100644
index 0000000000..92ce4c649f
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/fuzzed.2.errors.txt
@@ -0,0 +1,2 @@
+5:1:TetZ$ is not a type
+-1:-1:Invalid QML type name "TetZ$"
diff --git a/tests/auto/qml/qqmllanguage/data/fuzzed.2.qml b/tests/auto/qml/qqmllanguage/data/fuzzed.2.qml
new file mode 100644
index 0000000000..e726f6783c
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/fuzzed.2.qml
Binary files differ
diff --git a/tests/auto/qml/qqmllanguage/data/objectValueTypeProperty.errors.txt b/tests/auto/qml/qqmllanguage/data/objectValueTypeProperty.errors.txt
index cefd62f9d4..945dacf8ab 100644
--- a/tests/auto/qml/qqmllanguage/data/objectValueTypeProperty.errors.txt
+++ b/tests/auto/qml/qqmllanguage/data/objectValueTypeProperty.errors.txt
@@ -1 +1 @@
-4:18:Unexpected object assignment for property "x"
+4:18:Can not assign value of type "int" to property "x", expecting an object
diff --git a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
index 19927c5a8a..1b4ff71beb 100644
--- a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
+++ b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
@@ -361,7 +361,7 @@ private:
} \
file.close(); \
} else { \
- QCOMPARE(expected, actual); \
+ QCOMPARE(actual, expected); \
} \
}
@@ -614,6 +614,10 @@ void tst_qqmllanguage::errors_data()
QTest::newRow("badCompositeRegistration.2") << "badCompositeRegistration.2.qml" << "badCompositeRegistration.2.errors.txt" << false;
QTest::newRow("assignComponentToWrongType") << "assignComponentToWrongType.qml" << "assignComponentToWrongType.errors.txt" << false;
+ QTest::newRow("cyclicAlias") << "cyclicAlias.qml" << "cyclicAlias.errors.txt" << false;
+
+ QTest::newRow("fuzzed.1") << "fuzzed.1.qml" << "fuzzed.1.errors.txt" << false;
+ QTest::newRow("fuzzed.2") << "fuzzed.2.qml" << "fuzzed.2.errors.txt" << false;
}
@@ -624,6 +628,7 @@ void tst_qqmllanguage::errors()
QFETCH(bool, create);
QQmlComponent component(&engine, testFileUrl(file));
+ QTRY_VERIFY(!component.isLoading());
QScopedPointer<QObject> object;
diff --git a/tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp b/tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp
index 8a01524b5b..83a37df797 100644
--- a/tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp
+++ b/tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp
@@ -33,6 +33,8 @@
#include <QJSValueIterator>
#include <private/qquickvaluetypes_p.h>
#include <private/qqmlglobal_p.h>
+#include <private/qv4engine_p.h>
+#include <private/qv4variantobject_p.h>
#include "../../shared/util.h"
#include "testtypes.h"
@@ -94,6 +96,7 @@ private slots:
void toStringConversion();
void enumerableProperties();
void enumProperties();
+ void scarceTypes();
private:
QQmlEngine engine;
@@ -1809,6 +1812,26 @@ void tst_qqmlvaluetypes::enumProperties()
QCOMPARE(enumValue.toInt(), int(g.enumProperty()));
}
+void tst_qqmlvaluetypes::scarceTypes()
+{
+ // These should not be treated as value types because we want the scarce resource
+ // mechanism to clear them when going out of scope. The scarce resource mechanism
+ // only works on QV4::VariantObject as that has an additional level of redirection.
+ QVERIFY(!QQmlValueTypeFactory::isValueType(qMetaTypeId<QImage>()));
+ QVERIFY(!QQmlValueTypeFactory::isValueType(qMetaTypeId<QPixmap>()));
+
+ QV4::ExecutionEngine engine;
+ QV4::Scope scope(&engine);
+
+ QImage img(20, 20, QImage::Format_ARGB32);
+ QV4::ScopedObject imgValue(scope, engine.fromVariant(QVariant::fromValue(img)));
+ QCOMPARE(QByteArray(imgValue->vtable()->className), QByteArray("VariantObject"));
+
+ QPixmap pixmap;
+ QV4::ScopedObject pixmapValue(scope, engine.fromVariant(QVariant::fromValue(img)));
+ QCOMPARE(QByteArray(pixmapValue->vtable()->className), QByteArray("VariantObject"));
+}
+
QTEST_MAIN(tst_qqmlvaluetypes)
diff --git a/tests/auto/qml/qv4assembler/tst_qv4assembler.cpp b/tests/auto/qml/qv4assembler/tst_qv4assembler.cpp
index 4916cb4cc0..fd50ff5020 100644
--- a/tests/auto/qml/qv4assembler/tst_qv4assembler.cpp
+++ b/tests/auto/qml/qv4assembler/tst_qv4assembler.cpp
@@ -34,6 +34,8 @@
#include <QtQml/qqml.h>
#include <QtQml/qqmlapplicationengine.h>
+#include <private/qv4global_p.h>
+
#ifdef Q_OS_WIN
#include <windows.h>
#endif
@@ -46,6 +48,7 @@ private slots:
void initTestCase() override;
void perfMapFile();
void functionTable();
+ void jitEnabled();
};
void tst_QV4Assembler::initTestCase()
@@ -137,6 +140,26 @@ void tst_QV4Assembler::functionTable()
#endif
}
+#ifdef V4_ENABLE_JIT
+#define JIT_ENABLED 1
+#else
+#define JIT_ENABLED 0
+#endif
+
+void tst_QV4Assembler::jitEnabled()
+{
+#if defined(Q_OS_IOS) || defined(Q_OS_TVOS)
+ /* JIT should be disabled on iOS and tvOS. */
+ QCOMPARE(JIT_ENABLED, 0);
+#elif defined(Q_OS_WIN) && defined(Q_PROCESSOR_ARM)
+ /* JIT should be disabled Windows on ARM/ARM64 for now. */
+ QCOMPARE(JIT_ENABLED, 0);
+#else
+ /* JIT should be enabled on all other architectures/OSes tested in CI. */
+ QCOMPARE(JIT_ENABLED, 1);
+#endif
+}
+
QTEST_MAIN(tst_QV4Assembler)
#include "tst_qv4assembler.moc"
diff --git a/tests/auto/quick/qquicklistview/BLACKLIST b/tests/auto/quick/qquicklistview/BLACKLIST
index ecdf8f558e..893f95dcea 100644
--- a/tests/auto/quick/qquicklistview/BLACKLIST
+++ b/tests/auto/quick/qquicklistview/BLACKLIST
@@ -6,3 +6,6 @@ opensuse-leap
[populateTransitions]
opensuse-42.1
#QTBUG-65964
+
+[contentHeightWithDelayRemove]
+osx-10.12
diff --git a/tests/auto/quick/qquickmultipointtoucharea/BLACKLIST b/tests/auto/quick/qquickmultipointtoucharea/BLACKLIST
index de939b5273..6af00ab76f 100644
--- a/tests/auto/quick/qquickmultipointtoucharea/BLACKLIST
+++ b/tests/auto/quick/qquickmultipointtoucharea/BLACKLIST
@@ -3,8 +3,10 @@ ubuntu-16.04
ubuntu-18.04
opensuse-42.3
opensuse-leap
+sles
[nested]
ubuntu-16.04
ubuntu-18.04
opensuse-42.3
opensuse-leap
+sles
diff --git a/tests/auto/quickwidgets/qquickwidget/tst_qquickwidget.cpp b/tests/auto/quickwidgets/qquickwidget/tst_qquickwidget.cpp
index aaf37b32cd..fd5c3653ad 100644
--- a/tests/auto/quickwidgets/qquickwidget/tst_qquickwidget.cpp
+++ b/tests/auto/quickwidgets/qquickwidget/tst_qquickwidget.cpp
@@ -161,7 +161,7 @@ void tst_qquickwidget::showHide()
window.show();
QVERIFY(QTest::qWaitForWindowExposed(&window));
- QVERIFY(childView->quickWindow()->isVisible());
+ QVERIFY(!childView->quickWindow()->isVisible()); // this window is always not visible see QTBUG-65761
QVERIFY(childView->quickWindow()->visibility() != QWindow::Hidden);
window.hide();
@@ -612,7 +612,7 @@ void tst_qquickwidget::synthMouseFromTouch()
childView->resize(300, 300);
window.show();
QVERIFY(QTest::qWaitForWindowActive(&window));
- QVERIFY(childView->quickWindow()->isVisible());
+ QVERIFY(!childView->quickWindow()->isVisible()); // this window is always not visible see QTBUG-65761
QVERIFY(item->isVisible());
QPoint p1 = QPoint(20, 20);