sd/qa/unit/tiledrendering/LOKitSearchTest.cxx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
New commits: commit 656c79d0dcc790434308ce519fbdefa269be1996 Author: Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk> AuthorDate: Wed Jun 3 12:31:34 2020 +0200 Commit: Tomaž Vajngerl <qui...@gmail.com> CommitDate: Fri Jul 31 09:24:08 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 <qui...@gmail.com> (cherry picked from commit 25da71b489228b866f20d8ea6d1926128168d1fa) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95949 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> (cherry picked from commit 3e20ddab50de57f8a4f915791bbb56710c4936e3) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99818 diff --git a/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx b/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx index 5b079144f21c..ea5ff5a0104f 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> @@ -142,6 +144,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(); @@ -150,6 +153,7 @@ SdrObject* lclGetSelectedObject(sd::ViewShell* pViewShell) SdrObject* pObject = rMarkList.GetMark(0)->GetMarkedSdrObj(); return pObject; } +#endif } // end anonymous namespace @@ -264,6 +268,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); @@ -287,10 +292,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); @@ -334,10 +341,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); @@ -424,10 +433,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); @@ -522,12 +533,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); @@ -608,11 +621,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); @@ -772,6 +787,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); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits