[poppler] qt5/tests

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jan 28 22:51:08 UTC 2020


 qt5/tests/check_search.cpp |   15 +++++++++++++++
 1 file changed, 15 insertions(+)

New commits:
commit ceb4206215367b51ff361593ad7ee1771bfe1e97
Author: Albert Astals Cid <aacid at kde.org>
Date:   Tue Jan 28 23:47:28 2020 +0100

    qt5: add test to show that deseret search works
    
    The one with ignoring case doesn't work yet

diff --git a/qt5/tests/check_search.cpp b/qt5/tests/check_search.cpp
index 7c251c5d..2808a37f 100644
--- a/qt5/tests/check_search.cpp
+++ b/qt5/tests/check_search.cpp
@@ -13,6 +13,7 @@ private slots:
     void testWholeWordsOnly();
     void testIgnoreDiacritics();
     void testRussianSearch(); // Issue #743
+    void testDeseretSearch(); // Issue #853
 };
 
 void TestSearch::bug7063()
@@ -260,6 +261,20 @@ void TestSearch::testRussianSearch()
     QCOMPARE( page->search(str, l, t, r, b, direction, mode2W), true );
 }
 
+void TestSearch::testDeseretSearch()
+{
+    QScopedPointer< Poppler::Document > document(Poppler::Document::load(TESTDATADIR "/unittestcases/deseret.pdf"));
+    QVERIFY( document );
+
+    QScopedPointer< Poppler::Page > page(document->page(0));
+    QVERIFY( page );
+
+    double l, t, r, b; //left, top, right, bottom
+
+    const QString str = QString::fromUtf8("𐐐𐐯𐑊𐐬"); //clazy:exclude=qstring-allocations
+    QCOMPARE( page->search(str, l, t, r, b, Poppler::Page::FromTop, Poppler::Page::NoSearchFlags), true );
+}
+
 QTEST_GUILESS_MAIN(TestSearch)
 #include "check_search.moc"
 


More information about the poppler mailing list