summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJedrzej Nowacki <jedrzej.nowacki@nokia.com>2011-05-26 13:32:22 +0200
committerJedrzej Nowacki <jedrzej.nowacki@nokia.com>2011-05-26 13:32:22 +0200
commitcc91f70f6f9a6318f36914db401e61fa17329680 (patch)
treeec11621ea9aa5fad148ae334b825ee7f51664700
parent95c2b9ba7b7639a943fff6c431c9145dcc83b2fb (diff)
Fix tst_QScriptEngine::dateConversion tests.
The tests were broken by fix to QDataTime::toString that add "Z" at the end of a string representation in ISODate (merge-request 1149 and QTBUG-9698). Reviewed-by: Zeno Albisser
-rw-r--r--tests/auto/qscriptengine/tst_qscriptengine.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/auto/qscriptengine/tst_qscriptengine.cpp b/tests/auto/qscriptengine/tst_qscriptengine.cpp
index c63286c..7a98e22 100644
--- a/tests/auto/qscriptengine/tst_qscriptengine.cpp
+++ b/tests/auto/qscriptengine/tst_qscriptengine.cpp
@@ -6003,7 +6003,7 @@ void tst_QScriptEngine::dateConversionJSQt()
QDateTime qtDate = jsDate.toDateTime();
QString qtUTCDateStr = qtDate.toUTC().toString(Qt::ISODate);
QString jsUTCDateStr = jsDate.property("toISOString").call(jsDate).toString();
- jsUTCDateStr.chop(5); // get rid of milliseconds (".000Z")
+ jsUTCDateStr.remove(jsUTCDateStr.length() - 5, 4); // get rid of milliseconds (".000")
if (qtUTCDateStr != jsUTCDateStr)
QFAIL(qPrintable(jsDate.toString()));
secs += 2*60*60;
@@ -6017,7 +6017,7 @@ 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.chop(5); // get rid of milliseconds (".000Z")
+ 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()));