Debian Codegraph @

qt6/tests/check_object.cpp

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