summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorFabien Freling <fabien.freling@nokia.com>2011-04-15 15:05:03 +0200
committerFabien Freling <fabien.freling@nokia.com>2011-05-10 11:44:54 +0200
commit5edb03f8554ee05785c2a98c0c522586f49d7edd (patch)
tree7de1b2016ebefdd15e270aa74201923d7b77e00b /tests
parente37d9e969189b43cd7bf289b27394171d31bf063 (diff)
Fix an race condition in the auto test.
Deleting the page in the wizard without removing it first leads to a crash when the wizard tries to access a deleted page. Reviewed-by: Samuel Rødal (cherry picked from commit 4024a08239c3e69bb2e0ca045ccbdf3fc900f675)
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qwizard/tst_qwizard.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/auto/qwizard/tst_qwizard.cpp b/tests/auto/qwizard/tst_qwizard.cpp
index bbac8a3ce7..5667d4047a 100644
--- a/tests/auto/qwizard/tst_qwizard.cpp
+++ b/tests/auto/qwizard/tst_qwizard.cpp
@@ -2551,8 +2551,8 @@ void tst_QWizard::task177022_setFixedSize()
QWizard wiz;
QWizardPage page1;
QWizardPage page2;
- wiz.addPage(&page1);
- wiz.addPage(&page2);
+ int page1_id = wiz.addPage(&page1);
+ int page2_id = wiz.addPage(&page2);
wiz.setFixedSize(width, height);
if (wiz.wizardStyle() == QWizard::AeroStyle)
QEXPECT_FAIL("", "this probably relates to non-client area hack for AeroStyle titlebar "
@@ -2579,6 +2579,8 @@ void tst_QWizard::task177022_setFixedSize()
QCOMPARE(wiz.maximumWidth(), width);
QCOMPARE(wiz.maximumHeight(), height);
+ wiz.removePage(page1_id);
+ wiz.removePage(page2_id);
}
void tst_QWizard::task248107_backButton()