1 // Copyright 2011 The Emscripten Authors.  All rights reserved.
2 // Emscripten is available under two separate licenses, the MIT license and the
3 // University of Illinois/NCSA Open Source License.  Both these licenses can be
4 // found in the LICENSE file.
5 
6 #include <QtTest/QtTest>
7 
8 #include <poppler-qt4.h>
9 
10 class TestPageLayout: public QObject
11 {
12     Q_OBJECT
13 private slots:
14     void checkNone();
15     void checkSingle();
16     void checkFacing();
17 };
18 
checkNone()19 void TestPageLayout::checkNone()
20 {
21     Poppler::Document *doc;
22     doc = Poppler::Document::load("../../../test/unittestcases/UseNone.pdf");
23     QVERIFY( doc );
24 
25     QCOMPARE( doc->pageLayout(), Poppler::Document::NoLayout );
26 
27     delete doc;
28 }
29 
checkSingle()30 void TestPageLayout::checkSingle()
31 {
32     Poppler::Document *doc;
33     doc = Poppler::Document::load("../../../test/unittestcases/FullScreen.pdf");
34     QVERIFY( doc );
35 
36     QCOMPARE( doc->pageLayout(), Poppler::Document::SinglePage );
37 
38     delete doc;
39 }
40 
checkFacing()41 void TestPageLayout::checkFacing()
42 {
43     Poppler::Document *doc;
44     doc = Poppler::Document::load("../../../test/unittestcases/doublepage.pdf");
45     QVERIFY( doc );
46 
47     QCOMPARE( doc->pageLayout(), Poppler::Document::TwoPageRight );
48 
49     delete doc;
50 }
51 
52 QTEST_MAIN(TestPageLayout)
53 #include "check_pagelayout.moc"
54 
55