summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@suse.com>2011-09-27 14:43:26 +0100
committerMichael Meeks <michael.meeks@suse.com>2011-09-27 14:44:20 +0100
commit0e3361c0aee39c72e4f85d408676ac38efcf9bd0 (patch)
tree7b06eac3e96f8a2ab10b6bef8f5455592f6db6c9 /sc
parent41bc308973c8567aaa368949a02f1cf420c1ee8a (diff)
assert on the console in a helpful way as/when we get a message dialog
Diffstat (limited to 'sc')
-rw-r--r--sc/qa/unit/filters-test.cxx13
-rw-r--r--sc/qa/unit/ucalc.cxx1
2 files changed, 14 insertions, 0 deletions
diff --git a/sc/qa/unit/filters-test.cxx b/sc/qa/unit/filters-test.cxx
index 3b9bc50a0914..f1ae199a5b1e 100644
--- a/sc/qa/unit/filters-test.cxx
+++ b/sc/qa/unit/filters-test.cxx
@@ -35,6 +35,7 @@
#include "cppunit/extensions/HelperMacros.h"
#include "cppunit/plugin/TestPlugIn.h"
+#include <rtl/strbuf.hxx>
#include <osl/file.hxx>
#include <osl/process.h>
@@ -229,6 +230,8 @@ ScDocShellRef FiltersTest::load(const rtl::OUString &rFilter, const rtl::OUStrin
if (!xDocShRef->DoLoad(&aSrcMed))
// load failed.
xDocShRef.Clear();
+// else
+// SfxObjectShell::SetCurrentComponent( xDocShRef->GetModel() );
return xDocShRef;
}
@@ -686,8 +689,18 @@ FiltersTest::FiltersTest()
m_aSrcRoot += m_aFileRoot;
}
+static void aBasicErrorFunc( const String &rErr, const String &rAction )
+{
+ rtl::OStringBuffer aErr( "Unexpected dialog: " );
+ aErr.append( rtl::OUStringToOString( rAction, RTL_TEXTENCODING_ASCII_US ) );
+ aErr.append( " Error: " );
+ aErr.append( rtl::OUStringToOString( rErr, RTL_TEXTENCODING_ASCII_US ) );
+ CPPUNIT_ASSERT_MESSAGE( aErr.getStr(), false);
+}
+
void FiltersTest::setUp()
{
+ ErrorHandler::RegisterDisplay( aBasicErrorFunc );
}
FiltersTest::~FiltersTest()
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index b3260ca29eee..b3f6fd3f8ad9 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -48,6 +48,7 @@
#include "cppunit/extensions/HelperMacros.h"
#include "cppunit/plugin/TestPlugIn.h"
+#include <rtl/strbuf.hxx>
#include <osl/file.hxx>
#include <osl/process.h>