1#include <QtTest/QTest>
2
3#include <poppler-qt6.h>
4
5class TestPageLayout : public QObject
6{
7 Q_OBJECT
8public:
9 explicit TestPageLayout(QObject *parent = nullptr) : QObject(parent) { }
10private slots:
11 void checkNone();
12 void checkSingle();
13 void checkFacing();
14};
15
16void TestPageLayout::checkNone()
17{
18 std::unique_ptr<Poppler::Document> doc = Poppler::Document::load(TESTDATADIR "/unittestcases/UseNone.pdf");
19 QVERIFY(doc);
20
21 QCOMPARE(doc->pageLayout(), Poppler::Document::NoLayout);
22}
23
24void TestPageLayout::checkSingle()
25{
26 std::unique_ptr<Poppler::Document> doc = Poppler::Document::load(TESTDATADIR "/unittestcases/FullScreen.pdf");
27 QVERIFY(doc);
28
29 QCOMPARE(doc->pageLayout(), Poppler::Document::SinglePage);
30}
31
32void TestPageLayout::checkFacing()
33{
34 std::unique_ptr<Poppler::Document> doc = Poppler::Document::load(TESTDATADIR "/unittestcases/doublepage.pdf");
35 QVERIFY(doc);
36
37 QCOMPARE(doc->pageLayout(), Poppler::Document::TwoPageRight);
38}
39
40QTEST_GUILESS_MAIN(TestPageLayout)
41#include "check_pagelayout.moc"
42

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