diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2019-04-08 14:56:10 +0200 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2019-04-09 09:12:24 +0000 |
commit | 8355a7d1af3d2658a7409b0b0324b6863c9fdf2b (patch) | |
tree | 6a71ad1b5c97c35da8ac853d31846eda78e4c3d5 | |
parent | f06719db0e8fd84080042f9b23b83db47d6453f7 (diff) |
Use QDateTime::fromMSecsSinceEpoch(0) to get the epoch
... rather than hand-constructing it. This saves constructing two
intermediate objects and gets the same result.
Change-Id: Iaeadb92263b063c4c96c8d8ca151d7a2d99aa5e5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
-rw-r--r-- | tests/auto/qscriptvalue/tst_qscriptvalue.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/auto/qscriptvalue/tst_qscriptvalue.cpp b/tests/auto/qscriptvalue/tst_qscriptvalue.cpp index 195fe0c..35f0555 100644 --- a/tests/auto/qscriptvalue/tst_qscriptvalue.cpp +++ b/tests/auto/qscriptvalue/tst_qscriptvalue.cpp @@ -1524,7 +1524,7 @@ void tst_QScriptValue::toDateTime() QDateTime dt = eng.evaluate("new Date(0)").toDateTime(); QVERIFY(dt.isValid()); QCOMPARE(dt.timeSpec(), Qt::LocalTime); - QCOMPARE(dt.toUTC(), QDateTime(QDate(1970, 1, 1), QTime(0, 0, 0), Qt::UTC)); + QCOMPARE(dt.toUTC(), QDateTime::fromMSecsSinceEpoch(0, Qt::UTC)); QVERIFY(!eng.evaluate("[]").toDateTime().isValid()); QVERIFY(!eng.evaluate("{}").toDateTime().isValid()); |