-
Notifications
You must be signed in to change notification settings - Fork 109
Expand file tree
/
Copy pathPythonQtTestCleanup.h
More file actions
47 lines (36 loc) · 909 Bytes
/
PythonQtTestCleanup.h
File metadata and controls
47 lines (36 loc) · 909 Bytes
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
42
43
44
45
46
47
#ifndef _PYTHONQTTESTCLEANUP_H
#define _PYTHONQTTESTCLEANUP_H
#include <QtTest/QtTest>
class PythonQtTestCleanupHelper;
//! Test PythonQt cleanup and Python interpreter finalization
class PythonQtTestCleanup : public QObject
{
Q_OBJECT
private Q_SLOTS:
void initTestCase();
void cleanupTestCase();
void init();
void cleanup();
void testQtEnum();
void testCallQtMethodInDestructorOwnedQTimer();
void testCallQtMethodInDestructorWeakRefGuarded();
void testSignalReceiverCleanup();
void testPyFinalizeThenPythonQtCleanup();
private:
PythonQtTestCleanupHelper* _helper;
};
//! Test helper class
class PythonQtTestCleanupHelper : public QObject
{
Q_OBJECT
public:
PythonQtTestCleanupHelper()
: _passed(false) {};
bool runScript(const char* script);
public Q_SLOTS:
void setPassed() { _passed = true; }
void onDestroyed(QObject*) {}
private:
bool _passed;
};
#endif