summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@digia.com>2013-06-05 14:07:09 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-06-05 15:10:40 +0200
commit37ec5822522baaa5b6e316103477d6da7e6d6a9c (patch)
tree15bc9c99b25ee7a76db63534ec663b98424fa597 /tests
parente44e545ccfc6e6ed2847497bc09c6497e364cc98 (diff)
downloadqtscript-37ec5822522baaa5b6e316103477d6da7e6d6a9c.tar.gz
Don't remove milliseconds now that toString() includes them.
This patch fixes a test failure introduced by 15da0a5af20fe6771bcb94ef8d46edbd5c8fb64c. tst_QScriptEngine::dateConversionJSQt and tst_QScriptEngine::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: Iaddfc050adf8360bee776086b27de001702d221d Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qscriptengine/tst_qscriptengine.cpp2
1 files changed, 0 insertions, 2 deletions
diff --git a/tests/auto/qscriptengine/tst_qscriptengine.cpp b/tests/auto/qscriptengine/tst_qscriptengine.cpp
index c75f652..ffe6a2a 100644
--- a/tests/auto/qscriptengine/tst_qscriptengine.cpp
+++ b/tests/auto/qscriptengine/tst_qscriptengine.cpp
@@ -5843,7 +5843,6 @@ void tst_QScriptEngine::dateConversionJSQt()
QDateTime qtDate = jsDate.toDateTime();
QString qtUTCDateStr = qtDate.toUTC().toString(Qt::ISODate);
QString jsUTCDateStr = jsDate.property("toISOString").call(jsDate).toString();
- jsUTCDateStr.remove(jsUTCDateStr.length() - 5, 4); // get rid of milliseconds (".000")
if (qtUTCDateStr != jsUTCDateStr)
QFAIL(qPrintable(jsDate.toString()));
secs += 2*60*60;
@@ -5857,7 +5856,6 @@ void tst_QScriptEngine::dateConversionQtJS()
for (int i = 0; i < 8000; ++i) {
QScriptValue jsDate = eng.newDate(qtDate);
QString jsUTCDateStr = jsDate.property("toISOString").call(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()));