summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@theqtcompany.com>2015-09-23 08:45:08 +0200
committerChristian Kandeler <christian.kandeler@theqtcompany.com>2015-09-24 11:25:36 +0000
commit73b8cd879cd723fbcce42e63f21cc864d13cb91e (patch)
tree91015dae17a79ccb05a2933477aa40e40ed41929 /tests
parent9f779088f434901cd4b81f90fc00e3b34601e071 (diff)
QSettings: Special-case serialization of QDateTime.
QDateTime values with a UTC offset are not correctly serialized with QDataStream::Qt_4_0. So use a newer QDataStream format for this type and mark it with "@DateTime" instead of "@Variant". Task-number: QTBUG-46551 Change-Id: I211c89e8cd0211c949ec993e6ffd5192d0eebbb3 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/corelib/io/qsettings/tst_qsettings.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/auto/corelib/io/qsettings/tst_qsettings.cpp b/tests/auto/corelib/io/qsettings/tst_qsettings.cpp
index e2e1d99657..badff20490 100644
--- a/tests/auto/corelib/io/qsettings/tst_qsettings.cpp
+++ b/tests/auto/corelib/io/qsettings/tst_qsettings.cpp
@@ -37,6 +37,7 @@
#include <QtCore/QSettings>
#include <private/qsettings_p.h>
#include <QtCore/QCoreApplication>
+#include <QtCore/QDateTime>
#include <QtCore/QtGlobal>
#include <QtCore/QMetaType>
#include <QtCore/QString>
@@ -1201,6 +1202,9 @@ void tst_QSettings::testVariantTypes()
QList<QVariant> l4;
l4 << QVariant(m2) << QVariant(l2) << QVariant(l3);
testVal("key13", l4, QVariantList, List);
+ QDateTime dt = QDateTime::currentDateTime();
+ dt.setOffsetFromUtc(3600);
+ testVal("key14", dt, QDateTime, DateTime);
// We store key sequences as strings instead of binary variant blob, for improved
// readability in the resulting format.