From d8ae59e097b3fca29f071d1a792cdb98ad8139cf Mon Sep 17 00:00:00 2001 From: Markus Mohrhard Date: Thu, 3 Apr 2014 01:05:29 +0200 Subject: add concept for chart xshape tests will be run on a tinderbox for now that will be the reference for anything related to it Change-Id: Ib795b53f74e9207d0272342f12d426bbc21164b4 --- chart2/qa/extras/xshape/chart2xshape.cxx | 86 + chart2/qa/extras/xshape/data/ods/fdo75075.ods | Bin 0 -> 15763 bytes .../qa/extras/xshape/data/reference/fdo75075.xml | 1690 ++++++++++++++++++++ 3 files changed, 1776 insertions(+) create mode 100644 chart2/qa/extras/xshape/chart2xshape.cxx create mode 100644 chart2/qa/extras/xshape/data/ods/fdo75075.ods create mode 100644 chart2/qa/extras/xshape/data/reference/fdo75075.xml (limited to 'chart2/qa/extras/xshape') diff --git a/chart2/qa/extras/xshape/chart2xshape.cxx b/chart2/qa/extras/xshape/chart2xshape.cxx new file mode 100644 index 000000000000..ba100a694082 --- /dev/null +++ b/chart2/qa/extras/xshape/chart2xshape.cxx @@ -0,0 +1,86 @@ +/* -*- 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 "charttest.hxx" +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +#include + +class Chart2XShapeTest : public ChartTest +{ +public: + + void testFdo75075(); + + CPPUNIT_TEST_SUITE(Chart2XShapeTest); + CPPUNIT_TEST(testFdo75075); + CPPUNIT_TEST_SUITE_END(); + +private: + + void compareAgainstReference(const OUString& rReferenceFile, bool bCreateReference = false); + +}; + +namespace { + +bool checkDumpAgainstFile( const OUString& rDump, const OUString aFilePath) +{ + OString aOFile = OUStringToOString(aFilePath, RTL_TEXTENCODING_UTF8); + + CPPUNIT_ASSERT_MESSAGE("dump is empty", !rDump.isEmpty()); + + OString aDump = OUStringToOString(rDump, RTL_TEXTENCODING_UTF8); + return doXMLDiff(aOFile.getStr(), aDump.getStr(), + static_cast(rDump.getLength()), NULL); +} + +} + +void Chart2XShapeTest::compareAgainstReference(const OUString& rReferenceFile, bool bCreateReference) +{ + uno::Reference< chart::XChartDocument > xChartDoc ( getChartCompFromSheet( 0, mxComponent ), UNO_QUERY_THROW); + uno::Reference< qa::XDumper > xDumper( xChartDoc, UNO_QUERY_THROW ); + OUString aDump = xDumper->dump(); + OUString aReference = getPathFromSrc("/chart2/qa/extras/xshape/data/reference/") + rReferenceFile; + if(bCreateReference) + { + OString aOFile = OUStringToOString(aReference, RTL_TEXTENCODING_UTF8); + OString aODump = OUStringToOString(aDump, RTL_TEXTENCODING_UTF8); + std::ofstream aReferenceFile(aOFile.getStr()); + aReferenceFile << aODump.getStr(); + } + else + { + checkDumpAgainstFile(aDump, aReference); + } +} + +void Chart2XShapeTest::testFdo75075() +{ + load("chart2/qa/extras/xshape/data/ods/", "fdo75075.ods"); + compareAgainstReference("fdo75075.xml"); +} + +CPPUNIT_TEST_SUITE_REGISTRATION(Chart2XShapeTest); + +CPPUNIT_PLUGIN_IMPLEMENT(); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/qa/extras/xshape/data/ods/fdo75075.ods b/chart2/qa/extras/xshape/data/ods/fdo75075.ods new file mode 100644 index 000000000000..d2a1be49bf48 Binary files /dev/null and b/chart2/qa/extras/xshape/data/ods/fdo75075.ods differ diff --git a/chart2/qa/extras/xshape/data/reference/fdo75075.xml b/chart2/qa/extras/xshape/data/reference/fdo75075.xml new file mode 100644 index 000000000000..38572489ef8b --- /dev/null +++ b/chart2/qa/extras/xshape/data/reference/fdo75075.xml @@ -0,0 +1,1690 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.2.3