[Libreoffice-commits] core.git: include/test qadevOOo/objdsc sc/qa test/Library_subsequenttest.mk test/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Jan 22 06:18:40 UTC 2019


 include/test/drawing/xdrawpages.hxx                            |   37 +++++++
 qadevOOo/objdsc/sc/com.sun.star.comp.office.ScDrawPagesObj.csv |    2 
 sc/qa/extras/scdrawpagesobj.cxx                                |    6 +
 test/Library_subsequenttest.mk                                 |    3 
 test/source/drawing/xdrawpages.cxx                             |   49 ++++++++++
 5 files changed, 94 insertions(+), 3 deletions(-)

New commits:
commit fd8a724d22c92e3ebef4a3da126baaac3d3bde79
Author:     Jens Carl <j.carl43 at gmx.de>
AuthorDate: Tue Jan 22 04:33:17 2019 +0000
Commit:     Jens Carl <j.carl43 at gmx.de>
CommitDate: Tue Jan 22 07:18:17 2019 +0100

    tdf#45904 Move XDrawPages Java tests to C++
    
    Move XDrawPages Java tests to C++ for ScDrawPagesObj.
    
    Change-Id: I0e48aae9caadf0d9834c4f973095ba9d10435fdc
    Reviewed-on: https://gerrit.libreoffice.org/66712
    Tested-by: Jenkins
    Reviewed-by: Jens Carl <j.carl43 at gmx.de>

diff --git a/include/test/drawing/xdrawpages.hxx b/include/test/drawing/xdrawpages.hxx
new file mode 100644
index 000000000000..b6430df6026b
--- /dev/null
+++ b/include/test/drawing/xdrawpages.hxx
@@ -0,0 +1,37 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
+/*
+ * 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/.
+ */
+
+#ifndef INCLUDED_TEST_DRAWING_XDRAWPAGES_HXX
+#define INCLUDED_TEST_DRAWING_XDRAWPAGES_HXX
+
+#include <com/sun/star/uno/XInterface.hpp>
+
+#include <com/sun/star/uno/Reference.hxx>
+
+#include <test/testdllapi.hxx>
+
+namespace apitest
+{
+class OOO_DLLPUBLIC_TEST XDrawPages
+{
+public:
+    virtual css::uno::Reference<css::uno::XInterface> init() = 0;
+
+    virtual void testInsertNewByIndex();
+    virtual void testRemove();
+
+protected:
+    ~XDrawPages() {}
+};
+
+} // namespace apitest
+
+#endif // INCLUDED_TEST_DRAWING_XDRAWPAGES_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScDrawPagesObj.csv b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScDrawPagesObj.csv
index 11ce9966a95a..844f27507b3e 100644
--- a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScDrawPagesObj.csv
+++ b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScDrawPagesObj.csv
@@ -1,4 +1,2 @@
-"ScDrawPagesObj";"com::sun::star::drawing::XDrawPages";"insertNewByIndex()"
-"ScDrawPagesObj";"com::sun::star::drawing::XDrawPages";"remove()"
 "ScDrawPagesObj";"com::sun::star::drawing::XDrawPageExpander#optional";"expand()"
 "ScDrawPagesObj";"com::sun::star::drawing::XDrawPageSummarizer#optional";"summarize()"
diff --git a/sc/qa/extras/scdrawpagesobj.cxx b/sc/qa/extras/scdrawpagesobj.cxx
index 9a40d417791e..16ba202fb19b 100644
--- a/sc/qa/extras/scdrawpagesobj.cxx
+++ b/sc/qa/extras/scdrawpagesobj.cxx
@@ -10,6 +10,7 @@
 #include <test/calc_unoapi_test.hxx>
 #include <test/container/xelementaccess.hxx>
 #include <test/container/xindexaccess.hxx>
+#include <test/drawing/xdrawpages.hxx>
 
 #include <com/sun/star/drawing/XDrawPage.hpp>
 #include <com/sun/star/drawing/XDrawPages.hpp>
@@ -28,6 +29,7 @@ using namespace css::uno;
 namespace sc_apitest
 {
 class ScDrawPagesObj : public CalcUnoApiTest,
+                       public apitest::XDrawPages,
                        public apitest::XElementAccess,
                        public apitest::XIndexAccess
 {
@@ -40,6 +42,10 @@ public:
 
     CPPUNIT_TEST_SUITE(ScDrawPagesObj);
 
+    // XDrawPages
+    CPPUNIT_TEST(testInsertNewByIndex);
+    CPPUNIT_TEST(testRemove);
+
     // XElementAccess
     CPPUNIT_TEST(testGetElementType);
     CPPUNIT_TEST(testHasElements);
diff --git a/test/Library_subsequenttest.mk b/test/Library_subsequenttest.mk
index 43c4593efaca..80e8f0be7952 100644
--- a/test/Library_subsequenttest.mk
+++ b/test/Library_subsequenttest.mk
@@ -51,8 +51,9 @@ $(eval $(call gb_Library_add_exception_objects,subsequenttest,\
 	test/source/container/xnamecontainer \
 	test/source/container/xnamed \
 	test/source/container/xnamereplace \
-	test/source/drawing/captionshape \
 	test/source/document/xlinktargetsupplier \
+	test/source/drawing/captionshape \
+	test/source/drawing/xdrawpages \
 	test/source/lang/xserviceinfo \
 	test/source/sheet/cellarealink \
 	test/source/sheet/cellproperties \
diff --git a/test/source/drawing/xdrawpages.cxx b/test/source/drawing/xdrawpages.cxx
new file mode 100644
index 000000000000..5fe89abfb348
--- /dev/null
+++ b/test/source/drawing/xdrawpages.cxx
@@ -0,0 +1,49 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
+/*
+ * 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 <test/drawing/xdrawpages.hxx>
+
+#include <com/sun/star/drawing/XDrawPage.hpp>
+#include <com/sun/star/drawing/XDrawPages.hpp>
+#include <com/sun/star/uno/XInterface.hpp>
+
+#include <com/sun/star/uno/Reference.hxx>
+
+#include <cppunit/extensions/HelperMacros.h>
+
+using namespace css;
+using namespace css::uno;
+
+namespace apitest
+{
+void XDrawPages::testInsertNewByIndex()
+{
+    uno::Reference<drawing::XDrawPages> xDrawPages(init(), uno::UNO_QUERY_THROW);
+    const sal_Int32 nCount = xDrawPages->getCount();
+
+    uno::Reference<drawing::XDrawPage> xDP(xDrawPages->insertNewByIndex(0), uno::UNO_QUERY_THROW);
+    CPPUNIT_ASSERT(xDP.is());
+    CPPUNIT_ASSERT_EQUAL(nCount + 1, xDrawPages->getCount());
+}
+
+void XDrawPages::testRemove()
+{
+    uno::Reference<drawing::XDrawPages> xDrawPages(init(), uno::UNO_QUERY_THROW);
+    const sal_Int32 nCount = xDrawPages->getCount();
+
+    uno::Reference<drawing::XDrawPage> xDP(xDrawPages->insertNewByIndex(0), uno::UNO_QUERY_THROW);
+    CPPUNIT_ASSERT(xDP.is());
+
+    xDrawPages->remove(xDP);
+    CPPUNIT_ASSERT_EQUAL(nCount, xDrawPages->getCount());
+}
+
+} // namespace apitest
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */


More information about the Libreoffice-commits mailing list