[Libreoffice-commits] core.git: 5 commits - writerperfect/CppunitTest_writerperfect_wpftimport.mk writerperfect/qa

David Tardon dtardon at redhat.com
Thu Feb 16 16:13:04 UTC 2017


 writerperfect/CppunitTest_writerperfect_wpftimport.mk |    3 
 writerperfect/qa/unit/DrawImportTest.cxx              |  154 ------------------
 writerperfect/qa/unit/DrawingImportTest.cxx           |  154 ++++++++++++++++++
 writerperfect/qa/unit/ImpressImportTest.cxx           |  154 ------------------
 writerperfect/qa/unit/PresentationImportTest.cxx      |  154 ++++++++++++++++++
 writerperfect/qa/unit/SpreadsheetImportTest.cxx       |    2 
 writerperfect/qa/unit/WpftFilterFixture.cxx           |    7 
 writerperfect/qa/unit/WpftFilterFixture.hxx           |    1 
 8 files changed, 312 insertions(+), 317 deletions(-)

New commits:
commit 463f764aa0bcf4930ac914e6ed367d95338c65b4
Author: David Tardon <dtardon at redhat.com>
Date:   Thu Feb 16 17:09:01 2017 +0100

    enable the other tests
    
    Change-Id: I68a5435348a6a6362bc946c7eca18e29bd69724a

diff --git a/writerperfect/CppunitTest_writerperfect_wpftimport.mk b/writerperfect/CppunitTest_writerperfect_wpftimport.mk
index cb2c2c5..ed5187b 100644
--- a/writerperfect/CppunitTest_writerperfect_wpftimport.mk
+++ b/writerperfect/CppunitTest_writerperfect_wpftimport.mk
@@ -44,6 +44,9 @@ $(eval $(call gb_CppunitTest_use_rdbs,writerperfect_wpftimport,\
 $(eval $(call gb_CppunitTest_use_configuration,writerperfect_wpftimport))
 
 $(eval $(call gb_CppunitTest_add_exception_objects,writerperfect_wpftimport,\
+	writerperfect/qa/unit/DrawingImportTest \
+	writerperfect/qa/unit/PresentationImportTest \
+	writerperfect/qa/unit/SpreadsheetImportTest \
 	writerperfect/qa/unit/TextImportTest \
 	writerperfect/qa/unit/wpftimport \
 ))
commit 41414834157455555816050cb1e30b538d68792a
Author: David Tardon <dtardon at redhat.com>
Date:   Wed Feb 15 15:50:08 2017 +0100

    don't run terminate()
    
    AFAICS no other import test is doing it either.
    
    Change-Id: I8cbdc27fe60102067c6d09280b99a032ac44ba10

diff --git a/writerperfect/qa/unit/WpftFilterFixture.cxx b/writerperfect/qa/unit/WpftFilterFixture.cxx
index 106b28e..60708ce 100644
--- a/writerperfect/qa/unit/WpftFilterFixture.cxx
+++ b/writerperfect/qa/unit/WpftFilterFixture.cxx
@@ -34,13 +34,6 @@ void WpftFilterFixture::setUp()
     m_xTypeMap.set(m_xTypeDetection, uno::UNO_QUERY_THROW);
 }
 
-void WpftFilterFixture::tearDown()
-{
-    m_xDesktop->terminate();
-
-    ::test::BootstrapFixture::tearDown();
-}
-
 }
 }
 
