[Libreoffice] unit-test / code sharing ...

Markus Mohrhard markus.mohrhard at googlemail.com
Wed Sep 28 02:51:55 PDT 2011


Hello Stephan,

2011/9/28 Stephan Bergmann <sbergman at redhat.com>

> 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?
>
> The Basic Error Dialog seems to be the only dialog at the moment that still
tries to show up and results in a loop while waiting for user input.
Micheal's patch fixed that problem for me and makes it possible to try to
run basic code in unit tests.

Markus
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20110928/f4a9c462/attachment.htm>


More information about the LibreOffice mailing list