From d0a6f8a8e862bede67989cd3fac105d7c8231eb0 Mon Sep 17 00:00:00 2001 From: Jens Carl Date: Sat, 1 Dec 2018 07:42:52 +0000 Subject: Enable XIndexAccess test cases Add macro OOO_DLLPUBLIC_TEST to class XIndexAccess (needed to use the test cases), refactor ctor, and add missing header files. Change-Id: Id8b27c8c3a3d7fc5c64fafd25b0d9b4b511c281f Reviewed-on: https://gerrit.libreoffice.org/64375 Tested-by: Jenkins Reviewed-by: Jens Carl --- test/source/container/xindexaccess.cxx | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) (limited to 'test/source') diff --git a/test/source/container/xindexaccess.cxx b/test/source/container/xindexaccess.cxx index 3791e2b76393..9139136b36b3 100644 --- a/test/source/container/xindexaccess.cxx +++ b/test/source/container/xindexaccess.cxx @@ -8,49 +8,48 @@ */ #include + #include + +#include + #include using namespace css; using namespace css::uno; -namespace apitest { - -XIndexAccess::XIndexAccess(sal_Int32 nItems): - mnItems(nItems) +namespace apitest { -} - void XIndexAccess::testGetCount() { - uno::Reference< container::XIndexAccess > xIndexAccess(init(), UNO_QUERY_THROW); - CPPUNIT_ASSERT_EQUAL(mnItems, xIndexAccess->getCount()); + uno::Reference xIndexAccess(init(), UNO_QUERY_THROW); + CPPUNIT_ASSERT_EQUAL(m_nItems, xIndexAccess->getCount()); } void XIndexAccess::testGetByIndex() { - uno::Reference< container::XIndexAccess > xIndexAccess(init(), UNO_QUERY_THROW); - CPPUNIT_ASSERT_EQUAL(mnItems, xIndexAccess->getCount()); + uno::Reference xIndexAccess(init(), UNO_QUERY_THROW); + CPPUNIT_ASSERT_EQUAL(m_nItems, xIndexAccess->getCount()); - if (mnItems > 0) + if (m_nItems > 0) { Any aAny = xIndexAccess->getByIndex(0); CPPUNIT_ASSERT(aAny.hasValue()); - aAny = xIndexAccess->getByIndex(mnItems/2); + aAny = xIndexAccess->getByIndex(m_nItems / 2); CPPUNIT_ASSERT(aAny.hasValue()); - aAny = xIndexAccess->getByIndex(mnItems-1); + aAny = xIndexAccess->getByIndex(m_nItems - 1); CPPUNIT_ASSERT(aAny.hasValue()); } } void XIndexAccess::testGetByIndexException() { - uno::Reference< container::XIndexAccess > xIndexAccess(init(), UNO_QUERY_THROW); - xIndexAccess->getByIndex(mnItems); + uno::Reference xIndexAccess(init(), UNO_QUERY_THROW); + xIndexAccess->getByIndex(m_nItems); } -} +} // namespace apitest /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit