From 20480070a60469017770257b6c574c5707cda58b Mon Sep 17 00:00:00 2001 From: Rainer Keller Date: Thu, 15 Jan 2015 09:45:07 +0100 Subject: Autotest: Selftests fail in UTC timezone Selftests for testlib fail when executed in UTC timezone because local and UTC are the same, but expected to be different. A custom timezone is used instead. Debug output of qCompare does only handle local and non-local timezones, using new Qt5 features allows to show the correct timezone in format string. Change-Id: I753884a12370952b7b62a90d62896db4f2d3d1b4 Reviewed-by: Jason McDonald --- src/testlib/qtest.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/testlib/qtest.h') diff --git a/src/testlib/qtest.h b/src/testlib/qtest.h index 6298262958..995d653118 100644 --- a/src/testlib/qtest.h +++ b/src/testlib/qtest.h @@ -91,8 +91,7 @@ template<> inline char *toString(const QDate &date) template<> inline char *toString(const QDateTime &dateTime) { return dateTime.isValid() - ? qstrdup(qPrintable(dateTime.toString(QLatin1String("yyyy/MM/dd hh:mm:ss.zzz")) + - (dateTime.timeSpec() == Qt::LocalTime ? QLatin1String("[local time]") : QLatin1String("[UTC]")))) + ? qstrdup(qPrintable(dateTime.toString(QLatin1String("yyyy/MM/dd hh:mm:ss.zzz[t]")))) : qstrdup("Invalid QDateTime"); } #endif // QT_NO_DATESTRING -- cgit v1.2.3