Commit b0fce02f authored by hjk's avatar hjk
Browse files

Debugger: Fix QLocale dumper and autotest



Change-Id: Icf304a2fee681622b4126ddf5b373f0dfd3e03ac
Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
parent 578d60d5
......@@ -636,16 +636,22 @@ def qdump__QLinkedList(d, value):
qqLocalesCount = None
def qdump__QLocale(d, value):
# Check for uninitialized 'index' variable. Retrieve size of QLocale data array
# from variable in qlocale.cpp (default: 368/Qt 4.8), 368 being 'System'.
# Check for uninitialized 'index' variable. Retrieve size of
# QLocale data array from variable in qlocale.cpp.
# Default is 368 in Qt 4.8, 438 in Qt 5.0.1, the last one
# being 'System'.
global qqLocalesCount
if qqLocalesCount is None:
try:
qqLocalesCount = int(value(qtNamespace() + 'locale_data_size'))
qqLocalesCount = int(value(d.ns + 'locale_data_size'))
except:
qqLocalesCount = 368
index = int(value["p"]["index"])
check(index >= 0 and index <= qqLocalesCount)
qqLocalesCount = 438
try:
index = int(value["p"]["index"])
except:
index = int(value["d"]["d"]["m_index"])
check(index >= 0)
check(index <= qqLocalesCount)
d.putStringValue(call(value, "name"))
d.putNumChild(0)
return
......
......@@ -1244,12 +1244,19 @@ void tst_Dumpers::dumper_data()
QTest::newRow("QLocale")
<< Data("#include <QLocale>\n",
"QLocale loc0;\n"
"QLocale loc = QLocale::system();\n"
"QLocale::MeasurementSystem m = loc.measurementSystem();\n"
"unused(&m);\n")
"QLocale loc1(\"en_US\");\n"
"QLocale::MeasurementSystem m1 = loc1.measurementSystem();\n"
"unused(&loc0, &loc, &m, &loc1, &m1);\n")
% CoreProfile()
% Check("loc", "", "@QLocale")
% Check("m", "", "@QLocale::MeasurementSystem");
% Check("loc0", "\"en_US\"", "@QLocale")
% CheckType("loc", "@QLocale")
% CheckType("m", "@QLocale::MeasurementSystem")
% Check("loc1", "\"en_US\"", "@QLocale")
% Check("m1", Value5("@QLocale::ImperialUSSystem (1)"), "@QLocale::MeasurementSystem")
% Check("m1", Value4("@QLocale::ImperialSystem (1)"), "@QLocale::MeasurementSystem");
QTest::newRow("QMapUIntStringList")
......
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