[poppler] 2 commits - qt4/.gitignore qt4/tests test/.gitignore

Brad Hards bradh at kemper.freedesktop.org
Mon Nov 5 02:11:26 PST 2007


 qt4/.gitignore             |    1 +
 qt4/tests/.gitignore       |    3 +++
 qt4/tests/Makefile.am      |    7 ++++++-
 qt4/tests/check_search.cpp |   40 ++++++++++++++++++++++++++++++++++++++++
 test/.gitignore            |    2 ++
 5 files changed, 52 insertions(+), 1 deletion(-)

New commits:
commit c340255f46bc95b5f850abcd3d9bcdc8594199bb
Author: Brad Hards <bradh at kde.org>
Date:   Mon Nov 5 20:36:23 2007 +1100

    Update .gitignore
    
    Suppress the noise a bit.

diff --git a/qt4/.gitignore b/qt4/.gitignore
index 22a4e72..5540f35 100644
--- a/qt4/.gitignore
+++ b/qt4/.gitignore
@@ -1,3 +1,4 @@
 Makefile
 Makefile.in
+*~
 
diff --git a/qt4/tests/.gitignore b/qt4/tests/.gitignore
index 834feec..25a1981 100644
--- a/qt4/tests/.gitignore
+++ b/qt4/tests/.gitignore
@@ -6,6 +6,7 @@
 Makefile
 Makefile.in
 stress-poppler-qt4
+stress-poppler-dir
 test-poppler-qt4
 test-password-qt4
 poppler-attachments
@@ -17,4 +18,6 @@ check_metadata
 check_permissions
 check_pagelayout
 check_pagemode
+check_password
+check_search
 
diff --git a/test/.gitignore b/test/.gitignore
index c95ea0d..b9022f4 100644
--- a/test/.gitignore
+++ b/test/.gitignore
@@ -9,3 +9,5 @@ Makefile.in
 gtk-cairo-test
 gtk-splash-test
 pdf_inspector
+perf-test
+*~
commit cebf770379e7d71166e729aebf771a4ca291d48b
Author: Brad Hards <bradh at kde.org>
Date:   Mon Nov 5 20:31:18 2007 +1100

    Add a new unit test, for non-ASCII searching.
    
    There is a bug report (bug:7063) about not being able
    to find text that isn't ASCII. I think that the problem isn't
    in poppler core code - this unit test shows we can find
    characters as long as they are properly encoded (which the
    Qt4 front end does).

diff --git a/qt4/tests/Makefile.am b/qt4/tests/Makefile.am
index 3e13f4e..7698320 100644
--- a/qt4/tests/Makefile.am
+++ b/qt4/tests/Makefile.am
@@ -64,7 +64,8 @@ TESTS = \
 	check_permissions      	\
 	check_pagemode    	\
 	check_password    	\
-	check_pagelayout
+	check_pagelayout	\
+	check_search
 
 check_PROGRAMS = $(TESTS)
 
@@ -100,5 +101,9 @@ check_password_SOURCES = check_password.cpp
 check_password.$(OBJEXT): check_password.moc
 check_password_LDADD = $(LDADDS)
 
+check_search_SOURCES = check_search.cpp
+check_search.$(OBJEXT): check_search.moc
+check_search_LDADD = $(LDADDS)
+
 endif
 
diff --git a/qt4/tests/check_search.cpp b/qt4/tests/check_search.cpp
new file mode 100644
index 0000000..734bf45
--- /dev/null
+++ b/qt4/tests/check_search.cpp
@@ -0,0 +1,40 @@
+#include <QtTest/QtTest>
+
+#include <poppler-qt4.h>
+
+class TestSearch: public QObject
+{
+    Q_OBJECT
+private slots:
+    void bug7063();
+};
+
+void TestSearch::bug7063()
+{
+    Poppler::Document *doc;
+    doc = Poppler::Document::load("../../../test/unittestcases/bug7063.pdf");
+    QVERIFY( doc );
+   
+    Poppler::Page *page = doc->page(0);
+    QRectF pageRegion( QPointF(0,0), page->pageSize() );
+
+    QCOMPARE( page->search(QString("non-ascii:"), pageRegion, Poppler::Page::FromTop, Poppler::Page::CaseSensitive), true );
+
+    QCOMPARE( page->search(QString("Ascii"), pageRegion, Poppler::Page::FromTop, Poppler::Page::CaseSensitive), false );
+    QCOMPARE( page->search(QString("Ascii"), pageRegion, Poppler::Page::FromTop, Poppler::Page::CaseInsensitive), true );
+
+    QCOMPARE( page->search(QString("latin1:"), pageRegion, Poppler::Page::FromTop, Poppler::Page::CaseSensitive), false );
+
+    QCOMPARE( page->search(QString::fromUtf8("é"), pageRegion, Poppler::Page::FromTop, Poppler::Page::CaseSensitive), true );
+    QCOMPARE( page->search(QString::fromUtf8("à"), pageRegion, Poppler::Page::FromTop, Poppler::Page::CaseSensitive), true );
+    QCOMPARE( page->search(QString::fromUtf8("ç"), pageRegion, Poppler::Page::FromTop, Poppler::Page::CaseSensitive), true );
+    QCOMPARE( page->search(QString::fromUtf8("search \"é\", \"à\" or \"ç\""), pageRegion, Poppler::Page::FromTop, Poppler::Page::CaseSensitive), true );
+    QCOMPARE( page->search(QString::fromUtf8("¥µ©"), pageRegion, Poppler::Page::FromTop, Poppler::Page::CaseSensitive), true );
+    QCOMPARE( page->search(QString::fromUtf8("¥©"), pageRegion, Poppler::Page::FromTop, Poppler::Page::CaseSensitive), false );
+  
+    delete doc;
+}
+
+QTEST_MAIN(TestSearch)
+#include "check_search.moc"
+


More information about the poppler mailing list