aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@theqtcompany.com>2015-01-14 12:00:56 +0100
committerSimon Hausmann <simon.hausmann@theqtcompany.com>2015-01-16 12:46:52 +0100
commit291aea14636a0e779d874a01630524facb1397dd (patch)
tree044ff4131a9b3f5a3edb00e6a807d0609c04a182 /tests
parent39f1e0d66dc434e764731fbfed29c8fd98d217aa (diff)
parent88e87647c3b7d651dba2c8e61f945d47ecdd02c4 (diff)
Merge remote-tracking branch 'origin/5.4' into dev
Conflicts: .qmake.conf src/qml/jsruntime/qv4context_p.h src/qml/jsruntime/qv4debugging.cpp src/qml/jsruntime/qv4engine.cpp src/qml/jsruntime/qv4functionobject_p.h src/qml/jsruntime/qv4qobjectwrapper.cpp src/quick/scenegraph/shaders/visualization.frag tests/auto/qml/qjsengine/tst_qjsengine.cpp Change-Id: I492e8546c278f80a300a2129e9a29d861e144a30
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qml/qjsengine/tst_qjsengine.cpp11
-rw-r--r--tests/auto/qml/qqmlecmascript/data/date.qml6
-rw-r--r--tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp3
-rw-r--r--tests/auto/qml/qv4debugger/tst_qv4debugger.cpp38
-rw-r--r--tests/auto/quick/nokeywords/tst_nokeywords.cpp8
-rw-r--r--tests/auto/quick/qquickpixmapcache/tst_qquickpixmapcache.cpp2
-rw-r--r--tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp12
-rw-r--r--tests/testapplications/elements/content/BugPanel.qml2
8 files changed, 78 insertions, 4 deletions
diff --git a/tests/auto/qml/qjsengine/tst_qjsengine.cpp b/tests/auto/qml/qjsengine/tst_qjsengine.cpp
index 13e60fefd9..9f86c8e4e1 100644
--- a/tests/auto/qml/qjsengine/tst_qjsengine.cpp
+++ b/tests/auto/qml/qjsengine/tst_qjsengine.cpp
@@ -175,6 +175,7 @@ private slots:
void privateMethods();
void engineForObject();
+ void intConversion_QTBUG43309();
signals:
void testSignal();
@@ -3639,6 +3640,16 @@ void tst_QJSEngine::engineForObject()
QVERIFY(!qjsEngine(&object));
}
+void tst_QJSEngine::intConversion_QTBUG43309()
+{
+ // This failed in the interpreter:
+ QJSEngine engine;
+ QString jsCode = "var n = 0.1; var m = (n*255) | 0; m";
+ QJSValue result = engine.evaluate( jsCode );
+ QVERIFY(result.isNumber());
+ QCOMPARE(result.toNumber(), 25.0);
+}
+
QTEST_MAIN(tst_QJSEngine)
#include "tst_qjsengine.moc"
diff --git a/tests/auto/qml/qqmlecmascript/data/date.qml b/tests/auto/qml/qqmlecmascript/data/date.qml
index 0dcba71ae3..41dcaafa33 100644
--- a/tests/auto/qml/qqmlecmascript/data/date.qml
+++ b/tests/auto/qml/qqmlecmascript/data/date.qml
@@ -17,4 +17,10 @@ Item {
var dt = new Date("");
return isNaN(dt);
}
+
+ function test_rfc2822_date()
+ {
+ var dt = new Date("Wed, 18 Sep 2013 07:00:51 -0700");
+ return dt.getTime();
+ }
}
diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
index e137f6b042..8b95770312 100644
--- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
+++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
@@ -7360,7 +7360,8 @@ void tst_qqmlecmascript::dateParse()
QMetaObject::invokeMethod(object, "test_is_invalid_qtDateTime", Q_RETURN_ARG(QVariant, q));
QVERIFY(q.toBool() == true);
-
+ QMetaObject::invokeMethod(object, "test_rfc2822_date", Q_RETURN_ARG(QVariant, q));
+ QCOMPARE(q.toLongLong(), 1379512851000LL);
}
void tst_qqmlecmascript::utcDate()
diff --git a/tests/auto/qml/qv4debugger/tst_qv4debugger.cpp b/tests/auto/qml/qv4debugger/tst_qv4debugger.cpp
index 70e6739aff..628cd143cf 100644
--- a/tests/auto/qml/qv4debugger/tst_qv4debugger.cpp
+++ b/tests/auto/qml/qv4debugger/tst_qv4debugger.cpp
@@ -287,6 +287,8 @@ private slots:
// exceptions:
void pauseOnThrow();
+ void breakInCatch();
+ void breakInWith();
void evaluateExpression();
@@ -613,6 +615,42 @@ void tst_qv4debugger::pauseOnThrow()
QCOMPARE(m_debuggerAgent->m_thrownValue.toString(), QString("hard"));
}
+void tst_qv4debugger::breakInCatch()
+{
+ QString script =
+ "try {\n"
+ " throw 'catch...'\n"
+ "} catch (e) {\n"
+ " console.log(e, 'me');\n"
+ "}\n";
+
+ m_debuggerAgent->addBreakPoint("breakInCatch", 4);
+ evaluateJavaScript(script, "breakInCatch");
+ QVERIFY(m_debuggerAgent->m_wasPaused);
+ QCOMPARE(m_debuggerAgent->m_pauseReason, BreakPoint);
+ QCOMPARE(m_debuggerAgent->m_statesWhenPaused.count(), 1);
+ QV4::Debugging::Debugger::ExecutionState state = m_debuggerAgent->m_statesWhenPaused.first();
+ QCOMPARE(state.fileName, QString("breakInCatch"));
+ QCOMPARE(state.lineNumber, 4);
+}
+
+void tst_qv4debugger::breakInWith()
+{
+ QString script =
+ "with (42) {\n"
+ " console.log('give the answer');\n"
+ "}\n";
+
+ m_debuggerAgent->addBreakPoint("breakInWith", 2);
+ evaluateJavaScript(script, "breakInWith");
+ QVERIFY(m_debuggerAgent->m_wasPaused);
+ QCOMPARE(m_debuggerAgent->m_pauseReason, BreakPoint);
+ QCOMPARE(m_debuggerAgent->m_statesWhenPaused.count(), 1);
+ QV4::Debugging::Debugger::ExecutionState state = m_debuggerAgent->m_statesWhenPaused.first();
+ QCOMPARE(state.fileName, QString("breakInWith"));
+ QCOMPARE(state.lineNumber, 2);
+}
+
void tst_qv4debugger::evaluateExpression()
{
QString script =
diff --git a/tests/auto/quick/nokeywords/tst_nokeywords.cpp b/tests/auto/quick/nokeywords/tst_nokeywords.cpp
index 1a20649b2d..ddd9dccf4f 100644
--- a/tests/auto/quick/nokeywords/tst_nokeywords.cpp
+++ b/tests/auto/quick/nokeywords/tst_nokeywords.cpp
@@ -87,7 +87,13 @@ Q_SIGNALS:
void mySignal();
public Q_SLOTS:
- inline void mySlot() { mySignal(); }
+ inline void mySlot()
+ {
+ Q_UNUSED(signals);
+ Q_UNUSED(slots);
+
+ mySignal();
+ }
private:
int signals;
diff --git a/tests/auto/quick/qquickpixmapcache/tst_qquickpixmapcache.cpp b/tests/auto/quick/qquickpixmapcache/tst_qquickpixmapcache.cpp
index db69020589..83c678214d 100644
--- a/tests/auto/quick/qquickpixmapcache/tst_qquickpixmapcache.cpp
+++ b/tests/auto/quick/qquickpixmapcache/tst_qquickpixmapcache.cpp
@@ -113,7 +113,7 @@ void tst_qquickpixmapcache::initTestCase()
// This avoids a race condition/deadlock bug in network config
// manager when it is accessed by the HTTP server thread before
// anything else. Bug report can be found at:
- // https://bugreports.qt-project.org/browse/QTBUG-26355
+ // QTBUG-26355
QNetworkConfigurationManager cm;
cm.updateConfigurations();
diff --git a/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp b/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp
index 4f10b4ce82..c61504ef99 100644
--- a/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp
+++ b/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp
@@ -201,6 +201,7 @@ private slots:
void emptytags_QTBUG_22058();
void cursorRectangle_QTBUG_38947();
+ void textCached_QTBUG_41583();
private:
void simulateKeys(QWindow *window, const QList<Key> &keys);
@@ -5302,6 +5303,17 @@ void tst_qquicktextedit::cursorRectangle_QTBUG_38947()
QTest::mouseRelease(&window, Qt::LeftButton, Qt::NoModifier, to);
}
+void tst_qquicktextedit::textCached_QTBUG_41583()
+{
+ QQmlComponent component(&engine);
+ component.setData("import QtQuick 2.0\nTextEdit { property int margin: 10; text: \"TextEdit\"; textMargin: margin; property bool empty: !text; }", QUrl());
+ QQuickTextEdit *textedit = qobject_cast<QQuickTextEdit*>(component.create());
+ QVERIFY(textedit);
+ QCOMPARE(textedit->textMargin(), qreal(10.0));
+ QCOMPARE(textedit->text(), QString("TextEdit"));
+ QVERIFY(!textedit->property("empty").toBool());
+}
+
QTEST_MAIN(tst_qquicktextedit)
#include "tst_qquicktextedit.moc"
diff --git a/tests/testapplications/elements/content/BugPanel.qml b/tests/testapplications/elements/content/BugPanel.qml
index 48de12ab15..fcbdd941bc 100644
--- a/tests/testapplications/elements/content/BugPanel.qml
+++ b/tests/testapplications/elements/content/BugPanel.qml
@@ -37,7 +37,7 @@ Rectangle {
property string urltext
urltext: "<a href=\"" + bugreports + bugnumber + "\">QTBUG-" + bugnumber + "</a>"
property string bugnumber: ""
- property string bugreports: "http://bugreports.qt-project.org/browse/QTBUG-"
+ property string bugreports: "http://bugreports.qt.io/browse/QTBUG-"
visible: opacity != 0
opacity: bugnumber == "" ? 0 : 1
Behavior on opacity { NumberAnimation { duration: 1500 } }