Commit 13f3a6a5 authored by hjk's avatar hjk

Debugger: Fix QDateTime dumper and auto test

Change-Id: I1e71fdda85d791f76b8300fd1301f08e6d1bab71
Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
parent b6ad8a0d
......@@ -218,20 +218,25 @@ def qdump__QDateTime(d, value):
except:
d.putPlainChildren(value)
return
d.putValue("%s/%s" % (p["date"]["jd"], p["time"]["mds"]),
JulianDateAndMillisecondsSinceMidnight)
d.putNumChild(1)
if d.isExpanded():
# FIXME: This improperly uses complex return values.
with Children(d):
qt = d.ns + "Qt::"
d.putCallItem("toTime_t", value, "toTime_t")
d.putCallItem("toString", value, "toString", qt + "TextDate")
d.putCallItem("(ISO)", value, "toString", qt + "ISODate")
d.putCallItem("(SystemLocale)", value, "toString", qt + "SystemLocaleDate")
d.putCallItem("(Locale)", value, "toString", qt + "LocaleDate")
d.putCallItem("toUTC", value, "toTimeSpec", qt + "UTC")
d.putCallItem("toLocalTime", value, "toTimeSpec", qt + "LocalTime")
mds = p["time"]["mds"]
if int(mds) >= 0:
d.putValue("%s/%s" % (p["date"]["jd"], mds),
JulianDateAndMillisecondsSinceMidnight)
d.putNumChild(1)
if d.isExpanded():
# FIXME: This improperly uses complex return values.
with Children(d):
qt = d.ns + "Qt::"
d.putCallItem("toTime_t", value, "toTime_t")
d.putCallItem("toString", value, "toString", qt + "TextDate")
d.putCallItem("(ISO)", value, "toString", qt + "ISODate")
d.putCallItem("(SystemLocale)", value, "toString", qt + "SystemLocaleDate")
d.putCallItem("(Locale)", value, "toString", qt + "LocaleDate")
d.putCallItem("toUTC", value, "toTimeSpec", qt + "UTC")
d.putCallItem("toLocalTime", value, "toTimeSpec", qt + "LocalTime")
else:
d.putValue("(invalid)")
d.putNumChild(0)
def qdump__QDir(d, value):
......
......@@ -567,15 +567,20 @@ void tst_Dumpers::dumper_data()
% CheckType("time.(SystemLocale)", "@QString")
% Check("time.toString", "\"13:15:32\"", "@QString");
QTest::newRow("QDateTime")
QTest::newRow("QDateTime0")
<< Data("#include <QDateTime>\n",
"QDateTime date;\n")
% CheckType("date", "@QDateTime")
% Check("date.(ISO)", "", "@QString")
% Check("date.(Locale)", "", "@QString")
% Check("date.(SystemLocale)", "", "@QString")
% Check("date.toString", "\"\"", "@QString")
% Check("date.toUTC", "", "@QDateTime");
% Check("date", "(invalid)", "@QDateTime");
QTest::newRow("QDateTime1")
<< Data("#include <QDateTime>\n",
"QDateTime date(QDate(1980, 1, 1), QTime(13, 15, 32), Qt::UTC);\n")
% Check("date", "Tue Jan 1 13:15:32 1980", "@QDateTime")
% Check("date.(ISO)", "\"1980-01-01T13:15:32Z\"", "@QString")
% CheckType("date.(Locale)", "@QString")
% CheckType("date.(SystemLocale)", "@QString")
% Check("date.toString", "\"Tue Jan 1 13:15:32 1980\"", "@QString")
% Check("date.toUTC", "Tue Jan 1 13:15:32 1980", "@QDateTime");
QTest::newRow("QDir")
#ifdef Q_OS_WIN
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment