summaryrefslogtreecommitdiff
path: root/test/source
diff options
context:
space:
mode:
authorJens Carl <j.carl43@gmx.de>2019-01-22 04:33:17 +0000
committerJens Carl <j.carl43@gmx.de>2019-01-22 07:18:17 +0100
commitfd8a724d22c92e3ebef4a3da126baaac3d3bde79 (patch)
tree451cb8de1eb43e435e9f5f136065d1de48b33d6c /test/source
parent2d8253c54a37b973282cae6bcceb41b31bd6a237 (diff)
tdf#45904 Move XDrawPages Java tests to C++
Move XDrawPages Java tests to C++ for ScDrawPagesObj. Change-Id: I0e48aae9caadf0d9834c4f973095ba9d10435fdc Reviewed-on: https://gerrit.libreoffice.org/66712 Tested-by: Jenkins Reviewed-by: Jens Carl <j.carl43@gmx.de>
Diffstat (limited to 'test/source')
-rw-r--r--test/source/drawing/xdrawpages.cxx49
1 files changed, 49 insertions, 0 deletions
diff --git a/test/source/drawing/xdrawpages.cxx b/test/source/drawing/xdrawpages.cxx
new file mode 100644
index 000000000000..5fe89abfb348
--- /dev/null
+++ b/test/source/drawing/xdrawpages.cxx
@@ -0,0 +1,49 @@
+/* -*- 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/drawing/xdrawpages.hxx>
+
+#include <com/sun/star/drawing/XDrawPage.hpp>
+#include <com/sun/star/drawing/XDrawPages.hpp>
+#include <com/sun/star/uno/XInterface.hpp>
+
+#include <com/sun/star/uno/Reference.hxx>
+
+#include <cppunit/extensions/HelperMacros.h>
+
+using namespace css;
+using namespace css::uno;
+
+namespace apitest
+{
+void XDrawPages::testInsertNewByIndex()
+{
+ uno::Reference<drawing::XDrawPages> xDrawPages(init(), uno::UNO_QUERY_THROW);
+ const sal_Int32 nCount = xDrawPages->getCount();
+
+ uno::Reference<drawing::XDrawPage> xDP(xDrawPages->insertNewByIndex(0), uno::UNO_QUERY_THROW);
+ CPPUNIT_ASSERT(xDP.is());
+ CPPUNIT_ASSERT_EQUAL(nCount + 1, xDrawPages->getCount());
+}
+
+void XDrawPages::testRemove()
+{
+ uno::Reference<drawing::XDrawPages> xDrawPages(init(), uno::UNO_QUERY_THROW);
+ const sal_Int32 nCount = xDrawPages->getCount();
+
+ uno::Reference<drawing::XDrawPage> xDP(xDrawPages->insertNewByIndex(0), uno::UNO_QUERY_THROW);
+ CPPUNIT_ASSERT(xDP.is());
+
+ xDrawPages->remove(xDP);
+ CPPUNIT_ASSERT_EQUAL(nCount, xDrawPages->getCount());
+}
+
+} // namespace apitest
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */