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

Add XSheetFilterDescriptor2 and XSheetFilterDescriptor3 tests

Add XSheetFilterDescriptor2 and XSheetFilterDescriptor3 tests
to ScFilterDescriptorBase.

Change-Id: I932560c42d9c5f3077f47f116f6ae011f6aea79e
Reviewed-on: https://gerrit.libreoffice.org/67097
Tested-by: Jenkins
Reviewed-by: 's avatarJens Carl <j.carl43@gmx.de>
üst 37f4c73a
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* -*- 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 file is part of the LibreOffice project.
* *
...@@ -10,18 +10,17 @@ ...@@ -10,18 +10,17 @@
#ifndef INCLUDED_TEST_SHEET_XSHEETFILTERDESCRIPTOR_HXX #ifndef INCLUDED_TEST_SHEET_XSHEETFILTERDESCRIPTOR_HXX
#define INCLUDED_TEST_SHEET_XSHEETFILTERDESCRIPTOR_HXX #define INCLUDED_TEST_SHEET_XSHEETFILTERDESCRIPTOR_HXX
#include <com/sun/star/uno/XInterface.hpp> #include <com/sun/star/uno/XInterface.hpp>
#include <com/sun/star/uno/Reference.hxx> #include <com/sun/star/uno/Reference.hxx>
#include <test/testdllapi.hxx> #include <test/testdllapi.hxx>
namespace apitest { namespace apitest
{
class OOO_DLLPUBLIC_TEST XSheetFilterDescriptor class OOO_DLLPUBLIC_TEST XSheetFilterDescriptor
{ {
public: public:
virtual css::uno::Reference< css::uno::XInterface > init() =0; virtual css::uno::Reference<css::uno::XInterface> init() = 0;
void testGetSetFilterFields(); void testGetSetFilterFields();
...@@ -29,8 +28,8 @@ protected: ...@@ -29,8 +28,8 @@ protected:
~XSheetFilterDescriptor() {} ~XSheetFilterDescriptor() {}
}; };
} } // namespace apitest
#endif // INCLUDED_TEST_SHEET_XSHEETFILTERDESCRIPTOR_HXX #endif // INCLUDED_TEST_SHEET_XSHEETFILTERDESCRIPTOR_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
/* -*- 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_SHEET_XSHEETFILTERDESCRIPTOR2_HXX
#define INCLUDED_TEST_SHEET_XSHEETFILTERDESCRIPTOR2_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 XSheetFilterDescriptor2
{
public:
virtual css::uno::Reference<css::uno::XInterface> init() = 0;
void testGetSetFilterFields2();
protected:
~XSheetFilterDescriptor2() {}
};
} // namespace apitest
#endif // INCLUDED_TEST_SHEET_XSHEETFILTERDESCRIPTOR2_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
/* -*- 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_SHEET_XSHEETFILTERDESCRIPTOR3_HXX
#define INCLUDED_TEST_SHEET_XSHEETFILTERDESCRIPTOR3_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 XSheetFilterDescriptor3
{
public:
virtual css::uno::Reference<css::uno::XInterface> init() = 0;
void testGetSetFilterFields3();
protected:
~XSheetFilterDescriptor3() {}
};
} // namespace apitest
#endif // INCLUDED_TEST_SHEET_XSHEETFILTERDESCRIPTOR3_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
...@@ -12,11 +12,15 @@ ...@@ -12,11 +12,15 @@
#include <test/lang/xserviceinfo.hxx> #include <test/lang/xserviceinfo.hxx>
#include <test/sheet/sheetfilterdescriptor.hxx> #include <test/sheet/sheetfilterdescriptor.hxx>
#include <test/sheet/xsheetfilterdescriptor.hxx> #include <test/sheet/xsheetfilterdescriptor.hxx>
#include <test/sheet/xsheetfilterdescriptor2.hxx>
#include <test/sheet/xsheetfilterdescriptor3.hxx>
#include <com/sun/star/container/XIndexAccess.hpp> #include <com/sun/star/container/XIndexAccess.hpp>
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/sheet/XSheetFilterable.hpp> #include <com/sun/star/sheet/XSheetFilterable.hpp>
#include <com/sun/star/sheet/XSpreadsheetDocument.hpp> #include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
#include <com/sun/star/sheet/XSpreadsheet.hpp> #include <com/sun/star/sheet/XSpreadsheet.hpp>
#include <com/sun/star/uno/XInterface.hpp>
#include <com/sun/star/uno/Reference.hxx> #include <com/sun/star/uno/Reference.hxx>
...@@ -29,7 +33,9 @@ class ScFilterDescriptorBase : public CalcUnoApiTest, ...@@ -29,7 +33,9 @@ class ScFilterDescriptorBase : public CalcUnoApiTest,
public apitest::SheetFilterDescriptor, public apitest::SheetFilterDescriptor,
public apitest::XPropertySet, public apitest::XPropertySet,
public apitest::XServiceInfo, public apitest::XServiceInfo,
public apitest::XSheetFilterDescriptor public apitest::XSheetFilterDescriptor,
public apitest::XSheetFilterDescriptor2,
public apitest::XSheetFilterDescriptor3
{ {
public: public:
ScFilterDescriptorBase(); ScFilterDescriptorBase();
...@@ -59,6 +65,12 @@ public: ...@@ -59,6 +65,12 @@ public:
// XSheetFilterDescriptor // XSheetFilterDescriptor
CPPUNIT_TEST(testGetSetFilterFields); CPPUNIT_TEST(testGetSetFilterFields);
// XSheetFilterDescriptor2
CPPUNIT_TEST(testGetSetFilterFields2);
// XSheetFilterDescriptor3
CPPUNIT_TEST(testGetSetFilterFields3);
CPPUNIT_TEST_SUITE_END(); CPPUNIT_TEST_SUITE_END();
private: private:
......
...@@ -7604,7 +7604,6 @@ include/test/sheet/xsheetannotation.hxx ...@@ -7604,7 +7604,6 @@ include/test/sheet/xsheetannotation.hxx
include/test/sheet/xsheetannotations.hxx include/test/sheet/xsheetannotations.hxx
include/test/sheet/xsheetannotationshapesupplier.hxx include/test/sheet/xsheetannotationshapesupplier.hxx
include/test/sheet/xsheetfilterable.hxx include/test/sheet/xsheetfilterable.hxx
include/test/sheet/xsheetfilterdescriptor.hxx
include/test/sheet/xsheetlinkable.hxx include/test/sheet/xsheetlinkable.hxx
include/test/sheet/xsheetoperation.hxx include/test/sheet/xsheetoperation.hxx
include/test/sheet/xsheetoutline.hxx include/test/sheet/xsheetoutline.hxx
...@@ -16587,7 +16586,6 @@ test/source/sheet/xsheetannotation.cxx ...@@ -16587,7 +16586,6 @@ test/source/sheet/xsheetannotation.cxx
test/source/sheet/xsheetannotations.cxx test/source/sheet/xsheetannotations.cxx
test/source/sheet/xsheetannotationshapesupplier.cxx test/source/sheet/xsheetannotationshapesupplier.cxx
test/source/sheet/xsheetfilterable.cxx test/source/sheet/xsheetfilterable.cxx
test/source/sheet/xsheetfilterdescriptor.cxx
test/source/sheet/xsheetlinkable.cxx test/source/sheet/xsheetlinkable.cxx
test/source/sheet/xsheetoperation.cxx test/source/sheet/xsheetoperation.cxx
test/source/sheet/xsheetoutline.cxx test/source/sheet/xsheetoutline.cxx
......
...@@ -140,6 +140,8 @@ $(eval $(call gb_Library_add_exception_objects,subsequenttest,\ ...@@ -140,6 +140,8 @@ $(eval $(call gb_Library_add_exception_objects,subsequenttest,\
test/source/sheet/xsheetfilterable \ test/source/sheet/xsheetfilterable \
test/source/sheet/xsheetfilterableex \ test/source/sheet/xsheetfilterableex \
test/source/sheet/xsheetfilterdescriptor \ test/source/sheet/xsheetfilterdescriptor \
test/source/sheet/xsheetfilterdescriptor2 \
test/source/sheet/xsheetfilterdescriptor3 \
test/source/sheet/xsheetlinkable \ test/source/sheet/xsheetlinkable \
test/source/sheet/xsheetoperation \ test/source/sheet/xsheetoperation \
test/source/sheet/xsheetoutline \ test/source/sheet/xsheetoutline \
......
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* -*- 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 file is part of the LibreOffice project.
* *
...@@ -11,8 +11,8 @@ ...@@ -11,8 +11,8 @@
#include <com/sun/star/sheet/TableFilterField.hpp> #include <com/sun/star/sheet/TableFilterField.hpp>
#include <com/sun/star/sheet/XSheetFilterDescriptor.hpp> #include <com/sun/star/sheet/XSheetFilterDescriptor.hpp>
#include <com/sun/star/uno/Reference.hxx>
#include <com/sun/star/uno/Reference.hxx>
#include <com/sun/star/uno/Sequence.hxx> #include <com/sun/star/uno/Sequence.hxx>
#include <cppunit/extensions/HelperMacros.h> #include <cppunit/extensions/HelperMacros.h>
...@@ -20,23 +20,24 @@ ...@@ -20,23 +20,24 @@
using namespace css; using namespace css;
using namespace css::uno; using namespace css::uno;
namespace apitest { namespace apitest
{
void XSheetFilterDescriptor::testGetSetFilterFields() void XSheetFilterDescriptor::testGetSetFilterFields()
{ {
uno::Reference< sheet::XSheetFilterDescriptor > xSFD(init(), UNO_QUERY_THROW); uno::Reference<sheet::XSheetFilterDescriptor> xSFD(init(), uno::UNO_QUERY_THROW);
uno::Sequence< sheet::TableFilterField > xDefaultTFF = xSFD->getFilterFields(); uno::Sequence<sheet::TableFilterField> aDefaultTFF = xSFD->getFilterFields();
CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to get TableFilterField", sal_Int32(0), xDefaultTFF.getLength()); CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to get TableFilterField", sal_Int32(0),
aDefaultTFF.getLength());
uno::Sequence< sheet::TableFilterField > xTFF; uno::Sequence<sheet::TableFilterField> aTFF;
xTFF.realloc(1); aTFF.realloc(1);
xSFD->setFilterFields(xTFF); xSFD->setFilterFields(aTFF);
uno::Sequence< sheet::TableFilterField > xNewTFF = xSFD->getFilterFields(); uno::Sequence<sheet::TableFilterField> aNewTFF = xSFD->getFilterFields();
CPPUNIT_ASSERT_MESSAGE("Unable to set TableFilterField", xNewTFF != xDefaultTFF); CPPUNIT_ASSERT_MESSAGE("Unable to set TableFilterField", aNewTFF != aDefaultTFF);
} }
} } // namespace apitest
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
/* -*- 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/sheet/xsheetfilterdescriptor2.hxx>
#include <com/sun/star/sheet/TableFilterField2.hpp>
#include <com/sun/star/sheet/XSheetFilterDescriptor2.hpp>
#include <com/sun/star/uno/Reference.hxx>
#include <com/sun/star/uno/Sequence.hxx>
#include <cppunit/extensions/HelperMacros.h>
using namespace css;
using namespace css::uno;
namespace apitest
{
void XSheetFilterDescriptor2::testGetSetFilterFields2()
{
uno::Reference<sheet::XSheetFilterDescriptor2> xSFD(init(), uno::UNO_QUERY_THROW);
uno::Sequence<sheet::TableFilterField2> aDefaultTFF = xSFD->getFilterFields2();
CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to get TableFilterField", sal_Int32(0),
aDefaultTFF.getLength());
uno::Sequence<sheet::TableFilterField2> aTFF;
aTFF.realloc(1);
xSFD->setFilterFields2(aTFF);
uno::Sequence<sheet::TableFilterField2> aNewTFF = xSFD->getFilterFields2();
CPPUNIT_ASSERT_MESSAGE("Unable to set TableFilterField", aNewTFF != aDefaultTFF);
}
} // namespace apitest
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
/* -*- 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/sheet/xsheetfilterdescriptor3.hxx>
#include <com/sun/star/sheet/TableFilterField3.hpp>
#include <com/sun/star/sheet/XSheetFilterDescriptor3.hpp>
#include <com/sun/star/uno/Reference.hxx>
#include <com/sun/star/uno/Sequence.hxx>
#include <cppunit/extensions/HelperMacros.h>
using namespace css;
using namespace css::uno;
namespace apitest
{
void XSheetFilterDescriptor3::testGetSetFilterFields3()
{
uno::Reference<sheet::XSheetFilterDescriptor3> xSFD(init(), uno::UNO_QUERY_THROW);
uno::Sequence<sheet::TableFilterField3> aDefaultTFF = xSFD->getFilterFields3();
CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to get TableFilterField", sal_Int32(0),
aDefaultTFF.getLength());
uno::Sequence<sheet::TableFilterField3> aTFF;
aTFF.realloc(1);
xSFD->setFilterFields3(aTFF);
uno::Sequence<sheet::TableFilterField3> aNewTFF = xSFD->getFilterFields3();
CPPUNIT_ASSERT_MESSAGE("Unable to set TableFilterField", aNewTFF != aDefaultTFF);
}
} // 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