[poppler] poppler/qt4/tests: Makefile.am, 1.2, 1.3 check_author.cpp, NONE, 1.1 check_permissions.cpp, NONE, 1.1

Brad Hards bradh at freedesktop.org
Tue Jul 5 05:32:01 PDT 2005


Update of /cvs/poppler/poppler/qt4/tests
In directory gabe:/tmp/cvs-serv26549

Modified Files:
	Makefile.am 
Added Files:
	check_author.cpp check_permissions.cpp 
Log Message:
Check in a couple more test apps


Index: Makefile.am
===================================================================
RCS file: /cvs/poppler/poppler/qt4/tests/Makefile.am,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- Makefile.am	4 Jul 2005 08:21:27 -0000	1.2
+++ Makefile.am	5 Jul 2005 12:31:59 -0000	1.3
@@ -32,10 +32,18 @@
 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)

--- NEW FILE: check_author.cpp ---
#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);
}

--- NEW FILE: check_permissions.cpp ---
#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);
}



More information about the poppler mailing list