[Libreoffice] unit-test / code sharing ...
Stephan Bergmann
sbergman at redhat.com
Wed Sep 28 02:47:56 PDT 2011
On 09/28/2011 10:46 AM, Michael Meeks wrote:
> Incidentally, while trying to get some StarBasic / VBA unit tests
> working with Moggi, it seemed that some of our hangs were down to
> dialogs showing up that were simply not visible, and spinning the
> mainloop waiting for a response.
>
> 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 );
> }
>
> Solves that rather pleasantly, with the added bonus that it might help
> improve the accuracy / helpfulness our basic error reporting over time.
>
> I suspect we should do this for all unit-tests above tools, and the
> head-less smoketest too.
But isn't it the way that all dialogs are implicitly cancelled in
headless mode, anyway?
-Stephan
More information about the LibreOffice
mailing list