summaryrefslogtreecommitdiff
path: root/sw/qa/extras/uiwriter
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2024-10-29 12:25:55 +0100
committerXisco Fauli <xiscofauli@libreoffice.org>2024-10-29 13:50:40 +0100
commit30dee23a769ee81cef7c6b4fe95f2fd661e97b9b (patch)
treef6bfcebd87f4893f57b3cd59ce26b7a1e057f92b /sw/qa/extras/uiwriter
parentca1f1962ae163345ecaedc288244448589ae2a0e (diff)
UnoApiTest: check mxComponent right after loading
Change-Id: Ia834d19a5af999440f7d5847aeeae863daacd952 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175784 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> Tested-by: Jenkins
Diffstat (limited to 'sw/qa/extras/uiwriter')
-rw-r--r--sw/qa/extras/uiwriter/uiwriter3.cxx1
-rw-r--r--sw/qa/extras/uiwriter/uiwriter6.cxx9
-rw-r--r--sw/qa/extras/uiwriter/uiwriter7.cxx1
3 files changed, 4 insertions, 7 deletions
diff --git a/sw/qa/extras/uiwriter/uiwriter3.cxx b/sw/qa/extras/uiwriter/uiwriter3.cxx
index cbd860f0aabf..ff04ed301bfa 100644
--- a/sw/qa/extras/uiwriter/uiwriter3.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter3.cxx
@@ -563,7 +563,6 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testVariableFieldTableRowSplitHeader)
CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf147126)
{
createSwDoc("tdf147126.docx");
- CPPUNIT_ASSERT(mxComponent);
SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get());
CPPUNIT_ASSERT(pTextDoc);
diff --git a/sw/qa/extras/uiwriter/uiwriter6.cxx b/sw/qa/extras/uiwriter/uiwriter6.cxx
index c5caa395fc59..e76982737286 100644
--- a/sw/qa/extras/uiwriter/uiwriter6.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter6.cxx
@@ -660,7 +660,6 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf113790)
// Save it as DOCX & load it again
saveAndReload(u"Office Open XML Text"_ustr);
- CPPUNIT_ASSERT(dynamic_cast<SwXTextDocument*>(mxComponent.get()));
}
CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf157937)
@@ -3228,6 +3227,8 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testNestedGroupTextBoxCopyCrash)
{
createSwDoc("tdf149550.docx");
+ CPPUNIT_ASSERT_EQUAL(1, getShapes());
+
dispatchCommand(mxComponent, u".uno:SelectAll"_ustr, {});
dispatchCommand(mxComponent, u".uno:Copy"_ustr, {});
// This crashed here before the fix.
@@ -3236,7 +3237,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testNestedGroupTextBoxCopyCrash)
Scheduler::ProcessEventsToIdle();
dispatchCommand(mxComponent, u".uno:Paste"_ustr, {});
- CPPUNIT_ASSERT_MESSAGE("Where is the doc, it crashed, isn't it?!", mxComponent);
+ CPPUNIT_ASSERT_EQUAL(2, getShapes());
auto pLayout = parseLayoutDump();
// There must be 2 textboxes!
@@ -3269,10 +3270,8 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testCrashOnExit)
CPPUNIT_ASSERT_EQUAL(true, xProperties->getPropertyValue(u"TextBox"_ustr).get<bool>());
// save and reload
- saveAndReload(u"writer8"_ustr);
-
// Before the fix this crashed here and could not reopen.
- CPPUNIT_ASSERT_MESSAGE("Crash on exit, isn't it?", mxComponent);
+ saveAndReload(u"writer8"_ustr);
}
CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testCaptionShape)
diff --git a/sw/qa/extras/uiwriter/uiwriter7.cxx b/sw/qa/extras/uiwriter/uiwriter7.cxx
index 429fe7ce931d..bff6c0f3a46f 100644
--- a/sw/qa/extras/uiwriter/uiwriter7.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter7.cxx
@@ -2180,7 +2180,6 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testEmbeddedDataSource)
// Reload: should still have a component and a data source, too.
saveAndReload(u"writer8"_ustr);
- CPPUNIT_ASSERT(mxComponent.is());
CPPUNIT_ASSERT(xDatabaseContext->hasByName(u"calc-data-source"_ustr));
// Data source has a table named Sheet1 after saving to a different directory.