diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2011-01-30 03:48:37 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2011-01-30 03:48:37 (GMT) |
commit | e5974b024828578945bd4c349f5f87f82a635225 (patch) | |
tree | 7e6700c6d6a0a7cd32ae8422d0a35cfe21c14a41 /tests/auto/qcoreapplication | |
parent | 8bf770a1c9c28781aa8bfdea13df5194fac13573 (diff) | |
parent | 84b81d47829d56cbd5568034161bf25898ab0824 (diff) | |
download | Qt-e5974b024828578945bd4c349f5f87f82a635225.zip Qt-e5974b024828578945bd4c349f5f87f82a635225.tar.gz Qt-e5974b024828578945bd4c349f5f87f82a635225.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1:
Fix potential networking crash due to null-pointer dereference
Revert "Improve timer ID safety by using a serial counter per ID."
Invalidate QScriptPrograms when engine is destroyed
Fix alignment issue causing crash in QtScript/JavaScriptCore
Restore Qt 4.6 behaviour: exec() always enters the event loop.
Make syncqt not complain about missing header macros.
Diffstat (limited to 'tests/auto/qcoreapplication')
-rw-r--r-- | tests/auto/qcoreapplication/tst_qcoreapplication.cpp | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/tests/auto/qcoreapplication/tst_qcoreapplication.cpp b/tests/auto/qcoreapplication/tst_qcoreapplication.cpp index 95055d1..bc69461 100644 --- a/tests/auto/qcoreapplication/tst_qcoreapplication.cpp +++ b/tests/auto/qcoreapplication/tst_qcoreapplication.cpp @@ -59,6 +59,9 @@ private slots: void applicationPid(); void globalPostedEventsCount(); void processEventsAlwaysSendsPostedEvents(); + void reexec(); + void execAfterExit(); + void eventLoopExecAfterExit(); }; class EventSpy : public QObject @@ -524,5 +527,47 @@ void tst_QCoreApplication::processEventsAlwaysSendsPostedEvents() } while (t.elapsed() < 3000); } +void tst_QCoreApplication::reexec() +{ + int argc = 1; + char *argv[] = { "tst_qcoreapplication" }; + QCoreApplication app(argc, argv); + + // exec once + QMetaObject::invokeMethod(&app, "quit", Qt::QueuedConnection); + QCOMPARE(app.exec(), 0); + + // and again + QMetaObject::invokeMethod(&app, "quit", Qt::QueuedConnection); + QCOMPARE(app.exec(), 0); +} + +void tst_QCoreApplication::execAfterExit() +{ + int argc = 1; + char *argv[] = { "tst_qcoreapplication" }; + QCoreApplication app(argc, argv); + + app.exit(1); + QMetaObject::invokeMethod(&app, "quit", Qt::QueuedConnection); + QCOMPARE(app.exec(), 0); +} + +void tst_QCoreApplication::eventLoopExecAfterExit() +{ + int argc = 1; + char *argv[] = { "tst_qcoreapplication" }; + QCoreApplication app(argc, argv); + + // exec once and exit + QMetaObject::invokeMethod(&app, "quit", Qt::QueuedConnection); + QCOMPARE(app.exec(), 0); + + // and again, but this time using a QEventLoop + QEventLoop loop; + QMetaObject::invokeMethod(&loop, "quit", Qt::QueuedConnection); + QCOMPARE(loop.exec(), 0); +} + QTEST_APPLESS_MAIN(tst_QCoreApplication) #include "tst_qcoreapplication.moc" |