summaryrefslogtreecommitdiff
path: root/qt4/tests/check_orientation.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qt4/tests/check_orientation.cpp')
-rw-r--r--qt4/tests/check_orientation.cpp40
1 files changed, 40 insertions, 0 deletions
diff --git a/qt4/tests/check_orientation.cpp b/qt4/tests/check_orientation.cpp
new file mode 100644
index 00000000..33e9f438
--- /dev/null
+++ b/qt4/tests/check_orientation.cpp
@@ -0,0 +1,40 @@
+#include <stdlib.h>
+#include <QtCore/QtCore>
+#include <QtGui/QtGui>
+#include <ctype.h>
+
+#define UNSTABLE_POPPLER_QT4
+#include <poppler-qt4.h>
+
+int main( int argc, char **argv )
+{
+ QApplication a( argc, argv ); // QApplication required!
+
+ Poppler::Document *doc = Poppler::Document::load("orientation.pdf");
+ if (!doc)
+ {
+ exit(1);
+ }
+
+ Poppler::Page *page = doc->page(0);
+ if ( !( page->orientation() == Poppler::Page::Landscape ) ) {
+ exit(2);
+ }
+
+ page = doc->page(1);
+ if ( !( page->orientation() == Poppler::Page::Portrait ) ) {
+ exit(3);
+ }
+
+ page = doc->page(2);
+ if ( !( page->orientation() == Poppler::Page::Seascape ) ) {
+ exit(4);
+ }
+
+ page = doc->page(3);
+ if ( !( page->orientation() == Poppler::Page::UpsideDown ) ) {
+ exit(5);
+ }
+
+ exit(0);
+}