From a2ec72ee604181892050093669b870580708842d Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Wed, 16 Dec 2009 15:59:05 +0200 Subject: Fixed qstylesheetstyle benchmark for Symbian The benchmark ran out of stack for large grids somewhere inside QWidget::show(). Skipped show cases for large grids in Symbian, since we cannot increase application stack any further. Also removed some unnecessary whitespace. Task-number: QTBUG-6693 Reviewed-by: Janne Anttila --- tests/benchmarks/qstylesheetstyle/main.cpp | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/tests/benchmarks/qstylesheetstyle/main.cpp b/tests/benchmarks/qstylesheetstyle/main.cpp index 19efcab..d6fa48c 100644 --- a/tests/benchmarks/qstylesheetstyle/main.cpp +++ b/tests/benchmarks/qstylesheetstyle/main.cpp @@ -49,16 +49,16 @@ class tst_qstylesheetstyle : public QObject private slots: void empty(); void empty_events(); - + void simple(); void simple_events(); - + void grid_data(); void grid(); - + private: QWidget *buildSimpleWidgets(); - + }; @@ -103,7 +103,7 @@ void tst_qstylesheetstyle::empty_events() delete w; } -static const char *simple_css = +static const char *simple_css = " QLineEdit { background: red; } QPushButton { border: 1px solid yellow; color: pink; } \n" " QCheckBox { margin: 3px 5px; background-color:red; } QAbstractButton { background-color: #456; } \n" " QFrame { padding: 3px; } QLabel { color: black } QSpinBox:hover { background-color:blue; } "; @@ -138,7 +138,7 @@ void tst_qstylesheetstyle::grid_data() QTest::addColumn("events"); QTest::addColumn("show"); QTest::addColumn("N"); - for (int n = 5; n <= 25; n += 5) { + for (int n = 5; n <= 25; n += 5) { const QByteArray nString = QByteArray::number(n*n); QTest::newRow(("simple--" + nString).constData()) << false << false << n; QTest::newRow(("events--" + nString).constData()) << true << false << n; @@ -153,6 +153,13 @@ void tst_qstylesheetstyle::grid() QFETCH(bool, show); QFETCH(int, N); +#ifdef Q_OS_SYMBIAN + // Symbian has limited stack (max 80k), which will run out when N >= 20 due to + // QWidget::show() using recursion among grid labels somewhere down the line. + if (show && N >= 20) + QSKIP("Grid too big for device to show", SkipSingle); +#endif + QWidget *w = new QWidget(); QGridLayout *layout = new QGridLayout(w); w->setLayout(layout); -- cgit v0.12