pointers for updating tests after changing PDF export defaults
Miklos Vajna
vmiklos at collabora.com
Wed Aug 11 07:17:42 UTC 2021
Hi Stéphane,
> * when asserting an equality, e.g.:
> CPPUNIT_ASSERT_EQUAL(OString("Im19"), rIDs[0])
> <https://opengrok.libreoffice.org/xref/core/vcl/qa/cppunit/pdfexport/pdfexport.cxx?r=4390f233&mo=95984&fi=2214#2268>
> o what do strings like "Im19" or "Im12" mean in these contexts?
There are comments above the assert, they are meant to verify that "we
don't have 3 times the same page". You can also run 'git blame' on the
relevant lines to see this was added in commit
4505bc1701be73aab6543520cd342f0f0c8b7853.
> * what is the "W array" that is not found in: CPPUNIT_ASSERT(pWArray)
> <https://opengrok.libreoffice.org/xref/core/vcl/qa/cppunit/pdfexport/pdfexport.cxx?r=4390f233&mo=95984&fi=2214#2661>
It's a key in a PDF dictionary for a font object, did you attempt to
search in the PDF spec to see what is the exact meaning?
> * why could it be that rDocument.Read() fails at:
> CPPUNIT_ASSERT(rDocument.Read(aStream))
> <https://opengrok.libreoffice.org/xref/core/vcl/qa/cppunit/pdfexport/pdfexport.cxx?r=4390f233&mo=95984&fi=2214#912>
> (in the load function)
That means that the pdf tokenizer was unable to create a list of PDF
tokens from the input byte array. Usually there are some warnings
printed (in debug builds) before that happens, pointing at some more
specific problem.
> Is there someone with more knowledge about tests and PDFs who could put me
> on the right path?
In general, running git blame on the code you don't understand is
useful. You can also read comments around the code.
Last, it seems your patch changes 2 settings at the same time: it would
be good to change one at a time: it's always easier to debug a problem
if you only changed one thing and you know the breakage is caused by
exactly that change.
> (I am not subscribed to the dev mailing list so please send a reply to me as
> well as the list! 😁)
It would great to subscribe though; that way only we can help you, but
you can't help others.
Regards,
Miklos
More information about the LibreOffice
mailing list