diff --git a/tests/auto/qcoreapplication/tst_qcoreapplication.cpp b/tests/auto/qcoreapplication/tst_qcoreapplication.cpp index 8ba90990c..962a8041c 100644 --- a/tests/auto/qcoreapplication/tst_qcoreapplication.cpp +++ b/tests/auto/qcoreapplication/tst_qcoreapplication.cpp @@ -22,6 +22,8 @@ #include #include +#include + class tst_QCoreApplication: public QObject { Q_OBJECT @@ -41,6 +43,7 @@ private slots: void reexec(); void execAfterExit(); void eventLoopExecAfterExit(); + void postRoutine(); }; class EventSpy : public QObject @@ -556,6 +559,18 @@ void tst_QCoreApplication::eventLoopExecAfterExit() QCOMPARE(loop.exec(), 0); } +void TestPostRoutine() +{ + ::usleep(1000); + // deadlock test + qRemovePostRoutine(TestPostRoutine); +} + +void tst_QCoreApplication::postRoutine() +{ + qAddPostRoutine(TestPostRoutine); +} + static void createQObjectOnDestruction() { // Make sure that we can create a QObject after the last QObject has been