About fdo#70185 starmath: unit test writing

Markus Mohrhard markus.mohrhard at googlemail.com
Mon Dec 8 19:47:16 PST 2014


Hey,

On Tue, Dec 9, 2014 at 3:57 AM, Takeshi Abe <tabe at fixedpoint.jp> wrote:

> Hi,
>
> I am going to prepare a unit test for starmath's import filter, which is
> proposed in https://bugs.freedesktop.org/show_bug.cgi?id=70185.
> As a first step, I have made up the test case attached for importing a
> MathML
> file. Running the test case named "starmath_import" seems to finish reading
> the input .mml, but failed in the end with the following message.
>

Great to see some progress in adding test for the Math module. The first
steps until having a first working test are the hardest so I'll try to
assist you here a bit.



> ---
> [build CUT] starmath_import
> warn:legacy.osl:5812:1:starmath/source/mathmlimport.cxx:537: So there
> *was* a uno problem after all
> /home/tabe/core/starmath/qa/extras/mmlimport-test.cxx:63:(anonymous
> namespace)::Test::testSimple
> assertion failed
> - Expression: bLoaded
> - failed to load file:///home/tabe/core/starmath/qa/extras/data/simple.mml
>
> mmlimport-test.cxx:63:Assertion
> Test name: (anonymous namespace)::Test::testSimple
> assertion failed
> - Expression: bLoaded
> - failed to load file:///home/tabe/core/starmath/qa/extras/data/simple.mml
>
> Failures !!!
> Run: 1   Failure total: 1   Failures: 1   Errors: 0
> warn:fwk:5812:1:framework/source/services/desktop.cxx:1020: Desktop
> disposed before terminating it
> warn:tools.debug:5812:1:tools/source/debug/debug.cxx:297: no
> DbgTestSolarMutex function set
> warn:fwk:5812:1:framework/source/services/desktop.cxx:185: Desktop not
> terminated before being destructed
> warn:legacy.osl:5812:1:unotools/source/config/configmgr.cxx:167:
> OSL_ASSERT: items_.empty()
>
> Error: a unit test failed, please do one of:
>
> export DEBUGCPPUNIT=TRUE            # for exception catching
> export CPPUNITTRACE="gdb --args"    # for interactive debugging on Linux
> export CPPUNITTRACE="\"[full path to devenv.exe]\" /debugexe" # for
> interactive debugging in Visual Studio
> export VALGRIND=memcheck            # for memory checking
>
> and retry using: make CppunitTest_starmath_import
>
> ---
>
> As far as I see, in the following code around line 508 of
> starmath/source/mathmlimport.cxx
> ---
>         uno::Reference <frame::XModel> xModel = GetModel();
>         uno::Reference <lang::XUnoTunnel> xTunnel;
>         xTunnel = uno::Reference <lang::XUnoTunnel>
> (xModel,uno::UNO_QUERY);
>         SmModel *pModel = reinterpret_cast<SmModel *>
>             (xTunnel->getSomething(SmModel::getUnoTunnelId()));
> ---
> pModel ended up being NULL, but I have no idea what really happens.
> Could you give me any clue?
> Thank you for your attention.
>
> Cheers,
> -- Takeshi Abe
>


So this might be just a missing component file in the makefile. Could you
please attach your work in progress patch so we can easily reproduce the
problem and help you?

Regards,
Markus
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20141209/ed30d4d2/attachment.html>


More information about the LibreOffice mailing list