diff --git a/writerperfect/qa/unit/WpftFilterFixture.hxx b/writerperfect/qa/unit/WpftFilterFixture.hxx
index fde79c2..14ad4ea 100644
--- a/writerperfect/qa/unit/WpftFilterFixture.hxx
+++ b/writerperfect/qa/unit/WpftFilterFixture.hxx
@@ -73,7 +73,6 @@ class WPFTQAHELPER_DLLPUBLIC WpftFilterFixture : public ::test::BootstrapFixture
 {
 public:
     virtual void setUp() override;
-    virtual void tearDown() override;
 
 protected:
     css::uno::Reference<css::frame::XDesktop2> m_xDesktop;
commit 63c7f2b81e42a862803298cc3baeda01d816a19c
Author: David Tardon <dtardon at redhat.com>
Date:   Thu Feb 16 16:49:47 2017 +0100

    fix copypasta
    
    Change-Id: Id3e33aec0a1c027d350408abb86a6a99da74ebb4

diff --git a/writerperfect/qa/unit/DrawingImportTest.cxx b/writerperfect/qa/unit/DrawingImportTest.cxx
index 8b548c8..433c9a4 100644
--- a/writerperfect/qa/unit/DrawingImportTest.cxx
+++ b/writerperfect/qa/unit/DrawingImportTest.cxx
@@ -56,7 +56,7 @@ bool DrawingImportFilter::doImportDocument(librevenge::RVNGInputStream &, OdgGen
 
 bool DrawingImportFilter::doDetectFormat(librevenge::RVNGInputStream &, rtl::OUString &rTypeName)
 {
-    rTypeName = "WpftDummyText";
+    rTypeName = "WpftDummyDrawing";
     return true;
 }
 
diff --git a/writerperfect/qa/unit/PresentationImportTest.cxx b/writerperfect/qa/unit/PresentationImportTest.cxx
index 091bc90..7c1154b 100644
--- a/writerperfect/qa/unit/PresentationImportTest.cxx
+++ b/writerperfect/qa/unit/PresentationImportTest.cxx
@@ -56,7 +56,7 @@ bool PresentationImportFilter::doImportDocument(librevenge::RVNGInputStream &, O
 
 bool PresentationImportFilter::doDetectFormat(librevenge::RVNGInputStream &, rtl::OUString &rTypeName)
 {
-    rTypeName = "WpftDummyText";
+    rTypeName = "WpftDummyPresentation";
     return true;
 }
 
diff --git a/writerperfect/qa/unit/SpreadsheetImportTest.cxx b/writerperfect/qa/unit/SpreadsheetImportTest.cxx
index d62e1e4..db78702 100644
--- a/writerperfect/qa/unit/SpreadsheetImportTest.cxx
+++ b/writerperfect/qa/unit/SpreadsheetImportTest.cxx
@@ -55,7 +55,7 @@ bool SpreadsheetImportFilter::doImportDocument(librevenge::RVNGInputStream &, Od
 
 bool SpreadsheetImportFilter::doDetectFormat(librevenge::RVNGInputStream &, rtl::OUString &rTypeName)
 {
-    rTypeName = "WpftDummyText";
+    rTypeName = "WpftDummySpreadsheet";
     return true;
 }
 
commit 0f1a863c7542a121b006cff6b4151847b2a2ff95
Author: David Tardon <dtardon at redhat.com>
Date:   Wed Feb 15 16:04:33 2017 +0100

    rename to match text and spreadsheet tests
    
    Change-Id: I614326cfe8ade8ea07822479cbc656db8e51c1b7

diff --git a/writerperfect/qa/unit/DrawImportTest.cxx b/writerperfect/qa/unit/DrawingImportTest.cxx
similarity index 78%
rename from writerperfect/qa/unit/DrawImportTest.cxx
rename to writerperfect/qa/unit/DrawingImportTest.cxx
index 2c3d49c..8b548c8 100644
--- a/writerperfect/qa/unit/DrawImportTest.cxx
+++ b/writerperfect/qa/unit/DrawingImportTest.cxx
@@ -30,10 +30,10 @@ namespace
 
 namespace uno = css::uno;
 
-class DrawImportFilter : public writerperfect::ImportFilter<OdgGenerator>
+class DrawingImportFilter : public writerperfect::ImportFilter<OdgGenerator>
 {
 public:
-    explicit DrawImportFilter(const uno::Reference< uno::XComponentContext > &rxContext)
+    explicit DrawingImportFilter(const uno::Reference< uno::XComponentContext > &rxContext)
         : writerperfect::ImportFilter<OdgGenerator>(rxContext) {}
 
     // XServiceInfo
@@ -48,35 +48,35 @@ private:
     static void generate(librevenge::RVNGDrawingInterface &rDocument);
 };
 
-bool DrawImportFilter::doImportDocument(librevenge::RVNGInputStream &, OdgGenerator &rGenerator, utl::MediaDescriptor &)
+bool DrawingImportFilter::doImportDocument(librevenge::RVNGInputStream &, OdgGenerator &rGenerator, utl::MediaDescriptor &)
 {
-    DrawImportFilter::generate(rGenerator);
+    DrawingImportFilter::generate(rGenerator);
     return true;
 }
 
-bool DrawImportFilter::doDetectFormat(librevenge::RVNGInputStream &, rtl::OUString &rTypeName)
+bool DrawingImportFilter::doDetectFormat(librevenge::RVNGInputStream &, rtl::OUString &rTypeName)
 {
     rTypeName = "WpftDummyText";
     return true;
 }
 
 // XServiceInfo
-rtl::OUString SAL_CALL DrawImportFilter::getImplementationName()
+rtl::OUString SAL_CALL DrawingImportFilter::getImplementationName()
 {
-    return OUString("org.libreoffice.comp.Wpft.QA.DrawImportFilter");
+    return OUString("org.libreoffice.comp.Wpft.QA.DrawingImportFilter");
 }
 
-sal_Bool SAL_CALL DrawImportFilter::supportsService(const rtl::OUString &rServiceName)
+sal_Bool SAL_CALL DrawingImportFilter::supportsService(const rtl::OUString &rServiceName)
 {
     return cppu::supportsService(this, rServiceName);
 }
 
-uno::Sequence< rtl::OUString > SAL_CALL DrawImportFilter::getSupportedServiceNames()
+uno::Sequence< rtl::OUString > SAL_CALL DrawingImportFilter::getSupportedServiceNames()
 {
     return {"com.sun.star.document.ImportFilter", "com.sun.star.document.ExtendedTypeDetection"};
 }
 
-void DrawImportFilter::generate(librevenge::RVNGDrawingInterface &rDocument)
+void DrawingImportFilter::generate(librevenge::RVNGDrawingInterface &rDocument)
 {
     using namespace librevenge;
 
@@ -106,21 +106,21 @@ void DrawImportFilter::generate(librevenge::RVNGDrawingInterface &rDocument)
 namespace
 {
 
-class DrawImportTest : public writerperfect::test::WpftFilterFixture
+class DrawingImportTest : public writerperfect::test::WpftFilterFixture
 {
 public:
     void test();
 
-    CPPUNIT_TEST_SUITE(DrawImportTest);
+    CPPUNIT_TEST_SUITE(DrawingImportTest);
     CPPUNIT_TEST(test);
     CPPUNIT_TEST_SUITE_END();
 };
 
-void DrawImportTest::test()
+void DrawingImportTest::test()
 {
     using namespace css;
 
-    rtl::Reference<DrawImportFilter> xFilter{new DrawImportFilter(m_xContext)};
+    rtl::Reference<DrawingImportFilter> xFilter{new DrawingImportFilter(m_xContext)};
     writerperfect::test::WpftLoader aLoader(createDummyInput(), xFilter.get(), "private:factory/sdraw", m_xDesktop, m_xContext);
 
     uno::Reference<drawing::XDrawPagesSupplier> xDoc(aLoader.getDocument(), uno::UNO_QUERY);
@@ -147,7 +147,7 @@ void DrawImportTest::test()
     CPPUNIT_ASSERT_EQUAL(rtl::OUString("My hovercraft is full of eels."), xText->getString());
 }
 
-CPPUNIT_TEST_SUITE_REGISTRATION(DrawImportTest);
+CPPUNIT_TEST_SUITE_REGISTRATION(DrawingImportTest);
 
 }
 
diff --git a/writerperfect/qa/unit/ImpressImportTest.cxx b/writerperfect/qa/unit/PresentationImportTest.cxx
similarity index 77%
rename from writerperfect/qa/unit/ImpressImportTest.cxx
rename to writerperfect/qa/unit/PresentationImportTest.cxx
index bdfe533..091bc90 100644
--- a/writerperfect/qa/unit/ImpressImportTest.cxx
+++ b/writerperfect/qa/unit/PresentationImportTest.cxx
@@ -30,10 +30,10 @@ namespace
 
 namespace uno = css::uno;
 
-class ImpressImportFilter : public writerperfect::ImportFilter<OdpGenerator>
+class PresentationImportFilter : public writerperfect::ImportFilter<OdpGenerator>
 {
 public:
-    explicit ImpressImportFilter(const uno::Reference< uno::XComponentContext > &rxContext)
+    explicit PresentationImportFilter(const uno::Reference< uno::XComponentContext > &rxContext)
         : writerperfect::ImportFilter<OdpGenerator>(rxContext) {}
 
     // XServiceInfo
@@ -48,35 +48,35 @@ private:
     static void generate(librevenge::RVNGPresentationInterface &rDocument);
 };
 
-bool ImpressImportFilter::doImportDocument(librevenge::RVNGInputStream &, OdpGenerator &rGenerator, utl::MediaDescriptor &)
+bool PresentationImportFilter::doImportDocument(librevenge::RVNGInputStream &, OdpGenerator &rGenerator, utl::MediaDescriptor &)
 {
-    ImpressImportFilter::generate(rGenerator);
+    PresentationImportFilter::generate(rGenerator);
     return true;
 }
 
-bool ImpressImportFilter::doDetectFormat(librevenge::RVNGInputStream &, rtl::OUString &rTypeName)
+bool PresentationImportFilter::doDetectFormat(librevenge::RVNGInputStream &, rtl::OUString &rTypeName)
 {
     rTypeName = "WpftDummyText";
     return true;
 }
 
 // XServiceInfo
-rtl::OUString SAL_CALL ImpressImportFilter::getImplementationName()
+rtl::OUString SAL_CALL PresentationImportFilter::getImplementationName()
 {
-    return OUString("org.libreoffice.comp.Wpft.QA.ImpressImportFilter");
+    return OUString("org.libreoffice.comp.Wpft.QA.PresentationImportFilter");
 }
 
-sal_Bool SAL_CALL ImpressImportFilter::supportsService(const rtl::OUString &rServiceName)
+sal_Bool SAL_CALL PresentationImportFilter::supportsService(const rtl::OUString &rServiceName)
 {
     return cppu::supportsService(this, rServiceName);
 }
 
-uno::Sequence< rtl::OUString > SAL_CALL ImpressImportFilter::getSupportedServiceNames()
+uno::Sequence< rtl::OUString > SAL_CALL PresentationImportFilter::getSupportedServiceNames()
 {
     return {"com.sun.star.document.ImportFilter", "com.sun.star.document.ExtendedTypeDetection"};
 }
 
-void ImpressImportFilter::generate(librevenge::RVNGPresentationInterface &rDocument)
+void PresentationImportFilter::generate(librevenge::RVNGPresentationInterface &rDocument)
 {
     using namespace librevenge;
 
@@ -106,21 +106,21 @@ void ImpressImportFilter::generate(librevenge::RVNGPresentationInterface &rDocum
 namespace
 {
 
-class ImpressImportTest : public writerperfect::test::WpftFilterFixture
+class PresentationImportTest : public writerperfect::test::WpftFilterFixture
 {
 public:
     void test();
 
-    CPPUNIT_TEST_SUITE(ImpressImportTest);
+    CPPUNIT_TEST_SUITE(PresentationImportTest);
     CPPUNIT_TEST(test);
     CPPUNIT_TEST_SUITE_END();
 };
 
-void ImpressImportTest::test()
+void PresentationImportTest::test()
 {
     using namespace css;
 
-    rtl::Reference<ImpressImportFilter> xFilter{new ImpressImportFilter(m_xContext)};
+    rtl::Reference<PresentationImportFilter> xFilter{new PresentationImportFilter(m_xContext)};
     writerperfect::test::WpftLoader aLoader(createDummyInput(), xFilter.get(), "private:factory/simpress", m_xDesktop, m_xContext);
 
     uno::Reference<drawing::XDrawPagesSupplier> xDoc(aLoader.getDocument(), uno::UNO_QUERY);
@@ -147,7 +147,7 @@ void ImpressImportTest::test()
     CPPUNIT_ASSERT_EQUAL(rtl::OUString("My hovercraft is full of eels."), xText->getString());
 }
 
-CPPUNIT_TEST_SUITE_REGISTRATION(ImpressImportTest);
+CPPUNIT_TEST_SUITE_REGISTRATION(PresentationImportTest);
 
 }
 
commit fba9c59fec21d9f21d5a04a9e1a38f6bcc9d5705
Author: David Tardon <dtardon at redhat.com>
Date:   Wed Feb 15 16:02:47 2017 +0100

    fix factory URL
    
    Change-Id: I476b89d70510e786b116ee11ddd68916683945b8

diff --git a/writerperfect/qa/unit/ImpressImportTest.cxx b/writerperfect/qa/unit/ImpressImportTest.cxx
index c6a128c..bdfe533 100644
--- a/writerperfect/qa/unit/ImpressImportTest.cxx
+++ b/writerperfect/qa/unit/ImpressImportTest.cxx
@@ -121,7 +121,7 @@ void ImpressImportTest::test()
     using namespace css;
 
     rtl::Reference<ImpressImportFilter> xFilter{new ImpressImportFilter(m_xContext)};
-    writerperfect::test::WpftLoader aLoader(createDummyInput(), xFilter.get(), "private:factory/sdraw", m_xDesktop, m_xContext);
+    writerperfect::test::WpftLoader aLoader(createDummyInput(), xFilter.get(), "private:factory/simpress", m_xDesktop, m_xContext);
 
     uno::Reference<drawing::XDrawPagesSupplier> xDoc(aLoader.getDocument(), uno::UNO_QUERY);
     CPPUNIT_ASSERT(xDoc.is());


More information about the Libreoffice-commits mailing list