filter/qa/pdf.cxx |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

New commits:
commit d9f2193b72f6bd9e5f551c12331a5e547c3ac557
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Wed Aug 16 08:59:52 2023 +0300
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Wed Aug 16 13:10:49 2023 +0200

    Fix a DPI-dependent test
    
    Change-Id: I228b927c4daac3a4da0819e490a9963b514b4c16
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155731
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>

diff --git a/filter/qa/pdf.cxx b/filter/qa/pdf.cxx
index cc83f59e1652..9965114cadd2 100644
--- a/filter/qa/pdf.cxx
+++ b/filter/qa/pdf.cxx
@@ -172,8 +172,14 @@ void Test::doTestCommentsInMargin(bool 
commentsInMarginEnabled)
     std::unique_ptr<vcl::pdf::PDFiumDocument> pPdfDocument
         = pPDFium->openDocument(aStream.GetData(), aStream.GetSize(), 
OString());
     CPPUNIT_ASSERT(pPdfDocument);
-    CPPUNIT_ASSERT_EQUAL(commentsInMarginEnabled ? 9 : 1,
-                         pPdfDocument->openPage(0)->getObjectCount());
+    if (commentsInMarginEnabled)
+    {
+        // Unfortunately, the comment box is DPI dependent, and the lines 
there may split
+        // at higher DPIs, creating additional objects on import, hence the 
"_GREATER"
+        CPPUNIT_ASSERT_GREATER(8, pPdfDocument->openPage(0)->getObjectCount());
+    }
+    else
+        CPPUNIT_ASSERT_EQUAL(1, pPdfDocument->openPage(0)->getObjectCount());
 }
 
 CPPUNIT_TEST_FIXTURE(Test, testCommentsInMargin)

Reply via email to