Kaydet (Commit) 976bb311 authored tarafından Jens Carl's avatar Jens Carl

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: 's avatarJens Carl <j.carl43@gmx.de>
üst 2aed7abb
/* -*- 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: */
"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"
......
......@@ -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:
......
......@@ -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 \
))
......
/* -*- 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: */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment