Commit 1323c744 authored by Brad Hards's avatar Brad Hards
Browse files

Check in a couple more test apps

parent 839a798e
......@@ -32,10 +32,18 @@ stress_poppler_qt4_SOURCES = \
stress_poppler_qt4_LDADD = $(LDADDS)
TESTS = \
check_orientation
check_author \
check_orientation \
check_permissions
check_PROGRAMS = $(TESTS)
check_orientation_SOURCES = check_orientation.cpp
check_orientation_LDADD = $(LDADDS)
check_author_SOURCES = check_author.cpp
check_author_LDADD = $(LDADDS)
check_permissions_SOURCES = check_permissions.cpp
check_permissions_LDADD = $(LDADDS)
#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 )
{
QCoreApplication a( argc, argv ); // QApplication required!
Poppler::Document *doc = Poppler::Document::load("../../../test/unittestcases/orientation.pdf");
if (!doc)
{
exit(1);
}
if ( !(doc->info("Author") == QString("Brad Hards") ) )
{
exit(2);
}
exit(0);
}
#include <QtCore/QtCore>
#define UNSTABLE_POPPLER_QT4
#include <poppler-qt4.h>
int main( int argc, char **argv )
{
QCoreApplication a( argc, argv ); // QApplication required!
Poppler::Document *doc = Poppler::Document::load("../../../test/unittestcases/orientation.pdf");
if (!doc)
{
exit(1);
}
// we are allowed to print
if ( !(doc->okToPrint() ) )
{
exit(2);
}
// we are not allowed to change
if ( (doc->okToChange()) )
{
exit(3);
}
// we are not allowed to copy or extract content
if ( (doc->okToCopy() ) )
{
exit(4);
}
// we are not allowed to print at high resolution
if ( (doc->okToPrintHighRes() ) )
{
exit(5);
}
// we are not allowed to fill forms
if ( (doc->okToFillForm() ) )
{
exit(6);
}
// we are allowed to extract content for accessibility
if ( (!doc->okToExtractForAccessibility() ) )
{
exit(7);
}
// we are allowed to assemble this document
if ( (!doc->okToAssemble() ) )
{
exit(8);
}
exit(0);
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment