Commit e2aa5b53 authored by hjk's avatar hjk

Debugger: Add dumper for QIPv6Address and Q_IPV6ADDR

Change-Id: I85d8a484fdc3a265aa736d6a2f38ff955af8e138
Reviewed-by: default avatarDavid Schulz <david.schulz@digia.com>
parent b26ef7e6
......@@ -741,6 +741,15 @@ def qdump__QHostAddress(d, value):
d.putPlainChildren(value["d"]["d"].dereference())
def qdump__Q_IPV6ADDR(d, value):
data = d.readRawMemory(d.addressOf(value), 16)
d.putValue(':'.join("%x" % int(data[i:i+4], 16) for i in xrange(0, 32, 4)))
d.putPlainChildren(value["c"])
def qdump__QIPv6Address(d, value):
qdump__Q_IPV6ADDR(d, value)
def qdump__QList(d, value):
dptr = childAt(value, 0)["d"]
private = dptr.dereference()
......
......@@ -1400,7 +1400,7 @@ void tst_Dumpers::dumper_data()
% Check("it6.key", "33", "int")
% Check("it6.value", "33", "float");
QTest::newRow("QHostAddress")
QTest::newRow("QHostAddress1")
<< Data("#include <QHostAddress>\n",
"QHostAddress ha1(129u * 256u * 256u * 256u + 130u);\n"
"QHostAddress ha2(\"127.0.0.1\");\n")
......@@ -1409,6 +1409,30 @@ void tst_Dumpers::dumper_data()
% Check("ha1", "129.0.0.130", "@QHostAddress")
% Check("ha2", "\"127.0.0.1\"", "@QHostAddress");
QTest::newRow("QHostAddress2")
<< Data("#include <QHostAddress>\n",
"QIPv6Address addr;\n"
"addr.c[0] = 0;\n"
"addr.c[1] = 1;\n"
"addr.c[2] = 2;\n"
"addr.c[3] = 3;\n"
"addr.c[4] = 5;\n"
"addr.c[5] = 6;\n"
"addr.c[6] = 0;\n"
"addr.c[7] = 0;\n"
"addr.c[8] = 8;\n"
"addr.c[9] = 9;\n"
"addr.c[10] = 10;\n"
"addr.c[11] = 11;\n"
"addr.c[12] = 0;\n"
"addr.c[13] = 0;\n"
"addr.c[14] = 0;\n"
"addr.c[15] = 0;\n"
"QHostAddress ha1(addr);\n")
% CoreProfile()
% Profile("QT += network\n")
% Check("addr", "1:203:506:0:809:a0b:0:0", "@QIPv6Address");
QTest::newRow("QImage")
<< Data("#include <QImage>\n"
"#include <QApplication>\n"
......
......@@ -1016,7 +1016,7 @@ namespace qhash {
namespace qhostaddress {
void testQHostAddress()
void testQHostAddress1()
{
QHostAddress ha1(129u * 256u * 256u * 256u + 130u);
QHostAddress ha2("127.0.0.1");
......@@ -1027,6 +1027,32 @@ namespace qhostaddress {
dummyStatement(&ha1, &ha2);
}
void testQHostAddress2()
{
QIPv6Address addr;
for (int i = 0; i != 16; ++i)
addr.c[i] = i;
addr.c[4] = 0;
addr.c[5] = 0;
addr.c[6] = 0;
addr.c[7] = 0;
addr.c[12] = 0;
addr.c[13] = 0;
addr.c[14] = 0;
addr.c[15] = 0;
QHostAddress ha1(addr);
BREAK_HERE;
// Continue.
dummyStatement(&ha1);
}
void testQHostAddress()
{
testQHostAddress1();
testQHostAddress2();
}
} // namespace qhostaddress
......
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