summaryrefslogtreecommitdiff
path: root/test/source
diff options
context:
space:
mode:
authorJens Carl <j.carl43@gmx.de>2018-12-01 07:42:52 +0000
committerJens Carl <j.carl43@gmx.de>2018-12-01 09:51:12 +0100
commitd0a6f8a8e862bede67989cd3fac105d7c8231eb0 (patch)
treeade291e534258d0cecbd5a8e1225603cf8cca343 /test/source
parent21399c7378be020e5e43fc07575f46e87e2d607b (diff)
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 <j.carl43@gmx.de>
Diffstat (limited to 'test/source')
-rw-r--r--test/source/container/xindexaccess.cxx31
1 files changed, 15 insertions, 16 deletions
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 <test/container/xindexaccess.hxx>
+
#include <com/sun/star/container/XIndexAccess.hpp>
+
+#include <com/sun/star/uno/Reference.hxx>
+
#include <cppunit/extensions/HelperMacros.h>
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<container::XIndexAccess> 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<container::XIndexAccess> 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<container::XIndexAccess> xIndexAccess(init(), UNO_QUERY_THROW);
+ xIndexAccess->getByIndex(m_nItems);
}
-}
+} // namespace apitest
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */