[Libreoffice-commits] .: sc/qa

Michael Meeks michael at kemper.freedesktop.org
Tue Sep 27 06:43:39 PDT 2011


 sc/qa/unit/filters-test.cxx |   13 +++++++++++++
 sc/qa/unit/ucalc.cxx        |    1 +
 2 files changed, 14 insertions(+)

New commits:
commit 0e3361c0aee39c72e4f85d408676ac38efcf9bd0
Author: Michael Meeks <michael.meeks at suse.com>
Date:   Tue Sep 27 14:43:26 2011 +0100

    assert on the console in a helpful way as/when we get a message dialog

diff --git a/sc/qa/unit/filters-test.cxx b/sc/qa/unit/filters-test.cxx
index 3b9bc50..f1ae199 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 b3260ca..b3f6fd3 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>
 


More information about the Libreoffice-commits mailing list