blob: c5cc0a9b20338eaf18c575a3c133d5d250b06bb5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
// Copyright (C) 2020 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <QTest>
#include <QTimer>
static bool done = false;
static void cleanup()
{
done = true;
QEventLoop loop;
QTimer::singleShot(100,&loop, &QEventLoop::quit);
loop.exec();
}
struct tst_qAddPostRoutine : public QObject
{
public:
tst_qAddPostRoutine();
~tst_qAddPostRoutine();
};
tst_qAddPostRoutine::tst_qAddPostRoutine()
{
qAddPostRoutine(cleanup);
}
tst_qAddPostRoutine::~tst_qAddPostRoutine()
{
Q_ASSERT(done);
}
int main(int argc, char *argv[])
{
tst_qAddPostRoutine tc;
QGuiApplication app(argc, argv);
app.setAttribute(Qt::AA_Use96Dpi, true);
QTEST_SET_MAIN_SOURCE_PATH
return QTest::qExec(&tc, argc, argv);
}
|