forked from qt-creator/qt-creator
Test for array of function pointers in LLDB dumper
Test checks that the dumper doesn't go through the slow "iterate through every type defined in target" dumper path. Done-by: Alexandru Croitor Change-Id: I4e1aea22ea2912467635f2e62fe1f6b2aa58e897 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -478,6 +478,15 @@ struct TypeDef : Type
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct RequiredMessage
|
||||||
|
{
|
||||||
|
RequiredMessage() {}
|
||||||
|
|
||||||
|
RequiredMessage(const QString &message) : message(message) {}
|
||||||
|
|
||||||
|
QString message;
|
||||||
|
};
|
||||||
|
|
||||||
struct Check
|
struct Check
|
||||||
{
|
{
|
||||||
Check() {}
|
Check() {}
|
||||||
@@ -689,6 +698,12 @@ public:
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const Data &operator+(const RequiredMessage &check) const
|
||||||
|
{
|
||||||
|
requiredMessages.append(check);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
const Data &operator+(const Profile &profile) const
|
const Data &operator+(const Profile &profile) const
|
||||||
{
|
{
|
||||||
profileExtra += profile.contents;
|
profileExtra += profile.contents;
|
||||||
@@ -903,6 +918,7 @@ public:
|
|||||||
mutable QString code;
|
mutable QString code;
|
||||||
|
|
||||||
mutable QList<Check> checks;
|
mutable QList<Check> checks;
|
||||||
|
mutable QList<RequiredMessage> requiredMessages;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct TempStuff
|
struct TempStuff
|
||||||
@@ -1629,6 +1645,15 @@ void tst_Dumpers::dumper()
|
|||||||
qDebug() << "SEEN INAMES " << seenINames;
|
qDebug() << "SEEN INAMES " << seenINames;
|
||||||
qDebug() << "EXPANDED : " << expanded;
|
qDebug() << "EXPANDED : " << expanded;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (int i = data.requiredMessages.size(); --i >= 0; ) {
|
||||||
|
RequiredMessage check = data.requiredMessages.at(i);
|
||||||
|
if (fullOutput.contains(check.message.toLatin1())) {
|
||||||
|
qDebug() << " EXPECTED MESSAGE TO BE MISSING, BUT FOUND: " << check.message;
|
||||||
|
ok = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (ok) {
|
if (ok) {
|
||||||
m_keepTemp = false;
|
m_keepTemp = false;
|
||||||
} else {
|
} else {
|
||||||
@@ -6496,6 +6521,14 @@ void tst_Dumpers::dumper_data()
|
|||||||
+ Check("tc.1.bar", "15", "int")
|
+ Check("tc.1.bar", "15", "int")
|
||||||
+ Check("tc.2.bar", "15", "int")
|
+ Check("tc.2.bar", "15", "int")
|
||||||
+ Check("tc.3.bar", "15", "int");
|
+ Check("tc.3.bar", "15", "int");
|
||||||
|
|
||||||
|
QTest::newRow("ArrayOfFunctionPointers")
|
||||||
|
<< Data("typedef int (*FP)(int *); \n"
|
||||||
|
"int func(int *param) { unused(param); return 0; } \n",
|
||||||
|
"FP fps[5]; fps[0] = func; fps[0](0); unused(&fps);\n")
|
||||||
|
+ RequiredMessage("Searching for type int (*)(int *) across all target modules, this could be very slow")
|
||||||
|
+ LldbEngine;
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
#ifdef Q_OS_LINUX
|
#ifdef Q_OS_LINUX
|
||||||
// Hint: To open a failing test in Creator, do:
|
// Hint: To open a failing test in Creator, do:
|
||||||
|
Reference in New Issue
Block a user