[poppler] poppler/qt4/tests: Makefile.am, 1.10, 1.11 check_fonts.cpp, NONE, 1.1

Brad Hards bradh at freedesktop.org
Sun Dec 4 02:05:24 PST 2005


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

Modified Files:
	Makefile.am 
Added Files:
	check_fonts.cpp 
Log Message:
* qt4/src/poppler-qt4.h:
  qt4/src/fontinfo.cc: add implementation for FontInfo::typeName()

* qt4/tests/check_fonts.cpp:
* qt4/tests/Makefile.am: add unit test for fonts

* qt4/src/Mainpage.dox: Minor typo fixes.



Index: Makefile.am
===================================================================
RCS file: /cvs/poppler/poppler/qt4/tests/Makefile.am,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- Makefile.am	27 Nov 2005 01:33:51 -0000	1.10
+++ Makefile.am	4 Dec 2005 10:05:22 -0000	1.11
@@ -46,6 +46,7 @@
 
 if BUILD_POPPLER_QT4TESTS
 TESTS = \
+	check_fonts		\
 	check_metadata         \
 	check_permissions      \
 	check_pagemode    \
@@ -53,6 +54,10 @@
 
 check_PROGRAMS = $(TESTS)
 
+check_fonts_SOURCES = check_fonts.cpp
+check_fonts.$(OBJEXT): check_fonts.moc
+check_fonts_LDADD = $(UT_LDADDS)
+
 check_metadata_SOURCES = check_metadata.cpp
 check_metadata.$(OBJEXT): check_metadata.moc
 check_metadata_LDADD = $(UT_LDADDS)

--- NEW FILE: check_fonts.cpp ---
#include <QtTest/QtTest>

#define UNSTABLE_POPPLER_QT4
#include <poppler-qt4.h>

class TestFontsData: public QObject
{
    Q_OBJECT
private slots:
    void checkNoFonts();
    void checkType1();
};

void TestFontsData::checkNoFonts()
{
    Poppler::Document *doc;
    doc = Poppler::Document::load("../../../test/tests/image.pdf");
    QVERIFY( doc );

    QList<Poppler::FontInfo> listOfFonts = doc->fonts();
    QCOMPARE( listOfFonts.size(), 0 );
}

void TestFontsData::checkType1()
{
    Poppler::Document *doc;
    doc = Poppler::Document::load("../../../test/tests/text.pdf");
    QVERIFY( doc );

    QList<Poppler::FontInfo> listOfFonts = doc->fonts();
    QCOMPARE( listOfFonts.size(), 1 );
    QCOMPARE( listOfFonts.at(0).name(), QString("Helvetica") );
    QCOMPARE( listOfFonts.at(0).type(), Poppler::FontInfo::Type1 );
    QCOMPARE( listOfFonts.at(0).typeName(), QString("Type 1") );

    QCOMPARE( listOfFonts.at(0).isEmbedded(), false );
    QCOMPARE( listOfFonts.at(0).isSubset(), false );
}

QTEST_MAIN(TestFontsData)
#include "check_fonts.moc"




More information about the poppler mailing list