test/source/unoapi_test.cxx                 |    6 +++++-
 vcl/qa/cppunit/pdfexport/data/tdf152218.odt |binary
 vcl/qa/cppunit/pdfexport/pdfexport2.cxx     |   12 ++++++++++++
 3 files changed, 17 insertions(+), 1 deletion(-)

New commits:
commit f9de9bf5ecc235fc5ca68168db48744a63cb79a3
Author:     Xisco Fauli <[email protected]>
AuthorDate: Mon Feb 23 14:04:55 2026 +0100
Commit:     Tomaž Vajngerl <[email protected]>
CommitDate: Tue Mar 10 14:31:26 2026 +0100

    tdf#152218: vcl_pdfexport2: Add test
    
    Change-Id: I56d6f3ced197afbd104b6bb2428cb50b6dffc124
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200054
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <[email protected]>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/201188
    Reviewed-by: Tomaž Vajngerl <[email protected]>
    Tested-by: Jenkins CollaboraOffice <[email protected]>

diff --git a/vcl/qa/cppunit/pdfexport/data/tdf152218.odt 
b/vcl/qa/cppunit/pdfexport/data/tdf152218.odt
new file mode 100644
index 000000000000..d1891c966333
Binary files /dev/null and b/vcl/qa/cppunit/pdfexport/data/tdf152218.odt differ
diff --git a/vcl/qa/cppunit/pdfexport/pdfexport2.cxx 
b/vcl/qa/cppunit/pdfexport/pdfexport2.cxx
index 3ef2b43ff57a..f8d690dda816 100644
--- a/vcl/qa/cppunit/pdfexport/pdfexport2.cxx
+++ b/vcl/qa/cppunit/pdfexport/pdfexport2.cxx
@@ -1706,6 +1706,18 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest2, testTdf157517)
     save(TestFilter::PDF_WRITER, 
aMediaDescriptor.getAsConstPropertyValueList());
 }
 
+CPPUNIT_TEST_FIXTURE(PdfExportTest2, testTdf152218)
+{
+    uno::Sequence<beans::PropertyValue> 
aFilterData(comphelper::InitPropertySequence({
+        { "PDFUACompliance", uno::Any(true) },
+    }));
+    comphelper::SequenceAsHashMap aMediaDescriptor;
+    aMediaDescriptor[u"FilterData"_ustr] <<= aFilterData;
+    loadFromFile(u"tdf152218.odt");
+    // Without the fix in place, the validation would have failed
+    save(TestFilter::PDF_WRITER, 
aMediaDescriptor.getAsConstPropertyValueList());
+}
+
 CPPUNIT_TEST_FIXTURE(PdfExportTest2, testTdf152235)
 {
     // Enable PDF/UA
commit c6c256efcf6890efbebbadf1f3e65bf6ee0cb052
Author:     Stephan Bergmann <[email protected]>
AuthorDate: Wed Feb 25 22:55:55 2026 +0100
Commit:     Tomaž Vajngerl <[email protected]>
CommitDate: Tue Mar 10 14:31:18 2026 +0100

    Don't direct veraPDF stderr into output file
    
    This redirection was introduced in ba8fe774a1cfc1cc5be05ecc5175a7d020e5bd7a
    "test: capture stderr of odfvalidator too", so it probably doesn't make much
    sense for veraPDF.  And at least with Java 26, invocations of bin/verapdf.sh
    start off with writing
    
    > WARNING: Final field flavour in class 
org.verapdf.pdfa.validation.profiles.ValidationProfileImpl has been mutated 
reflectively by class 
com.sun.xml.bind.v2.runtime.reflect.Accessor$FieldReflection in unnamed module 
@67117f44 (file:/home/sberg/lo-external-tarballs/verapdf-cli-1.29.0.jar)
    > WARNING: Use --enable-final-field-mutation=ALL-UNNAMED to avoid a warning
    > WARNING: Mutating final fields will be blocked in a future release unless 
final field mutation is enabled
    
    to stderr, so that e.g. CppunitTest_vcl_pdfexport failed with various
    
    > Entity: line 1: parser error : Start tag expected, '<' not found
    > WARNING: Final field flavour in class 
org.verapdf.pdfa.validation.profiles.Valid
    > ^
    > /home/sberg/lo/core/test/source/unoapi_test.cxx:217:(anonymous 
namespace)::testTdf142806::TestBody
    > assertion failed
    > - Expression: pXmlDoc
    
    Change-Id: I83970406d7ac8a4d4be98a7fc1e7da530075685c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200359
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <[email protected]>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/201187
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Tomaž Vajngerl <[email protected]>

diff --git a/test/source/unoapi_test.cxx b/test/source/unoapi_test.cxx
index 4f2713e4c80c..dc532468d1fc 100644
--- a/test/source/unoapi_test.cxx
+++ b/test/source/unoapi_test.cxx
@@ -191,7 +191,11 @@ void UnoApiTest::validate(TestFilter eFilter)
     utl::TempFileNamed aOutput;
     aOutput.EnableKillingFile();
     OUString aOutputFile = aOutput.GetFileName();
-    OUString aCommand = aValidator + " " + maTempFile.GetFileName() + " > " + 
aOutputFile + " 2>&1";
+    OUString aCommand = aValidator + " " + maTempFile.GetFileName() + " > " + 
aOutputFile;
+    if (var != "VERAPDF")
+    {
+        aCommand += " 2>&1";
+    }
 
 #if !defined _WIN32
     // For now, this is only needed by some Linux ASan builds, so keep it 
simply and disable it on

Reply via email to