Kaydet (Commit) 6f763a3f authored tarafından Jens Carl's avatar Jens Carl

tdf#45904 Move SearchDescriptor Java tests to C++

Move SearchDescriptor Java tests to C++ for ScCellSearchObj.

Change-Id: I3c9ffbfc80c7fdc39d0e67fe8aae12605a8d04f5
Reviewed-on: https://gerrit.libreoffice.org/71644
Tested-by: Jenkins
Reviewed-by: 's avatarJens Carl <j.carl43@gmx.de>
üst 976bb311
/* -*- 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 SearchDescriptor
{
public:
virtual css::uno::Reference<css::uno::XInterface> init() = 0;
void testSearchDescriptorProperties();
protected:
~SearchDescriptor() {}
};
} // namespace apitest
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
"ScCellSearchObj";"com::sun::star::util::SearchDescriptor";"SearchBackwards"
"ScCellSearchObj";"com::sun::star::util::SearchDescriptor";"SearchCaseSensitive"
"ScCellSearchObj";"com::sun::star::util::SearchDescriptor";"SearchWords"
"ScCellSearchObj";"com::sun::star::util::SearchDescriptor";"SearchRegularExpression"
"ScCellSearchObj";"com::sun::star::util::SearchDescriptor";"SearchStyles"
"ScCellSearchObj";"com::sun::star::util::SearchDescriptor";"SearchSimilarity"
"ScCellSearchObj";"com::sun::star::util::SearchDescriptor";"SearchSimilarityRelax"
"ScCellSearchObj";"com::sun::star::util::SearchDescriptor";"SearchSimilarityRemove"
"ScCellSearchObj";"com::sun::star::util::SearchDescriptor";"SearchSimilarityAdd"
"ScCellSearchObj";"com::sun::star::util::SearchDescriptor";"SearchSimilarityExchange"
"ScCellSearchObj";"com::sun::star::util::XReplaceDescriptor";"getReplaceString()"
"ScCellSearchObj";"com::sun::star::util::XReplaceDescriptor";"setReplaceString()"
......@@ -9,6 +9,7 @@
#include <test/calc_unoapi_test.hxx>
#include <test/beans/xpropertyset.hxx>
#include <test/util/searchdescriptor.hxx>
#include <test/util/xsearchdescriptor.hxx>
#include <com/sun/star/container/XIndexAccess.hpp>
......@@ -26,6 +27,7 @@ using namespace css;
namespace sc_apitest
{
class ScCellSearchObj : public CalcUnoApiTest,
public apitest::SearchDescriptor,
public apitest::XPropertySet,
public apitest::XSearchDescriptor
{
......@@ -38,6 +40,9 @@ public:
CPPUNIT_TEST_SUITE(ScCellSearchObj);
// SearchDescriptor
CPPUNIT_TEST(testSearchDescriptorProperties);
// XPropertSet
CPPUNIT_TEST(testGetPropertySetInfo);
CPPUNIT_TEST(testGetPropertyValue);
......
......@@ -186,6 +186,7 @@ $(eval $(call gb_Library_add_exception_objects,subsequenttest,\
test/source/text/textprintersettings \
test/source/text/textsettings \
test/source/text/textdocumentindex \
test/source/util/searchdescriptor \
test/source/util/xindent \
test/source/util/xmergeable \
test/source/util/xrefreshable \
......
/* -*- 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/searchdescriptor.hxx>
#include <test/unoapi_property_testers.hxx>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/uno/Reference.hxx>
#include <cppunit/extensions/HelperMacros.h>
using namespace css;
namespace apitest
{
void SearchDescriptor::testSearchDescriptorProperties()
{
uno::Reference<beans::XPropertySet> xPS(init(), uno::UNO_QUERY_THROW);
OUString aPropName;
aPropName = "SearchBackwards";
testBooleanProperty(xPS, aPropName);
aPropName = "SearchCaseSensitive";
testBooleanProperty(xPS, aPropName);
aPropName = "SearchWords";
testBooleanProperty(xPS, aPropName);
aPropName = "SearchRegularExpression";
testBooleanProperty(xPS, aPropName);
aPropName = "SearchStyles";
testBooleanProperty(xPS, aPropName);
aPropName = "SearchSimilarity";
testBooleanProperty(xPS, aPropName);
aPropName = "SearchSimilarityRelax";
testBooleanProperty(xPS, aPropName);
aPropName = "SearchSimilarityRemove";
testShortProperty(xPS, aPropName);
aPropName = "SearchSimilarityAdd";
testShortProperty(xPS, aPropName);
aPropName = "SearchSimilarityExchange";
testShortProperty(xPS, aPropName);
aPropName = "SearchWildcard";
testBooleanOptionalProperty(xPS, aPropName);
}
} // 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