summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/kernel
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@digia.com>2014-07-24 15:11:27 +0200
committerFriedemann Kleint <Friedemann.Kleint@digia.com>2014-07-24 19:39:40 +0200
commitf70031c17b9724d8918420a3ab7342b62c061485 (patch)
treec084a21f57d85061d756fae0354ba67d1c56698d /tests/auto/widgets/kernel
parent8d15068911d7c0ba05732e2796aaa7a90e34a6a1 (diff)
Add checks for widget/window leaks to kernel tests.
Change-Id: I52af87279e37e49ce2206c5c823fe8fb4caef338 Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Diffstat (limited to 'tests/auto/widgets/kernel')
-rw-r--r--tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp1
-rw-r--r--tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp8
2 files changed, 8 insertions, 1 deletions
diff --git a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp
index a170430ef6..6c1e67a049 100644
--- a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp
+++ b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp
@@ -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()
diff --git a/tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp b/tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp
index 1809cdc16a..8084d50fbe 100644
--- a/tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp
+++ b/tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp
@@ -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