summaryrefslogtreecommitdiffstats
path: root/tests/auto/qwizard/tst_qwizard.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qwizard/tst_qwizard.cpp')
-rw-r--r--tests/auto/qwizard/tst_qwizard.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/tests/auto/qwizard/tst_qwizard.cpp b/tests/auto/qwizard/tst_qwizard.cpp
index 5667d4047a..00b59a923b 100644
--- a/tests/auto/qwizard/tst_qwizard.cpp
+++ b/tests/auto/qwizard/tst_qwizard.cpp
@@ -854,25 +854,26 @@ struct MyPage2 : public QWizardPage
public:
MyPage2() : init(0), cleanup(0), validate(0) {}
- void initializePage() { ++init; QWizardPage::initializePage(); checkInvariant(); }
- void cleanupPage() { ++cleanup; QWizardPage::cleanupPage(); checkInvariant(); }
+ void initializePage() { ++init; QWizardPage::initializePage(); }
+ void cleanupPage() { ++cleanup; QWizardPage::cleanupPage(); }
bool validatePage() { ++validate; return QWizardPage::validatePage(); }
- void check(int init, int cleanup)
- { Q_ASSERT(init == this->init && cleanup == this->cleanup); Q_UNUSED(init); Q_UNUSED(cleanup); }
+ bool check(int init, int cleanup)
+ {
+ return init == this->init
+ && cleanup == this->cleanup
+ && (this->init == this->cleanup || this->init - 1 == this->cleanup);
+ }
int init;
int cleanup;
int validate;
-
-private:
- void checkInvariant() { Q_ASSERT(init == cleanup || init - 1 == cleanup); }
};
#define CHECK_PAGE_INIT(i0, c0, i1, c1, i2, c2) \
- page0->check((i0), (c0)); \
- page1->check((i1), (c1)); \
- page2->check((i2), (c2));
+ QVERIFY(page0->check((i0), (c0))); \
+ QVERIFY(page1->check((i1), (c1))); \
+ QVERIFY(page2->check((i2), (c2)));
void tst_QWizard::setOption_IndependentPages()
{