mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-24 02:42:55 +00:00
add test case for qAddPostRoutine() and qRemovePostRoutine()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
41320de644
commit
c23499cb2a
1 changed files with 15 additions and 0 deletions
|
@ -22,6 +22,8 @@
|
|||
#include <QtCore/QtCore>
|
||||
#include <QtTest/QtTest>
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
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
|
||||
|
|
Loading…
Add table
Reference in a new issue