summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJens Carl <j.carl43@gmx.de>2017-11-11 01:34:27 +0000
committerJens Carl <j.carl43@gmx.de>2017-11-24 18:59:02 +0100
commitbefef6ff30f4eb6d3c61c1542839661d7f823dc4 (patch)
treefc73a6047db038b781318746ceeb6eade9569a38 /test
parent4b30570bebb2632eb0ba5a5e48dfde0de00f54d4 (diff)
tdf#45904 Move _XSheetAnnotationAnchor Java test to C++
Fixes #i109517 for sc.ScCellObj by adding a note/comment during the set up of the test in sccellobj.cxx and allows to re-enabled the test. Change-Id: Ic7aa6bcb2606f555a76612a6f50c200d738674db Reviewed-on: https://gerrit.libreoffice.org/44617 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jens Carl <j.carl43@gmx.de>
Diffstat (limited to 'test')
-rw-r--r--test/Library_subsequenttest.mk1
-rw-r--r--test/source/sheet/xcelladdressable.cxx2
-rw-r--r--test/source/sheet/xsheetannotationanchor.cxx44
3 files changed, 46 insertions, 1 deletions
diff --git a/test/Library_subsequenttest.mk b/test/Library_subsequenttest.mk
index a2bee04955d0..e70ee12970f3 100644
--- a/test/Library_subsequenttest.mk
+++ b/test/Library_subsequenttest.mk
@@ -74,6 +74,7 @@ $(eval $(call gb_Library_add_exception_objects,subsequenttest,\
test/source/sheet/xspreadsheets2 \
test/source/sheet/xspreadsheetview \
test/source/sheet/xsheetannotation \
+ test/source/sheet/xsheetannotationanchor \
test/source/sheet/xsheetannotations \
test/source/sheet/xsheetannotationssupplier \
test/source/sheet/xsheetannotationshapesupplier \
diff --git a/test/source/sheet/xcelladdressable.cxx b/test/source/sheet/xcelladdressable.cxx
index 5fad50858af5..eeb7ea85f5de 100644
--- a/test/source/sheet/xcelladdressable.cxx
+++ b/test/source/sheet/xcelladdressable.cxx
@@ -24,7 +24,7 @@ void XCellAddressable::testGetCellAddress()
{
uno::Reference< sheet::XCellAddressable > xCellAddressable(init(), UNO_QUERY_THROW);
table::CellAddress xCellAddress = xCellAddressable->getCellAddress();
- table::CellAddress defaultCellAddress;
+ table::CellAddress defaultCellAddress(0, 2, 3);
CPPUNIT_ASSERT_EQUAL_MESSAGE("getCellAddress() didn't returned default cell address",
defaultCellAddress, xCellAddress);
diff --git a/test/source/sheet/xsheetannotationanchor.cxx b/test/source/sheet/xsheetannotationanchor.cxx
new file mode 100644
index 000000000000..cf0894a7e83d
--- /dev/null
+++ b/test/source/sheet/xsheetannotationanchor.cxx
@@ -0,0 +1,44 @@
+/* -*- 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/sheet/xsheetannotationanchor.hxx>
+#include <test/cppunitasserthelper.hxx>
+
+#include <com/sun/star/sheet/XSheetAnnotation.hpp>
+#include <com/sun/star/sheet/XSheetAnnotationAnchor.hpp>
+#include <com/sun/star/table/CellAddress.hpp>
+#include <com/sun/star/uno/Reference.hxx>
+
+#include <cppunit/extensions/HelperMacros.h>
+
+using namespace css;
+using namespace css::uno;
+
+namespace apitest
+{
+void XSheetAnnotationAnchor::testGetAnnotation()
+{
+ uno::Reference<sheet::XSheetAnnotationAnchor> xAnchor(init(), UNO_QUERY_THROW);
+ uno::Reference<sheet::XSheetAnnotation> xAnnotation(xAnchor->getAnnotation(), UNO_QUERY_THROW);
+ CPPUNIT_ASSERT_MESSAGE("Unable to get XSheetAnnotation", xAnnotation.is());
+
+ CPPUNIT_ASSERT_MESSAGE("Unable to check: getAuthor()", xAnnotation->getAuthor().isEmpty());
+ CPPUNIT_ASSERT_MESSAGE("Unable to check: getDate()", !xAnnotation->getDate().isEmpty());
+ CPPUNIT_ASSERT_MESSAGE("Unable to check: getIsVisible()", !xAnnotation->getIsVisible());
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to check: getPosition()", table::CellAddress(0, 2, 3),
+ xAnnotation->getPosition());
+
+ xAnnotation->setIsVisible(false);
+ CPPUNIT_ASSERT_MESSAGE("Unable to setIsVisible() to false", !xAnnotation->getIsVisible());
+ xAnnotation->setIsVisible(true);
+ CPPUNIT_ASSERT_MESSAGE("Unable to setIsVisible() to true", xAnnotation->getIsVisible());
+}
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */