summaryrefslogtreecommitdiff
path: root/test/source
diff options
context:
space:
mode:
authorJens Carl <j.carl43@gmx.de>2017-11-03 22:56:02 +0000
committerJens Carl <j.carl43@gmx.de>2017-11-04 06:57:57 +0100
commitafc5d7aedf4d115bfaa539301b155db37be87054 (patch)
treecfe5e785347562acc387d51f0cedf8e8feeb6c91 /test/source
parente7be51491c2295e546549b750d9723753731725a (diff)
Create CppUnit::assertion_traits helper file
Place the CppUnit:assertion_traits for ::table::CellAddress and ::table::CellRangeAddress into a file, so that they can be used/shared from several locations. Avoid copy/paste action. Change-Id: Ie2358ea1ac6925eef05644bea03a2ae526cd7fc6 Reviewed-on: https://gerrit.libreoffice.org/44291 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jens Carl <j.carl43@gmx.de>
Diffstat (limited to 'test/source')
-rw-r--r--test/source/sheet/databaserange.cxx21
-rw-r--r--test/source/sheet/xarealink.cxx21
-rw-r--r--test/source/sheet/xcelladdressable.cxx20
-rw-r--r--test/source/sheet/xsheetcellrangecontainer.cxx21
4 files changed, 4 insertions, 79 deletions
diff --git a/test/source/sheet/databaserange.cxx b/test/source/sheet/databaserange.cxx
index 8e6f56cb1ed1..91ee88184863 100644
--- a/test/source/sheet/databaserange.cxx
+++ b/test/source/sheet/databaserange.cxx
@@ -8,6 +8,7 @@
*/
#include <test/sheet/databaserange.hxx>
+#include <test/cppunitasserthelper.hxx>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/sheet/XDatabaseRange.hpp>
@@ -19,26 +20,6 @@
using namespace com::sun::star;
using namespace com::sun::star::uno;
-CPPUNIT_NS_BEGIN
-
-template<> struct assertion_traits<table::CellRangeAddress>
-{
- static bool equal(const table::CellRangeAddress& x, const table::CellRangeAddress& y)
- {
- return x == y;
- }
-
- static std::string toString( const table::CellRangeAddress& x )
- {
- OStringStream ost;
- ost << "Sheet: " << x.Sheet << " StartColumn: " << x.StartColumn << " StartRow: " << x.StartRow
- << " EndColumn: " << x.EndColumn << " EndRow: " << x.EndRow;
- return ost.str();
- }
-};
-
-CPPUNIT_NS_END
-
namespace apitest {
void DatabaseRange::testMoveCells()
diff --git a/test/source/sheet/xarealink.cxx b/test/source/sheet/xarealink.cxx
index 89704052da45..ec7ce49a01f8 100644
--- a/test/source/sheet/xarealink.cxx
+++ b/test/source/sheet/xarealink.cxx
@@ -8,6 +8,7 @@
*/
#include <test/sheet/xarealink.hxx>
+#include <test/cppunitasserthelper.hxx>
#include <com/sun/star/sheet/XAreaLink.hpp>
#include <com/sun/star/table/CellRangeAddress.hpp>
@@ -18,26 +19,6 @@
using namespace com::sun::star;
using namespace com::sun::star::uno;
-CPPUNIT_NS_BEGIN
-
-template<> struct assertion_traits<table::CellRangeAddress>
-{
- static bool equal(const table::CellRangeAddress& x, const table::CellRangeAddress& y)
- {
- return x == y;
- }
-
- static std::string toString( const table::CellRangeAddress& x )
- {
- OStringStream ost;
- ost << "Sheet: " << x.Sheet << " StartColumn: " << x.StartColumn << " StartRow: " << x.StartRow
- << " EndColumn: " << x.EndColumn << " EndRow: " << x.EndRow;
- return ost.str();
- }
-};
-
-CPPUNIT_NS_END
-
namespace apitest {
void XAreaLink::testSetDestArea()
diff --git a/test/source/sheet/xcelladdressable.cxx b/test/source/sheet/xcelladdressable.cxx
index 98aa6f0c787d..5fad50858af5 100644
--- a/test/source/sheet/xcelladdressable.cxx
+++ b/test/source/sheet/xcelladdressable.cxx
@@ -8,6 +8,7 @@
*/
#include <test/sheet/xcelladdressable.hxx>
+#include <test/cppunitasserthelper.hxx>
#include <com/sun/star/sheet/XCellAddressable.hpp>
#include <com/sun/star/table/CellAddress.hpp>
@@ -17,25 +18,6 @@
using namespace com::sun::star;
using namespace com::sun::star::uno;
-CPPUNIT_NS_BEGIN
-
-template<> struct assertion_traits<table::CellAddress>
-{
- static bool equal(const table::CellAddress& x, const table::CellAddress& y)
- {
- return x == y;
- }
-
- static std::string toString( const table::CellAddress& x )
- {
- OStringStream ost;
- ost << "Sheet: " << x.Sheet << " Column: " << x.Column << " Row: " << x.Row;
- return ost.str();
- }
-};
-
-CPPUNIT_NS_END
-
namespace apitest {
void XCellAddressable::testGetCellAddress()
diff --git a/test/source/sheet/xsheetcellrangecontainer.cxx b/test/source/sheet/xsheetcellrangecontainer.cxx
index e18bff3ba226..b68e09a7ffe2 100644
--- a/test/source/sheet/xsheetcellrangecontainer.cxx
+++ b/test/source/sheet/xsheetcellrangecontainer.cxx
@@ -8,6 +8,7 @@
*/
#include <test/sheet/xsheetcellrangecontainer.hxx>
+#include <test/cppunitasserthelper.hxx>
#include <com/sun/star/sheet/XSheetCellRangeContainer.hpp>
@@ -19,26 +20,6 @@
using namespace com::sun::star;
using namespace com::sun::star::uno;
-CPPUNIT_NS_BEGIN
-
-template<> struct assertion_traits<table::CellRangeAddress>
-{
- static bool equal(const table::CellRangeAddress& x, const table::CellRangeAddress& y)
- {
- return x == y;
- }
-
- static std::string toString( const table::CellRangeAddress& x )
- {
- OStringStream ost;
- ost << "Sheet: " << x.Sheet << " StartColumn: " << x.StartColumn << " StartRow: " << x.StartRow
- << " EndColumn: " << x.EndColumn << " EndRow: " << x.EndRow;
- return ost.str();
- }
-};
-
-CPPUNIT_NS_END
-
namespace apitest {
void XSheetCellRangeContainer::testAddRemoveRangeAddress()