crash course in unittests

Lionel Elie Mamane lionel at mamane.lu
Mon Aug 5 12:44:38 PDT 2013


On Mon, Aug 05, 2013 at 12:04:46PM +0200, Miklos Vajna wrote:
> On Sat, Aug 03, 2013 at 08:29:23PM +0200, Lionel Elie Mamane <lionel at mamane.lu> wrote:

>> Now, it fails because it cannot find the tango theme; actually there
>> is no solver/unxlngx6/unittest/install/share directory at all. How do
>> I get it into the unittest environment?

> Are you sure that's the reason for the failure?

>> warn:legacy.osl:20196:1:vcl/source/gdi/bitmapex.cxx:106: BitmapEx::BitmapEx( const ResId& rResId ): could not load image <dbaccess/res/tables_32.png>
>> warn:legacy.osl:20196:1:vcl/source/gdi/bitmapex.cxx:106: BitmapEx::BitmapEx( const ResId& rResId ): could not load image <dbaccess/res/queries_32.png>
>> warn:legacy.osl:20196:1:vcl/source/gdi/bitmapex.cxx:106: BitmapEx::BitmapEx( const ResId& rResId ): could not load image <dbaccess/res/forms_32.png>
>> warn:legacy.osl:20196:1:vcl/source/gdi/bitmapex.cxx:106: BitmapEx::BitmapEx( const ResId& rResId ): could not load image <dbaccess/res/reports_32.png>
>> warn:legacy.osl:20196:1:vcl/source/gdi/bitmapex.cxx:106: BitmapEx::BitmapEx( const ResId& rResId ): could not load image <res/plus.png>
>> warn:legacy.osl:20196:1:vcl/source/gdi/bitmapex.cxx:106: BitmapEx::BitmapEx( const ResId& rResId ): could not load image <res/minus.png>
>> warn:legacy.osl:20196:1:vcl/source/gdi/bitmapex.cxx:106: BitmapEx::BitmapEx( const ResId& rResId ): could not load image <dbaccess/res/forms_16.png>
>> warn:legacy.osl:20196:1:vcl/source/window/window.cxx:4463: Window () with live children destroyed:  N5dbaui12OTasksWindowE ()

> This last one is the real probem, I guess.

This last one is triggered (by a chain of reasons where one link is)
because it does not find the tango theme. Let me explain. Indeed, the
process survives all the "could not load image <foo.png>" seemingly
without problem. But then, a dbaui::OApplicationDetailView is
created. So its constructor is called; it first constructs the
members, in particular two dbaui::OTitleWindow. Then the body of
dbaui::OApplicationDetailView::OApplicationDetailView is entered, it
calls a bunch of functions, one of which (calls a function that calls
a function that ...) that tries to find share/config/images_tango.zip,
fails to find it and throws an InteractiveIOException. This exception
is not caught by dbaui::OApplicationDetailView::OApplicationDetailView
nor anything lower in the stack, so the exception stack unwinding
happens. In particular, the members are destroyed. The destructor
of the first dbaui::OTitleWindow member (the second to be destroyed)
obviously calls the destructor of its base class Window (from vcl),
where this "last one warning" calls abort().

So, yes, something in
dbaui::OApplicationDetailView::OApplicationDetailView and/or
dbaui::OTitleWindow::~OTitleWindow is not quite exception-safe. If it
were, this particular "Window () with live children destroyed" abort
would not happen, but even if that were fixed, I doubt the application
would survive that uncaught exception enough to execute the unittest.

-- 
Lionel


More information about the LibreOffice mailing list