Commit 2dc1ed8c authored by hjk's avatar hjk Committed by hjk
Browse files

debugger: add manual test for QHostAddress dumper

Change-Id: I6cc146b1d5b21a4d4881a35a11ce24ad378e813c
Reviewed-on: http://codereview.qt.nokia.com/2694

Reviewed-by: default avatarhjk <qthjk@ovi.com>
parent a5e893a4
...@@ -429,14 +429,12 @@ def qdump__QHostAddress(d, item): ...@@ -429,14 +429,12 @@ def qdump__QHostAddress(d, item):
if int(data["ipString"]["d"]["size"]): if int(data["ipString"]["d"]["size"]):
d.putStringValue(data["ipString"]) d.putStringValue(data["ipString"])
else: else:
a = data["a"] a = long(data["a"])
m, a = divmod(a, 256 * 256 * 256) a, n4 = divmod(a, 256)
s = str(m) a, n3 = divmod(a, 256)
m, a = divmod(a, 256 * 256) a, n2 = divmod(a, 256)
s = s + "." + str(m) a, n1 = divmod(a, 256)
m, a = divmod(a, 256) d.putValue("%d.%d.%d.%d" % (n1, n2, n3, n4));
s = s + "." + str(m)
d.putValue(s)
d.putNumChild(1) d.putNumChild(1)
if d.isExpanded(item): if d.isExpanded(item):
with Children(d): with Children(d):
......
...@@ -642,6 +642,19 @@ void testQFixed() ...@@ -642,6 +642,19 @@ void testQFixed()
*/ */
} }
namespace qhostaddress {
void testQHostAddress()
{
QHostAddress ha1(129 * 256 * 256 * 256 + 130);
QHostAddress ha2("127.0.0.1");
// <== break here
// Check ha1 and ha2 look correct.
dummyStatement(&ha1, &ha2);
}
} // namespace qhostaddress
QHash<int, float> testQHash() QHash<int, float> testQHash()
{ {
#if 1 #if 1
...@@ -3161,6 +3174,7 @@ namespace varargs { ...@@ -3161,6 +3174,7 @@ namespace varargs {
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
qhostaddress::testQHostAddress();
varargs::testVaList(); varargs::testVaList();
cp42895::test42895(); cp42895::test42895();
bug5046::test5046(); bug5046::test5046();
......
Supports Markdown
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