Re: About fdo#70185 starmath: unit test writing

2015-01-11 Thread Takeshi Abe
Hi,

The setup problem on starmath import CppunitTest has been resolved finally
after a month I had been stuck for understanding why the initial patch did not
work; linking objects in the sm library to the test case by calling
gb_CppunitTest_use_library_objects caused arranging two different
addresses of duplicate entries in runtime for SmModel::getUnoTunnelId(),
which unexpectedly ended up returnig one of the two different UUIDs arbitrarily
for each time.

Thus I have tried linking the sm (and smd) shared library by
gb_CppunitTest_use_libraries instead. This however requires that some symbols
used in the test case are visible. So I have introduced the SM_DLLPUBLIC
trick in new smdllapi.h, as like in sc / sd / sw. The CppunitTest has passed 
now.
You can find the revised patch at https://gerrit.libreoffice.org/13861.

Cheers,
-- Takeshi Abe
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: About fdo#70185 starmath: unit test writing

2014-12-10 Thread Markus Mohrhard
Hey,

On Tue, Dec 9, 2014 at 9:30 AM, Takeshi Abe t...@fixedpoint.jp wrote:

 Hi Markus,

 On Tue, 9 Dec 2014 07:13:37 +0100, Markus Mohrhard 
 markus.mohrh...@googlemail.com wrote:
  so the attched version of the patch gets you past that problem. Now the
  test fails actually in parsing which you should debug and check if there
 is
  something missing or if there is a setup problem.
 
  The problem that I fixed is that because you passed the filter version as
  current it was trying to handle the file as a ODF file. I think there are
  still a few wrong filter flags but that would need some more debugging
 and
  checking which are used during a normal import.
 Thanks a lot for pointing out the filter version, which I suspected but
 could not figure out which version should work.
 Anyway the same problem still persists in my environment as follows.
 Just in case, I have run 'make clean' and then 'make starmath.all'.



I know that it is still not working. I just helped to get you to a point
where it is now failing inside of the starmath import. You need to debug
now why the import actually fails.

