summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authoranfanite396 <dipamt1729@gmail.com>2023-08-11 23:29:32 +0530
committerTomaž Vajngerl <quikee@gmail.com>2023-08-25 08:25:53 +0200
commit7a762a2c7ec5fe107697c06d31bc7a184011a338 (patch)
treeec442e7e1378cd83f9da306d1b5e74ef97559ff9 /sw/qa
parent52f785d15197b4ef645ae08015994f5accf2ec8e (diff)
tdf#45904: Move _XTextRangeCompare Java tests to C++
Change-Id: I40390a8b05f0e685a9408f0c486f6129633bc5b5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155634 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/api/SwXBodyText.cxx6
-rw-r--r--sw/qa/api/SwXFootnoteText.cxx6
-rw-r--r--sw/qa/api/SwXHeadFootText.cxx34
3 files changed, 29 insertions, 17 deletions
diff --git a/sw/qa/api/SwXBodyText.cxx b/sw/qa/api/SwXBodyText.cxx
index d364ba3a8aa0..69fb22a959b2 100644
--- a/sw/qa/api/SwXBodyText.cxx
+++ b/sw/qa/api/SwXBodyText.cxx
@@ -12,6 +12,7 @@
#include <test/container/xelementaccess.hxx>
#include <test/text/xtextrange.hxx>
#include <test/container/xenumerationaccess.hxx>
+#include <test/text/xtextrangecompare.hxx>
#include <unotest/macros_test.hxx>
#include <com/sun/star/frame/Desktop.hpp>
@@ -36,7 +37,8 @@ class SwXBodyText final : public test::BootstrapFixture,
public apitest::XElementAccess,
public apitest::XTextRange,
public apitest::XSimpleText,
- public apitest::XEnumerationAccess
+ public apitest::XEnumerationAccess,
+ public apitest::XTextRangeCompare
{
public:
SwXBodyText();
@@ -57,6 +59,8 @@ public:
CPPUNIT_TEST(testGetEnd);
CPPUNIT_TEST(testGetSetString);
CPPUNIT_TEST(testCreateEnumeration);
+ CPPUNIT_TEST(testCompareRegionStarts);
+ CPPUNIT_TEST(testCompareRegionEnds);
CPPUNIT_TEST_SUITE_END();
private:
diff --git a/sw/qa/api/SwXFootnoteText.cxx b/sw/qa/api/SwXFootnoteText.cxx
index 9e8bab00c544..23697293352a 100644
--- a/sw/qa/api/SwXFootnoteText.cxx
+++ b/sw/qa/api/SwXFootnoteText.cxx
@@ -13,6 +13,7 @@
#include <test/text/xtextrange.hxx>
#include <test/text/xtext.hxx>
#include <test/container/xenumerationaccess.hxx>
+#include <test/text/xtextrangecompare.hxx>
#include <unotest/macros_test.hxx>
#include <com/sun/star/frame/Desktop.hpp>
@@ -40,7 +41,8 @@ class SwXFootnoteText final : public test::BootstrapFixture,
public apitest::XSimpleText,
public apitest::XTextRange,
public apitest::XText,
- public apitest::XEnumerationAccess
+ public apitest::XEnumerationAccess,
+ public apitest::XTextRangeCompare
{
public:
SwXFootnoteText();
@@ -63,6 +65,8 @@ public:
CPPUNIT_TEST(testGetText);
// CPPUNIT_TEST(testInsertRemoveTextContent);
CPPUNIT_TEST(testCreateEnumeration);
+ CPPUNIT_TEST(testCompareRegionStarts);
+ CPPUNIT_TEST(testCompareRegionEnds);
CPPUNIT_TEST_SUITE_END();
private:
diff --git a/sw/qa/api/SwXHeadFootText.cxx b/sw/qa/api/SwXHeadFootText.cxx
index ca51ba8c0069..b3769ccc58a1 100644
--- a/sw/qa/api/SwXHeadFootText.cxx
+++ b/sw/qa/api/SwXHeadFootText.cxx
@@ -13,6 +13,7 @@
#include <test/text/xtextrange.hxx>
#include <test/text/xtext.hxx>
#include <test/container/xenumerationaccess.hxx>
+#include <test/text/xtextrangecompare.hxx>
#include <unotest/macros_test.hxx>
#include <com/sun/star/frame/Desktop.hpp>
@@ -34,25 +35,26 @@ using namespace css::uno;
namespace
{
/**
- * Initial tests for SwXHeadFootTextText.
+ * Initial tests for SwXHeadFootText.
*/
-class SwXHeadFootTextText final : public test::BootstrapFixture,
- public unotest::MacrosTest,
- public apitest::XElementAccess,
- public apitest::XSimpleText,
- public apitest::XTextRange,
- public apitest::XText,
- public apitest::XEnumerationAccess
+class SwXHeadFootText final : public test::BootstrapFixture,
+ public unotest::MacrosTest,
+ public apitest::XElementAccess,
+ public apitest::XSimpleText,
+ public apitest::XTextRange,
+ public apitest::XText,
+ public apitest::XEnumerationAccess,
+ public apitest::XTextRangeCompare
{
public:
- SwXHeadFootTextText();
+ SwXHeadFootText();
virtual void setUp() override;
void tearDown() override;
Reference<XInterface> init() override;
Reference<text::XTextContent> getTextContent() override { return mxTextContent; };
- CPPUNIT_TEST_SUITE(SwXHeadFootTextText);
+ CPPUNIT_TEST_SUITE(SwXHeadFootText);
CPPUNIT_TEST(testGetElementType);
CPPUNIT_TEST(testHasElements);
CPPUNIT_TEST(testCreateTextCursor);
@@ -65,6 +67,8 @@ public:
CPPUNIT_TEST(testGetText);
// CPPUNIT_TEST(testInsertRemoveTextContent);
CPPUNIT_TEST(testCreateEnumeration);
+ CPPUNIT_TEST(testCompareRegionStarts);
+ CPPUNIT_TEST(testCompareRegionEnds);
CPPUNIT_TEST_SUITE_END();
private:
@@ -72,19 +76,19 @@ private:
Reference<text::XTextContent> mxTextContent;
};
-SwXHeadFootTextText::SwXHeadFootTextText()
+SwXHeadFootText::SwXHeadFootText()
: XElementAccess(cppu::UnoType<text::XTextRange>::get())
{
}
-void SwXHeadFootTextText::setUp()
+void SwXHeadFootText::setUp()
{
test::BootstrapFixture::setUp();
mxDesktop.set(
frame::Desktop::create(comphelper::getComponentContext(getMultiServiceFactory())));
}
-void SwXHeadFootTextText::tearDown()
+void SwXHeadFootText::tearDown()
{
if (component_.is())
component_->dispose();
@@ -92,7 +96,7 @@ void SwXHeadFootTextText::tearDown()
test::BootstrapFixture::tearDown();
}
-Reference<XInterface> SwXHeadFootTextText::init()
+Reference<XInterface> SwXHeadFootText::init()
{
component_ = loadFromDesktop("private:factory/swriter", "com.sun.star.text.TextDocument");
Reference<text::XTextDocument> xTextDocument(component_, UNO_QUERY_THROW);
@@ -114,7 +118,7 @@ Reference<XInterface> SwXHeadFootTextText::init()
return Reference<XInterface>(xText, UNO_QUERY_THROW);
}
-CPPUNIT_TEST_SUITE_REGISTRATION(SwXHeadFootTextText);
+CPPUNIT_TEST_SUITE_REGISTRATION(SwXHeadFootText);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */