[Libreoffice-commits] core.git: sd/qa

Tomaž Vajngerl (via logerrit) logerrit at kemper.freedesktop.org
Thu Jun 4 15:02:32 UTC 2020


 sd/qa/unit/tiledrendering/LOKitSearchTest.cxx |   16 ++++++++++++++++
 1 file changed, 16 insertions(+)

New commits:
commit 25da71b489228b866f20d8ea6d1926128168d1fa
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Wed Jun 3 12:31:34 2020 +0200
Commit:     Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Thu Jun 4 17:01:57 2020 +0200

    sd: disable LOKitSearchTest that test PDF search if no PDFium
    
    enclose the tests with HAVE_FEATURE_PDFIUM
    
    Change-Id: I1ce97fe090cef2cc2ab2f25fd1d2698bcaf28222
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95463
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>

diff --git a/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx b/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx
index 8c2a41eeca9e..91b5ecbc8473 100644
--- a/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx
+++ b/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx
@@ -8,6 +8,8 @@
  */
 
 #include "../sdmodeltestbase.hxx"
+#include <config_features.h>
+
 #include "CallbackRecorder.hxx"
 
 #include <test/bootstrapfixture.hxx>
@@ -140,6 +142,7 @@ void lcl_search(const OUString& rKey, bool bFindAll = false, bool bBackwards = f
     Scheduler::ProcessEventsToIdle();
 }
 
+#if HAVE_FEATURE_PDFIUM
 SdrObject* lclGetSelectedObject(sd::ViewShell* pViewShell)
 {
     SdrView* pSdrView = pViewShell->GetView();
@@ -148,6 +151,7 @@ SdrObject* lclGetSelectedObject(sd::ViewShell* pViewShell)
     SdrObject* pObject = rMarkList.GetMark(0)->GetMarkedSdrObj();
     return pObject;
 }
+#endif
 
 } // end anonymous namespace
 
@@ -262,6 +266,7 @@ void LOKitSearchTest::testDontSearchInMasterPages()
 
 void LOKitSearchTest::testSearchInPDFNonExisting()
 {
+#if HAVE_FEATURE_PDFIUM
     SdXImpressDocument* pXImpressDocument = createDoc("PDFSearch.pdf");
     sd::ViewShell* pViewShell = pXImpressDocument->GetDocShell()->GetViewShell();
     CPPUNIT_ASSERT(pViewShell);
@@ -285,10 +290,12 @@ void LOKitSearchTest::testSearchInPDFNonExisting()
     lcl_search("NonExisting");
 
     CPPUNIT_ASSERT_EQUAL(false, mpCallbackRecorder->m_bFound);
+#endif
 }
 
 void LOKitSearchTest::testSearchInPDF()
 {
+#if HAVE_FEATURE_PDFIUM
     SdXImpressDocument* pXImpressDocument = createDoc("PDFSearch.pdf");
     sd::ViewShell* pViewShell = pXImpressDocument->GetDocShell()->GetViewShell();
     CPPUNIT_ASSERT(pViewShell);
@@ -332,10 +339,12 @@ void LOKitSearchTest::testSearchInPDF()
                          mpCallbackRecorder->m_aSearchResultSelection[0]);
     CPPUNIT_ASSERT_EQUAL(tools::Rectangle(Point(3763, 1331), Size(1433, 484)),
                          mpCallbackRecorder->m_aSelection[0]);
+#endif
 }
 
 void LOKitSearchTest::testSearchInPDFInMultiplePages()
 {
+#if HAVE_FEATURE_PDFIUM
     SdXImpressDocument* pXImpressDocument = createDoc("PDFSearch.pdf");
     sd::ViewShell* pViewShell = pXImpressDocument->GetDocShell()->GetViewShell();
     CPPUNIT_ASSERT(pViewShell);
@@ -422,10 +431,12 @@ void LOKitSearchTest::testSearchInPDFInMultiplePages()
     CPPUNIT_ASSERT_EQUAL(0, mpCallbackRecorder->m_aSearchResultPart[0]);
     CPPUNIT_ASSERT_EQUAL(OString("9463, 3382, 1099, 499"),
                          mpCallbackRecorder->m_aSearchResultSelection[0]);
+#endif
 }
 
 void LOKitSearchTest::testSearchInPDFInMultiplePagesBackwards()
 {
+#if HAVE_FEATURE_PDFIUM
     SdXImpressDocument* pXImpressDocument = createDoc("PDFSearch.pdf");
     sd::ViewShell* pViewShell = pXImpressDocument->GetDocShell()->GetViewShell();
     CPPUNIT_ASSERT(pViewShell);
@@ -520,12 +531,14 @@ void LOKitSearchTest::testSearchInPDFInMultiplePagesBackwards()
     CPPUNIT_ASSERT_EQUAL(0, mpCallbackRecorder->m_aSearchResultPart[0]);
     CPPUNIT_ASSERT_EQUAL(OString("5592, 5038, 1100, 499"),
                          mpCallbackRecorder->m_aSearchResultSelection[0]);
+#endif
 }
 
 // Test searching in document with mixed objects.
 // We have 2 objects: 1. Text Object, 2. Graphic Object with PDF
 void LOKitSearchTest::testSearchIn2MixedObjects()
 {
+#if HAVE_FEATURE_PDFIUM
     SdXImpressDocument* pXImpressDocument = createDoc("MixedTest1.odg");
     sd::ViewShell* pViewShell = pXImpressDocument->GetDocShell()->GetViewShell();
     CPPUNIT_ASSERT(pViewShell);
@@ -606,11 +619,13 @@ void LOKitSearchTest::testSearchIn2MixedObjects()
 
     CPPUNIT_ASSERT_EQUAL(OString("3546, 3174, 738, 402"),
                          mpCallbackRecorder->m_aSearchResultSelection[0]);
+#endif
 }
 
 // Test searching in document with mixed objects. We have 6 objects.
 void LOKitSearchTest::testSearchIn6MixedObjects()
 {
+#if HAVE_FEATURE_PDFIUM
     SdXImpressDocument* pXImpressDocument = createDoc("MixedTest2.odg");
     sd::ViewShell* pViewShell = pXImpressDocument->GetDocShell()->GetViewShell();
     CPPUNIT_ASSERT(pViewShell);
@@ -770,6 +785,7 @@ void LOKitSearchTest::testSearchIn6MixedObjects()
     CPPUNIT_ASSERT_EQUAL(size_t(1), mpCallbackRecorder->m_aSearchResultSelection.size());
     CPPUNIT_ASSERT_EQUAL(size_t(1), mpCallbackRecorder->m_aSearchResultPart.size());
     CPPUNIT_ASSERT_EQUAL(pPage->GetObj(0), lclGetSelectedObject(pViewShell));
+#endif
 }
 
 CPPUNIT_TEST_SUITE_REGISTRATION(LOKitSearchTest);


More information about the Libreoffice-commits mailing list