Commit 54d662c2 authored by hjk's avatar hjk

Debugger: Fix QDate and QTime dumper and auto test

Change-Id: Iaf4cee3099a6745c5ccc42362463ec5203f8bfb0
Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
parent 0ea26fae
......@@ -173,32 +173,42 @@ def qdump__QModelIndex(d, value):
def qdump__QDate(d, value):
d.putValue(value["jd"], JulianDate)
d.putNumChild(1)
if d.isExpanded():
qt = d.ns + "Qt::"
# FIXME: This improperly uses complex return values.
with Children(d):
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")
jd = value["jd"]
if int(jd):
d.putValue(jd, JulianDate)
d.putNumChild(1)
if d.isExpanded():
qt = d.ns + "Qt::"
# FIXME: This improperly uses complex return values.
with Children(d):
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")
else:
d.putValue("(invalid)")
d.putNumChild(0)
def qdump__QTime(d, value):
d.putValue(value["mds"], MillisecondsSinceMidnight)
d.putNumChild(1)
if d.isExpanded():
qt = d.ns + "Qt::"
# FIXME: This improperly uses complex return values.
with Children(d):
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")
mds = value["mds"]
if int(mds) >= 0:
d.putValue(value["mds"], MillisecondsSinceMidnight)
d.putNumChild(1)
if d.isExpanded():
qt = d.ns + "Qt::"
# FIXME: This improperly uses complex return values.
with Children(d):
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")
else:
d.putValue("(invalid)")
d.putNumChild(0)
def qdump__QDateTime(d, value):
......
......@@ -537,18 +537,14 @@ void tst_Dumpers::dumper_data()
<< Data("#include <QDate>\n",
"QDate date;\n"
"dummyStatement(&date);\n")
% CheckType("date", "@QDate")
% Check("date.(ISO)", "", "@QString")
% Check("date.(Locale)", "", "@QString")
% Check("date.(SystemLocale)", "", "@QString")
% Check("date.toString", "", "@QString");
% Check("date", "(invalid)", "@QDate");
QTest::newRow("QDate1")
<< Data("#include <QDate>\n",
"QDate date;\n"
"date.setDate(1980, 1, 1);\n"
"dummyStatement(&date);\n")
% CheckType("date", "@QDate")
% Check("date", "Tue Jan 1 1980", "@QDate")
% Check("date.(ISO)", "\"1980-01-01\"", "@QString")
% CheckType("date.(Locale)", "@QString")
% CheckType("date.(SystemLocale)", "@QString")
......@@ -557,11 +553,7 @@ void tst_Dumpers::dumper_data()
QTest::newRow("QTime0")
<< Data("#include <QTime>\n",
"QTime time;\n")
% CheckType("time", "@QTime")
% Check("time.(ISO)", "", "@QString")
% CheckType("time.(Locale)", "@QString")
% CheckType("time.(SystemLocale)", "@QString")
% Check("time.toString", "", "@QString");
% Check("time", "(invalid)", "@QTime");
QTest::newRow("QTime1")
<< Data("#include <QTime>\n",
......
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