<p dir="ltr"><br>
On Aug 3, 2013 1:29 PM, "Lionel Elie Mamane" <<a href="mailto:lionel@mamane.lu">lionel@mamane.lu</a>> wrote:<br>
><br>
> And that's because file xmloff/util/xo.component contains:<br>
>   <implementation name="XMLVersionListPersistence"><br>
>     <service name="com.sun.star.document.DocumentRevisionListPersistence"/><br>
>   </implementation><br>
><br>
> which is the service about with it was complaining. OK, I understand<br>
> and I'm one step more removed from "cargo cult unittest writing".<br>
><br>
> Now, it fails because it cannot find the tango theme; actually there<br>
> is no solver/unxlngx6/unittest/install/share directory at all. How do<br>
> I get it into the unittest environment?</p>
<p dir="ltr">I have no idea when the file should be created. If it already exists when we build test we can just copy it similar to the profile files in test/<a href="http://package_unittest.mk">package_unittest.mk</a> otherwise we might need to move the test to the subsequent check target.</p>

<p dir="ltr">But in general it might be an idea to check if that exception should be handled somewhere so that we don't have problems if a icon theme is not found during the test.</p>
<p dir="ltr">Regards,<br>
Markus<br>
><br>
><br>
> Details:<br>
><br>
> 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><br>
> 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><br>
> 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><br>
> 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><br>
> warn:legacy.osl:20196:1:vcl/source/gdi/bitmapex.cxx:106: BitmapEx::BitmapEx( const ResId& rResId ): could not load image <res/plus.png><br>
> warn:legacy.osl:20196:1:vcl/source/gdi/bitmapex.cxx:106: BitmapEx::BitmapEx( const ResId& rResId ): could not load image <res/minus.png><br>
> 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><br>
> warn:legacy.osl:20196:1:vcl/source/window/window.cxx:4463: Window () with live children destroyed:  N5dbaui12OTasksWindowE ()<br>
> Window () with live children destroyed:  N5dbaui12OTasksWindowE ()<br>
><br>
> Error: a unit test failed, please do one of:<br>
><br>
> export DEBUGCPPUNIT=TRUE            # for exception catching<br>
> export GDBCPPUNITTRACE="gdb --args" # for interactive debugging<br>
> export VALGRIND=memcheck            # for memory checking<br>
><br>
> and retry using: make CppunitTest_dbaccess_dialog_save<br>
><br>
> make: *** [/home/master/src/libreoffice/workdirs/master/workdir/unxlngx6/CppunitTest/dbaccess_dialog_save.test] Error 1<br>
><br>
><br>
> I ran it under gdb, and I see that this vcl/Window abort() hides the<br>
> underlying exception / error:<br>
><br>
> $2 = uno::Any {<br>
>   <com::sun::star::ucb::InteractiveIOException> = {<br>
>     <com::sun::star::task::ClassifiedInteractionRequest> = {<br>
>       <com::sun::star::uno::Exception> = {<br>
>         Message = "an error occurred during file opening",<br>
>         Context = uno::Reference to (fileaccess::BaseContent *)<br>
>         0x7fffd99774a8<br>
>       },<br>
>       members of com::sun::star::task::ClassifiedInteractionRequest:<br>
>       Classification =<br>
>       com::sun::star::task::InteractionClassification_ERROR<br>
>     },<br>
>     members of com::sun::star::ucb::InteractiveIOException:<br>
>     Code = com::sun::star::ucb::IOErrorCode_NOT_EXISTING<br>
>   },<br>
>   members of com::sun::star::ucb::InteractiveAugmentedIOException:<br>
>   Arguments = uno::Sequence of length 2 = {uno::Any {<br>
>   Name = "Uri",<br>
>   Handle = -1,<br>
>   Value = uno::Any<br>
>   "file:///home/master/src/libreoffice/workdirs/master/solver/unxlngx6/unittest/install/share/config/images_tango.zip",<br>
>   State = com::sun::star::beans::PropertyState_DIRECT_VALUE<br>
> }, uno::Any {<br>
>   Name = "ResourceName",<br>
>   Handle = -1,<br>
>   Value = uno::Any<br>
>   "/home/master/src/libreoffice/workdirs/master/solver/unxlngx6/unittest/install/share/config/images_tango.zip",<br>
>   State = com::sun::star::beans::PropertyState_DIRECT_VALUE<br>
> }}<br>
> }<br>
><br>
><br>
> So it is again this images stuff, but this time it is considered<br>
> fatal.<br>
><br>
><br>
> On Sat, Aug 03, 2013 at 06:39:49PM +0200, Markus Mohrhard wrote:<br>
> > OK that contains all the necessary information. You need to add<br>
> > xmloff/util/xo to the component list.<br>
> ><br>
> > This component file contains the missing service specification.<br>
> > On Aug 3, 2013 11:32 AM, "Lionel Elie Mamane" <<a href="mailto:lionel@mamane.lu">lionel@mamane.lu</a>> wrote:<br>
> ><br>
> > > On Sat, Aug 03, 2013 at 05:51:37PM +0200, Markus Mohrhard wrote:<br>
> > ><br>
> > > > I'm until September in vacation so i can only give you some General<br>
> > > > advice.<br>
> > ><br>
> > > I see. If I don't get it to work, it will have to wait.<br>
> > ><br>
> > > > Most of the time loading fails because of a wrong path or missing<br>
> > > component<br>
> > > > files. I suppose you checked the first so you might need a dbgutil build<br>
> > > > that prints information about failed loading of component files for uno<br>
> > > > interfaces.<br>
> > ><br>
> > > Well, I have a dbgutil build, but it is not enlightening:<br>
> > ><br>
> > >   [build CUT] dbaccess_dialog_save<br>
> > >   warn:xmloff.core:29588:1:xmloff/source/core/xmlimp.cxx:851: exception<br>
> > > caught<br>
> > >   warn:legacy.osl:29588:1:xmloff/source/core/xmlimp.cxx:852: caught an<br>
> > > exception!<br>
> > >   in function:virtual void SvXMLImport::setTargetDocument(const<br>
> > > com::sun::star::uno::Reference<com::sun::star::lang::XComponent>&)<br>
> > >   type: com.sun.star.lang.NotInitializedException<br>
> > >   context: N8dbaccess17ODatabaseDocumentE<br>
> > ><br>
> > > This one is usual / not a fatal problem: I get it each time I open an<br>
> > > .odb file "normally". I once tried to get rid of it, but never got<br>
> > > anywhere. But the following one, I'm more clueless about:<br>
> > ><br>
> > >   warn:legacy.osl:29588:1:dbaccess/source/filter/xml/dbloader2.cxx:519:<br>
> > > caught an exception!<br>
> > >   in function:virtual void dbaxml::DBContentLoader::load(const<br>
> > > com::sun::star::uno::Reference<com::sun::star::frame::XFrame>&, const<br>
> > > rtl::OUString&, const<br>
> > > com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>&, const<br>
> > > com::sun::star::uno::Reference<com::sun::star::frame::XLoadEventListener>&)<br>
> > >   type: com.sun.star.uno.DeploymentException<br>
> > >   message: component context fails to supply service<br>
> > >   com.sun.star.document.DocumentRevisionListPersistence of type<br>
> > >   com.sun.star.document.XDocumentRevisionListPersistence<br>
> > >   context: N4cppu16ComponentContextE<br>
> > ><br>
> > >   This used to be an assertion failure: Desktop disposed before<br>
> > > terminating it, but nothing bad seems to happen anyway?<br>
> > >   macros_test.cxx:43:Assertion<br>
> > >   Test name: DialogSaveTest::test<br>
> > >   assertion failed<br>
> > >   - Expression: xComponent.is()<br>
> > >   - loading failed:<br>
> > >   file:///home/master/src/libreoffice/workdirs/master/dbaccess/<br>
> > >   qa/extras/testdocuments/testDialogSave.odb<br>
> > ><br>
> > > It looks weird that the path is cut in two like that, but I added a<br>
> > >  std::cerr << fileName << std::endl;<br>
> > > and there it comes out without newline; I assume it is the cppunit<br>
> > > stuff that does some word-wrapping.<br>
> > ><br>
> > ><br>
> > > > The changes to the existing unit tests are fine.<br>
> > ><br>
> > > OK, will commit them.<br>
> > ><br>
> > ><br>
> > > > On Aug 3, 2013 10:36 AM, "Lionel Elie Mamane" <<a href="mailto:lionel@mamane.lu">lionel@mamane.lu</a>> wrote:<br>
> > > ><br>
> > > > > Thanks for these pointers. I think I mostly got it, but it fails for<br>
> > > > > me, and not at the place I expected it to.<br>
> > > > ><br>
> > > > > Could you please take a look at branch private/lmamane/basetest ?<br>
> > > > ><br>
> > > > > It contains:<br>
> > > > ><br>
> > > > >  commit d965888eb4a0be4c0bdd33fb0b401546de48af0b<br>
> > > > >  Author: Lionel Elie Mamane <<a href="mailto:lionel@mamane.lu">lionel@mamane.lu</a>><br>
> > > > >  Date:   Sat Aug 3 10:50:14 2013 +0200<br>
> > > > ><br>
> > > > >     proposed changes to other unittests<br>
> > > > ><br>
> > > > >     Change-Id: I64769fee917c5d8c6450a19ad53fdf795e280c98<br>
> > > > ><br>
> > > > > Just things I found weird in existing tests I took inspiration of, but<br>
> > > > > before pushing to master, want a quick check by you.<br>
> > > > ><br>
> > > > > Then it contains:<br>
> > > > ><br>
> > > > >  commit bbcc93b3ad2eec0a717b5c59053519cc668cb27b<br>
> > > > >  Author: Lionel Elie Mamane <<a href="mailto:lionel@mamane.lu">lionel@mamane.lu</a>><br>
> > > > >  Date:   Sat Aug 3 10:49:41 2013 +0200<br>
> > > > ><br>
> > > > >     first stab at unittest for fdo#67685<br>
> > > > ><br>
> > > > >     Change-Id: I44500717109a026d7c71e6494daacbea1f224263<br>
> > > > ><br>
> > > > > Which is the unittest I wanted to add, but it does not work. It fails<br>
> > > > > at:<br>
> > > > ><br>
> > > > > Test name: DialogSaveTest::test<br>
> > > > > assertion failed<br>
> > > > > - Expression: xComponent.is()<br>
> > > > > - loading failed:<br>
> > > > > file:///home/master/src/libreoffice/workdirs/master/dbaccess/<br>
> > > > > qa/extras/testdocuments/testDialogSave.odb<br>
> > > > ><br>
> > > > > Dunno what wrong. Thanks in advance for your help.<br>
> > > > ><br>
> > > > ><br>
> > > > > On Sat, Aug 03, 2013 at 02:35:49AM +0200, Markus Mohrhard wrote:<br>
> > > > > > Hey Lionel,<br>
> > > > > ><br>
> > > > > > So you basically have two options. We already have a test concept<br>
> > > where<br>
> > > > > we<br>
> > > > > > open a file and execute a basic macro in it. You can find an example<br>
> > > for<br>
> > > > > it<br>
> > > > > > in sc/qa/extras/macros-test.cxx<br>
> > > > > ><br>
> > > > > > The other more flexible option is that you open a document and call<br>
> > > the<br>
> > > > > uno<br>
> > > > > > calls yourself from c++. The advantage of the second option is that<br>
> > > it<br>
> > > > > > allows to add additional assertions and easier debugging but it<br>
> > > takes a<br>
> > > > > bit<br>
> > > > > > more code.<br>
> > > > > ><br>
> > > > > > Regards,<br>
> > > > > > Markus<br>
> > > > > > On Aug 2, 2013 5:59 PM, "Lionel Elie Mamane" <<a href="mailto:lionel@mamane.lu">lionel@mamane.lu</a>><br>
> > > wrote:<br>
> > > > > ><br>
> > > > > > > I'd appreciate some help in writing a unittest (subsequenttest?)<br>
> > > for<br>
> > > > > > > <a href="https://bugs.freedesktop.org/67685">https://bugs.freedesktop.org/67685</a><br>
> > > > > > ><br>
> > > > > > > It is the second time such a bug crops up, I'd like to prevent it.<br>
> > > > > > ><br>
> > > > > > > Basically, we "just" need to open an .odb file, run a Basic macro<br>
> > > (we<br>
> > > > > > > can set it to autorun on document load), then save the file, and<br>
> > > > > > > inspect the result.<br>
> > > > > > ><br>
> > > > > > > Thanks in advance!<br>
> > > > > > ><br>
> > > > > > > --<br>
> > > > > > > Lionel<br>
> > > > ><br>
> > ><br>
> > > > _______________________________________________<br>
> > > > LibreOffice mailing list<br>
> > > > <a href="mailto:LibreOffice@lists.freedesktop.org">LibreOffice@lists.freedesktop.org</a><br>
> > > > <a href="http://lists.freedesktop.org/mailman/listinfo/libreoffice">http://lists.freedesktop.org/mailman/listinfo/libreoffice</a><br>
> > ><br>
> > ><br>
><br>
> > _______________________________________________<br>
> > LibreOffice mailing list<br>
> > <a href="mailto:LibreOffice@lists.freedesktop.org">LibreOffice@lists.freedesktop.org</a><br>
> > <a href="http://lists.freedesktop.org/mailman/listinfo/libreoffice">http://lists.freedesktop.org/mailman/listinfo/libreoffice</a><br>
><br>
</p>