Kaydet (Commit) 6cc31515 authored tarafından Markus Mohrhard's avatar Markus Mohrhard

extract the calc data structure printers for cppunit equal macros

Change-Id: I9bb1311f5c4688f66c3eb3f85da599686c95e87a
üst 7169026a
......@@ -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 \
......
......@@ -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 },
......
......@@ -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
......
......@@ -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();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment