diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2022-09-08 12:39:14 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2022-09-08 13:08:14 +0200 |
commit | 9f682acf75d56c82b40114bb9fceb29d837de2dd (patch) | |
tree | 2baf53627d942a5b453aa06d7d19e41b92e50b15 /vcl/qa | |
parent | 686d9caaba6e1fe0bb1e1caedc6869fa9f2bddc7 (diff) |
Related: tdf#150786 workaround unit test failure
The test detects a different problem, so this issue is unrelated to
the detection. Indeed, after this issue is fixed, the test could be
restored to test it all, complementing the test coverage.
Change-Id: Ie3c8621d76bf1ccb58ffbdde875a7adb7bceb76a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139639
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'vcl/qa')
-rw-r--r-- | vcl/qa/cppunit/pdfexport/pdfexport.cxx | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/vcl/qa/cppunit/pdfexport/pdfexport.cxx b/vcl/qa/cppunit/pdfexport/pdfexport.cxx index 0168c157b0c2..840dae3ac561 100644 --- a/vcl/qa/cppunit/pdfexport/pdfexport.cxx +++ b/vcl/qa/cppunit/pdfexport/pdfexport.cxx @@ -2648,12 +2648,17 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testFormFontName) CPPUNIT_ASSERT_EQUAL(vcl::pdf::PDFObjectType::String, pAnnot->getValueType("DA")); OUString aDA = pAnnot->getString("DA"); + // Workaround tdf#150786: skip color. It may be either "0 0 0 rg /TiRo 12 Tf" on light mode, + // or "1 1 1 rg /TiRo 12 Tf" on dark mode. + sal_Int32 rgPos = aDA.indexOf(u"rg"); + CPPUNIT_ASSERT(rgPos >= 0); + // Without the accompanying fix in place, this test would have failed with: - // - Expected: 0 0 0 rg /TiRo 12 Tf - // - Actual : 0 0 0 rg /F2 12 Tf + // - Expected: rg /TiRo 12 Tf + // - Actual : rg /F2 12 Tf // i.e. Liberation Serif was exposed as a form font as-is, without picking the closest built-in // font. - CPPUNIT_ASSERT_EQUAL(OUString("0 0 0 rg /TiRo 12 Tf"), aDA); + CPPUNIT_ASSERT_EQUAL(OUString("rg /TiRo 12 Tf"), aDA.copy(rgPos)); } // Check we don't have duplicated objects when we reexport the PDF multiple |