Commit 167316d7 authored by hjk's avatar hjk
Browse files

Debugger: Work on auto tests



Change-Id: I21e783407a904de3501d0ac89d5f6f497ae4b1fe
Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
parent 96d53225
......@@ -40,27 +40,35 @@ using namespace Internal;
static QByteArray noValue = "\001";
static QByteArray nameFromIName(const QByteArray &iname)
{
int pos = iname.lastIndexOf('.');
return pos == -1 ? iname : iname.mid(pos + 1);
}
static QByteArray parentIName(const QByteArray &iname)
{
int pos = iname.lastIndexOf('.');
return pos == -1 ? QByteArray() : iname.left(pos);
}
class Check
{
public:
Check() {}
Check(const QByteArray &iname, const QByteArray &value,
const QByteArray &type)
: iname(iname), expectedName(nameFromIName(iname)),
expectedValue(value), expectedType(type)
{}
Check(const QByteArray &iname, const QByteArray &name,
const QByteArray &value, const QByteArray &type)
: iname(iname), expectedName(name),
expectedValue(value), expectedType(type)
{}
// Remove.
Check(const QByteArray &stuff)
{
QList<QByteArray> list = stuff.split(' ');
iname = list.value(0, QByteArray());
expectedName = iname.mid(iname.lastIndexOf('.'));
expectedValue = list.value(1, QByteArray());
expectedType = list.value(2, QByteArray());
}
QByteArray iname;
QByteArray expectedName;
QByteArray expectedValue;
......@@ -75,14 +83,18 @@ public:
: Check(iname, name, noValue, type)
{}
CheckType(const QByteArray &stuff)
{
QList<QByteArray> list = stuff.split(' ');
iname = list.value(0, QByteArray());
expectedName = iname.mid(iname.lastIndexOf('.'));
expectedValue = noValue;
expectedType = list.value(1, QByteArray());
}
CheckType(const QByteArray &iname, const QByteArray &type)
: Check(iname, noValue, type)
{}
};
class Profile
{
public:
Profile(const QByteArray &contents) : contents(contents) {}
public:
QByteArray contents;
};
class Data
......@@ -102,7 +114,14 @@ public:
return *this;
}
const Data &operator%(const Profile &profile) const
{
profileExtra += profile.contents;
return *this;
}
public:
mutable QByteArray profileExtra;
QByteArray includes;
QByteArray code;
mutable QMap<QByteArray, Check> checks;
......@@ -141,12 +160,15 @@ void tst_Dumpers::dumper()
ok = proFile.open(QIODevice::ReadWrite);
QVERIFY(ok);
proFile.write("SOURCES = main.cpp\nTARGET = doit\n");
proFile.write(data.profileExtra);
proFile.close();
QFile source(buildDir.path() + QLatin1String("/main.cpp"));
ok = source.open(QIODevice::ReadWrite);
QVERIFY(ok);
source.write(data.includes +
source.write(
"\n\nvoid dummyStatement(...) {}"
"\n\n" + data.includes +
"\n\nvoid stopper() {}"
"\n\nint main()"
"\n{"
......@@ -184,9 +206,13 @@ void tst_Dumpers::dumper()
QSet<QByteArray> expandedINames;
expandedINames.insert("local");
foreach (const Check &check, data.checks) {
int pos = check.iname.lastIndexOf('.');
if (pos != -1)
expandedINames.insert("local." + check.iname.left(pos));
QByteArray parent = check.iname;
while (true) {
parent = parentIName(parent);
if (parent.isEmpty())
break;
expandedINames.insert("local." + parent);
}
}
QByteArray expanded;
......@@ -273,20 +299,32 @@ void tst_Dumpers::dumper()
foreach (const WatchData &item, list) {
if (data.checks.contains(item.iname)) {
Check check = data.checks.take(item.iname);
check.expectedType.replace("@NS@", nameSpace);
check.expectedValue.replace(' ', "");
check.expectedType.replace('@', nameSpace);
check.expectedType.replace(' ', "");
QByteArray actualValue = item.value.toLatin1();
actualValue.replace(' ', "");
QByteArray actualType = item.type;
actualType.replace(' ', "");
if (item.name.toLatin1() != check.expectedName) {
qDebug() << "INAME : " << item.iname;
qDebug() << "NAME ACTUAL : " << item.name;
qDebug() << "NAME EXPECTED: " << check.expectedName;
qDebug() << "CONTENTS : " << contents;
QVERIFY(false);
}
if (check.expectedValue != noValue && item.value.toLatin1() != check.expectedValue) {
if (check.expectedValue != noValue && actualValue != check.expectedValue) {
qDebug() << "INAME : " << item.iname;
qDebug() << "VALUE ACTUAL : " << item.value;
qDebug() << "VALUE EXPECTED: " << check.expectedValue;
qDebug() << "CONTENTS : " << contents;
QVERIFY(false);
}
if (check.expectedType != noValue && item.type != check.expectedType) {
if (check.expectedType != noValue && actualType != check.expectedType) {
qDebug() << "INAME : " << item.iname;
qDebug() << "TYPE ACTUAL : " << item.type;
qDebug() << "TYPE EXPECTED: " << check.expectedType;
qDebug() << "CONTENTS : " << contents;
QVERIFY(false);
}
}
......@@ -296,6 +334,8 @@ void tst_Dumpers::dumper()
qDebug() << "SOME TESTS NOT EXECUTED: ";
foreach (const Check &check, data.checks)
qDebug() << " TEST NOT FOUND FOR INAME: " << check.iname;
qDebug() << "CONTENTS : " << contents;
qDebug() << "EXPANDED : " << expanded;
QVERIFY(false);
}
}
......@@ -304,10 +344,33 @@ void tst_Dumpers::dumper_data()
{
QTest::addColumn<Data>("data");
QTest::newRow("QStringRef1")
<< Data("QString str = \"Hello\";\n"
"QStringRef ref(&str, 1, 2);")
% Check("ref", "ref", "\"el\"", "@NS@QStringRef");
QByteArray fooData =
"#include <QMap>\n"
"class Foo\n"
"{\n"
"public:\n"
" Foo(int i = 0)\n"
" : a(i), b(2)\n"
" {}\n"
" virtual ~Foo()\n"
" {\n"
" a = 5;\n"
" }\n"
" void doit()\n"
" {\n"
" static QObject ob;\n"
" m[\"1\"] = \"2\";\n"
" h[&ob] = m.begin();\n"
" --b;\n"
" }\n"
"public:\n"
" int a, b;\n"
" char x[6];\n"
"private:\n"
" typedef QMap<QString, QString> Map;\n"
" Map m;\n"
" QHash<QObject *, Map::iterator> h;\n"
"};";
QTest::newRow("AnonymousStruct")
<< Data("union {\n"
......@@ -316,25 +379,25 @@ void tst_Dumpers::dumper_data()
" double d;\n"
" } a = { { 42, 43 } };\n (void)a;")
% CheckType("a", "a", "union {...}")
% Check("a.b", "b", "43", "int")
% Check("a.d", "d", "9.1245819032257467e-313", "double")
% Check("a.f", "f", "5.88545355e-44", "float")
% Check("a.i", "i", "42", "int");
% Check("a.b", "43", "int")
% Check("a.d", "9.1245819032257467e-313", "double")
% Check("a.f", "5.88545355e-44", "float")
% Check("a.i", "42", "int");
QTest::newRow("QByteArray0")
<< Data("QByteArray ba;")
% Check("ba "" QByteArray");
% Check("ba", "ba", "\"\"", "@QByteArray");
QTest::newRow("QByteArray1")
<< Data("QByteArray ba = \"Hello\\\"World;\n"
<< Data("QByteArray ba = \"Hello\\\"World\";\n"
"ba += char(0);\n"
"ba += 1;\n"
"ba += 2;\n")
% Check("ba", "ba", "\"Hello\"World\"", "QByteArray")
% Check("ba.0", "0", "72 'H'", "char")
% Check("ba.11", "11", "0 '\0'", "char")
% Check("ba.12", "12", "1", "char")
% Check("ba.13", "13", "2", "char");
% Check("ba", "\"Hello\"World\"", "@QByteArray")
% Check("ba.0", "[0]", "72", "char")
% Check("ba.11", "[11]", "0", "char")
% Check("ba.12", "[12]", "1", "char")
% Check("ba.13", "[13]", "2", "char");
QTest::newRow("QByteArray2")
<< Data("QByteArray ba;\n"
......@@ -342,9 +405,9 @@ void tst_Dumpers::dumper_data()
" ba.append(char(i));\n"
"QString s(10000, 'x');\n"
"std::string ss(10000, 'c');")
% CheckType("ba", "ba", "QByteArray")
% Check("s", "s", QByteArray(10000, 'x'), "QByteArray")
% Check("ss", "ss", QByteArray(10000, 'c'), "QByteArray");
% CheckType("ba", "@QByteArray")
% Check("s", '"' + QByteArray(10000, 'x') + '"', "@QString")
% Check("ss", '"' + QByteArray(10000, 'c') + '"', "std::string");
QTest::newRow("QByteArray3")
<< Data("const char *str1 = \"\356\";\n"
......@@ -353,77 +416,83 @@ void tst_Dumpers::dumper_data()
"QByteArray buf1(str1);\n"
"QByteArray buf2(str2);\n"
"QByteArray buf3(str3);\n")
% Check("buf1", "buf1", ", "QByteArray")
% Check("buf2", "buf2", ", "QByteArray")
% Check("buf3", "buf3", "\ee", "QByteArray")
% CheckType("str1", "str1", "char *");
% Check("buf1", "\"î\"", "@QByteArray")
% Check("buf2", "\"î\"", "@QByteArray")
% Check("buf3", "\"\ee\"", "@ByteArray")
% CheckType("str1", "char *");
QTest::newRow("QByteArray4")
<< Data("char data[] = { 'H', 'e', 'l', 'l', 'o' };\n"
"QByteArray ba1 = QByteArray::fromRawData(data, 4);\n"
"QByteArray ba2 = QByteArray::fromRawData(data + 1, 4);\n")
% Check("ba1", "ba1", "\"Hell\"", "QByteArray")
% Check("ba2", "ba2", "\"ello\"", "QByteArray");
% Check("ba1", "\"Hell\"", "@QByteArray")
% Check("ba2", "\"ello\"", "@QByteArray");
QTest::newRow("QDate0")
<< Data("QDate date;\n")
% CheckType("date", "date", "QDate")
% Check("date.(ISO)", "date.(ISO)", "", "QString")
% Check("date.(Locale)", "date.(Locale)", "", "QString")
% Check("date.(SystemLocale)", "date.(SystemLocale)" ,"", "QString")
% Check("date.toString", "date.toString", "", "QString");
% CheckType("date", "@QDate")
% Check("date.(ISO)", "", "@QString")
% Check("date.(Locale)", "", "@QString")
% Check("date.(SystemLocale)", "", "@QString")
% Check("date.toString", "", "@QString");
QTest::newRow("QDate1")
<< Data("QDate date;\n"
"date.setDate(1980, 1, 1);\n")
% CheckType("date", "date", "QDate")
% Check("date.(ISO)", "date.(ISO)", "", "QString")
% Check("date.(Locale)", "date.(Locale)", "", "QString")
% Check("date.(SystemLocale)", "date.(SystemLocale)" ,"", "QString")
% Check("date.toString", "date.toString", "", "QString");
% CheckType("date", "@QDate")
% Check("date.(ISO)", "\"1980-01-01\"", "@QString")
% CheckType("date.(Locale)", "@QString")
% CheckType("date.(SystemLocale)", "@QString")
% Check("date.toString", "\"Tue Jan 1 1980\"", "@QString");
QTest::newRow("QTime0")
<< Data("QTime time;\n")
% CheckType("time QTime")
% Check("time.(ISO) "" QString")
% Check("time.(Locale) "" QString")
% Check("time.(SystemLocale) "" QString")
% Check("time.toString "" QString");
<< 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");
QTest::newRow("QTime1")
<< Data("QTime time;\n"
"time.setCurrentTime(12, 20, 20)\n")
% CheckType("time QTime")
% Check("time.(ISO) "" QString")
% Check("time.(Locale) "" QString")
% Check("time.(SystemLocale) "" QString")
% Check("time.toString "" QString");
<< Data("#include <QTime>\n",
"QTime time(13, 15, 32);")
% Check("time", "13:15:32", "@QTime")
% Check("time.(ISO)", "\"13:15:32\"", "@QString")
% CheckType("time.(Locale)", "@QString")
% CheckType("time.(SystemLocale)", "@QString")
% Check("time.toString", "\"13:15:32\"", "@QString");
QTest::newRow("QDateTime")
<< Data("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");
<< 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");
QTest::newRow("QDir")
#ifdef Q_OS_WIN
<< Data("QDir dir(\"C:\\\\Program Files\");")
% Check("dir", "C:/Program Files", "QDir")
% Check("dir.absolutePath", "C:/Program Files", "QString")
% Check("dir.canonicalPath", "C:/Program Files", "QString");
<< Data("#include <QDir>\n",
"QDir dir(\"C:\\\\Program Files\");")
% Check("dir", "C:/Program Files", "@QDir")
% Check("dir.absolutePath", "C:/Program Files", "@QString")
% Check("dir.canonicalPath", "C:/Program Files", "@QString");
#else
<< Data("QDir dir(\"/tmp\");")
% Check("dir", "dir", "/tmp", "QDir")
% Check("dir.absolutePath", "absolutePath", "/tmp", "QString")
% Check("dir.canonicalPath", "canonicalPath", "/tmp", "QString");
<< Data("#include <QDir>\n",
"QDir dir(\"/tmp\"); QString s = dir.absolutePath();")
% Check("dir", "/tmp", "@QDir")
% Check("dir.absolutePath", "/tmp", "@QString")
% Check("dir.canonicalPath", "/tmp", "@QString");
#endif
QTest::newRow("QFileInfo")
#ifdef Q_OS_WIN
<< Data("QFile file(\"C:\\\\Program Files\\t\");\n"
<< Data("#include <QFile>\n"
"#include <QFileInfo>\n",
"QFile file(\"C:\\\\Program Files\\t\");\n"
"file.setObjectName(\"A QFile instance\");\n"
"QFileInfo fi(\"C:\\Program Files\\tt\");\n"
"QString s = fi.absoluteFilePath();\n")
......@@ -431,36 +500,40 @@ void tst_Dumpers::dumper_data()
% Check("file", "C:\Program Files\t", "QFile")
% Check("s", "C:/Program Files/tt", "QString");
#else
<< Data("QFile file(\"/tmp//t\");\n"
<< Data("#include <QFile>\n"
"#include <QFileInfo>\n",
"QFile file(\"/tmp/t\");\n"
"file.setObjectName(\"A QFile instance\");\n"
"QFileInfo fi(\"/tmp/tt\");\n"
"QString s = fi.absoluteFilePath();\n")
% Check("fi", "fi", "/tmp/tt", "QFileInfo")
% Check("file", "file", "/tmp/t", "QFile")
% Check("s", "s", "/tmp/tt", "QString");
% Check("fi", "/tmp/tt", "@QFileInfo")
% Check("file", "/tmp/t", "@QFile")
% Check("s", "/tmp/tt", "@QString");
#endif
QTest::newRow("QHash1")
<< Data("QHash<QString, QList<int> > hash;\n"
<< Data("#include <QHash>\n",
"QHash<QString, QList<int> > hash;\n"
"hash.insert(\"Hallo\", QList<int>());\n"
"hash.insert(\"Welt\", QList<int>() << 1);\n"
"hash.insert(\"!\", QList<int>() << 1 << 2);\n")
% Check("hash", "hash", "<3 items>", "QHash<QString, QList<int>>")
% Check("hash.0", "0", "", "QHashNode<QString, QList<int>>")
% Check("hash.0.key", "key", "\"Hallo\"", "QString")
% Check("hash.0.value", "value", "<0 items>", "QList<int>")
% Check("hash.1", "1", "", "QHashNode<QString, QList<int>>")
% Check("hash.1.key", "key", "\"Welt\"", "QString")
% Check("hash.1.value", "value", "<1 items>", "QList<int>")
% Check("hash", "<3 items>", "@QHash<@QString, @QList<int> >")
% Check("hash.0", "[0]", "", "@QHashNode<@QString, @QList<int>>")
% Check("hash.0.key", "\"Hallo\"", "@QString")
% Check("hash.0.value", "<0 items>", "@QList<int>")
% Check("hash.1", "[1]", "", "@QHashNode<@QString, @QList<int>>")
% Check("hash.1.key", "key", "\"Welt\"", "@QString")
% Check("hash.1.value", "value", "<1 items>", "@QList<int>")
% Check("hash.1.value.0", "0", "1", "int")
% Check("hash.2", "2", "", "QHashNode<QString, QList<int>>")
% Check("hash.2.key", "key", "\"!\"", "QString")
% Check("hash.2.value", "value", "<2 items>", "QList<int>")
% Check("hash.2", "[2]", "", "@QHashNode<@QString, @QList<int>>")
% Check("hash.2.key", "key", "\"!\"", "@QString")
% Check("hash.2.value", "value", "<2 items>", "@QList<int>")
% Check("hash.2.value.0", "0", "1", "int")
% Check("hash.2.value.1", "1", "2", "int");
QTest::newRow("QHash2")
<< Data("QHash<int, float> hash;\n"
<< Data("#include <QHash>\n",
"QHash<int, float> hash;\n"
"hash[11] = 11.0;\n"
"hash[22] = 22.0;\n")
% Check("hash", "hash", "<2 items>", "QHash<int, float>")
......@@ -468,7 +541,8 @@ void tst_Dumpers::dumper_data()
% Check("hash.11", "11", "11", "float");
QTest::newRow("QHash3")
<< Data("QHash<QString, int> hash;\n"
<< Data("#include <QHash>\n",
"QHash<QString, int> hash;\n"
"hash[\"22.0\"] = 22.0;\n"
"hash[\"123.0\"] = 22.0;\n"
"hash[\"111111ss111128.0\"] = 28.0;\n"
......@@ -479,15 +553,16 @@ void tst_Dumpers::dumper_data()
"hash[\"111111111128.0\"] = 28.0;\n"
"hash[\"111111111111111111129.0\"] = 29.0;\n")
% Check("hash", "hash", "<9 items>", "QHash<QString, int>")
% Check("hash.0", "0", "", "QHashNode<QString, int>")
% Check("hash.0", "0", "", "@QHashNode<QString, int>")
% Check("hash.0.key", "key", "\"123.0\"", "QString")
% Check("hash.0.value 22 int")
% Check("hash.0.value", "22", "int")
% Check("hash.8", "", "", "QHashNode<QString, int>")
% Check("hash.8.key", "key", "\"11124.0\"", "QString")
% Check("hash.8.value", "value", "22", "int");
QTest::newRow("QHash4")
<< Data("QHash<QByteArray, float> hash;\n"
<< Data("#include <QHash>\n",
"QHash<QByteArray, float> hash;\n"
"hash[\"22.0\"] = 22.0;\n"
"hash[\"123.0\"] = 22.0;\n"
"hash[\"111111ss111128.0\"] = 28.0;\n"
......@@ -497,52 +572,56 @@ void tst_Dumpers::dumper_data()
"hash[\"111111127.0\"] = 27.0;\n"
"hash[\"111111111128.0\"] = 28.0;\n"
"hash[\"111111111111111111129.0\"] = 29.0;\n")
% Check("hash <9 items> QHash<QByteArray, float>")
% Check("hash.0 QHashNode<QByteArray, float>")
% Check("hash.0.key \"123.0\" QByteArray")
% Check("hash.0.value 22 float")
% Check("hash.8 QHashNode<QByteArray, float>")
% Check("hash.8.key \"11124.0\" QByteArray")
% Check("hash.8.value 22 float");
% Check("hash", "<9 items>", "@QHash<@QByteArray, float>")
% Check("hash.0", "[0]", "@QHashNode<@QByteArray, float>")
% Check("hash.0.key", "\"123.0\"", "@QByteArray")
% Check("hash.0.value", "22", "float")
% Check("hash.8", "[8]", "@QHashNode<@QByteArray, float>")
% Check("hash.8.key", "\"11124.0\"", "@QByteArray")
% Check("hash.8.value", "22", "float");
QTest::newRow("QHash5")
<< Data("QHash<int, QString> hash;\n"
<< Data("#include <QHash>\n",
"QHash<int, QString> hash;\n"
"hash[22] = \"22.0\";\n")
% Check("hash <1 items> QHash<int, QString>")
% Check("hash.0 QHashNode<int, QString>")
% Check("hash.0.key 22 int")
% Check("hash.0.value \"22.0\" QString");
% Check("hash", "<1 items>", "@QHash<int, @QString>")
% Check("hash.0", "", "@QHashNode<int, @QString>")
% Check("hash.0.key", "22", "int")
% Check("hash.0.value", "\"22.0\"", "@QString");
QTest::newRow("QHash6")
<< Data("QHash<QString, Foo> hash;\n"
<< Data("#include <QHash>\n" + fooData,
"QHash<QString, Foo> hash;\n"
"hash[\"22.0\"] = Foo(22);\n"
"hash[\"33.0\"] = Foo(33);\n")
% Check("hash <2 items> QHash<QString, Foo>")
% Check("hash.0 QHashNode<QString, Foo>")
% Check("hash.0.key \"22.0\" QString")
% CheckType("hash.0.value Foo")
% Check("hash.0.value.a 22 int")
% Check("hash.1 QHashNode<QString, Foo>")
% Check("hash.1.key \"33.0\" QString")
% CheckType("hash.1.value Foo");
% Check("hash", "<2 items>", "@QHash<@QString, Foo>")
% Check("hash.0", "", "@QHashNode<@QString, Foo>")
% Check("hash.0.key", "\"22.0\"", "@QString")
% CheckType("hash.0.value", "Foo")
% Check("hash.0.value.a", "22", "int")
% Check("hash.1", "", "@QHashNode<@QString, Foo>")
% Check("hash.1.key", "\"33.0\"", "@QString")
% CheckType("hash.1.value", "Foo");
QTest::newRow("QHash7")
<< Data("QObject ob;\n"
<< Data("#include <QHash>\n",
"QObject ob;\n"
"QHash<QString, QPointer<QObject> > hash;\n"
"hash.insert(\"Hallo\", QPointer<QObject>(&ob));\n"
"hash.insert(\"Welt\", QPointer<QObject>(&ob));\n"
"hash.insert(\".\", QPointer<QObject>(&ob));\n")
% Check("hash <3 items> QHash<QString, QPointer<QObject>>")
% Check("hash.0 QHashNode<QString, QPointer<QObject>>")
% Check("hash.0.key \"Hallo\" QString")
% CheckType("hash.0.value QPointer<QObject>")
% CheckType("hash.0.value.o QObject")
% Check("hash.2 QHashNode<QString, QPointer<QObject>>")
% Check("hash.2.key \".\" QString")
% CheckType("hash.2.value QPointer<QObject>");
% Check("hash", "<3 items>", "@QHash<@QString, @QPointer<@QObject>>")
% Check("hash.0", "", "@QHashNode<@QString, @QPointer<@QObject>>")
% Check("hash.0.key", "\"Hallo\"", "@QString")
% CheckType("hash.0.value", "@QPointer<QObject>")
% CheckType("hash.0.value.o", "@QObject")
% Check("hash.2", "", "@QHashNode<@QString, @QPointer<@QObject>>")
% Check("hash.2.key", "\".\"", "@QString")
% CheckType("hash.2.value", "@QPointer<@QObject>");
QTest::newRow("QHashIntFloatIterator")
<< Data("typedef QHash<int, float> Hash;\n"
<< Data("#include <QHash>\n",
"typedef QHash<int, float> Hash;\n"
"Hash hash;\n"
"hash[11] = 11.0;\n"
"hash[22] = 22.0;\n"
......@@ -556,18 +635,20 @@ void tst_Dumpers::dumper_data()
"Hash::iterator it4 = it3; ++it4;\n"
"Hash::iterator it5 = it4; ++it5;\n"
"Hash::iterator it6 = it5; ++it6;\n")
% Check("hash <6 items> qhash::Hash")
% Check("hash.11 11 float")
% Check("it1.key 55 int")
% Check("it1.value 55 float")
% Check("it6.key 33 int")
% Check("it6.value 33 float");
% Check("hash", "<6 items>", "qhash::Hash")
% Check("hash.11", "11", "float")
% Check("it1.key", "55", "int")
% Check("it1.value", "55", "float")
% Check("it6.key", "33", "int")
% Check("it6.value", "33", "float");
QTest::newRow("QHostAddress")
<< Data("QHostAddress ha1(129u * 256u * 256u * 256u + 130u);\n"
<< Data("#include <QHostAddress>\n",
"QHostAddress ha1(129u * 256u * 256u * 256u + 130u);\n"
"QHostAddress ha2(\"127.0.0.1\");\n")