Kaydet (Commit) 4a3328a9 authored tarafından Matúš Kukan's avatar Matúš Kukan Kaydeden (comit) Miklos Vajna

sw: Unit test for cycle in lcl_CreatePortions

Reviewed on:
	https://gerrit.libreoffice.org/13413
Conflicts:
	sw/qa/extras/uiwriter/uiwriter.cxx

Change-Id: I26a8707046d7f30381fb51c41e49f8dee4796ba7
üst 6d65e30f
...@@ -63,6 +63,7 @@ public: ...@@ -63,6 +63,7 @@ public:
void testAutoCorr(); void testAutoCorr();
void testFdo87005(); void testFdo87005();
void testMergeDoc(); void testMergeDoc();
void testCreatePortions();
CPPUNIT_TEST_SUITE(SwUiWriterTest); CPPUNIT_TEST_SUITE(SwUiWriterTest);
CPPUNIT_TEST(testReplaceForward); CPPUNIT_TEST(testReplaceForward);
...@@ -89,6 +90,7 @@ public: ...@@ -89,6 +90,7 @@ public:
CPPUNIT_TEST(testAutoCorr); CPPUNIT_TEST(testAutoCorr);
CPPUNIT_TEST(testFdo87005); CPPUNIT_TEST(testFdo87005);
CPPUNIT_TEST(testMergeDoc); CPPUNIT_TEST(testMergeDoc);
CPPUNIT_TEST(testCreatePortions);
CPPUNIT_TEST_SUITE_END(); CPPUNIT_TEST_SUITE_END();
...@@ -662,6 +664,21 @@ void SwUiWriterTest::testMergeDoc() ...@@ -662,6 +664,21 @@ void SwUiWriterTest::testMergeDoc()
getParagraph(7, ""); getParagraph(7, "");
} }
void SwUiWriterTest::testCreatePortions()
{
createDoc("uno-cycle.odt");
uno::Reference<text::XBookmarksSupplier> xBookmarksSupplier(mxComponent, uno::UNO_QUERY);
uno::Reference<text::XTextContent> xText(xBookmarksSupplier->getBookmarks()->getByName("Mark"), uno::UNO_QUERY);
uno::Reference<container::XEnumerationAccess> xTextCursor(xText->getAnchor(), uno::UNO_QUERY);
CPPUNIT_ASSERT(xTextCursor.is());
uno::Reference<container::XEnumerationAccess> xParagraph(
xTextCursor->createEnumeration()->nextElement(), uno::UNO_QUERY);
CPPUNIT_ASSERT(xParagraph.is());
// This looped forever in lcl_CreatePortions
xParagraph->createEnumeration();
}
CPPUNIT_TEST_SUITE_REGISTRATION(SwUiWriterTest); CPPUNIT_TEST_SUITE_REGISTRATION(SwUiWriterTest);
CPPUNIT_PLUGIN_IMPLEMENT(); CPPUNIT_PLUGIN_IMPLEMENT();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment