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

Jens Carl (via logerrit) logerrit at kemper.freedesktop.org
Wed May 1 23:20:16 UTC 2019


 include/test/util/xsearchdescriptor.hxx                         |   33 +++++++++
 qadevOOo/objdsc/sc/com.sun.star.comp.office.ScCellSearchObj.csv |    2 
 sc/qa/extras/sccellsearchobj.cxx                                |    8 +-
 test/Library_subsequenttest.mk                                  |    1 
 test/source/util/xsearchdescriptor.cxx                          |   36 ++++++++++
 5 files changed, 77 insertions(+), 3 deletions(-)

New commits:
commit 976bb31199baf8ded562323e35626c61ef5bffbe
Author:     Jens Carl <j.carl43 at gmx.de>
AuthorDate: Wed May 1 03:55:35 2019 +0000
Commit:     Jens Carl <j.carl43 at gmx.de>
CommitDate: Thu May 2 01:19:34 2019 +0200

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

diff --git a/include/test/util/xsearchdescriptor.hxx b/include/test/util/xsearchdescriptor.hxx
new file mode 100644
index 000000000000..1bad973753db
--- /dev/null
+++ b/include/test/util/xsearchdescriptor.hxx
@@ -0,0 +1,33 @@
+/* -*- 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/.
+ */
+
+#pragma once
+
+#include <com/sun/star/uno/XInterface.hpp>
+
+#include <com/sun/star/uno/Reference.hxx>
+
+#include <test/testdllapi.hxx>
+
+namespace apitest
+{
+class OOO_DLLPUBLIC_TEST XSearchDescriptor
+{
+public:
+    virtual css::uno::Reference<css::uno::XInterface> init() = 0;
+
+    void testGetSetSearchString();
+
+protected:
+    ~XSearchDescriptor() {}
+};
+
+} // namespace apitest
+
+/* 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.ScCellSearchObj.csv b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScCellSearchObj.csv
index 8f8a0add5ae6..04f296d22cbf 100644
--- a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScCellSearchObj.csv
+++ b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScCellSearchObj.csv
@@ -1,5 +1,3 @@
-"ScCellSearchObj";"com::sun::star::util::XSearchDescriptor";"getSearchString()"
-"ScCellSearchObj";"com::sun::star::util::XSearchDescriptor";"setSearchString()"
 "ScCellSearchObj";"com::sun::star::util::SearchDescriptor";"SearchBackwards"
 "ScCellSearchObj";"com::sun::star::util::SearchDescriptor";"SearchCaseSensitive"
 "ScCellSearchObj";"com::sun::star::util::SearchDescriptor";"SearchWords"
diff --git a/sc/qa/extras/sccellsearchobj.cxx b/sc/qa/extras/sccellsearchobj.cxx
index 21ece504221b..0dfb94a8c245 100644
--- a/sc/qa/extras/sccellsearchobj.cxx
+++ b/sc/qa/extras/sccellsearchobj.cxx
@@ -9,6 +9,7 @@
 
 #include <test/calc_unoapi_test.hxx>
 #include <test/beans/xpropertyset.hxx>
+#include <test/util/xsearchdescriptor.hxx>
 
 #include <com/sun/star/container/XIndexAccess.hpp>
 #include <com/sun/star/lang/XComponent.hpp>
@@ -24,7 +25,9 @@ using namespace css;
 
 namespace sc_apitest
 {
-class ScCellSearchObj : public CalcUnoApiTest, public apitest::XPropertySet
+class ScCellSearchObj : public CalcUnoApiTest,
+                        public apitest::XPropertySet,
+                        public apitest::XSearchDescriptor
 {
 public:
     ScCellSearchObj();
@@ -42,6 +45,9 @@ public:
     CPPUNIT_TEST(testPropertyChangeListener);
     CPPUNIT_TEST(testVetoableChangeListener);
 
+    // XSearchDescriptor
+    CPPUNIT_TEST(testGetSetSearchString);
+
     CPPUNIT_TEST_SUITE_END();
 
 private:
diff --git a/test/Library_subsequenttest.mk b/test/Library_subsequenttest.mk
index 95341a5f91f5..2d8a876d6a95 100644
--- a/test/Library_subsequenttest.mk
+++ b/test/Library_subsequenttest.mk
@@ -191,6 +191,7 @@ $(eval $(call gb_Library_add_exception_objects,subsequenttest,\
 	test/source/util/xrefreshable \
 	test/source/util/xreplaceable \
 	test/source/util/xsearchable \
+	test/source/util/xsearchdescriptor \
 	test/source/view/xcontrolaccess \
 	test/source/view/xformlayeraccess \
 ))
diff --git a/test/source/util/xsearchdescriptor.cxx b/test/source/util/xsearchdescriptor.cxx
new file mode 100644
index 000000000000..b42ed7f90a44
--- /dev/null
+++ b/test/source/util/xsearchdescriptor.cxx
@@ -0,0 +1,36 @@
+/* -*- 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/util/xsearchdescriptor.hxx>
+
+#include <com/sun/star/util/XSearchDescriptor.hpp>
+
+#include <com/sun/star/uno/Reference.hxx>
+
+#include <cppunit/extensions/HelperMacros.h>
+
+using namespace css;
+
+namespace apitest
+{
+void XSearchDescriptor::testGetSetSearchString()
+{
+    uno::Reference<util::XSearchDescriptor> xDS(init(), uno::UNO_QUERY_THROW);
+    const OUString aSearchStringOld = xDS->getSearchString();
+    CPPUNIT_ASSERT(aSearchStringOld.isEmpty());
+
+    xDS->setSearchString("_XSearchDescriptor");
+    const OUString aSearchStringNew = xDS->getSearchString();
+    CPPUNIT_ASSERT_EQUAL(OUString("_XSearchDescriptor"), aSearchStringNew);
+    CPPUNIT_ASSERT(aSearchStringOld != aSearchStringNew);
+}
+
+} // 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