diff options
author | Lars Knoll <lars.knoll@digia.com> | 2014-09-09 15:39:11 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@digia.com> | 2014-09-11 09:57:00 +0200 |
commit | 046cce32d9f818809382fcbbff0cfa4adfe8d3f7 (patch) | |
tree | c8ae8010377b5cc13967654d7950195db8281f5d /tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp | |
parent | 91d6a63ab317817990c3b2306860adbd8916cca4 (diff) |
Fix setUTCXxx methods in Date
The methods where converting doing a localtime->UTC
conversion even though the input was already in UTC.
Task-number: QTBUG-38448
Change-Id: I4409275fade0dd2a677af2293edc87445f853879
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp')
-rw-r--r-- | tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp index 01125f86f6..c246647325 100644 --- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp +++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp @@ -199,6 +199,7 @@ private slots: void sequenceSort_data(); void sequenceSort(); void dateParse(); + void utcDate(); void qtbug_22464(); void qtbug_21580(); void singleV8BindingDestroyedDuringEvaluation(); @@ -7362,6 +7363,21 @@ void tst_qqmlecmascript::dateParse() } +void tst_qqmlecmascript::utcDate() +{ + QQmlComponent component(&engine, testFileUrl("utcdate.qml")); + + QObject *object = component.create(); + if (object == 0) + qDebug() << component.errorString(); + QVERIFY(object != 0); + + QVariant q; + QVariant val = QString::fromLatin1("2014-07-16T23:30:31"); + QMetaObject::invokeMethod(object, "check_utc", Q_RETURN_ARG(QVariant, q), Q_ARG(QVariant, val)); + QVERIFY(q.toBool() == true); +} + void tst_qqmlecmascript::concatenatedStringPropertyAccess() { QQmlComponent component(&engine, testFileUrl("concatenatedStringPropertyAccess.qml")); |