From afc5d7aedf4d115bfaa539301b155db37be87054 Mon Sep 17 00:00:00 2001 From: Jens Carl Date: Fri, 3 Nov 2017 22:56:02 +0000 Subject: 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 Reviewed-by: Jens Carl --- test/source/sheet/databaserange.cxx | 21 +-------------------- test/source/sheet/xarealink.cxx | 21 +-------------------- test/source/sheet/xcelladdressable.cxx | 20 +------------------- test/source/sheet/xsheetcellrangecontainer.cxx | 21 +-------------------- 4 files changed, 4 insertions(+), 79 deletions(-) (limited to 'test') 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 +#include #include #include @@ -19,26 +20,6 @@ using namespace com::sun::star; using namespace com::sun::star::uno; -CPPUNIT_NS_BEGIN - -template<> struct assertion_traits -{ - 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 +#include #include #include @@ -18,26 +19,6 @@ using namespace com::sun::star; using namespace com::sun::star::uno; -CPPUNIT_NS_BEGIN - -template<> struct assertion_traits -{ - 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 +#include #include #include @@ -17,25 +18,6 @@ using namespace com::sun::star; using namespace com::sun::star::uno; -CPPUNIT_NS_BEGIN - -template<> struct assertion_traits -{ - 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 +#include #include @@ -19,26 +20,6 @@ using namespace com::sun::star; using namespace com::sun::star::uno; -CPPUNIT_NS_BEGIN - -template<> struct assertion_traits -{ - 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() -- cgit