summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJens Carl <j.carl43@gmx.de>2019-05-01 23:08:14 +0000
committerJens Carl <j.carl43@gmx.de>2019-05-02 02:53:26 +0200
commitf07e91ac739edf846ae9dda9b2305bae6dde489e (patch)
tree3a06751570af1c2627318931228211c861220e58 /test
parent6f763a3fcd420ddd147459db0f836ef3e05e710f (diff)
tdf#45904 Move XReplaceDescriptor Java tests to C++
Move XReplaceDescriptor Java tests to C++ for ScCellSearchObj. Change-Id: Ica5042ce8b5eac3663a0fb5f66ae0a2830c89d93 Reviewed-on: https://gerrit.libreoffice.org/71645 Tested-by: Jenkins Reviewed-by: Jens Carl <j.carl43@gmx.de>
Diffstat (limited to 'test')
-rw-r--r--test/Library_subsequenttest.mk1
-rw-r--r--test/source/util/xreplacedescriptor.cxx37
2 files changed, 38 insertions, 0 deletions
diff --git a/test/Library_subsequenttest.mk b/test/Library_subsequenttest.mk
index 6bdde7dece5b..2ad096c59c32 100644
--- a/test/Library_subsequenttest.mk
+++ b/test/Library_subsequenttest.mk
@@ -191,6 +191,7 @@ $(eval $(call gb_Library_add_exception_objects,subsequenttest,\
test/source/util/xmergeable \
test/source/util/xrefreshable \
test/source/util/xreplaceable \
+ test/source/util/xreplacedescriptor \
test/source/util/xsearchable \
test/source/util/xsearchdescriptor \
test/source/view/xcontrolaccess \
diff --git a/test/source/util/xreplacedescriptor.cxx b/test/source/util/xreplacedescriptor.cxx
new file mode 100644
index 000000000000..15733cc6f252
--- /dev/null
+++ b/test/source/util/xreplacedescriptor.cxx
@@ -0,0 +1,37 @@
+/* -*- 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/util/xreplacedescriptor.hxx>
+#include <rtl/ustring.hxx>
+
+#include <com/sun/star/util/XReplaceDescriptor.hpp>
+
+#include <com/sun/star/uno/Reference.hxx>
+
+#include <cppunit/extensions/HelperMacros.h>
+
+using namespace css;
+
+namespace apitest
+{
+void XReplaceDescriptor::testGetSetReplaceString()
+{
+ uno::Reference<util::XReplaceDescriptor> xRD(init(), uno::UNO_QUERY_THROW);
+ const OUString aReplaceStringOld = xRD->getReplaceString();
+ CPPUNIT_ASSERT(aReplaceStringOld.isEmpty());
+
+ xRD->setReplaceString("_XReplaceDescriptor");
+ const OUString aReplaceStringNew = xRD->getReplaceString();
+ CPPUNIT_ASSERT_EQUAL(OUString("_XReplaceDescriptor"), aReplaceStringNew);
+ CPPUNIT_ASSERT(aReplaceStringOld != aReplaceStringNew);
+}
+
+} // namespace apitest
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */