[Libreoffice] sylk unit tests

Caolán McNamara caolanm at redhat.com
Wed Jul 13 02:45:49 PDT 2011


On Tue, 2011-07-12 at 00:31 +0200, Maciej Rumianowski wrote:
> But I wasn't successful using ScImportExport::ImportStream and
> ScImportExport::ExportStream, which use Sylk2Doc.

Hmm, well I've now added a sylk import unit test to sc, i.e.
http://cgit.freedesktop.org/libreoffice/calc/commit/?id=8ac49ef8ab4f065d7b7277779dcb15505c602c77

But see the comment there, at the ScDocShell "import this .sylk" level
of this test, if it *fails* to import as a sylk then it will
automatically try to import as a .csv, and if that fails then as raw
text, so its not a great test outside of detecting if the sylk importer
crashes as opposed to failing gracefully.

So a custom test calling ScImportExport::Sylk2Doc directly is probably
required to detect graceful fails of the Sylk importer, which means that
(because of the way things link together) that a test that calls
ScImportExport::Sylk2Doc directly needs to go in qa/unit/ucalc.cxx
rather than in qa/unit/filters-test.cxx which can basically only use
exported (SC_DLLPUBLIC) classes like ScDocShell. ucalc.cxx on the other
hand can use DC_DLLPRIVATE classes.

C.



More information about the LibreOffice mailing list