summaryrefslogtreecommitdiffstats
path: root/tests/auto/qwizard
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-04-18 11:34:29 +0200
commit4024a08239c3e69bb2e0ca045ccbdf3fc900f675 (patch)
treef893cc7d794800e0fbb00673c7bf3c74009a3389 /tests/auto/qwizard
parent3c659eb590aecbcdb40cb498901e757e780fa892 (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
Diffstat (limited to 'tests/auto/qwizard')
-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()