From 331e0c83466edef000ffb02b3e55cb49c5580347 Mon Sep 17 00:00:00 2001 From: Jens Carl Date: Tue, 2 Apr 2019 00:02:14 +0000 Subject: tdf#45904 Move XIndexAccess Java tests to C++ Move XIndexAccess Java tests to C++ for ScAutoFormatObj. Change-Id: Ifa88b55b4691accb19c18a8c5f9c880d26a3d078 Reviewed-on: https://gerrit.libreoffice.org/70094 Tested-by: Jenkins Reviewed-by: Jens Carl --- .../com.sun.star.comp.office.ScAutoFormatObj.csv | 2 -- sc/qa/extras/scautoformatobj.cxx | 26 +++++++++++++--------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScAutoFormatObj.csv b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScAutoFormatObj.csv index c4a036d9c3f2..694fd818058d 100644 --- a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScAutoFormatObj.csv +++ b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScAutoFormatObj.csv @@ -1,5 +1,3 @@ -"ScAutoFormatObj";"com::sun::star::container::XIndexAccess";"getCount()" -"ScAutoFormatObj";"com::sun::star::container::XIndexAccess";"getByIndex()" "ScAutoFormatObj";"com::sun::star::container::XElementAccess";"getElementType()" "ScAutoFormatObj";"com::sun::star::container::XElementAccess";"hasElements()" "ScAutoFormatObj";"com::sun::star::container::XNamed";"getName()" diff --git a/sc/qa/extras/scautoformatobj.cxx b/sc/qa/extras/scautoformatobj.cxx index 518b967335b1..8f86f46d2f9c 100644 --- a/sc/qa/extras/scautoformatobj.cxx +++ b/sc/qa/extras/scautoformatobj.cxx @@ -9,6 +9,7 @@ #include #include +#include #include #include @@ -21,15 +22,13 @@ #include using namespace css; -using namespace css::uno; -using namespace com::sun::star; namespace sc_apitest { class ScAutoFormatObj : public CalcUnoApiTest, + public apitest::TableAutoFormat, public apitest::XEnumerationAccess, - public apitest::TableAutoFormat - + public apitest::XIndexAccess { public: ScAutoFormatObj(); @@ -40,11 +39,15 @@ public: CPPUNIT_TEST_SUITE(ScAutoFormatObj); + // TableAutoFormat + CPPUNIT_TEST(testTableAutoFormatProperties); + // XEnumerationAccess CPPUNIT_TEST(testCreateEnumeration); - // TableAutoFormat - CPPUNIT_TEST(testTableAutoFormatProperties); + // XIndexAccess + CPPUNIT_TEST(testGetByIndex); + CPPUNIT_TEST(testGetCount); CPPUNIT_TEST_SUITE_END(); @@ -54,19 +57,20 @@ private: ScAutoFormatObj::ScAutoFormatObj() : CalcUnoApiTest("/sc/qa/extras/testdocuments") + , XIndexAccess(16) { } uno::Reference ScAutoFormatObj::init() { - uno::Reference xDoc(mxComponent, UNO_QUERY_THROW); + uno::Reference xDoc(mxComponent, uno::UNO_QUERY_THROW); - uno::Reference xMSF(xDoc, UNO_QUERY_THROW); + uno::Reference xMSF(xDoc, uno::UNO_QUERY_THROW); uno::Reference xIA( - xMSF->createInstance("com.sun.star.sheet.TableAutoFormats"), UNO_QUERY_THROW); + xMSF->createInstance("com.sun.star.sheet.TableAutoFormats"), uno::UNO_QUERY_THROW); uno::Reference xTableAutoFormat(xIA->getByIndex(xIA->getCount() - 1), - UNO_QUERY_THROW); + uno::UNO_QUERY_THROW); return xTableAutoFormat; } @@ -84,7 +88,7 @@ void ScAutoFormatObj::tearDown() CPPUNIT_TEST_SUITE_REGISTRATION(ScAutoFormatObj); -} // end namespace +} // namespace sc_apitest CPPUNIT_PLUGIN_IMPLEMENT(); -- cgit