summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJens Carl <j.carl43@gmx.de>2017-06-28 08:09:33 +0000
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2017-07-02 04:49:14 +0200
commitc08dd17baf7ea63f10d5311e90c5c6a4c48aac20 (patch)
treecffa7913175d864719d8859e525a0d7504825c57 /test
parent01985fd8fccf46749b74ee733391ce8b6ec1f1f8 (diff)
tdf#45904 Move Java XCellAddressable test to C++
Change-Id: Ib68c7dd8087f19bd969cf5273c3a6e8664c6bb62 Reviewed-on: https://gerrit.libreoffice.org/39348 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'test')
-rw-r--r--test/Library_subsequenttest.mk1
-rw-r--r--test/source/sheet/xcelladdressable.cxx53
2 files changed, 54 insertions, 0 deletions
diff --git a/test/Library_subsequenttest.mk b/test/Library_subsequenttest.mk
index e5ab18b166f2..1f68fd395ba5 100644
--- a/test/Library_subsequenttest.mk
+++ b/test/Library_subsequenttest.mk
@@ -44,6 +44,7 @@ $(eval $(call gb_Library_add_exception_objects,subsequenttest,\
test/source/container/xnamed \
test/source/sheet/cellproperties \
test/source/sheet/datapilotfield \
+ test/source/sheet/xcelladdressable \
test/source/sheet/xcellrangedata \
test/source/sheet/xcellrangereferrer \
test/source/sheet/xcellrangesquery \
diff --git a/test/source/sheet/xcelladdressable.cxx b/test/source/sheet/xcelladdressable.cxx
new file mode 100644
index 000000000000..0d92b1ae2333
--- /dev/null
+++ b/test/source/sheet/xcelladdressable.cxx
@@ -0,0 +1,53 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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/xcelladdressable.hxx>
+
+#include <com/sun/star/sheet/XCellAddressable.hpp>
+#include <com/sun/star/table/CellAddress.hpp>
+
+#include "cppunit/extensions/HelperMacros.h"
+
+using namespace com::sun::star;
+using namespace com::sun::star::uno;
+
+CPPUNIT_NS_BEGIN
+
+template<> struct assertion_traits<table::CellAddress>
+{
+ static bool equal(const table::CellAddress& x, const table::CellAddress& y)
+ {
+ return x == y;
+ }
+
+ static std::string toString( const table::CellAddress& x )
+ {
+ OStringStream ost;
+ ost << "Sheet: " << x.Sheet << " Column: " << x.Column << " Row: " << x.Row;
+ return ost.str();
+ }
+};
+
+CPPUNIT_NS_END
+
+namespace apitest {
+
+void XCellAddressable::testGetCellAddress()
+{
+ uno::Reference< sheet::XCellAddressable > xCellAddressable(init(), UNO_QUERY_THROW);
+ table::CellAddress xCellAddress = xCellAddressable->getCellAddress();
+ table::CellAddress defaultCellAddress;
+
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("getCellAddress() didn't returned default cell address",
+ defaultCellAddress, xCellAddress);
+}
+
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */