1#include <QtCore/QScopedPointer>
2#include <QtTest/QTest>
3
4#include "poppler/Object.h"
5
6class TestObject : public QObject
7{
8 Q_OBJECT
9public:
10 explicit TestObject(QObject *parent = nullptr) : QObject(parent) { }
11private slots:
12 void benchDefaultConstructor();
13 void benchMoveConstructor();
14 void benchSetToNull();
15};
16
17void TestObject::benchDefaultConstructor()
18{
19 QBENCHMARK {
20 Object obj;
21 }
22}
23
24void TestObject::benchMoveConstructor()
25{
26 QBENCHMARK {
27 Object src;
28 Object dst { std::move(src) };
29 }
30}
31
32void TestObject::benchSetToNull()
33{
34 Object obj;
35 QBENCHMARK {
36 obj.setToNull();
37 }
38}
39
40QTEST_GUILESS_MAIN(TestObject)
41#include "check_object.moc"
42

source code of poppler/qt6/tests/check_object.cpp