Add checks for widget/window leaks to kernel tests.

Change-Id: I52af87279e37e49ce2206c5c823fe8fb4caef338
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
bb10
Friedemann Kleint 2014-07-24 15:11:27 +02:00
parent 8d15068911
commit f70031c17b
4 changed files with 20 additions and 1 deletions

View File

@ -64,6 +64,7 @@ class tst_QGuiApplication: public tst_QCoreApplication
Q_OBJECT
private slots:
void cleanup();
void displayName();
void firstWindowTitle();
void windowIcon();
@ -80,6 +81,11 @@ private slots:
void layoutDirection();
};
void tst_QGuiApplication::cleanup()
{
QVERIFY(QGuiApplication::allWindows().isEmpty());
}
void tst_QGuiApplication::displayName()
{
int argc = 1;

View File

@ -101,11 +101,17 @@ private slots:
touchDevice->setType(QTouchDevice::TouchScreen);
QWindowSystemInterface::registerTouchDevice(touchDevice);
}
void cleanup();
private:
QTouchDevice *touchDevice;
};
void tst_QWindow::cleanup()
{
QVERIFY(QGuiApplication::allWindows().isEmpty());
}
void tst_QWindow::mapGlobal()
{
QWindow a;

View File

@ -260,6 +260,7 @@ void tst_QApplication::cleanup()
{
// TODO: Add cleanup code here.
// This will be executed immediately after each test is run.
QVERIFY(QApplication::topLevelWidgets().isEmpty());
}
void tst_QApplication::staticSetup()

View File

@ -61,7 +61,7 @@ static inline void setFrameless(QWidget *w)
w->setWindowFlags(flags);
}
class tst_QWidget_window : public QWidget
class tst_QWidget_window : public QObject
{
Q_OBJECT
@ -71,6 +71,7 @@ public:
public slots:
void initTestCase();
void cleanupTestCase();
void cleanup();
private slots:
void tst_min_max_size();
@ -106,6 +107,11 @@ void tst_QWidget_window::cleanupTestCase()
{
}
void tst_QWidget_window::cleanup()
{
QVERIFY(QApplication::topLevelWidgets().isEmpty());
}
/* Test if the maximum/minimum size constraints
* are propagated from the widget to the QWidgetWindow
* independently of whether they were set before or after