summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/README.md (renamed from test/README)4
-rw-r--r--test/source/beans/xpropertyset.cxx8
-rw-r--r--test/source/bootstrapfixture.cxx9
-rw-r--r--test/source/chart/xchartdata.cxx6
-rw-r--r--test/source/lang/xcomponent.cxx23
-rw-r--r--test/source/sheet/cellarealink.cxx10
-rw-r--r--test/source/sheet/databaserange.cxx22
-rw-r--r--test/source/sheet/datapilotitem.cxx4
-rw-r--r--test/source/sheet/xactivationbroadcaster.cxx6
-rw-r--r--test/source/sheet/xarrayformularange.cxx2
-rw-r--r--test/source/sheet/xdocumentauditing.cxx4
-rw-r--r--test/source/sheet/xnamedranges.cxx7
-rw-r--r--test/source/sheet/xspreadsheets2.cxx5
-rw-r--r--test/source/table/xcell.cxx4
-rw-r--r--test/source/table/xcellcursor.cxx8
-rw-r--r--test/source/text/textsettings.cxx6
-rw-r--r--test/source/util/xrefreshable.cxx4
-rw-r--r--test/source/xmltesttools.cxx75
-rw-r--r--test/user-template/user/autocorr/acor_en-GB.datbin1786 -> 2942 bytes
19 files changed, 145 insertions, 62 deletions
diff --git a/test/README b/test/README.md
index dc0afd80a8d9..0845e3f7354a 100644
--- a/test/README
+++ b/test/README.md
@@ -1,4 +1,4 @@
-Test harness code for C++ unit testing
+# Test Harness Code for C++ Unit Testing
Many of these tests are run during the build process. In that case on
-unix, if a test fails follow the error messages to debug it under gdb.
+unix, if a test fails follow the error messages to debug it under `gdb`.
diff --git a/test/source/beans/xpropertyset.cxx b/test/source/beans/xpropertyset.cxx
index d42bc836ca88..33c0398650db 100644
--- a/test/source/beans/xpropertyset.cxx
+++ b/test/source/beans/xpropertyset.cxx
@@ -86,7 +86,7 @@ void XPropertySet::testPropertyChangeListener()
{
rtl::Reference<MockedPropertyChangeListener> xListener = new MockedPropertyChangeListener();
xPropSet->addPropertyChangeListener(
- aName, uno::Reference<beans::XPropertyChangeListener>(xListener.get()));
+ aName, uno::Reference<beans::XPropertyChangeListener>(xListener));
if (!isPropertyValueChangeable(aName))
continue;
@@ -94,7 +94,7 @@ void XPropertySet::testPropertyChangeListener()
xListener->m_bListenerCalled = false;
xPropSet->removePropertyChangeListener(
- aName, uno::Reference<beans::XPropertyChangeListener>(xListener.get()));
+ aName, uno::Reference<beans::XPropertyChangeListener>(xListener));
isPropertyValueChangeable(aName);
CPPUNIT_ASSERT(!xListener->m_bListenerCalled);
}
@@ -110,7 +110,7 @@ void XPropertySet::testVetoableChangeListener()
{
rtl::Reference<MockedVetoableChangeListener> xListener = new MockedVetoableChangeListener();
xPropSet->addVetoableChangeListener(
- aName, uno::Reference<beans::XVetoableChangeListener>(xListener.get()));
+ aName, uno::Reference<beans::XVetoableChangeListener>(xListener));
if (!isPropertyValueChangeable(aName))
continue;
@@ -118,7 +118,7 @@ void XPropertySet::testVetoableChangeListener()
xListener->m_bListenerCalled = false;
xPropSet->removeVetoableChangeListener(
- aName, uno::Reference<beans::XVetoableChangeListener>(xListener.get()));
+ aName, uno::Reference<beans::XVetoableChangeListener>(xListener));
isPropertyValueChangeable(aName);
CPPUNIT_ASSERT(!xListener->m_bListenerCalled);
}
diff --git a/test/source/bootstrapfixture.cxx b/test/source/bootstrapfixture.cxx
index 5116ac32115a..5ae9b3e4ab24 100644
--- a/test/source/bootstrapfixture.cxx
+++ b/test/source/bootstrapfixture.cxx
@@ -25,7 +25,9 @@
#include <osl/file.hxx>
#include <osl/process.h>
#include <unotools/tempfile.hxx>
+#include <vcl/salgtype.hxx>
#include <vcl/scheduler.hxx>
+#include <vcl/virdev.hxx>
#include <memory>
#include <cstring>
@@ -246,4 +248,11 @@ bool test::BootstrapFixture::IsDefaultDPI()
&& Application::GetDefaultDevice()->GetDPIY() == 96);
}
+sal_uInt16 test::BootstrapFixture::getDefaultDeviceBitCount()
+{
+ ScopedVclPtr<VirtualDevice> device
+ = VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT);
+ return device->GetBitCount();
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/test/source/chart/xchartdata.cxx b/test/source/chart/xchartdata.cxx
index dcecf33a0c3d..68a9b82f191e 100644
--- a/test/source/chart/xchartdata.cxx
+++ b/test/source/chart/xchartdata.cxx
@@ -67,11 +67,11 @@ void XChartData::testChartDataChangeEventListener()
rtl::Reference<MockedChartDataChangeEventListener> pListener0
= new MockedChartDataChangeEventListener();
xCD->addChartDataChangeEventListener(
- uno::Reference<chart::XChartDataChangeEventListener>(pListener0.get()));
+ uno::Reference<chart::XChartDataChangeEventListener>(pListener0));
rtl::Reference<MockedChartDataChangeEventListener> pListener1
= new MockedChartDataChangeEventListener();
xCD->addChartDataChangeEventListener(
- uno::Reference<chart::XChartDataChangeEventListener>(pListener1.get()));
+ uno::Reference<chart::XChartDataChangeEventListener>(pListener1));
uno::Reference<chart::XChartDataArray> xCDD(xCD, uno::UNO_QUERY_THROW);
uno::Sequence<uno::Sequence<double>> aData = xCDD->getData();
@@ -84,7 +84,7 @@ void XChartData::testChartDataChangeEventListener()
pListener1->m_bListenerCalled = false;
xCD->removeChartDataChangeEventListener(
- uno::Reference<chart::XChartDataChangeEventListener>(pListener1.get()));
+ uno::Reference<chart::XChartDataChangeEventListener>(pListener1));
aData[0][0] += 1.0;
xCDD->setData(aData);
CPPUNIT_ASSERT(pListener0->m_bListenerCalled);
diff --git a/test/source/lang/xcomponent.cxx b/test/source/lang/xcomponent.cxx
index abe5111e4f2a..286f66c5c77a 100644
--- a/test/source/lang/xcomponent.cxx
+++ b/test/source/lang/xcomponent.cxx
@@ -9,6 +9,7 @@
#include <cppuhelper/implbase.hxx>
#include <test/lang/xcomponent.hxx>
+#include <rtl/ref.hxx>
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/lang/XEventListener.hpp>
@@ -38,9 +39,8 @@ namespace apitest
void XComponent::testAddEventListener()
{
Reference<lang::XComponent> xComponent(init(), uno::UNO_QUERY_THROW);
- auto pListenerAdded(new TestEventListener());
- Reference<lang::XEventListener> xListenerAdded(pListenerAdded);
- xComponent->addEventListener(xListenerAdded);
+ rtl::Reference<TestEventListener> pListenerAdded(new TestEventListener());
+ xComponent->addEventListener(pListenerAdded);
xComponent->dispose();
CPPUNIT_ASSERT_EQUAL(true, pListenerAdded->m_hasDisposingCalled);
}
@@ -48,10 +48,9 @@ void XComponent::testAddEventListener()
void XComponent::testRemoveEventListener()
{
Reference<lang::XComponent> xComponent(init(), uno::UNO_QUERY_THROW);
- auto pListenerAddedAndRemoved(new TestEventListener());
- Reference<lang::XEventListener> xListenerAddedAndRemoved(pListenerAddedAndRemoved);
- xComponent->addEventListener(xListenerAddedAndRemoved);
- xComponent->removeEventListener(xListenerAddedAndRemoved);
+ rtl::Reference<TestEventListener> pListenerAddedAndRemoved(new TestEventListener());
+ xComponent->addEventListener(pListenerAddedAndRemoved);
+ xComponent->removeEventListener(pListenerAddedAndRemoved);
xComponent->dispose();
CPPUNIT_ASSERT_EQUAL(false, pListenerAddedAndRemoved->m_hasDisposingCalled);
}
@@ -59,9 +58,8 @@ void XComponent::testRemoveEventListener()
void XComponent::testDispose()
{
Reference<lang::XComponent> xComponent(init(), uno::UNO_QUERY_THROW);
- auto pListenerAdded(new TestEventListener());
- Reference<lang::XEventListener> xListenerAdded(pListenerAdded);
- xComponent->addEventListener(xListenerAdded);
+ rtl::Reference<TestEventListener> pListenerAdded(new TestEventListener());
+ xComponent->addEventListener(pListenerAdded);
xComponent->dispose();
CPPUNIT_ASSERT_EQUAL(true, pListenerAdded->m_hasDisposingCalled);
}
@@ -69,9 +67,8 @@ void XComponent::testDispose()
void XComponent::testDisposedByDesktopTerminate()
{
Reference<lang::XComponent> xComponent(init(), uno::UNO_QUERY_THROW);
- auto pListenerAdded(new TestEventListener());
- Reference<lang::XEventListener> xListenerAdded(pListenerAdded);
- xComponent->addEventListener(xListenerAdded);
+ rtl::Reference<TestEventListener> pListenerAdded(new TestEventListener());
+ xComponent->addEventListener(pListenerAdded);
triggerDesktopTerminate();
CPPUNIT_ASSERT_EQUAL(true, pListenerAdded->m_hasDisposingCalled);
}
diff --git a/test/source/sheet/cellarealink.cxx b/test/source/sheet/cellarealink.cxx
index d73f4e09ce8e..bfaf4c3fe99b 100644
--- a/test/source/sheet/cellarealink.cxx
+++ b/test/source/sheet/cellarealink.cxx
@@ -22,7 +22,7 @@ void CellAreaLink::testUrl()
{
uno::Reference<beans::XPropertySet> xCellAreaLink(init(), uno::UNO_QUERY_THROW);
- const OUString propName("Url");
+ static const OUStringLiteral propName(u"Url");
OUString aUrl;
CPPUNIT_ASSERT(xCellAreaLink->getPropertyValue(propName) >>= aUrl);
@@ -39,7 +39,7 @@ void CellAreaLink::testFilter()
{
uno::Reference<beans::XPropertySet> xCellAreaLink(init(), uno::UNO_QUERY_THROW);
- const OUString propName("Filter");
+ static const OUStringLiteral propName(u"Filter");
OUString aFilter;
CPPUNIT_ASSERT(xCellAreaLink->getPropertyValue(propName) >>= aFilter);
@@ -56,7 +56,7 @@ void CellAreaLink::testFilterOptions()
{
uno::Reference<beans::XPropertySet> xCellAreaLink(init(), uno::UNO_QUERY_THROW);
- const OUString propName("FilterOptions");
+ static const OUStringLiteral propName(u"FilterOptions");
OUString aFilterOptions;
CPPUNIT_ASSERT(xCellAreaLink->getPropertyValue(propName) >>= aFilterOptions);
@@ -75,7 +75,7 @@ void CellAreaLink::testRefreshDelay()
{
uno::Reference<beans::XPropertySet> xCellAreaLink(init(), uno::UNO_QUERY_THROW);
- const OUString propName("RefreshDelay");
+ static const OUStringLiteral propName(u"RefreshDelay");
sal_Int32 aRefreshDelay = 0;
CPPUNIT_ASSERT(xCellAreaLink->getPropertyValue(propName) >>= aRefreshDelay);
@@ -94,7 +94,7 @@ void CellAreaLink::testRefreshPeriod()
{
uno::Reference<beans::XPropertySet> xCellAreaLink(init(), uno::UNO_QUERY_THROW);
- const OUString propName("RefreshPeriod");
+ static const OUStringLiteral propName(u"RefreshPeriod");
sal_Int32 aRefreshPeriod = 0;
CPPUNIT_ASSERT(xCellAreaLink->getPropertyValue(propName) >>= aRefreshPeriod);
diff --git a/test/source/sheet/databaserange.cxx b/test/source/sheet/databaserange.cxx
index 302d88bc6b50..d87e3723ce3b 100644
--- a/test/source/sheet/databaserange.cxx
+++ b/test/source/sheet/databaserange.cxx
@@ -26,7 +26,7 @@ void DatabaseRange::testMoveCells()
{
uno::Reference<beans::XPropertySet> xDatabaseRange(init("DataArea"), UNO_QUERY_THROW);
- const OUString propName("MoveCells");
+ static const OUStringLiteral propName(u"MoveCells");
bool bMoveCells = true;
CPPUNIT_ASSERT(xDatabaseRange->getPropertyValue(propName) >>= bMoveCells);
@@ -43,7 +43,7 @@ void DatabaseRange::testKeepFormats()
{
uno::Reference<beans::XPropertySet> xDatabaseRange(init("DataArea"), UNO_QUERY_THROW);
- const OUString propName("KeepFormats");
+ static const OUStringLiteral propName(u"KeepFormats");
bool bKeepFormats = true;
CPPUNIT_ASSERT(xDatabaseRange->getPropertyValue(propName) >>= bKeepFormats);
@@ -60,7 +60,7 @@ void DatabaseRange::testStripData()
{
uno::Reference<beans::XPropertySet> xDatabaseRange(init("DataArea"), UNO_QUERY_THROW);
- const OUString propName("StripData");
+ static const OUStringLiteral propName(u"StripData");
bool bStripData = true;
CPPUNIT_ASSERT(xDatabaseRange->getPropertyValue(propName) >>= bStripData);
@@ -77,7 +77,7 @@ void DatabaseRange::testAutoFilter()
{
uno::Reference<beans::XPropertySet> xDatabaseRange(init("DataArea"), UNO_QUERY_THROW);
- const OUString propName("AutoFilter");
+ static const OUStringLiteral propName(u"AutoFilter");
bool bAutoFilter = true;
CPPUNIT_ASSERT(xDatabaseRange->getPropertyValue(propName) >>= bAutoFilter);
@@ -94,7 +94,7 @@ void DatabaseRange::testUseFilterCriteriaSource()
{
uno::Reference<beans::XPropertySet> xDatabaseRange(init("DataArea"), UNO_QUERY_THROW);
- const OUString propName("UseFilterCriteriaSource");
+ static const OUStringLiteral propName(u"UseFilterCriteriaSource");
bool bUseFilterCriteriaSource = true;
CPPUNIT_ASSERT(xDatabaseRange->getPropertyValue(propName) >>= bUseFilterCriteriaSource);
@@ -113,7 +113,7 @@ void DatabaseRange::testFilterCriteriaSource()
{
uno::Reference<beans::XPropertySet> xDatabaseRange(init("DataArea"), UNO_QUERY_THROW);
- const OUString propName("FilterCriteriaSource");
+ static const OUStringLiteral propName(u"FilterCriteriaSource");
table::CellRangeAddress cellRangeAddress;
CPPUNIT_ASSERT(xDatabaseRange->getPropertyValue(propName) >>= cellRangeAddress);
@@ -132,7 +132,7 @@ void DatabaseRange::testRefreshPeriod()
{
uno::Reference<beans::XPropertySet> xDatabaseRange(init("DataArea"), UNO_QUERY_THROW);
- const OUString propName("RefreshPeriod");
+ static const OUStringLiteral propName(u"RefreshPeriod");
sal_Int32 aRefreshPeriod = 1;
CPPUNIT_ASSERT(xDatabaseRange->getPropertyValue(propName) >>= aRefreshPeriod);
@@ -151,7 +151,7 @@ void DatabaseRange::testFromSelection()
{
uno::Reference<beans::XPropertySet> xDatabaseRange(init("DataArea"), UNO_QUERY_THROW);
- const OUString propName("FromSelection");
+ static const OUStringLiteral propName(u"FromSelection");
bool bFromSelection = true;
CPPUNIT_ASSERT(xDatabaseRange->getPropertyValue(propName) >>= bFromSelection);
@@ -168,7 +168,7 @@ void DatabaseRange::testTokenIndex()
{
uno::Reference<beans::XPropertySet> xDatabaseRange(init("DataArea"), UNO_QUERY_THROW);
- const OUString propName("TokenIndex");
+ static const OUStringLiteral propName(u"TokenIndex");
sal_Int32 aTokenIndex = 0;
CPPUNIT_ASSERT(xDatabaseRange->getPropertyValue(propName) >>= aTokenIndex);
@@ -185,7 +185,7 @@ void DatabaseRange::testTotalsRow()
{
uno::Reference<beans::XPropertySet> xDatabaseRange(init("DataArea"), UNO_QUERY_THROW);
- const OUString propName("TotalsRow");
+ static const OUStringLiteral propName(u"TotalsRow");
bool bTotalsRow = true;
CPPUNIT_ASSERT(xDatabaseRange->getPropertyValue(propName) >>= bTotalsRow);
@@ -202,7 +202,7 @@ void DatabaseRange::testContainsHeader()
{
uno::Reference<beans::XPropertySet> xDatabaseRange(init("DataArea"), UNO_QUERY_THROW);
- const OUString propName("ContainsHeader");
+ static const OUStringLiteral propName(u"ContainsHeader");
bool bContainsHeader = false;
CPPUNIT_ASSERT(xDatabaseRange->getPropertyValue(propName) >>= bContainsHeader);
diff --git a/test/source/sheet/datapilotitem.cxx b/test/source/sheet/datapilotitem.cxx
index 4b2299c0068f..bfbe2110afec 100644
--- a/test/source/sheet/datapilotitem.cxx
+++ b/test/source/sheet/datapilotitem.cxx
@@ -24,7 +24,7 @@ void DataPilotItem::testProperties()
{
uno::Reference<beans::XPropertySet> xItem(init(), UNO_QUERY_THROW);
- const OUString propNameIS("IsHidden");
+ static const OUStringLiteral propNameIS(u"IsHidden");
bool bIsHidden = true;
CPPUNIT_ASSERT(xItem->getPropertyValue(propNameIS) >>= bIsHidden);
@@ -36,7 +36,7 @@ void DataPilotItem::testProperties()
CPPUNIT_ASSERT(xItem->getPropertyValue(propNameIS) >>= bIsHidden);
CPPUNIT_ASSERT_MESSAGE("Value of IsHidden wasn't changed", !bIsHidden);
- const OUString propNameSD("ShowDetail");
+ static const OUStringLiteral propNameSD(u"ShowDetail");
bool bShowDetail = false;
CPPUNIT_ASSERT(xItem->getPropertyValue(propNameSD) >>= bShowDetail);
diff --git a/test/source/sheet/xactivationbroadcaster.cxx b/test/source/sheet/xactivationbroadcaster.cxx
index 93fa5ab93689..6c7769db5a38 100644
--- a/test/source/sheet/xactivationbroadcaster.cxx
+++ b/test/source/sheet/xactivationbroadcaster.cxx
@@ -51,8 +51,7 @@ void XActivationBroadcaster::testAddRemoveActivationEventListener()
xAB->addActivationEventListener(nullptr);
rtl::Reference<MockedActivationEventListener> xListener = new MockedActivationEventListener();
- xAB->addActivationEventListener(
- uno::Reference<sheet::XActivationEventListener>(xListener.get()));
+ xAB->addActivationEventListener(uno::Reference<sheet::XActivationEventListener>(xListener));
uno::Reference<sheet::XSpreadsheetView> xView(xAB, UNO_QUERY_THROW);
uno::Reference<sheet::XSpreadsheet> xSheet1(xView->getActiveSheet(), UNO_SET_THROW);
@@ -62,8 +61,7 @@ void XActivationBroadcaster::testAddRemoveActivationEventListener()
CPPUNIT_ASSERT_MESSAGE("Listener wasn't called", xListener->mbListenerCalled);
- xAB->removeActivationEventListener(
- uno::Reference<sheet::XActivationEventListener>(xListener.get()));
+ xAB->removeActivationEventListener(uno::Reference<sheet::XActivationEventListener>(xListener));
xView->setActiveSheet(xSheet1);
CPPUNIT_ASSERT_MESSAGE("Listener still called after removal", xListener->mbListenerCalled);
}
diff --git a/test/source/sheet/xarrayformularange.cxx b/test/source/sheet/xarrayformularange.cxx
index ab4ed7847a3a..f7f30a1af73e 100644
--- a/test/source/sheet/xarrayformularange.cxx
+++ b/test/source/sheet/xarrayformularange.cxx
@@ -27,7 +27,7 @@ void XArrayFormulaRange::testGetSetArrayFormula()
{
uno::Reference<sheet::XArrayFormulaRange> xAFR(init(), UNO_QUERY_THROW);
- const OUString sFormula("=1 + 2 * 5");
+ static const OUStringLiteral sFormula(u"=1 + 2 * 5");
xAFR->setArrayFormula(sFormula);
uno::Reference<sheet::XCellRangeAddressable> xCRA(xAFR, UNO_QUERY_THROW);
diff --git a/test/source/sheet/xdocumentauditing.cxx b/test/source/sheet/xdocumentauditing.cxx
index acbab0968397..3a08fdb2e729 100644
--- a/test/source/sheet/xdocumentauditing.cxx
+++ b/test/source/sheet/xdocumentauditing.cxx
@@ -122,8 +122,8 @@ void XDocumentAuditing::testRefreshArrows()
CPPUNIT_ASSERT_MESSAGE("Wrong amount of shapes on page", bResult);
awt::Point Position1 = m_Position;
- CPPUNIT_ASSERT_MESSAGE("Arrow has been refreshed",
- Position0.X == Position1.X && Position0.Y == Position1.Y);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Arrow has been refreshed", Position0.X, Position1.X);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Arrow has been refreshed", Position0.Y, Position1.Y);
xDocumentAuditing->refreshArrows();
diff --git a/test/source/sheet/xnamedranges.cxx b/test/source/sheet/xnamedranges.cxx
index 25726ca9e739..e07911f421ab 100644
--- a/test/source/sheet/xnamedranges.cxx
+++ b/test/source/sheet/xnamedranges.cxx
@@ -70,6 +70,13 @@ void XNamedRanges::testAddNewByName()
xNamedRanges->addNewByName(aName5, "D5", aBaseAddress, nType);
CPPUNIT_ASSERT_MESSAGE("Failed to create Namedrange Type ROW_HEADER",
xNamedRanges->hasByName(aName5));
+
+ // tdf#119457 - check for a valid range name
+ OUString aName6("type_INVALID_BAD_STRING.+:");
+ CPPUNIT_ASSERT_THROW(xNamedRanges->addNewByName(aName6, "D6", aBaseAddress, 0),
+ uno::RuntimeException);
+ CPPUNIT_ASSERT_MESSAGE("Created Namedrange with invalid name",
+ !xNamedRanges->hasByName(aName6));
}
void XNamedRanges::testAddNewFromTitles()
diff --git a/test/source/sheet/xspreadsheets2.cxx b/test/source/sheet/xspreadsheets2.cxx
index 9c53af7374fb..f88de2a43055 100644
--- a/test/source/sheet/xspreadsheets2.cxx
+++ b/test/source/sheet/xspreadsheets2.cxx
@@ -242,7 +242,7 @@ void XSpreadsheets2::testImportCellStyle()
//new style created in dest
uno::Reference< beans::XPropertySet > xSrcCellPropSet (xSrcCell, UNO_QUERY_THROW);
- const OUString aCellProperty("CellStyle");
+ static const OUStringLiteral aCellProperty(u"CellStyle");
OUString aSrcStyleName;
CPPUNIT_ASSERT(xSrcCellPropSet->getPropertyValue(aCellProperty) >>= aSrcStyleName);
@@ -323,9 +323,6 @@ uno::Reference< sheet::XSpreadsheetDocument> XSpreadsheets2::getDoc(const OUStri
createFileURL(aFileBase, aFileURL);
uno::Reference< lang::XComponent > xComp = loadFromDesktop(aFileURL);
-
- CPPUNIT_ASSERT(xComp.is());
-
uno::Reference< sheet::XSpreadsheetDocument > xDoc(xComp, UNO_QUERY_THROW);
return xDoc;
}
diff --git a/test/source/table/xcell.cxx b/test/source/table/xcell.cxx
index 921ef78bad83..8540117a5618 100644
--- a/test/source/table/xcell.cxx
+++ b/test/source/table/xcell.cxx
@@ -28,8 +28,8 @@ void XCell::testGetError()
xCell->setFormula("=sqrt(-2)");
const sal_Int32 nIncorrectFormula = xCell->getError();
- CPPUNIT_ASSERT_MESSAGE("Successfully able to get Error",
- (nCorrectFormula == 0) && (nIncorrectFormula != 0));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Successfully able to get Error", sal_Int32(0), nCorrectFormula);
+ CPPUNIT_ASSERT_MESSAGE("Successfully able to get Error", (nIncorrectFormula != 0));
}
void XCell::testGetType()
diff --git a/test/source/table/xcellcursor.cxx b/test/source/table/xcellcursor.cxx
index a8e7b2be5728..6f6cc33e0cc2 100644
--- a/test/source/table/xcellcursor.cxx
+++ b/test/source/table/xcellcursor.cxx
@@ -95,8 +95,8 @@ void XCellCursor::testGoToStart()
const sal_Int32 startCol = aCellRangeAddr.StartColumn;
const sal_Int32 endRow = aCellRangeAddr.EndRow;
const sal_Int32 endCol = aCellRangeAddr.EndColumn;
- CPPUNIT_ASSERT_MESSAGE("Successfully able to got to Start",
- (startCol == endCol) && (endRow == startRow));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Successfully able to go to Start", startCol, endCol);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Successfully able to go to Start", endRow, startRow);
}
void XCellCursor::testGoToEnd()
@@ -118,8 +118,8 @@ void XCellCursor::testGoToEnd()
const sal_Int32 startCol = aCellRangeAddr.StartColumn;
const sal_Int32 endRow = aCellRangeAddr.EndRow;
const sal_Int32 endCol = aCellRangeAddr.EndColumn;
- CPPUNIT_ASSERT_MESSAGE("Successfully able to go to End",
- (startCol == endCol) && (endRow == startRow));
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Successfully able to go to End", startCol, endCol);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Successfully able to go to End", endRow, startRow);
}
}
diff --git a/test/source/text/textsettings.cxx b/test/source/text/textsettings.cxx
index 5b8cef60cdd0..112fc939dee9 100644
--- a/test/source/text/textsettings.cxx
+++ b/test/source/text/textsettings.cxx
@@ -44,7 +44,7 @@ bool isPropertyReadOnly(css::uno::Reference<css::beans::XPropertySet> const& rxP
// [property] string PrinterName;
void testPrinterName(css::uno::Reference<css::beans::XPropertySet> const& rxSettings)
{
- const OUString rPropertyName("PrinterName");
+ static const OUStringLiteral rPropertyName(u"PrinterName");
if (!extstsProperty(rxSettings, rPropertyName))
return; // Property is sometimes not set - bug? it is not defined as optional
@@ -67,7 +67,7 @@ void testPrinterName(css::uno::Reference<css::beans::XPropertySet> const& rxSett
// [optional, property] short PrinterIndependentLayout;
void testPrinterIndependentLayout(css::uno::Reference<css::beans::XPropertySet> const& rxSettings)
{
- const OUString rPropertyName("PrinterIndependentLayout");
+ static const OUStringLiteral rPropertyName(u"PrinterIndependentLayout");
if (!extstsProperty(rxSettings, rPropertyName))
return; // Property is optional
@@ -91,7 +91,7 @@ void testPrinterIndependentLayout(css::uno::Reference<css::beans::XPropertySet>
// [optional, property] com::sun::star::i18n::XForbiddenCharacters ForbiddenCharacters;
void testForbiddenCharacters(css::uno::Reference<css::beans::XPropertySet> const& rxSettings)
{
- const OUString rPropertyName("ForbiddenCharacters");
+ static const OUStringLiteral rPropertyName(u"ForbiddenCharacters");
if (!extstsProperty(rxSettings, rPropertyName))
return; // Property is optional
diff --git a/test/source/util/xrefreshable.cxx b/test/source/util/xrefreshable.cxx
index f448d93e5008..5d145e5b2fbe 100644
--- a/test/source/util/xrefreshable.cxx
+++ b/test/source/util/xrefreshable.cxx
@@ -49,13 +49,13 @@ void XRefreshable::testRefreshListener()
uno::Reference<util::XRefreshable> xRefreshable(init(), uno::UNO_QUERY_THROW);
rtl::Reference<MockedRefreshListener> xListener = new MockedRefreshListener();
- xRefreshable->addRefreshListener(uno::Reference<util::XRefreshListener>(xListener.get()));
+ xRefreshable->addRefreshListener(uno::Reference<util::XRefreshListener>(xListener));
xRefreshable->refresh();
CPPUNIT_ASSERT(xListener->m_bListenerCalled);
xListener->m_bListenerCalled = false;
- xRefreshable->removeRefreshListener(uno::Reference<util::XRefreshListener>(xListener.get()));
+ xRefreshable->removeRefreshListener(uno::Reference<util::XRefreshListener>(xListener));
xRefreshable->refresh();
CPPUNIT_ASSERT(!xListener->m_bListenerCalled);
}
diff --git a/test/source/xmltesttools.cxx b/test/source/xmltesttools.cxx
index 16226a2e8845..fcd6ca5815ac 100644
--- a/test/source/xmltesttools.cxx
+++ b/test/source/xmltesttools.cxx
@@ -84,6 +84,7 @@ OUString XmlTestTools::getXPath(const xmlDocUniquePtr& pXmlDoc, const OString& r
{
CPPUNIT_ASSERT(pXmlDoc);
xmlXPathObjectPtr pXmlObj = getXPathNode(pXmlDoc, rXPath);
+ CPPUNIT_ASSERT(pXmlObj);
xmlNodeSetPtr pXmlNodes = pXmlObj->nodesetval;
CPPUNIT_ASSERT_EQUAL_MESSAGE(OString(OStringLiteral("In <") + pXmlDoc->name + ">, XPath '" + rXPath + "' number of nodes is incorrect").getStr(),
1, xmlXPathNodeSetGetLength(pXmlNodes));
@@ -278,4 +279,78 @@ int XmlTestTools::getXPathPosition(const xmlDocUniquePtr& pXmlDoc, const OString
return nRet;
}
+void XmlTestTools::registerODFNamespaces(xmlXPathContextPtr& pXmlXpathCtx)
+{
+ xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("office"),
+ BAD_CAST("urn:oasis:names:tc:opendocument:xmlns:office:1.0"));
+ xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("style"),
+ BAD_CAST("urn:oasis:names:tc:opendocument:xmlns:style:1.0"));
+ xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("text"),
+ BAD_CAST("urn:oasis:names:tc:opendocument:xmlns:text:1.0"));
+ xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("table"),
+ BAD_CAST("urn:oasis:names:tc:opendocument:xmlns:table:1.0"));
+ xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("draw"),
+ BAD_CAST("urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"));
+ xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("fo"),
+ BAD_CAST("urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"));
+ xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("config"),
+ BAD_CAST("urn:oasis:names:tc:opendocument:xmlns:config:1.0"));
+ xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("xlink"), BAD_CAST("http://www.w3.org/1999/xlink"));
+ xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("dc"), BAD_CAST("http://purl.org/dc/elements/1.1/"));
+ xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("meta"),
+ BAD_CAST("urn:oasis:names:tc:opendocument:xmlns:meta:1.0"));
+ xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("number"),
+ BAD_CAST("urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0"));
+ xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("svg"),
+ BAD_CAST("urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0"));
+ xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("chart"),
+ BAD_CAST("urn:oasis:names:tc:opendocument:xmlns:chart:1.0"));
+ xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("dr3d"),
+ BAD_CAST("urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0"));
+ xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("math"),
+ BAD_CAST("http://www.w3.org/1998/Math/MathML"));
+ xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("form"),
+ BAD_CAST("urn:oasis:names:tc:opendocument:xmlns:form:1.0"));
+ xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("script"),
+ BAD_CAST("urn:oasis:names:tc:opendocument:xmlns:script:1.0"));
+ xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("ooo"),
+ BAD_CAST("http://openoffice.org/2004/office"));
+ xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("ooow"),
+ BAD_CAST("http://openoffice.org/2004/writer"));
+ xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("oooc"), BAD_CAST("http://openoffice.org/2004/calc"));
+ xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("dom"),
+ BAD_CAST("http://www.w3.org/2001/xml-events"));
+ xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("xforms"), BAD_CAST("http://www.w3.org/2002/xforms"));
+ xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("xsd"), BAD_CAST("http://www.w3.org/2001/XMLSchema"));
+ xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("xsi"),
+ BAD_CAST("http://www.w3.org/2001/XMLSchema-instance"));
+ xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("rpt"),
+ BAD_CAST("http://openoffice.org/2005/report"));
+ xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("of"),
+ BAD_CAST("urn:oasis:names:tc:opendocument:xmlns:of:1.2"));
+ xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("xhtml"), BAD_CAST("http://www.w3.org/1999/xhtml"));
+ xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("grddl"),
+ BAD_CAST("http://www.w3.org/2003/g/data-view#"));
+ xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("officeooo"),
+ BAD_CAST("http://openoffice.org/2009/office"));
+ xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("tableooo"),
+ BAD_CAST("http://openoffice.org/2009/table"));
+ xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("drawooo"),
+ BAD_CAST("http://openoffice.org/2010/draw"));
+ xmlXPathRegisterNs(
+ pXmlXpathCtx, BAD_CAST("calcext"),
+ BAD_CAST("urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0"));
+ xmlXPathRegisterNs(
+ pXmlXpathCtx, BAD_CAST("loext"),
+ BAD_CAST("urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0"));
+ xmlXPathRegisterNs(
+ pXmlXpathCtx, BAD_CAST("field"),
+ BAD_CAST("urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0"));
+ xmlXPathRegisterNs(
+ pXmlXpathCtx, BAD_CAST("formx"),
+ BAD_CAST("urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0"));
+ xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("css3t"),
+ BAD_CAST("http://www.w3.org/TR/css3-text/"));
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/test/user-template/user/autocorr/acor_en-GB.dat b/test/user-template/user/autocorr/acor_en-GB.dat
index b74f1834caac..ae2f12db59d8 100644
--- a/test/user-template/user/autocorr/acor_en-GB.dat
+++ b/test/user-template/user/autocorr/acor_en-GB.dat
Binary files differ