Don't remove milliseconds now that toString() includes them.
authorMitch Curtis <mitch.curtis@digia.com>
Wed, 5 Jun 2013 09:58:15 +0000 (11:58 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Wed, 5 Jun 2013 10:58:26 +0000 (12:58 +0200)
This patch fixes a test failure introduced by
15da0a5af20fe6771bcb94ef8d46edbd5c8fb64c.

tst_QJSEngine::dateConversionJSQt and tst_QJSEngine::dateConversionQtJS
removed milliseconds from the JS-converted datetime, as
QTime::toString() previously did not include them. Now it does, so we
can remove this code.

Change-Id: I48604a2eb4ed854665c9c9a24ba7b03657fea116
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
tests/auto/qml/qjsengine/tst_qjsengine.cpp

index 23c32c1..5e36a8a 100644 (file)
@@ -2664,7 +2664,6 @@ void tst_QJSEngine::dateConversionJSQt()
         QDateTime qtDate = jsDate.toDateTime();
         QString qtUTCDateStr = qtDate.toUTC().toString(Qt::ISODate);
         QString jsUTCDateStr = jsDate.property("toISOString").callWithInstance(jsDate).toString();
-        jsUTCDateStr.remove(jsUTCDateStr.length() - 5, 4); // get rid of milliseconds (".000")
         if (qtUTCDateStr != jsUTCDateStr)
             QFAIL(qPrintable(jsDate.toString()));
         secs += 2*60*60;
@@ -2678,7 +2677,6 @@ void tst_QJSEngine::dateConversionQtJS()
     for (int i = 0; i < 8000; ++i) {
         QJSValue jsDate = eng.toScriptValue(qtDate);
         QString jsUTCDateStr = jsDate.property("toISOString").callWithInstance(jsDate).toString();
-        jsUTCDateStr.remove(jsUTCDateStr.length() - 5, 4); // get rid of milliseconds (".000")
         QString qtUTCDateStr = qtDate.toUTC().toString(Qt::ISODate);
         if (jsUTCDateStr != qtUTCDateStr)
             QFAIL(qPrintable(qtDate.toString()));