diff options
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/qml/qjsengine/tst_qjsengine.cpp | 28 | ||||
-rw-r--r-- | tests/auto/qml/qmlmin/tst_qmlmin.cpp | 1 | ||||
-rw-r--r-- | tests/auto/qml/qqmllanguage/data/fuzzed.1.errors.txt | 2 | ||||
-rw-r--r-- | tests/auto/qml/qqmllanguage/data/fuzzed.1.qml | 2 | ||||
-rw-r--r-- | tests/auto/qml/qqmllanguage/data/fuzzed.2.errors.txt | 2 | ||||
-rw-r--r-- | tests/auto/qml/qqmllanguage/data/fuzzed.2.qml | bin | 0 -> 404 bytes | |||
-rw-r--r-- | tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp | 6 | ||||
-rw-r--r-- | tests/auto/qml/qv4assembler/tst_qv4assembler.cpp | 23 | ||||
-rw-r--r-- | tests/auto/quick/qquicklistview/BLACKLIST | 3 | ||||
-rw-r--r-- | tests/auto/quickwidgets/qquickwidget/tst_qquickwidget.cpp | 4 |
10 files changed, 68 insertions, 3 deletions
diff --git a/tests/auto/qml/qjsengine/tst_qjsengine.cpp b/tests/auto/qml/qjsengine/tst_qjsengine.cpp index 620e31e01a..75fa2216f7 100644 --- a/tests/auto/qml/qjsengine/tst_qjsengine.cpp +++ b/tests/auto/qml/qjsengine/tst_qjsengine.cpp @@ -4427,6 +4427,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/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 Binary files differnew file mode 100644 index 0000000000..e726f6783c --- /dev/null +++ b/tests/auto/qml/qqmllanguage/data/fuzzed.2.qml diff --git a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp index 89c1d05905..fe2256319b 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); \ } \ } @@ -615,6 +615,9 @@ void tst_qqmllanguage::errors_data() 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; } @@ -625,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/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/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); |