About fdo#70185 starmath: unit test writing

Takeshi Abe tabe at fixedpoint.jp
Mon Dec 8 18:57:26 PST 2014


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.
---
[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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-prototype-of-unit-test-for-importing-a-MathML-file.patch
Type: text/x-patch
Size: 7049 bytes
Desc: 0001-prototype-of-unit-test-for-importing-a-MathML-file.patch
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20141209/4c2c0907/attachment.bin>


More information about the LibreOffice mailing list