summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2013-09-05 13:41:28 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2013-09-05 14:36:57 +0200
commit6cc31515db179c61ec2269fa9fe939ad6ae7a9bc (patch)
tree6d5811d213245a0143d237bc5260f23ae0470eda /sc
parent7169026abcdc42182e7649e5bbf5b247a9575a2f (diff)
extract the calc data structure printers for cppunit equal macros
Change-Id: I9bb1311f5c4688f66c3eb3f85da599686c95e87a
Diffstat (limited to 'sc')
-rw-r--r--sc/CppunitTest_sc_rangelst_test.mk16
-rw-r--r--sc/qa/unit/helper/qahelper.cxx21
-rw-r--r--sc/qa/unit/helper/qahelper.hxx9
-rw-r--r--sc/qa/unit/rangelst_test.cxx21
4 files changed, 46 insertions, 21 deletions
diff --git a/sc/CppunitTest_sc_rangelst_test.mk b/sc/CppunitTest_sc_rangelst_test.mk
index a2002c36095b..5618c0466ca9 100644
--- a/sc/CppunitTest_sc_rangelst_test.mk
+++ b/sc/CppunitTest_sc_rangelst_test.mk
@@ -9,12 +9,26 @@
$(eval $(call gb_CppunitTest_CppunitTest,sc_rangelst_test))
-$(eval $(call gb_CppunitTest_use_external,sc_rangelst_test,boost_headers))
+$(eval $(call gb_CppunitTest_use_externals,sc_rangelst_test, \
+ boost_headers \
+ icu_headers \
+ icudata \
+ icui18n \
+ icuuc \
+ libxml2 \
+ mdds_headers \
+ orcus \
+ orcus-parser \
+))
$(eval $(call gb_CppunitTest_add_exception_objects,sc_rangelst_test, \
sc/qa/unit/rangelst_test \
))
+$(eval $(call gb_CppunitTest_use_library_objects,sc_rangelst_test, \
+ scqahelper \
+))
+
$(eval $(call gb_CppunitTest_use_libraries,sc_rangelst_test, \
avmedia \
basegfx \
diff --git a/sc/qa/unit/helper/qahelper.cxx b/sc/qa/unit/helper/qahelper.cxx
index 6ba96cec0b89..2a572136165d 100644
--- a/sc/qa/unit/helper/qahelper.cxx
+++ b/sc/qa/unit/helper/qahelper.cxx
@@ -29,6 +29,27 @@
using namespace com::sun::star;
using namespace ::com::sun::star::uno;
+// calc data structure pretty printer
+std::ostream& operator<<(std::ostream& rStrm, const ScAddress& rAddr)
+{
+ rStrm << "Col: " << rAddr.Col() << " Row: " << rAddr.Row() << " Tab: " << rAddr.Tab() << "\n";
+ return rStrm;
+}
+
+std::ostream& operator<<(std::ostream& rStrm, const ScRange& rRange)
+{
+ rStrm << "ScRange: " << rRange.aStart << rRange.aEnd << "\n";
+ return rStrm;
+}
+
+std::ostream& operator<<(std::ostream& rStrm, const ScRangeList& rList)
+{
+ rStrm << "ScRangeList: \n";
+ for(size_t i = 0; i < rList.size(); ++i)
+ rStrm << *rList[i];
+ return rStrm;
+}
+
FileFormat aFileFormats[] = {
{ "ods" , "calc8", "", ODS_FORMAT_TYPE },
{ "xls" , "MS Excel 97", "calc_MS_EXCEL_97", XLS_FORMAT_TYPE },
diff --git a/sc/qa/unit/helper/qahelper.hxx b/sc/qa/unit/helper/qahelper.hxx
index a4966a15ebfb..eea457635e96 100644
--- a/sc/qa/unit/helper/qahelper.hxx
+++ b/sc/qa/unit/helper/qahelper.hxx
@@ -78,6 +78,15 @@ struct FileFormat {
const char* pName; const char* pFilterName; const char* pTypeName; unsigned int nFormatType;
};
+// Printers for the calc data structures. Needed for the EQUAL assertion
+// macros from CPPUNIT.
+
+std::ostream& operator<<(std::ostream& rStrm, const ScAddress& rAddr);
+
+std::ostream& operator<<(std::ostream& rStrm, const ScRange& rRange);
+
+std::ostream& operator<<(std::ostream& rStrm, const ScRangeList& rList);
+
// Why is this here and not in osl, and using the already existing file
// handling APIs? Do we really want to add arbitrary new file handling
// wrappers here and there (and then having to handle the Android (and
diff --git a/sc/qa/unit/rangelst_test.cxx b/sc/qa/unit/rangelst_test.cxx
index 4281392b4909..afec0d1c84fa 100644
--- a/sc/qa/unit/rangelst_test.cxx
+++ b/sc/qa/unit/rangelst_test.cxx
@@ -9,6 +9,7 @@
#include <sal/config.h>
#include <test/bootstrapfixture.hxx>
+#include "helper/qahelper.hxx"
#include "document.hxx"
#include "docsh.hxx"
@@ -78,26 +79,6 @@ private:
ScDocShellRef m_xDocShRef;
};
-static std::ostream& operator<<(std::ostream& rStrm, const ScAddress& rAddr)
-{
- rStrm << "Col: " << rAddr.Col() << " Row: " << rAddr.Row() << " Tab: " << rAddr.Tab() << "\n";
- return rStrm;
-}
-
-static std::ostream& operator<<(std::ostream& rStrm, const ScRange& rRange)
-{
- rStrm << "ScRange: " << rRange.aStart << rRange.aEnd << "\n";
- return rStrm;
-}
-
-static std::ostream& operator<<(std::ostream& rStrm, const ScRangeList& rList)
-{
- rStrm << "ScRangeList: \n";
- for(size_t i = 0; i < rList.size(); ++i)
- rStrm << *rList[i];
- return rStrm;
-}
-
void Test::setUp()
{
BootstrapFixture::setUp();