summaryrefslogtreecommitdiffstats
path: root/tests/auto/qtimer
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2011-01-10 16:45:05 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2011-01-10 16:45:05 (GMT)
commitf0b854bf5cfc6ec4715ff5f4aed3f0bd189d24ee (patch)
tree195a47b88ae55179330334a8e17da49b0a427de7 /tests/auto/qtimer
parent8ef9b5f9d125a81b4268d5c88ab609089720df65 (diff)
parentd62e9f4a6fe199ae790b1561fd4ba9ea84bd4d1e (diff)
downloadQt-f0b854bf5cfc6ec4715ff5f4aed3f0bd189d24ee.zip
Qt-f0b854bf5cfc6ec4715ff5f4aed3f0bd189d24ee.tar.gz
Qt-f0b854bf5cfc6ec4715ff5f4aed3f0bd189d24ee.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-s60-public into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/qt-s60-public: Setting WA_TranslucentBackground after winid() is ineffective on Symbian. Fix handle leak in symbian QTimer implementation
Diffstat (limited to 'tests/auto/qtimer')
-rw-r--r--tests/auto/qtimer/tst_qtimer.cpp38
1 files changed, 38 insertions, 0 deletions
diff --git a/tests/auto/qtimer/tst_qtimer.cpp b/tests/auto/qtimer/tst_qtimer.cpp
index 102308e..e964728 100644
--- a/tests/auto/qtimer/tst_qtimer.cpp
+++ b/tests/auto/qtimer/tst_qtimer.cpp
@@ -90,6 +90,9 @@ private slots:
void QTBUG13633_dontBlockEvents();
void postedEventsShouldNotStarveTimers();
+#ifdef Q_OS_SYMBIAN
+ void handleLeaks();
+#endif
};
class TimerHelper : public QObject
@@ -750,5 +753,40 @@ void tst_QTimer::postedEventsShouldNotStarveTimers()
QVERIFY(timerHelper.count > 5);
}
+#ifdef Q_OS_SYMBIAN
+void tst_QTimer::handleLeaks()
+{
+ const int timercount = 5;
+ int processhandles_start;
+ int threadhandles_start;
+ RThread().HandleCount(processhandles_start, threadhandles_start);
+ {
+ TimerHelper timerHelper;
+ QList<QTimer*> timers;
+ for (int i=0;i<timercount;i++) {
+ QTimer* timer = new QTimer;
+ timers.append(timer);
+ connect(timer, SIGNAL(timeout()), &timerHelper, SLOT(timeout()));
+ timer->setSingleShot(true);
+ timer->start(i); //test both zero and normal timeouts
+ }
+ int processhandles_mid;
+ int threadhandles_mid;
+ RThread().HandleCount(processhandles_mid, threadhandles_mid);
+ qDebug() << threadhandles_mid - threadhandles_start << "new thread owned handles";
+ QTest::qWait(100);
+ QCOMPARE(timerHelper.count, timercount);
+ qDeleteAll(timers);
+ }
+ int processhandles_end;
+ int threadhandles_end;
+ RThread().HandleCount(processhandles_end, threadhandles_end);
+ QCOMPARE(threadhandles_end, threadhandles_start); //RTimer::CreateLocal creates a thread owned handle
+ //Can not verify process handles because QObject::connect may create up to 2 mutexes
+ //from a QMutexPool (4 process owned handles with open C imp.)
+ //QCOMPARE(processhandles_end, processhandles_start);
+}
+#endif
+
QTEST_MAIN(tst_QTimer)
#include "tst_qtimer.moc"