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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Sun Sep 9 23:53:41 UTC 2018


 include/test/container/xchild.hxx                               |   34 ++++++++
 qadevOOo/objdsc/sc/com.sun.star.comp.office.ScAnnotationObj.csv |    2 
 sc/qa/extras/scannotationobj.cxx                                |    8 +-
 test/Library_subsequenttest.mk                                  |    1 
 test/source/container/xchild.cxx                                |   40 ++++++++++
 5 files changed, 82 insertions(+), 3 deletions(-)

New commits:
commit 8e12e517473dcdfbfd04dc5192c841aff011f609
Author:     Rahul Gurung <gurungrahul2 at gmail.com>
AuthorDate: Fri Sep 7 17:15:55 2018 +0530
Commit:     Markus Mohrhard <markus.mohrhard at googlemail.com>
CommitDate: Mon Sep 10 01:53:20 2018 +0200

    tdf#45904 Move _XChild Java tests to C++
    
    Change-Id: Idaf883eadb95792bdb333dea487be084b1722194
    Reviewed-on: https://gerrit.libreoffice.org/60146
    Tested-by: Jenkins
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>

diff --git a/include/test/container/xchild.hxx b/include/test/container/xchild.hxx
new file mode 100644
index 000000000000..2128b40390e3
--- /dev/null
+++ b/include/test/container/xchild.hxx
@@ -0,0 +1,34 @@
+/* -*- 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_TABLE_XCHILD_HXX
+#define INCLUDED_TEST_TABLE_XCHILD_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 XChild
+{
+public:
+    virtual css::uno::Reference<css::uno::XInterface> init() = 0;
+
+    void testGetSetParent();
+
+protected:
+    ~XChild() {}
+};
+}
+
+#endif // INCLUDED_TEST_TABLE_XCHILD_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.ScAnnotationObj.csv b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScAnnotationObj.csv
index 5bfb8b6e1270..fe1b71e1b4fb 100644
--- a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScAnnotationObj.csv
+++ b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScAnnotationObj.csv
@@ -7,5 +7,3 @@
 "ScAnnotationObj";"com::sun::star::text::XTextRange";"getEnd()"
 "ScAnnotationObj";"com::sun::star::text::XTextRange";"getString()"
 "ScAnnotationObj";"com::sun::star::text::XTextRange";"setString()"
-"ScAnnotationObj";"com::sun::star::container::XChild";"getParent()"
-"ScAnnotationObj";"com::sun::star::container::XChild";"setParent()"
diff --git a/sc/qa/extras/scannotationobj.cxx b/sc/qa/extras/scannotationobj.cxx
index 7d6d10890c12..bbd0f60493fb 100644
--- a/sc/qa/extras/scannotationobj.cxx
+++ b/sc/qa/extras/scannotationobj.cxx
@@ -8,6 +8,7 @@
  */
 
 #include <test/calc_unoapi_test.hxx>
+#include <test/container/xchild.hxx>
 #include <test/sheet/xsheetannotation.hxx>
 #include <test/sheet/xsheetannotationshapesupplier.hxx>
 
@@ -26,7 +27,9 @@ using namespace css::uno;
 
 namespace sc_apitest {
 
-class ScAnnontationObj : public CalcUnoApiTest, public apitest::XSheetAnnotation, public apitest::XSheetAnnotationShapeSupplier
+class ScAnnontationObj : public CalcUnoApiTest, public apitest::XSheetAnnotation,
+                                                public apitest::XSheetAnnotationShapeSupplier,
+                                                public apitest::XChild
 {
 public:
     ScAnnontationObj();
@@ -39,6 +42,9 @@ public:
 
     CPPUNIT_TEST_SUITE(ScAnnontationObj);
 
+    // XChild
+    CPPUNIT_TEST(testGetSetParent);
+
     // XSheetAnnotation
     CPPUNIT_TEST(testGetPosition);
     CPPUNIT_TEST(testGetAuthor);
diff --git a/test/Library_subsequenttest.mk b/test/Library_subsequenttest.mk
index fce5a9033314..f916567160ce 100644
--- a/test/Library_subsequenttest.mk
+++ b/test/Library_subsequenttest.mk
@@ -41,6 +41,7 @@ $(eval $(call gb_Library_add_exception_objects,subsequenttest,\
 	test/source/unoapi_test \
 	test/source/calc_unoapi_test \
 	test/source/beans/xpropertyset \
+	test/source/container/xchild \
 	test/source/container/xelementaccess \
 	test/source/container/xindexaccess \
 	test/source/container/xnamecontainer \
diff --git a/test/source/container/xchild.cxx b/test/source/container/xchild.cxx
new file mode 100644
index 000000000000..45627ed03de0
--- /dev/null
+++ b/test/source/container/xchild.cxx
@@ -0,0 +1,40 @@
+/* -*- 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/cppunitasserthelper.hxx>
+#include <test/container/xchild.hxx>
+
+#include <com/sun/star/container/XChild.hpp>
+#include <com/sun/star/container/XNamed.hpp>
+#include <com/sun/star/uno/XInterface.hpp>
+
+#include <com/sun/star/uno/Reference.hxx>
+
+#include <cppunit/extensions/HelperMacros.h>
+
+using namespace com::sun::star;
+using namespace com::sun::star::uno;
+
+namespace apitest
+{
+void XChild::testGetSetParent()
+{
+    uno::Reference<container::XChild> xChild(init(), UNO_QUERY_THROW);
+    uno::Reference<uno::XInterface> xInterface(xChild, UNO_QUERY_THROW);
+    xInterface = xChild->getParent();
+
+    CPPUNIT_ASSERT_MESSAGE("Successfully able to Get Parent", xInterface);
+
+    xChild->setParent(xInterface);
+
+    CPPUNIT_ASSERT_MESSAGE("Successfully able to Set Parent", xChild);
+}
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */


More information about the Libreoffice-commits mailing list