summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authoranfanite396 <dipamt1729@gmail.com>2023-08-01 15:35:01 +0530
committerTomaž Vajngerl <quikee@gmail.com>2023-08-25 08:21:53 +0200
commitbb8f57dfa17e108c4cd5d08a538077c3d2c6f195 (patch)
tree98c21fd04a4b85b9f8daa9402f10d4e3ae97ef6d /test
parent594665e757c4adec4d243e4c33299877b2264552 (diff)
tdf#45904: Move _BaseIndexMark Java tests to C++
Change-Id: Ie6c09c0cfedbad8168281af354590ab7c9dd374e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155162 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'test')
-rw-r--r--test/Library_subsequenttest.mk1
-rw-r--r--test/source/text/baseindexmark.cxx45
2 files changed, 46 insertions, 0 deletions
diff --git a/test/Library_subsequenttest.mk b/test/Library_subsequenttest.mk
index 76798568d58b..f86818722d10 100644
--- a/test/Library_subsequenttest.mk
+++ b/test/Library_subsequenttest.mk
@@ -188,6 +188,7 @@ $(eval $(call gb_Library_add_exception_objects,subsequenttest,\
test/source/table/xtablecolumns \
test/source/table/xtablerows \
test/source/text/baseindex \
+ test/source/text/baseindexmark \
test/source/text/numberingrules \
test/source/text/textcontent \
test/source/text/xsimpletext \
diff --git a/test/source/text/baseindexmark.cxx b/test/source/text/baseindexmark.cxx
new file mode 100644
index 000000000000..755b55856cf8
--- /dev/null
+++ b/test/source/text/baseindexmark.cxx
@@ -0,0 +1,45 @@
+/* -*- 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/cppunitasserthelper.hxx>
+#include <test/text/baseindexmark.hxx>
+
+#include <com/sun/star/beans/XPropertySet.hpp>
+
+#include <com/sun/star/uno/Any.hxx>
+#include <com/sun/star/uno/Reference.hxx>
+
+#include <cppunit/TestAssert.h>
+
+using namespace com::sun::star;
+using namespace com::sun::star::uno;
+
+namespace apitest
+{
+void BaseIndexMark::testBaseIndexMarkProperties()
+{
+ Reference<beans::XPropertySet> xBaseIndexMark(init(), UNO_QUERY_THROW);
+ OUString propName;
+ uno::Any aNewValue;
+
+ propName = "AlternativeText";
+ OUString aAlternativeTextGet = "";
+ CPPUNIT_ASSERT_MESSAGE("Unable to get PropertyValue AlternativeText",
+ xBaseIndexMark->getPropertyValue(propName) >>= aAlternativeTextGet);
+
+ OUString aAlternativeTextSet = "testProperty";
+ aNewValue <<= aAlternativeTextSet;
+ xBaseIndexMark->setPropertyValue(propName, aNewValue);
+ CPPUNIT_ASSERT(xBaseIndexMark->getPropertyValue(propName) >>= aAlternativeTextGet);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to set PropertyValue AlternativeText", aAlternativeTextGet,
+ aAlternativeTextSet);
+}
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */