From 8e12e517473dcdfbfd04dc5192c841aff011f609 Mon Sep 17 00:00:00 2001 From: Rahul Gurung Date: Fri, 7 Sep 2018 17:15:55 +0530 Subject: 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 --- include/test/container/xchild.hxx | 34 ++++++++++++++++++ .../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(-) create mode 100644 include/test/container/xchild.hxx create mode 100644 test/source/container/xchild.cxx 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 +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XChild +{ +public: + virtual css::uno::Reference 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 +#include #include #include @@ -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 +#include + +#include +#include +#include + +#include + +#include + +using namespace com::sun::star; +using namespace com::sun::star::uno; + +namespace apitest +{ +void XChild::testGetSetParent() +{ + uno::Reference xChild(init(), UNO_QUERY_THROW); + uno::Reference 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: */ -- cgit