Regards,
Markus


 ---
 [build CUT] starmath_import
 warn:vcl.app:24879:1:vcl/source/app/IconThemeScanner.cxx:76: Could not
 find any icon themes in the provided directory
 ('file:///home/tabe/build/instdir/share/config/'.
 warn:legacy.osl:24879: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:24879:1:framework/source/services/desktop.cxx:1020: Desktop
 disposed before terminating it
 warn:tools.debug:24879:1:tools/source/debug/debug.cxx:297: no
 DbgTestSolarMutex function set
 warn:fwk:24879:1:framework/source/services/desktop.cxx:185: Desktop not
 terminated before being destructed
 warn:legacy.osl:24879: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
 ---

 Cheers,
 -- Takeshi Abe

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: About fdo#70185 starmath: unit test writing

2014-12-09 Thread Takeshi Abe
Hi Markus,

On Tue, 9 Dec 2014 07:13:37 +0100, Markus Mohrhard 
markus.mohrh...@googlemail.com wrote:
 so the attched version of the patch gets you past that problem. Now the
 test fails actually in parsing which you should debug and check if there is
 something missing or if there is a setup problem.
 
 The problem that I fixed is that because you passed the filter version as
 current it was trying to handle the file as a ODF file. I think there are
 still a few wrong filter flags but that would need some more debugging and
 checking which are used during a normal import.
Thanks a lot for pointing out the filter version, which I suspected but
could not figure out which version should work.
Anyway the same problem still persists in my environment as follows.
Just in case, I have run 'make clean' and then 'make starmath.all'.
---
[build CUT] starmath_import
warn:vcl.app:24879:1:vcl/source/app/IconThemeScanner.cxx:76: Could not find any 
icon themes in the provided directory 
('file:///home/tabe/build/instdir/share/config/'.
warn:legacy.osl:24879: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:24879:1:framework/source/services/desktop.cxx:1020: Desktop disposed 
before terminating it
warn:tools.debug:24879:1:tools/source/debug/debug.cxx:297: no DbgTestSolarMutex 
function set
warn:fwk:24879:1:framework/source/services/desktop.cxx:185: Desktop not 
terminated before being destructed
warn:legacy.osl:24879: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
---

Cheers,
-- Takeshi Abe
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


About fdo#70185 starmath: unit test writing

2014-12-08 Thread Takeshi Abe
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_castSmModel *
(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
From f82e628f77151d118b555efc0d15a1a8e60c4e3b Mon Sep 17 00:00:00 2001
From: Takeshi Abe t...@fixedpoint.jp
Date: Tue, 9 Dec 2014 11:40:54 +0900
Subject: [PATCH] prototype of unit test for importing a MathML file

Change-Id: I19f38c85b6475c15679653c31413e7d0f6aef309
---
 starmath/CppunitTest_starmath_import.mk |   93 +++
 starmath/Module_starmath.mk |1 +
 starmath/qa/extras/data/simple.mml  |   13 +
 starmath/qa/extras/mmlimport-test.cxx   |   92 ++
 4 files changed, 199 insertions(+)
 create mode 100644 starmath/CppunitTest_starmath_import.mk
 create mode 100644 starmath/qa/extras/data/simple.mml
 create mode 100644 starmath/qa/extras/mmlimport-test.cxx

diff --git a/starmath/CppunitTest_starmath_import.mk b/starmath/CppunitTest_starmath_import.mk
new file mode 100644
index 000..d570b9b
--- /dev/null
+++ b/starmath/CppunitTest_starmath_import.mk
@@ -0,0 +1,93 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_CppunitTest_CppunitTest,starmath_import))
+
+$(eval $(call gb_CppunitTest_set_include,starmath_import,\
+$$(INCLUDE) \
+-I$(SRCDIR)/starmath/inc \
+))
+
+$(eval $(call gb_CppunitTest_use_external,starmath_import,boost_headers))
+
+$(eval $(call gb_CppunitTest_use_api,starmath_import,\
+offapi \
+udkapi \
+))
+
+$(eval $(call gb_CppunitTest_use_library_objects,starmath_import,\
+sm \
+smd \
+))
+
+$(eval $(call gb_CppunitTest_use_libraries,starmath_import,\
+comphelper \
+cppu \
+cppuhelper \
+editeng \
+i18nlangtag \
+i18nutil \
+msfilter \
+oox \
+sal \
+salhelper \
+sax \
+sfx \
+sot \
+svl \
+svt \
+svx \
+svxcore \
+test \
+tk \
+tl \
+unotest \
+unoxml \
+utl \
+vcl \
+xo \
+	$(gb_UWINAPI) \
+))
+
+$(eval $(call gb_CppunitTest_add_exception_objects,starmath_import,\
+starmath/qa/extras/mmlimport-test \
+))
+
+$(eval $(call gb_CppunitTest_use_ure,starmath_import))
+$(eval $(call gb_CppunitTest_use_vcl,starmath_import))
+
+$(eval $(call gb_CppunitTest_use_components,starmath_import,\
+configmgr/source/configmgr \
+framework/util/fwk \
+i18npool/util/i18npool \
+package/source/xstor/xstor \
+package/util/package2 \
+sfx2/util/sfx \
+starmath/util/sm \
+starmath/util/smd \
+toolkit/util/tk \
+

Re: About fdo#70185 starmath: unit test writing

2014-12-08 Thread Markus Mohrhard
Hey,

On Tue, Dec 9, 2014 at 3:57 AM, Takeshi Abe t...@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_castSmModel *
 (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
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: About fdo#70185 starmath: unit test writing

2014-12-08 Thread Takeshi Abe
Hi Markus,

Thank you for quick reply.

On Tue, 9 Dec 2014 04:47:16 +0100, Markus Mohrhard 
markus.mohrh...@googlemail.com wrote:
(snip)
 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?
That's the attached one with the previous mail.
Or, do you mean any other essential piece of new cppunit tests are missing
in the patch?

Cheers,
-- Takeshi Abe
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: About fdo#70185 starmath: unit test writing

2014-12-08 Thread Markus Mohrhard
On Tue, Dec 9, 2014 at 5:43 AM, Takeshi Abe t...@fixedpoint.jp wrote:

 Hi Markus,

 Thank you for quick reply.

 On Tue, 9 Dec 2014 04:47:16 +0100, Markus Mohrhard 
 markus.mohrh...@googlemail.com wrote:
 (snip)
  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?
 That's the attached one with the previous mail.


Sorry, I missed that. I'll have a look at it.


 Or, do you mean any other essential piece of new cppunit tests are missing
 in the patch?

 Cheers,
 -- Takeshi Abe

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: About fdo#70185 starmath: unit test writing

2014-12-08 Thread Markus Mohrhard
Hey,

so the attched version of the patch gets you past that problem. Now the
test fails actually in parsing which you should debug and check if there is
something missing or if there is a setup problem.

The problem that I fixed is that because you passed the filter version as
current it was trying to handle the file as a ODF file. I think there are
still a few wrong filter flags but that would need some more debugging and
checking which are used during a normal import.

Regards,
Markus

On Tue, Dec 9, 2014 at 5:58 AM, Markus Mohrhard 
markus.mohrh...@googlemail.com wrote:



 On Tue, Dec 9, 2014 at 5:43 AM, Takeshi Abe t...@fixedpoint.jp wrote:

 Hi Markus,

 Thank you for quick reply.

 On Tue, 9 Dec 2014 04:47:16 +0100, Markus Mohrhard 
 markus.mohrh...@googlemail.com wrote:
 (snip)
  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?
 That's the attached one with the previous mail.


 Sorry, I missed that. I'll have a look at it.


 Or, do you mean any other essential piece of new cppunit tests are missing
 in the patch?

 Cheers,
 -- Takeshi Abe



From 342ae77c50c877870cfc9452acaee5edc2f6c542 Mon Sep 17 00:00:00 2001
From: Takeshi Abe t...@fixedpoint.jp
Date: Tue, 9 Dec 2014 11:40:54 +0900
Subject: [PATCH] prototype of unit test for importing a MathML file

Change-Id: I19f38c85b6475c15679653c31413e7d0f6aef309
---
 starmath/CppunitTest_starmath_import.mk | 93 +
 starmath/Module_starmath.mk |  1 +
 starmath/qa/extras/data/simple.mml  | 13 +
 starmath/qa/extras/mmlimport-test.cxx   | 92 
 4 files changed, 199 insertions(+)
 create mode 100644 starmath/CppunitTest_starmath_import.mk
 create mode 100644 starmath/qa/extras/data/simple.mml
 create mode 100644 starmath/qa/extras/mmlimport-test.cxx

diff --git a/starmath/CppunitTest_starmath_import.mk b/starmath/CppunitTest_starmath_import.mk
new file mode 100644
index 000..d570b9b
--- /dev/null
+++ b/starmath/CppunitTest_starmath_import.mk
@@ -0,0 +1,93 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_CppunitTest_CppunitTest,starmath_import))
+
+$(eval $(call gb_CppunitTest_set_include,starmath_import,\
+$$(INCLUDE) \
+-I$(SRCDIR)/starmath/inc \
+))
+
+$(eval $(call gb_CppunitTest_use_external,starmath_import,boost_headers))
+
+$(eval $(call gb_CppunitTest_use_api,starmath_import,\
+offapi \
+udkapi \
+))
+
+$(eval $(call gb_CppunitTest_use_library_objects,starmath_import,\
+sm \
+smd \
+))
+
+$(eval $(call gb_CppunitTest_use_libraries,starmath_import,\
+comphelper \
+cppu \
+cppuhelper \
+editeng \
+i18nlangtag \
+i18nutil \
+msfilter \
+oox \
+sal \
+salhelper \
+sax \
+sfx \
+sot \
+svl \
+svt \
+svx \
+svxcore \
+test \
+tk \
+tl \
+unotest \
+unoxml \
+utl \
+vcl \
+xo \
+	$(gb_UWINAPI) \
+))
+
+$(eval $(call gb_CppunitTest_add_exception_objects,starmath_import,\
+starmath/qa/extras/mmlimport-test \
+))
+
+$(eval $(call gb_CppunitTest_use_ure,starmath_import))
+$(eval $(call gb_CppunitTest_use_vcl,starmath_import))
+
+$(eval $(call gb_CppunitTest_use_components,starmath_import,\
+configmgr/source/configmgr \
+framework/util/fwk \
+i18npool/util/i18npool \
+package/source/xstor/xstor \
+package/util/package2 \
+sfx2/util/sfx \
+starmath/util/sm \
+starmath/util/smd \
+toolkit/util/tk \
+ucb/source/core/ucb1 \
+ucb/source/ucp/file/ucpfile1 \
+unotools/util/utl \
+comphelper/util/comphelp \
+filter/source/config/cache/filterconfig1 \
+oox/util/oox \
+sax/source/expatwrap/expwrap \
+svl/source/fsstor/fsstorage \
+svl/util/svl \
+svx/util/svx \
+unoxml/source/service/unoxml \
+xmloff/util/xo \
+))
+
+$(eval $(call gb_CppunitTest_use_configuration,starmath_import))
+
+$(eval $(call gb_CppunitTest_use_unittest_configuration,starmath_import))
+
+# vim: set noet sw=4 ts=4:
diff --git a/starmath/Module_starmath.mk b/starmath/Module_starmath.mk
index 2830a46..1a6af4c 100644
--- a/starmath/Module_starmath.mk
+++ b/starmath/Module_starmath.mk
@@ -21,6 +21,7 @@ $(eval $(call gb_Module_add_l10n_targets,starmath,\
 ))
 
 $(eval $(call gb_Module_add_check_targets,starmath,\
+CppunitTest_starmath_import \
 CppunitTest_starmath_qa_cppunit \
 ))
 
diff --git a/starmath/qa/extras/data/simple.mml b/starmath/qa/extras/data/simple.mml
new file mode 100644
index 000..822d1a7
--- /dev/null
+++ b/starmath/qa/extras/data/simple.mml
@@ -0,0 +1,13 @@
+?xml