From bb1fd2c9819d1ee5ba26c181d8fea8272b89b673 Mon Sep 17 00:00:00 2001 From: Samuel Mehrbrodt Date: Thu, 30 Nov 2017 10:28:33 +0100 Subject: Unit test for tdf#113696 Change-Id: I566cd5d38cf86547b664f0ae9a1c2f8c37edc0ca Reviewed-on: https://gerrit.libreoffice.org/45560 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt --- sw/qa/extras/fodfexport/data/tdf113696.odt | Bin 0 -> 10731 bytes sw/qa/extras/fodfexport/fodfexport.cxx | 44 +++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 sw/qa/extras/fodfexport/data/tdf113696.odt create mode 100644 sw/qa/extras/fodfexport/fodfexport.cxx (limited to 'sw/qa/extras/fodfexport') diff --git a/sw/qa/extras/fodfexport/data/tdf113696.odt b/sw/qa/extras/fodfexport/data/tdf113696.odt new file mode 100644 index 000000000000..03e0612a3d14 Binary files /dev/null and b/sw/qa/extras/fodfexport/data/tdf113696.odt differ diff --git a/sw/qa/extras/fodfexport/fodfexport.cxx b/sw/qa/extras/fodfexport/fodfexport.cxx new file mode 100644 index 000000000000..6cd00b49ba47 --- /dev/null +++ b/sw/qa/extras/fodfexport/fodfexport.cxx @@ -0,0 +1,44 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include + +class Test : public SwModelTestBase +{ +public: + Test() + : SwModelTestBase("/sw/qa/extras/fodfexport/data/", "OpenDocument Text Flat XML") + { + } + + /** + * Blacklist handling + */ + bool mustTestImportOf(const char* filename) const override + { + // Only test import of .fodt document + return OString(filename).endsWith(".odt") || OString(filename).endsWith(".fodt"); + } +}; + +DECLARE_FODFEXPORT_TEST(testTdf113696, "tdf113696.odt") +{ + // Test that an image which is written in svm format (image/x-vclgraphic) + // is accompanied by a png fallback graphic. + if (xmlDocPtr pXmlDoc = parseExportedFile()) + { + assertXPath(pXmlDoc, "/office:document/office:body/office:text/text:p/draw:frame/" + "draw:image[@loext:mime-type='image/x-vclgraphic']"); + assertXPath(pXmlDoc, "/office:document/office:body/office:text/text:p/draw:frame/" + "draw:image[@loext:mime-type='image/png']"); + } +} + +CPPUNIT_PLUGIN_IMPLEMENT(); +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit