https://wiki.openoffice.org/w/api.php?action=feedcontributions&user=Sb&feedformat=atomApache OpenOffice Wiki - User contributions [en]2024-03-29T12:01:33ZUser contributionsMediaWiki 1.23.13https://wiki.openoffice.org/wiki/Documentation/DevGuide/AppendixD/UNOIDL_Syntax_SpecificationDocumentation/DevGuide/AppendixD/UNOIDL Syntax Specification2013-09-03T10:09:36Z<p>Sb: fix errors in method-decl, interface-service-decl, accumulated-service-decl</p>
<hr />
<div>{{Documentation/DevGuide/AppendixDTOC<br />
|ShowPrevNext=block<br />
|PrevPage=Documentation/DevGuide/AppendixC/The Help Content Provider<br />
|NextPage=Documentation/DevGuide/Glossary/Glossary<br />
}}<br />
{{Documentation/DevGuideLanguages|Documentation/DevGuide/AppendixD/{{SUBPAGENAME}}}}<br />
{{DISPLAYTITLE:Appendix D: UNOIDL Syntax Specification}} <br />
{{Download Collection|MediaWiki:Collections/Developer's Guide - UNOIDL Syntax Specification}}<br />
The following listing comprises the language specification for UNOIDL in pseudo [http://cui.unige.ch/db-research/Enseignement/analyseinfo/AboutBNF.html BNF notation]. <br />
<br />
idl-specification ::= declaration*<br />
<br />
declaration ::= enum-decl<br />
| plain-struct-decl<br />
| poly-struct-template-decl<br />
| exception-decl<br />
| interface-forward-decl<br />
| interface-decl<br />
| typedef-decl<br />
| constant-decl<br />
| constants-decl<br />
| module-decl<br />
| interface-service-decl<br />
| accumulated-service-decl<br />
| interface-singleton-decl<br />
| service-singleton-decl<br />
<br />
enum-decl ::= ["published"] "enum" identifier "{" enum-member-decl ("," enum-member-decl)* "}" ";"<br />
<br />
enum-member-decl ::= identifier ["=" expr]<br />
<br />
plain-struct-decl ::= ["published"] "struct" identifier [single-inheritance] "{" struct-member-decl+ "}" ";"<br />
<br />
single-inheritance ::= ":" name<br />
<br />
struct-member-decl ::= type identifier ";"<br />
<br />
poly-struct-template-decl ::= ["published"] "struct" identifier struct-params <br />
"{" poly-struct-member-decl+ "}" ";"<br />
<br />
struct-params ::= "<" identifier ("," identifier)* ">"<br />
<br />
poly-struct-member-decl ::= struct-member-decl | parametric-member-decl<br />
<br />
parametric-member-decl ::= identifier identifier ";"<br />
<br />
exception-decl ::= ["published"] "exception" identifier [single-inheritance] "{" struct-member-decl* "}" ";"<br />
<br />
interface-forward-decl ::= ["published"] "interface" identifier ";"<br />
<br />
interface-decl ::= ["published"] "interface" identifier [single-inheritance] "{" interface-member-decl* "}" ";"<br />
<br />
interface-member-decl ::= interface-inheritance-decl | attribute-decl | method-decl<br />
<br />
interface-inheritance-decl ::= ["[" "optional" "]"] "interface" name ";"<br />
<br />
attribute-decl ::= attribute-flags type identifier ["{" attribute-access-decl* "}"] ";"<br />
<br />
attribute-flags ::= "[" (attribute-flag ",")* "attribute" ("," attribute-flag)* "]"<br />
<br />
attribute-flag ::= "bound" | "readonly"<br />
<br />
attribute-access-decl ::= attribute-get-decl | attribute-set-decl<br />
<br />
attribute-get-decl ::= "get" exception-spec ";"<br />
<br />
attribute-set-decl ::= "set" exception-spec ";"<br />
<br />
exception-spec ::= "raises" "(" name ("," name)* ")"<br />
<br />
method-decl ::= ["[" "oneway" "]"] type identifier "(" [method-param ("," method-param)*] ")" [exception-spec] ";"<br />
<br />
method-param ::= "[" direction "]" type identifier<br />
<br />
direction ::= "in" | "out" | "inout"<br />
<br />
typedef-decl ::= ["published"] "typedef" type identifier ";"<br />
<br />
constant-decl ::= ["published"] const-decl<br />
<br />
const-decl ::= "const" type identifier "=" expr ";"<br />
<br />
constants-decl ::= ["published"] "constants" identifier "{" const-decl* "}" ";"<br />
<br />
module-decl ::= "module" identifier "{" declaration* "}" ";"<br />
<br />
interface-service-decl ::= ["published"] "service" identifier ":" name ["{" constructor-decl* "}"] ";"<br />
<br />
constructor-decl ::= identifier "(" [constructor-params] ")" [exception-spec] ";"<br />
<br />
constructor-params ::= rest-param | ctor-param ("," ctor-param)*<br />
<br />
rest-param ::= "[" "in" "]" "any" "..." identifier<br />
<br />
ctor-param ::= "[" "in" "]" type identifier<br />
<br />
accumulated-service-decl ::= ["published"] "service" identifier "{" service-member-decl+ "}" ";"<br />
<br />
service-member-decl ::= service-inheritance-decl | interface-inheritance-decl | property-decl<br />
<br />
service-inheritance-decl ::= ["[" "optional" "]"] "service" name ";"<br />
<br />
property-decl ::= property-flags type identifier ";"<br />
<br />
property-flags ::= "[" (property-flag ",")* "property" ("," property-flag)* "]"<br />
<br />
property-flag ::= "bound" | "constrained" | "maybeambiguous" | "maybedefault" | "maybevoid" | "optional" | "readonly" | "removable" | "transient"<br />
<br />
interface-singleton-decl ::= ["published"] "singleton" identifier ":" name ";"<br />
<br />
service-singleton-decl ::= ["published"] "singleton" identifier "{" "service" name ";" "}" ";"<br />
<br />
type ::= simple-type | sequence-type | poly-struct-type | name<br />
<br />
simple-type ::= "void" | "boolean" | "byte" | "short" | "unsigned" "short" | "long" | "unsigned" "long" | "hyper" | "unsigned" "hyper" | "float" | "double" | "char" | "string" | "type" | "any"<br />
<br />
sequence-type ::= "sequence" "<" type ">"<br />
<br />
poly-struct-type ::= name "<" type ("," type)* ">"<br />
<br />
expr ::= [expr "|"] xor-expr<br />
<br />
xor-expr ::= [xor-expr "^"] and-expr<br />
<br />
and-expr ::= [and-expr "&"] shift-expr<br />
<br />
shift-expr ::= [shift-expr shift-op] add-expr<br />
<br />
shift-op ::= "<<" | ">>"<br />
<br />
add-expr ::= [add-expr add-op] mult-expr<br />
<br />
add-op ::= "+" | "-"<br />
<br />
mult-expr ::= [mult-expr mult-op] unary-expr<br />
<br />
mult-op ::= "*" | "/" | "%"<br />
<br />
unary-expr ::= [unary-op] primary-expr<br />
<br />
unary-op ::= "+" | "-" | "~"<br />
<br />
primary-expr ::= name | literal | "(" expr ")"<br />
<br />
literal ::= boolean-literal | <INTEGER-LITERAL> | <FLOATING-POINT-LITERAL><br />
<br />
boolean-literal ::= "False" | "FALSE" | "True" | "TRUE"<br />
<br />
name ::= ["::"] (identifier "::")* identifier<br />
<br />
identifier ::= <IDENTIFIER><br />
<br />
{{PDL1}}<br />
<br />
[[Category:Documentation/Developer's Guide/Appendix]]</div>Sbhttps://wiki.openoffice.org/wiki/Test_CleanupTest Cleanup2012-02-09T09:28:45Z<p>Sb: fixed broken link</p>
<hr />
<div>= Test Cleanup Project =<br />
<br />
The demand for automated (unit) testing should be obvious. See the [http://www.openoffice.org/servlets/ReadMsg?list=dev&msgNo=26189 mission statement mail] and [[Media:JustTestingPresentation.odp|slides]] from a [http://fosdem.org/2010/schedule/events/ooo_testing FOSDEM'10 talk] and an [http://www.ooocon.org/index.php/ooocon/2010/paper/view/188 OOoCon&nbsp;2010 presentation] for more information and further links.<br />
<br />
For examples of how to write xUnit based tests in the OOo code base, see [http://hg.services.openoffice.org/DEV300/file/87f4911ea629/basegfx/test <code>basegfx/test/</code>], [http://hg.services.openoffice.org/DEV300/file/87f4911ea629/sal/qa/ByteSequence <code>sal/qa/ByteSequence/</code>], and [http://hg.services.openoffice.org/DEV300/file/87f4911ea629/smoketestoo_native <code>smoketest_native/</code>]. However, the hard part should not be how to write test code, anyway, but how to write ''testable'' code; see [http://misko.hevery.com/2008/11/04/clean-code-talks-unit-testing/ The Clean Code Talks&mdash;Unit Testing].<br />
<br />
When testing C++ code that merely uses UNO types (no services), but uses them in a way that requires UNO to be bootstrapped so that the relevant type information is available (e.g., putting instances of complex UNO types into <code>com::sun::star::uno::Any</code>), one approach is as follows: In the <code>makefile.mk</code>, instead of <code>.INCLUDE: _cppunit.mk</code> use<br />
<source lang="make"><br />
.IF "$(OS)" == "WNT"<br />
my_file = file:///<br />
.ELSE<br />
my_file = file://<br />
.END<br />
<br />
ALLTAR : test<br />
<br />
test .PHONY : $(SHL1TARGETN)<br />
$(CPPUNITTESTER) $(SHL1TARGETN) \<br />
-env:UNO_TYPES=$(my_file)$(SOLARBINDIR)/types.rdb<br />
</source><br />
and in the test code once call <code>cppu::defaultBootstrap_InitialComponentContext()</code>.<br />
<br />
== User Interface ==<br />
<br />
=== CppUnit ===<br />
<br />
For tests in C++, plain CppUnit (at least version 1.12.1) is available. (OOo bundles CppUnit 1.12.1 as an external module; alternatively, you can configure <code>--with-system-cppunit</code>.)<br />
<br />
Implement the test code as a dynamic library, following CppUnit conventions (i.e., using [http://cppunit.sourceforge.net/doc/lastest/group___creating_test_suite.html#ga0 <code>CPPUNIT_TEST_SUITE_REGISTRATION</code>] and [http://cppunit.sourceforge.net/doc/lastest/_test_plug_in_8h.html#a2 <code>CPPUNIT_PLUGIN_IMPLEMENT</code>] macros). The following settings are needed in the <code>makefile.mk</code>:<br />
* <code>ENABLE_EXCEPTIONS = TRUE</code><br />
* <code>CFLAGSCXX += $(CPPUNIT_CFLAGS)</code><br />
* <code>SHL<var>n</var>RPATH = NONE</code><br />
* <code>SHL<var>n</var>STDLIBS += $(CPPUNITLIB)</code><br />
* <code>SHL<var>n</var>VERSIONMAP = <var>version.map</var></code>, where that file must contain the following (see [[#CppUnit_1.12.1|details]] below for improving this):<br />
UDK_3_0_0 {<br />
global:<br />
cppunitTestPlugIn;<br />
local:<br />
*;<br />
};<br />
<br />
To run tests, <code>sal/cppunittester</code> delivers a <code>cppunittester</code> executable that has some advantages over the plain CppUnit <code>DllPlugInTester</code>:<br />
* It uses <code>SAL_IMPLEMENT_MAIN</code> to properly set up the per-process settings required by URE. Test code as well as tested code based on URE will expect this and would fail in a process that is not set up in this way.<br />
* Getting CppUnit to build as an external module within the Windows OOo build is a non-trivial task. The less parts of it that need to be built, the better.<br />
<br />
Something like the following in <code>makefile.mk</code> will execute the tests:<br />
ALLTAR : test<br />
test .PHONY : $(SHL1TARGETN)<br />
$(CPPUNITTESTER) $(SHL1TARGETN)<br />
<br />
<code>$(CPPUNITTESTER)</code> internally uses <code>$(AUGMENT_LIBRARY_PATH_LOCAL)</code> to favor library instances in the local output tree over ones in solver. Alternatively to the above, <code>.INCLUDE: _cppunit.mk</code> calls <code>$(CPPUNITTESTER)</code> on each of <code>$(SHL1TARGETN)</code>, &hellip;, <code>$(SHL10TARGETN)</code> that is defined.<br />
<br />
=== JUnit ===<br />
<br />
For tests in Java, plain JUnit (at least version 4) is available. (OOo requires JUnit as a prerequisite, see [http://junit.org/ junit.org] for downloads; you can configure <code>--with-junit=<var>&hellip;</var></code> if it is not automatically found; alternatively, you can configure <code>--without-junit</code>, disabling JUnit-based tests.)<br />
<br />
=== <code>subsequenttests</code> ===<br />
<br />
Some tests have build and/or run time dependencies on modules further up in the hierarchy, or modules that the rest of the module in question does not have dependencies on (and which are thus not listed in the module's <code>build.lst</code>). The extreme case are tests that need a complete OOo installation as their test environment.<br />
<br />
For such tests, the whole <code>makefile.mk</code> should be wrapped in:<br />
.IF "$(OOO_SUBSEQUENT_TESTS)" == ""<br />
nothing .PHONY :<br />
.ELSE<br />
...<br />
.END<br />
(and the directory included in the module's <code>build.lst</code>).<br />
<br />
The idea is to do a complete OOo build first (<code>cd smoketestoo_native && build --all</code>) and then build and execute those tests either selectively or wholesale.<br />
<br />
Selectively building a specific such test directory can be done with <code>cd <var>&hellip;</var> && OOO_SUBSEQUENT_TESTS=TRUE dmake</code>.<br />
<br />
To build and execute ''all'' these test directories, the tool <code>subsequenttests</code> (in <code>solenv/bin</code>) exists. It scans the <code>build.lst</code> files of all modules for <code>makefile.mk</code>s that mention <code>OOO_SUBSEQUENT_TESTS</code> and simply executes <code>dmake</code> in all those directories, with <code>OOO_SUBSEQUENT_TESTS</code> set. It supports a <code>-P<var>n</var></code> switch to build <var>n</var> directories in parallel.<br />
<br />
=== Helpers ===<br />
<br />
A new module <code>test</code> shall collect reusable code snippets for C++ and Java tests.<br />
<br />
For now, it concentrates on letting a test connect to an OOo instance via remote UNO: A C++ test class can hold a <code>test::OfficeConnection</code> as class member and, in its CppUnit <code>setUp</code> and <code>tearDown</code> functions, call <code>OfficeConnection::setUp</code> and <code>OfficeConnection::tearDown</code>, respectively. Tests obtain access to the OOo instance via <code>OfficeConnection::getFactory</code>. Similarly, a Java test class can use an <code>org.openoffice.test.OfficeConnection</code> instance, offering the same functionality as its C++ counterpart.<br />
<br />
For this to work, three additional steps are necessary:<br />
* First, in <code>instsetoo_native</code>, building an installation set for the <code>openoffice</code> product in the default language (<code>en-US</code>) in any package format now takes care to always also build an archive package format (<code>tar.gz</code> resp. <code>zip</code>) of that product.<br />
* Second, building <code>smoketestoo_native</code> permanently installs that archive into the solver. (Except on Windows, where problems with resulting long pathnames prevent this; there, as a workaround, each test individually unzips the archive to some local temporary directory.) <br />
* Third, a test that requires an OOo instance includes <code>installationtest.mk</code> in its <code>makefile.mk</code>. That file makes sure to call the CppUnit and JUnit test runners with the information necessary for the helper classes to start the correct OOo instance with a fresh <code>UserInstallation</code> and set up an URP pipe connection. The information is tunneled into the test runner executables as UNO bootstrap parameters.<br />
<br />
For debugging purposes, which OOo instance the tests use can manually be overridden, see [https://issues.apache.org/ooo/show_bug.cgi?id=111558#c5 &ldquo;installationtest.mk: allow override of tested soffice process&rdquo;].<br />
<br />
=== <code>unoapi</code> Tests ===<br />
<br />
The <code>unoapi</code> tests are redesigned to use the new test framework. They are plain JUnit tests and use the mechanisms described above to connect to running OOo instances. However, due to the large amount of logic encoded in <code>qadevOOo</code>, those JUnit tests for now are only thin wrappers around <code>org.openoffice.Runner.run</code>. This is intended to change over time.<br />
<br />
The <code>cwscheckapi</code> tool to run the <code>unoapi</code> tests has been subsumed by <code>subsequenttests</code>. The latter always runs all tests, while the former had mechanisms to run only tests for modules that had been changed by a CWS. The hope is that the parallel mode of <code>subsequenttests</code> makes it fast enough so that running all tests all of the times becomes feasible.<br />
<br />
Unfortunately, running the <code>unoapi</code> tests is still not stable enough to give useful results. Therefore, running <code>subsequenttests</code> has been disabled in the build bots for now. Making the tests sufficiently stable is ongoing work.<br />
<br />
== Details ==<br />
<br />
Working on {{CWS|sb118}}, {{CWS|sb120}}.<br />
<br />
=== CppUnit 1.12.1 ===<br />
<br />
* Replace existing <code>cppunit</code> and <code>testshl2</code> combo with latest CppUnit 1.12.1.<br />
* OOo <code>configure --with-system-cppunit</code> (for now only if also <code>--with-system-stl</code>!); minimal required version for now arbitrarily 1.12.1.<br />
* '''TODO:''' Upstream <code>PATCH_FILES</code> (<code>windows.patch</code>?!?).<br />
* '''TODO:''' <code>RPATH</code> in generated libraries and executables.<br />
* '''TODO:''' Improve <code>CPPUNIT_PLUGIN_EXPORT</code> and get rid of version maps (GCC exception problems?).<br />
* '''TODO:''' <code>cppunit/makefile.mk</code> <code>MY_LIBS = -lm</code> Solaris hack.<br />
* '''TODO:''' In general OOo build environment, no longer set <code>CFLAGS</code> etc. as environment variables; have package-specific <code>OOO_<var>package</var>_CFLAGS</code> etc. and combine those into <code>CFLAGS</code> etc. where necessary (see <code>OOO_STLPORT_CXXFLAGS</code> etc. in <code>cppunit/makefile.mk</code>).<br />
* '''TODO:''' Why use <code>cppunittester</code> instead of <code>DllPlugInTester</code>? (Remove building/delivering <code>DllPlugInTester</code>.)<br />
* '''TODO:''' Make <code>operator &lt;&lt;(std::basic_ostream &amp;, rtl::OUString const &amp;)</code> from <code>test/oustringstreaminserter.hxx</code> generally available?<br />
* '''TODO:''' Make STLport <code>num_put</code> symbols available on platforms other than Linux (see <code>solenv/bin/addsym.awk</code>), too, so that <code>CPPUNIT_ASSERT_EQUAL</code> actually outputs numeric values.<br />
<br />
==== Is CppUnit an active project? ====<br />
<br />
When I wrote<br />
<pre><br />
Message-ID: <4D67B884.8080101@oracle.com><br />
Date: Fri, 25 Feb 2011 15:11:16 +0100<br />
From: Stephan Bergmann <stephan.bergmann@oracle.com><br />
MIME-Version: 1.0<br />
To: cppunit-devel@lists.sourceforge.net<br />
Subject: What part of the API is published?<br />
Content-Type: text/plain; charset=UTF-8; format=flowed<br />
Content-Transfer-Encoding: 7bit<br />
<br />
At least for CppUnit 1.12.1, it is unclear whether for example class <br />
DynamicLibraryManager is supposed to be available to client code.<br />
<br />
The HTML documentation's class list contains DynamicLibraryManager just <br />
like, say, TestCase, and I can't find any hint on the former's page that <br />
it is an implementation detail. However, in DynamicLibraryManager.h, <br />
the class is not decorated with CPPUNIT_API.<br />
<br />
Is there any specification of what is published (i.e., stable, usable by <br />
clients) vs. what is implementation detail (i.e., not to be used by <br />
clients)?<br />
<br />
-Stephan<br />
</pre><br />
the only response I ever got was<br />
<pre><br />
MIME-Version: 1.0<br />
Content-Type: text/plain; charset="us-ascii"<br />
Content-Transfer-Encoding: 7bit<br />
Subject: Your message to Cppunit-devel awaits moderator approval<br />
From: cppunit-devel-bounces@lists.sourceforge.net<br />
To: stephan.bergmann@oracle.com<br />
Message-ID: <mailman.49713.1298643119.7082.cppunit-devel@lists.sourceforge.net><br />
Date: Fri, 25 Feb 2011 14:11:59 +0000<br />
<br />
Your mail to 'Cppunit-devel' with the subject<br />
<br />
What part of the API is published?<br />
<br />
Is being held until the list moderator can review it for approval.<br />
<br />
The reason it is being held:<br />
<br />
Post by non-member to a members-only list<br />
<br />
Either the message will get posted to the list, or you will receive<br />
notification of the moderator's decision. If you would like to cancel<br />
this posting, please visit the following URL:<br />
<br />
https://lists.sourceforge.net/lists/confirm/cppunit-devel/1da27e17e1d5fdfcb7f8ac6860a05bb5ca1eab1d<br />
</pre><br />
and the last message in [http://sourceforge.net/mailarchive/forum.php?forum_name=cppunit-devel the archive] is from January 2010.<br />
<br />
=== <code>testshl2</code> ===<br />
<br />
* <code>solenv/inc_cppunit.mk</code>/<code>cppunit.mk</code>: [http://hg.services.openoffice.org/cws/sb118/rev/cf13421c3774 &ldquo;adapted <code>cppunit.mk</code> to <code>cppunittester</code> and no longer require &lsquo;<code>dmake test</code>&rsquo; to run tests&rdquo;].<br />
* '''TODO:''' <code>DEV300_m68</code> introduced <code>TESTSHL2LIB</code> (which I removed again) and uses it in many <code>qa</code> makefiles (that I need to touch someday, anyway).<br />
<br />
=== Unit Tests ===<br />
<br />
* <code>OOO_SUBSEQUENT_TESTS</code> (<code>build.lst</code> lists local dependencies of those directories, so that modifying a module and then calling &ldquo;<code>OOO_SUBSEQUENT_TESTS=x build</code>&rdquo; rebuilds the module and executes the tests).<br />
* '''TODO:''' If Build Environment&nbsp;2.0 would build directly to solver (instead of local output tree/deliver), that would simplify tests that currently need to take care to test local libraries instead of solver ones (see, for example, <code>OOO_TEST_PREFIX</code> in the <code>services.rdb</code> of <code>stoc/test/uriproc/makefile.mk</code>).<br />
{{Documentation/Note|Build Environment&nbsp;2.0 will not build directly to solver, but will make a module depend on the targets in the solver, and these are depending on the targets in the workdir (aka the old "local output tree"). Thus on an usual build in a module building and delivering are not two steps anymore. If tests depend on the target in the solver (which they will do automatically in most use cases, as linking against a library automatically creates a dependency on the library in the solver), they can be sure that the target is up to date in the solver '''and''' in the workdir.<br />
<br />
--[[User:B michaelsen|B michaelsen]] 06:32, 27 August 2010 (UTC)}}<br />
* '''TODO:''' Constructs like &ldquo;<code>-env:UNO_<var>&hellip;</var>=$(my_file)<var>&hellip;</var></code>&rdquo; would fail for problematic characters (spaces!) in paths.<br />
<br />
=== Smoke Test ===<br />
<br />
* Redesign <code>smoketestoo_native</code> to use CppUnit and pre-installed OOo.<br />
* [http://hg.services.openoffice.org/cws/sb118/rev/160b248247a0 &ldquo;changed <code>tools/debug</code> to never fall back from writing to shell to writing to file, and read <code>DBGSV_INIT</code> from <code>rtl::Bootstrap</code>; the latter causes problems if <code>tools/debug</code> is called from static code executing before <code>SAL_MAIN</code> has called <code>osl_setCommandArgs</code> &rarr; removed statics from code and added assertions to <code>osl/process</code>; various improvements to <code>smoketests.cxx</code> (incl. passing an appropriate <code>dbgsv.ini</code> for non-pro builds)&rdquo;] followed by [http://hg.services.openoffice.org/cws/sb118/rev/dbbacb9d2fd3 &ldquo;reverted parts of HG <code>-c&nbsp;160b248247a0</code> again: the &lsquo;static code executing before <code>SAL_MAIN</code>&rsquo; problem was too severe; instead, globally set <code>DBGSV_INIT</code> build env var to new <code>solenv/bin/dbgsv.ini</code>&rdquo;]; see also {{issue|109142}} &ldquo;Let assertions abort&rdquo;.<br />
* '''TODO:''' For <code>smoketestoo_native/makefile.mk</code> &ldquo;<code><nowiki>-env:arg-env=$(OOO_LIBRARY_PATH_VAR)"$${{$(OOO_LIBRARY_PATH_VAR)+=$$$(OOO_LIBRARY_PATH_VAR)}}"</nowiki></code>&rdquo; mechanism: <code>osl_executeProcess</code> <code>ustrEnvironments</code> members without &ldquo;<code>=</code>&rdquo;: all platforms; documentation; documentation of <code>osl_executeProcess_WithRedicrectedIO</code>.<br />
* '''TODO:''' <code>-headless</code>? (appears to still display windows on Windows and Mac OS&nbsp;X, however, see {{issue|109052}})<br />
* '''TODO:''' {{issue|113341}} &ldquo;-nofirststartwizard should disable update check&rdquo;<br />
<br />
=== Pre-Installed OOo ===<br />
<br />
* For Sun Hamburg Release Engineering, take MWS archive installation sets from &ldquo;S:&rdquo; instead of solver: [http://hg.services.openoffice.org/cws/sb118/rev/d5dbea724063 &ldquo;take installation set from <code>SHIPDRIVE</code> if appropriate&rdquo;].<br />
* '''TODO:''' <code>PKGFORMAT=installed</code> instead of <code>archive</code>?<br />
<br />
=== <code>unoapi</code> Tests ===<br />
<br />
* Known issues, open (not yet addressed at all; disabled for now on net-yet-integrated CWS; or fixed on not-yet-integrated CWS):<br />
** {{issue|114669}} &ldquo;forms/qa/unoapi forms.OListBoxControl crash&rdquo; (fixed on {{CWS|sb140}})<br />
** {{issue|116120}} &ldquo;vcl: TabControl::ImplGetTabRect negative height leads to X_CreatePixmap BadAlloc&rdquo; (fixed on {{CWS|vcl118}}, integrated into <code>DEV300_m101</code>)<br />
** {{issue|116125}} &ldquo;qadevOOo/qa/complex/junitskeleton failure&rdquo;<br />
** {{issue|116156}} &ldquo;toolkit/qa/unoapi crash in SwAccessibleMap::RemoveContext&rdquo;<br />
** {{issue|116192}} &ldquo;[sw] fixed text fields sometimes get updated&rdquo; (fixed on {{CWS|sw34bf03}}, integrated into <code>DEV300_m102</code>)<br />
** {{issue|116550}} &ldquo;toolkit/qa/unoapi crashes OOo in ~SwAccessibleParagraph vs. SwXTextDocument::close&rdquo;<br />
** {{issue|116583}} &ldquo;comphelper/qa/complex/comphelper failure&rdquo;<br />
** {{issue|116730}} &ldquo;vcl: crash with multiple threads in Window::ImplGrabFocus&rdquo;<br />
** {{issue|116733}} &ldquo;sw: crash in ~SwDrawContact (forms/qa/unoapi)&rdquo;<br />
** {{issue|117381}} &ldquo;ucb/qa/unoapi ucb.UniversalContentBroker::com::sun::star::ucb::XContentProviderManager::deregisterContentProvider() fails with gvfs&rdquo; (fixed on {{CWS|sb140}})<br />
** {{issue|117486}} &ldquo;toolkit/qa/complex/toolkit: "Window pos size wrong"&rdquo; (fixed on {{CWS|sb140}})<br />
** {{issue|117488}} &ldquo;sw/qa/unoapi: sw.SwXViewSettings::com::sun::star::text::ViewSettings::ShowOnlineLayout ShowOnlineLayout/ZoomValue failed&rdquo;<br />
** {{issue|117641}} &ldquo;chart2/qa/unoapi fails in sch.ChXDataPoint::com::sun::star::chart::ChartDataPointProperties due to change to jpeg/prj/d.lst&rdquo; (fixed as <code>DEV300_m106</code> masterfix)<br />
** {{issue|117693}} &ldquo;xmlsecurity/qa/certext fails on wntmsci12 non-pro ("no OPENSSL_Applink")&rdquo;<br />
** {{issue|117774}} &ldquo;static in editengine ImplGetSvxUnoOutlinerTextCursorSvxPropertySet causes deadlock in chart2/qa/unoapi&rdquo;<br />
** {{issue|117777}} &ldquo;vcl: AquaSalFrame::Show deadlock in toolkit/qa/unoapi&rdquo;<br />
** {{issue|117805}} &ldquo;unoxml/qa/complex/unoxml fails on Mac OS X&rdquo;<br />
* Known issues, disabled for now:<br />
** {{issue|109517}} &ldquo;sc/qa/unoapi fails for ScAnnotationObj etc.&rdquo;<br />
** {{issue|109518}} &ldquo;sd/qa/unoapi crash in SfxViewShell::GetController&rdquo;<br />
** {{issue|109643}} &ldquo;toolkit/qa/unoapi tests fail when losing focus&rdquo;<br />
** {{issue|109728}} &ldquo;~ScAutoFormatObj uses cleared ScGlobal&rdquo;<br />
** {{issue|109917}} &ldquo;fragile unoapi test using OnUnfocus event&rdquo;<br />
** {{issue|109939}} &ldquo;toolkit: inconsistent UnoControl locking schemes&rdquo;<br />
** {{issue|110862}} &ldquo;sc/qa/unoapi fails for sc.ScDataPilotTableObj::com::sun::star::sheet::XDataPilotTable::refresh()&rdquo;<br />
** {{issue|110988}} &ldquo;svtools/qa/unoapi fails for svtools.AccessibleBrowseBox etc.&rdquo;<br />
** {{issue|111006}} &ldquo;toolkit: deadlock between UnoControls&rdquo;<br />
** {{issue|111032}} &ldquo;sc/qa/unoapi sc.ScAccessibleCell::com::sun::star::accessibility::XAccessibleText getCharacterBounds() failure&rdquo;<br />
** {{issue|111042}} &ldquo;sd/qa/unoapi sd::DrawController::dispose crash&rdquo;<br />
** {{issue|111043}} &ldquo;sd/qa/unoapi sd::DrawController_OutlineView NullPointerException&rdquo;<br />
** {{issue|111102}} &ldquo;chart2: ChartModelHelper::findDiagram returns null&rdquo;<br />
** {{issue|111111}} &ldquo;xmloff.Impress.XMLImporter::com::sun::star::document::XImporter&rdquo;<br />
** {{issue|111113}} &ldquo;toolkit.AccessibleStatusBarItem unoapi failure&rdquo;<br />
** {{issue|111148}} &ldquo;forms/qa/unoapi forms.OImageControlModel::com::sun::star::beans::XMultiPropertySet deadlock&rdquo;<br />
** {{issue|111169}} &ldquo;svx.AccessiblePageShape unoapi failure&rdquo;<br />
** {{issue|111170}} &ldquo;sun/i18n/qa/unoapi "creating a drawdoc" failure&rdquo;<br />
** {{issue|111178}} &ldquo;sw/qa/unoapi SwView::SelectShell crash&rdquo;<br />
** {{issue|111180}} &ldquo;framework/qa/unoapi fwk.Desktop::com::sun::star::frame::XComponentLoader::loadComponentFromURL() failure&rdquo;<br />
** {{issue|111182}} &ldquo;Desktop::terminate -> ~DropTarget -> _objc_error crash&rdquo;<br />
** {{issue|111184}} &ldquo;sal/qa/osl/pipe uses fixed pipe names&rdquo;<br />
** {{issue|111186}} &ldquo;sw/qa/unoapi sw.PageStyle::com::sun::star::beans::XPropertySet::setPropertyValue() failure&rdquo;<br />
** {{issue|111190}} &ldquo;sw/qa/unoapi sw.SwXShape failure&rdquo;<br />
** {{issue|111194}} &ldquo;sw/qa/unoapi sw.XMLExporter crash&rdquo;<br />
** {{issue|111195}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleScrollBar::com::sun::star::accessibility::XAccessibleValue::setCurrentValue() failure&rdquo;<br />
** {{issue|111197}} &ldquo;sw/qa/unoapi sw.SwAccessibleDocumentPageView failure&rdquo;<br />
** {{issue|111199}} &ldquo;sd/qa/unoapi sd.AccessibleOutlineView failure&rdquo;<br />
** {{issue|111200}} &ldquo;xmloff/qa/unoapi xmloff.Draw.XMLMetaImporter failure&rdquo;<br />
** {{issue|111216}} &ldquo;svx/qa/unoapi accessibility deadlock&rdquo;<br />
** {{issue|111218}} &ldquo;sw/qa/unoapi sw.SwAccessibleParagraphView::com::sun::star::accessibility::XAccessibleEventBroadcaster::removeEventListener() failure&rdquo;<br />
** {{issue|111220}} &ldquo;sw/qa/unoapi sw.XMLContentExporter::com::sun::star::document::XFilter::cancel() failure&rdquo;<br />
** {{issue|111224}} &ldquo;xmloff/qa/unoapi xmloff.Impress.XMLContentExporter crash&rdquo;<br />
** {{issue|111225}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleStatusBar failure&rdquo;<br />
** {{issue|111252}} &ldquo;svx/qa/unoapi svx.AccessibleOLEShape deadlock&rdquo;<br />
** {{issue|111273}} &ldquo;sw/qa/unoapi sw.SwXTextEmbeddedObject::com::sun::star::document::XEmbeddedObjectSupplier::getEmbeddedObject() crash&rdquo;<br />
** {{issue|111278}} &ldquo;svx/qa/unoapi svx.AccessibleEditableTextPara failure&rdquo;<br />
** {{issue|111283}} &ldquo;sfx2/qa/unoapi sfx.StandaloneDocumentInfo failure&rdquo;<br />
** {{issue|111285}} &ldquo;forms/qa/unoapi forms.OButtonModel failure&rdquo;<br />
** {{issue|111287}} &ldquo;xmloff/qa/unoapi XMLSettingsIm-/Exporter crash&rdquo;<br />
** {{issue|111329}} &ldquo;sd/qa/unoapi SdXCustomPresentationAccess::getElementNames/ImpEditEngine::OnlineSpellHdl hang&rdquo;<br />
** {{issue|111332}} &ldquo;sw/qa/unoapi sw.XMLStylesExporter::com::sun::star::document::XFilter crash&rdquo;<br />
** {{issue|111333}} &ldquo;forms/qa/unoapi forms.OImageControlControl::com::sun::star::awt::XControl deadlock&rdquo;<br />
** {{issue|112743}} &ldquo;starmath/qa/unoapi sm.XMLSettingsExporter failure&rdquo;<br />
** {{issue|112746}} &ldquo;framework/qa/unoapi fwk.ModuleManager failure (X11 BadWindow)&rdquo;<br />
** {{issue|112751}} &ldquo;testgraphical/qa/graphical failure&rdquo;<br />
** {{issue|112778}} &ldquo;xmloff/qa/unoapi xmloff.Draw.XMLContentExporter failure&rdquo;<br />
** {{issue|113020}} &ldquo;sw/qa/unoapi sw.SwXTextGraphicObject::com::sun::star::beans::XPropertySet failure&rdquo;<br />
** {{issue|113103}} &ldquo;chart2: deadlock between DiagramHelper and Diagram&rdquo;<br />
** {{issue|113136}} &ldquo;sw/qa/unoapi sw.SwAccessibleParagraphView::com::sun::star::accessibility::XAccessibleEditableText failure&rdquo;<br />
** {{issue|113142}} &ldquo;sw/qa/unoapi SwAccessibleContext::RemoveFrmFromAccessibleMap crash&rdquo;<br />
** {{issue|113161}} &ldquo;sd/qa/unoapi sd.SdLayer::com::sun::star::drawing::Layer::IsVisible failure&rdquo;<br />
** {{issue|113201}} &ldquo;forms/qa/unoapi forms.OEditModel::com::sun::star::form::validation::XValidatableFormComponent failure&rdquo;<br />
** {{issue|113245}} &ldquo;framework/qa/unoapi fwl.TypeDetection failure&rdquo;<br />
** {{issue|113306}} &ldquo;sfx2/qa/unoapi sfx.DocumentTemplates failure&rdquo;<br />
** {{issue|113386}} &ldquo;sd/qa/unoapi sd.AccessibleDrawDocumentView::com::sun::star::accessibility::XAccessibleComponent::containsPoint() failure&rdquo;<br />
** {{issue|113489}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleMenu{,Bar,Separator} failures&rdquo;<br />
** {{issue|114205}} &ldquo;sw/qa/unoapi sw.SwAccessibleParagraphView::com::sun::star::accessibility::XAccessibleText::copyText() failed&rdquo;<br />
** {{issue|114209}} &ldquo;forms/qa/unoapi forms.OGridControlModel::com::sun::star::view::XSelectionSupplier crash&rdquo;<br />
** {{issue|114211}} &ldquo;xmloff/qa/unoapi xmloff.Draw.XMLStylesImporter::com::sun::star::lang::XInitialization crash&rdquo;<br />
** {{issue|114213}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleMenu::com::sun::star::accessibility::XAccessibleSelection failure&rdquo;<br />
** {{issue|114636}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleScrollBar::com::sun::star::accessibility::XAccessibleAction failure&rdquo;<br />
** {{issue|114637}} &ldquo;sw/qa/unoapi sw.SwAccessibleFootnoteView(?) crash&rdquo;<br />
** {{issue|114642}} &ldquo;svx/qa/unoapi svx: svx.SvxUnoTextContent::com::sun::star::style::CharacterProperties crash&rdquo;<br />
** {{issue|114889}} &ldquo;sw/qa/unoapi sw.SwXTextViewCursor::com::sun::star::view::XScreenCursor&rdquo;<br />
** {{issue|116784}} &ldquo;[sfx2] CheckGlobalEventBroadcaster_writer1 fails&rdquo;<br />
** {{issue|116813}} &ldquo;[sfx2] complex.sfx2.UndoManager checkBrokenScripts fails&rdquo;<br />
** {{issue|116814}} &ldquo;[toolkit] unoapi test UnoControlDialogModel: XCloneable fails&rdquo;<br />
* Missing tests:<br />
** {{issue|109564}} &ldquo;qadevOOo/tests/java/ifc/awt/_XSystemChildFactory.java&rdquo;<br />
* Sporadic failures:<br />
** {{issue|111217}} &ldquo;BasicManager::SetGlobalUNOConstant crash during shutdown&rdquo;<br />
** {{issue|111246}} &ldquo;svx::FontHeightToolBoxControl::statusChanged crash (memory corruption)&rdquo;<br />
** {{issue|111271}} &ldquo;Mac OS X: crash during shutdown, __tcf_2 on stack&rdquo;<br />
** {{issue|111400}} &ldquo;Extension Manager does not join spawned uno process (-> smoketestoo_native fails)&rdquo;<br />
** {{issue|112070}} &ldquo;UNO API tests must not use random&rdquo;<br />
** {{issue|113158}} &ldquo;crash with two threads in framework::ToolBarManager dtor&rdquo;<br />
** {{issue|113197}} &ldquo;sw/qa/unoapi sw.SwXTextRange hangs&rdquo;<br />
** {{issue|113367}} &ldquo;sysdtrans deadlock during shutdown&rdquo;<br />
** {{issue|113464}} &ldquo;stoc_smgr::ORegistryServiceManager::dispose crash during shutdown&rdquo;<br />
** {{issue|114207}} &ldquo;framework::ModuleUIConfigurationManager::dispose crash during shutdown&rdquo;<br />
** {{issue|114675}} &ldquo;binary URP bridge race on shut down, crash&rdquo;<br />
** {{issue|114718}} &ldquo;forms/qa/unoapi: crash in remote async release call&rdquo;<br />
** {{issue|116131}} &ldquo;vcl: message unregisterDraggingDestinationHandler: sent to freed object&rdquo;<br />
<br />
[[Category:Effort]][[Category:Test]]</div>Sbhttps://wiki.openoffice.org/wiki/Documentation/DevGuide/Extensions/File_FormatDocumentation/DevGuide/Extensions/File Format2011-11-02T07:11:05Z<p>Sb: fixed external URL</p>
<hr />
<div>{{Documentation/DevGuide/ExtensionsTOC<br />
|ShowPrevNext=block<br />
|PrevPage=Documentation/DevGuide/Extensions/Checklist for Writing Extensions<br />
|NextPage=Documentation/DevGuide/Extensions/description.xml<br />
}}<br />
{{Documentation/DevGuideLanguages|Documentation/DevGuide/Extensions/{{SUBPAGENAME}}}}<br />
{{DISPLAYTITLE:File Format}}<br />
An extension is a zip file having a name that ends in ''.oxt'' (formerly ''.uno.pkg'' or ''.zip''). The file extension ''.oxt'' is associated with the MIME / media type ''vnd.openofficeorg.extension''. The ''.oxt'' file serves as a wrapper for all the items of an extension, and contains files which list and describe those items. An extension can contain UNO components, type libraries, configuration files, dialog or basic libraries, etc. <br />
<br />
An extension should contain a ''description.xml'' (see [[Documentation/DevGuide/Extensions/description.xml|description.xml]]) and must contain a directory META-INF (all uppercase). The META-INF directory contains a ''manifest.xml'' which lists all items and their media-type.<br />
<br />
{{Documentation/Note|For backward compatibility, legacy bundles (extension ''.uno.pkg'', ''.zip'') that have been formerly deployed using ''pkgchk'' are deployable, too. Migrate legacy bundles to the current ''.oxt'' format. This can easily be done using the GUI, exporting a legacy bundle as an ''.oxt'' file. When a legacy bundle is exported, a ''manifest.xml'' file is generated, enumerating the detected items of the bundle.}}<br />
<br />
Depending on its media-type, the respective file needs to be treated particularly. For example a UNO component needs to be registered before it can be used. All media types which do not require a particular handling of the file are ignored currently (and actually need not be contained in the ''manifest.xml'').<br />
<br />
=== Runtime Libraries ===<br />
The extensions need to bring their own runtime libraries, such as C or C++, when it is not guaranteed that these libraries are shipped with OOo or are installed on the users' systems. They typically need to reside in the same directory as the libraries containing the UNO components.<br />
<br />
Please note that there is a peculiarity of libraries build with MS Visual Studio 2008. The runtime libraries (C, C++) need either be installed in the system or must reside next to the library in order to be found. It does not matter if the runtime libraries are contained in the OOo installation (<office>/OpenOffice.org/Basis/program). As a consequence extensions need always contain the runtime libraries which they use.<br />
<br />
The runtime libraries must not be referenced by the ''manifest.xml''.<br />
<br />
=== Shared Library UNO Components ===<br />
<br />
The media-type for a shared library UNO component is ''application/vnd.sun.star.uno-component;type=native'', for example,<br />
<source lang="xml"><br />
<manifest:file-entry manifest:media-type="application/vnd.sun.star.uno-component;type=native" <br />
manifest:full-path="myComponent.uno.so"/><br />
</source><br />
<br />
=== Shared Library UNO Components for particular Platforms === <br />
<br />
When you implement a UNO native component, for example, a ''.dll'' or ''.so'' file, then this file is only deployable on that specific platform. It is often convenient to package a bundle for different platforms. For instance, you compile your component for x86 Linux, Solaris SPARC and Windows. You have to tell the Extension Manager which version of your component file corresponds to which platform via a platform attribute supplied with the media-type, for example,<br />
<source lang="xml"><br />
<manifest:file-entry manifest:media-type= "application/vnd.sun.star.uno-component;type=native;platform=Windows"<br />
manifest:full-path="windows/mycomp.uno.dll"/><br />
<manifest:file-entry manifest:media-type= "application/vnd.sun.star.uno-component;type=native;platform=Linux_x86"<br />
manifest:full-path="linux/myComp.uno.so"/><br />
<manifest:file-entry manifest:media-type= "application/vnd.sun.star.uno-component;type=native;platform=Solaris_SPARC"<br />
manifest:full-path="solsparc/myComp.uno.so"/><br />
</source><br />
<br />
=== Uno Jar Components=== <br />
<br />
The media-type for a UNO Jar component is ''application/vnd.sun.star.uno-component;type=Java'', for example,<br />
<source lang="xml"><br />
<manifest:file-entry manifest:media-type="application/vnd.sun.star.uno-component;type=Java" <br />
manifest:full-path="myComponent.uno.jar"/><br />
</source><br />
<br />
=== UNO Python Components=== <br />
<br />
''unopkg'' now supports registration of Python components (''.py'' files). Those files are registered using the <code>com.sun.star.loader.Python</code> loader. For details concerning Python-UNO, please refer to [http://udk.openoffice.org/python/python-bridge.html http://udk.openoffice.org/python/python-bridge.html]. The media-type for a UNO Python component is ''application/vnd.sun.star.uno-component;type=Python'', for example,<br />
<source lang="xml"><br />
<manifest:file-entry manifest:media-type="application/vnd.sun.star.uno-component;type=Python" <br />
manifest:full-path="myComponent.uno.py"/><br />
</source><br />
<br />
=== Passively Registered UNO Components ===<br />
<br />
Beginning with {{PRODUCTNAME}}&nbsp;3.4, UNO components can use passive registration, see [[Passive_Component_Registration]]. Components written that way are no longer individually listed in the <code>manifest.xml</code> file. Instead, one or more XML files (with root element <code>&lt;components&gt;</code>) containing the relevant information are registered in the <code>manifest.xml</code> file with media type <code>application/vnd.sun.star.uno_components</code>, optionally giving a <code>platform</code> attribute. For an example extension containing passively registered UNO components, see [http://hg.services.openoffice.org/OOO340/file/c904c1944462/desktop/test/deployment/passive <code>desktop/test/deployment/passive/</code>].<br />
<br />
=== RDB Type Library=== <br />
<br />
The media-type for a UNO RDB type library is ''application/vnd.sun.star.uno-typelibrary;type=RDB'', for example,<br />
<source lang="xml"><br />
<manifest:file-entry manifest:media-type="application/vnd.sun.star.uno-typelibrary;type=RDB"<br />
manifest:full-path="myTypes.uno.rdb"/><br />
</source><br />
<br />
=== Jar Type Library=== <br />
<br />
The media-type for a UNO Jar typelibrary is ''application/vnd.sun.star.uno-typelibrary;type=Java'', for example,<br />
<source lang="xml"><br />
<manifest:file-entry manifest:media-type="application/vnd.sun.star.uno-typelibrary;type=Java" <br />
manifest:full-path="myTypes.uno.jar"/><br />
</source><br />
Keep in mind that the RDB variant of that type library must be deployed also. This is currently necessary, because your Java UNO types may be referenced from native UNO code.<br />
<br />
=== {{PRODUCTNAME}} Basic Libraries=== <br />
<br />
{{PRODUCTNAME}} Basic libraries are linked to the basic library container files. Refer to [[Documentation/DevGuide/Basic/OpenOffice.org Basic|OpenOffice.org Basic]] for additional information.The media-type for a {{PRODUCTNAME}} Basic Library is "application/vnd.sun.star.basic-library", for example,<br />
<source lang="xml"><br />
<manifest:file-entry manifest:media-type="application/vnd.sun.star.basic-library" <br />
manifest:full-path="myBasicLib/"/><br />
</source><br />
<br />
=== Dialog Libraries=== <br />
<br />
Dialog libraries are linked to the basic dialog library container files. Refer to [[Documentation/DevGuide/Basic/OpenOffice.org Basic|OpenOffice.org Basic]] for additional information.The media-type for a dialog library is ''application/vnd.sun.star.dialog-library'', for example,<br />
<source lang="xml"><br />
<manifest:file-entry manifest:media-type="application/vnd.sun.star.dialog-library" <br />
manifest:full-path="myDialog/"/><br />
</source><br />
<br />
=== Configuration Data Files=== <br />
<br />
The media-type for a configuration data file is ''application/vnd.sun.star.configuration-data'', for example,<br />
<source lang="xml"><br />
<manifest:file-entry manifest:media-type="application/vnd.sun.star.configuration-data" <br />
manifest:full-path="myData.xcu"/><br />
</source><br />
<br />
=== Configuration Schema Files=== <br />
<br />
The media-type for a configuration schema file is ''application/vnd.sun.star.configuration-schema'', for example,<br />
<source lang="xml"><br />
<manifest:file-entry manifest:media-type="application/vnd.sun.star.configuration-schema" <br />
manifest:full-path="mySchema.xcs"/><br />
</source><br />
Be careful not to install schemata (''.xcs'' files) which contain the same elements (<code>oor:package</code>, <code>oor:name</code>) but have different definitions.<br />
<br />
=== Extension Tooltip Description=== <br />
<br />
'''Deprecated as of OOo 3.1.''' See [[Documentation/DevGuide/Extensions/Extension Description|Extension Description]] for details.<br />
<br />
If you want to add a tooltip description (which shows up in the balloon help of a bundle node in the Extension Manager dialog), then you can do so by specifying localized UTF-8 files, for example,<br />
<source lang="xml"><br />
<manifest:file-entry manifest:media-type="application/vnd.sun.star.package-bundle-description;locale=en" <br />
manifest:full-path="readme.en" /><br />
<manifest:file-entry manifest:media-type="application/vnd.sun.star.package-bundle-description;locale=de" <br />
manifest:full-path="readme.de" /><br />
<manifest:file-entry manifest:media-type="application/vnd.sun.star.package-bundle-description" <br />
manifest:full-path="readme.txt" /><br />
</source><br />
The best matching locale (against the current installation's locale) is taken. The locale is of the form locale=language-country-variant.<br />
<br />
=== Executable Files ===<br />
<br />
The media type for an executable is ''application/vnd.sun.star.executable''. This media type is new in OOo 2.4. If an extension uses it then it should also use the dependency [[Documentation/DevGuide/Extensions/Description of XML Elements#Element /description/dependencies|OpenOffice.org-minimal-version]] set to 2.4.<br />
This media type was introduced to work-around the problem that the executable attribute (Unix files, does not apply for Windows files) will not be preserved when OOo extracts a zipped extension. Also when an extension was zipped on Windows then the attribute is lost. Using the media type for an Windows executable does not have an effect since there is no such file attribute on Windows. On Unix the executable attribute is set when the extension is being installed. If it is installed for the current user then the user exectuable flag is set and if it is installed for all users, that is as shared extension, then the executable flag is set for user,group and other.<br />
Example:<br />
<source lang="xml"><br />
<manifest:file-entry manifest:media-type="application/vnd.sun.star.executable" <br />
manifest:full-path="hello"/><br />
</source><br />
<br />
All other contents of the extension are simply copied into the Extension Manager cache. You can, for instance, deploy an image for add-on menus within a package, or any other file needed by your component. The {{PRODUCTNAME}} configuration is used to find out in which path this file is located in a particular installation. When you define a package containing additional files, include an ''.xcu'' configuration data file, which points to your files. Use a variable ''%origin%'' as a placeholder for the exact path where the file will be copied by the Extension Manager. When ''unopkg'' installs the data, it replaces the path with an URL containing a macro and writes into the configuration. This URL has to be expanded before it is a valid file URL. This can be done using the <idl>com.sun.star.util.MacroExpander</idl> service. The ''%origin%'' variable is, for instance, used by the <code>ImageIdentifier</code> property of add-on menus and toolbar items, which is described in the [[Documentation/DevGuide/WritingUNO/AddOns/Configuration|Configuration]] section.<br />
<br />
{{PDL1}}<br />
<br />
[[Category:Documentation/Developer's Guide/Extensions]]</div>Sbhttps://wiki.openoffice.org/wiki/ApacheMigrationApacheMigration2011-08-30T06:31:53Z<p>Sb: added link to quotation source</p>
<hr />
<div>__TOC__<br />
<br />
== TODO ==<br />
<br />
* rewrite regex part // FIXME : specs ?<br />
* get new odma.h file with suitable license<br />
* get new os2bitmap.cxx file with suitable license<br />
* get new ksc5601.h file from XFree86<br />
* find replacements for nss and seamonkey<br />
** xmlsecurity<br />
** address book support<br />
** AES encryption<br />
* get new break iterator data from current ICU<br />
* sync unixODBC header files with opensource.apple.com<br />
* clarify status of library files used for tests<br />
* find replacement for neon<br />
** use libcurl<br />
** what about webdav? contribute to curl?<br />
* find replacement for saxon<br />
:possibly Apache xalan?<br />
* can we use cppunit ?<br />
* find replacement for ext_sources repository currently hosted on services.openoffice.org<br />
* discuss usage of GNU cp<br />
* the source code at idlc/source/preproc appears to be copied from LCC code (see <http://en.wikipedia.org/wiki/LCC_(compiler)>) and then erroneously decorated with the OOo license header. This needs to be addressed. Similarly, the code at soltools/cpp appears to be a second copy of that code, with the same memcpy error, but at least without the erroneous OOo license headers. (see [http://mail-archives.apache.org/mod_mbox/incubator-ooo-dev/201108.mbox/%3c4E5BF562.8010605@gmx.net%3e message at ooo-dev@incubator.apache.org])<br />
<br />
== Classification of OOo source code ==<br />
<br />
[[ApacheMigration/Permissive|List]] of files where it seems that the copyright owner is not Oracle, but the license probably is compatible with the ASL <br />
<br />
[[ApacheMigration/GPL|List]] of files where it seems that the copyright owner is not Oracle, but the license probably is not compatible with the ASL <br />
<br />
All other files in the OOo code repository should have an Oracle Copyright and can be part of the software grant <br />
<br />
== Unclear files ==<br />
<br />
Here a list of files that need more investigation to decide in which of the three categories they belong: <br />
<br />
=== xmergesync ===<br />
<br />
xmerge/source/activesync/BIN/xmergesync.dll<br />
<br />
I doubt that we want to have them in the repository, or ... ?<br />
<br />
=== VBasicEventListener (solved) ===<br />
<br />
extensions/test/ole/EventListenerSample/VBEventListener/VBasicEventListener.dll<br />
<br />
Only test code, can be checked later.<br />
<br />
=== connectivity (solved) ===<br />
<br />
connectivity/workben/TT/StartTest.class<br />
<br />
Binary file committed to the repository; I doubt that we want to have that in the Apache repo. As it is only test code, we can check that later. Would be nice to know what this is nevertheless. There is a java file with the same name in this folder.<br />
<br />
Only test code, can be checked later.<br />
<br />
=== boost/Regex_Experimental.tar.gz (solved) ===<br />
<br />
Is not needed, can be omitted.<br />
<br />
=== UnixODBC (solved) === <br />
<br />
unixODBC/inc/sql.h<br />
<br />
unixODBC/inc/sqlext.h<br />
<br />
unixODBC/inc/sqltypes.h<br />
<br />
unixODBC/inc/sqlucode.h<br />
<br />
No license information provided. http://www.unixodbc.org/ states that it is GPL+LGPL, but that comprises a whole package; no idea where the header are from.<br />
<br />
There are very similar files at http://www.opensource.apple.com/source/iodbc/iodbc-36/iodbc/include/<br />
<br />
So we can take these, they have a BSD license.<br />
<br />
=== dtrans/source/os2/clipb/OS2Bitmap.cxx (solved) ===<br />
<br />
* This code is property of Serenity Systems Intl<br />
* All rights reserverd.<br />
<br />
This file can not be moved to Apache, perhaps Yuri Dario will provide a new file with better license.<br />
<br />
=== A header from GNU c library (solved) ===<br />
<br />
hwpfilter/source/ksc5601.h<br />
<br />
This file has been released by a permissive license (MIT style) by the FSF:<br />
<br />
see http://cvsweb.xfree86.org/cvsweb/xc/lib/X11/lcUniConv/#dirlist<br />
<br />
=== ODMA (solved) ===<br />
<br />
ucb/source/ucp/odma/odma.h<br />
<br />
This file will not be moved to Apache. As we don't build the odma content provider regularly, we can add a new file with better license later.<br />
<br />
=== MPL headers (solved) ===<br />
<br />
xmlsecurity/source/xmlsec/nss/nssrenam.h<br />
<br />
We can't use nss anyway, so this header file is obsolete also.<br />
<br />
=== Regexp (solved) ===<br />
<br />
regexp/source/reclass.hxx<br />
<br />
regexp/source/reclass.cxx<br />
<br />
A complete mess, IMHO. We have to reimplement this functionality. This is only used in a single place in the OOo source: http://svn.services.openoffice.org/opengrok/xref/Current%20%28trunk%29/i18npool/source/search/textsearch.cxx<br />
<br />
==Classification of OOo external source tarballs==<br />
<br />
<br />
{| class = "wikitable sortable"<br />
!Tarball!!License<br />
|-<br />
| Adobe-Core35_AFMs-314.tar.gz<br />
| permissive <br />
<br />
|-<br />
| boost_1_39_0.tar.gz<br />
| Boost Software License<br />
<br />
|-<br />
| bsh-2.0b1-src.tar.gz<br />
| LGPL + SPL<br />
<br />
|-<br />
| cairo-1.8.0.tar.gz<br />
| LGPL + MPL<br />
<br />
|-<br />
| commons-codec-1.3-src.tar.gz<br />
| Apache<br />
<br />
|-<br />
| commons-httpclient-3.1-src.tar.gz<br />
| Apache<br />
<br />
|-<br />
| commons-lang-2.3-src.tar.gz<br />
| Apache<br />
<br />
|-<br />
| commons-logging-1.1.1-src.tar.gz<br />
| Apache<br />
<br />
|-<br />
| core.zip (Pentaho)<br />
| LGPL<br />
<br />
|-<br />
| cppunit-1.12.1.tar.gz<br />
| LGPL<br />
<br />
|-<br />
| cups-1.1.19.tar.gz<br />
| GPL/LGPL<br />
<br />
|-<br />
| curl-7.19.7.tar.gz<br />
| permissive<br />
<br />
|-<br />
| db-4.7.25.NC-custom.tar.gz<br />
| permissive<br />
<br />
|-<br />
| dejavu-fonts-ttf-2.32.zip<br />
| permissive<br />
<br />
|-<br />
| epm-3.7.tar.gz<br />
| GPL<br />
<br />
|-<br />
| expat-2.0.1.tar.gz<br />
| MIT<br />
<br />
|-<br />
| flow-engine-0.9.4.zip (Pentaho)<br />
| LGPL<br />
<br />
|-<br />
| flute-1.1.6.zip<br />
| permissive<br />
<br />
|-<br />
| fondu_src-051010.tar.gz<br />
| permissive<br />
<br />
|-<br />
| fontconfig-2.2.0.tar.gz<br />
| permissive<br />
<br />
|-<br />
| gdk-pixbuf-2.23.0.tar.gz<br />
| LGPL + MPL<br />
<br />
|-<br />
| gentiumbasic-fonts-1.10.zip<br />
| SIL OpenFont License<br />
<br />
|-<br />
| gettext-0.18.1.1.tar.gz<br />
| GPL <br />
<br />
|-<br />
| glib-2.28.1.tar.gz<br />
| LGPL<br />
<br />
|-<br />
| glibc-2.1.3-stub.tar.gz<br />
| LGPL<br />
<br />
|-<br />
| hsqldb_1_8_0.zip<br />
| permissive<br />
<br />
|-<br />
| hunspell-1.2.9.tar.gz (based on myspell)<br />
| LGPL+GPL+MPL (MySpell: permissive)<br />
<br />
|-<br />
| hyphen-2.7.1.tar.gz<br />
| LGPL+GPL+MPL<br />
<br />
|-<br />
| icu4c-4_0_1-src.tgz<br />
| permissive<br />
<br />
|-<br />
| jaf-1_0_2.zip<br />
| <br />
<br />
|-<br />
| jakarta-tomcat-5.0.30-src.tar.gz<br />
| Apache<br />
<br />
|-<br />
| javamail-1_3_1.zip<br />
| <br />
<br />
|-<br />
| jpeg-8c.tar.gz<br />
| permissive<br />
<br />
|-<br />
| libbase-1.1.6.zip (Pentaho)<br />
| LGPL<br />
<br />
|-<br />
| libcroco-0.6.2.tar.gz<br />
| LGPL<br />
<br />
|-<br />
| liberation-fonts-ttf-1.06.0.20100721.tar.gz<br />
| GPL<br />
<br />
|-<br />
| libfonts-1.1.6.zip (Pentaho)<br />
| LGPL<br />
<br />
|-<br />
| libformula-1.1.7.zip (Pentaho)<br />
| LGPL<br />
<br />
|-<br />
| libgsf-1.14.19.tar.gz<br />
| LGPL<br />
<br />
|-<br />
| liblayout-0.2.10.zip (pentaho)<br />
| LGPL<br />
<br />
|-<br />
| libloader-1.1.6.zip (pentaho)<br />
| LGPL<br />
<br />
|-<br />
| libpng-1.5.1.tar.gz<br />
| permissive<br />
<br />
|-<br />
| librepository-1.1.6.zip (Pentaho)<br />
| LGPL<br />
<br />
|-<br />
| librsvg-2.32.1.tar.gz<br />
| <br />
<br />
|-<br />
| libserializer-1.1.6.zip (Pentaho)<br />
| LGPL<br />
<br />
|-<br />
| libtextcat-2.2.tar.gz<br />
| permissive<br />
<br />
|-<br />
| libwpd-0.8.8.tar.gz<br />
| LGPL<br />
<br />
|-<br />
| libxml-1.1.7.zip (pentaho)<br />
| LGPL<br />
<br />
|-<br />
| libxml2-2.7.6.tar.gz<br />
| MIT<br />
<br />
|-<br />
| libxslt-1.1.26.tar.gz<br />
| MIT<br />
<br />
|-<br />
| lp_solve_5.5.tar.gz<br />
| LGPL<br />
<br />
|-<br />
| lucene-2.3.2.tar.gz<br />
| Apache<br />
<br />
|-<br />
| mdds_0.3.0.tar.bz2<br />
| MIT<br />
<br />
|-<br />
| MesaLib-6.2.1.tar.gz<br />
| MIT style<br />
<br />
|-<br />
| mysql-connector-cpp.zip<br />
| GPL, owned by Sun(Oracle)<br />
<br />
|-<br />
| mythes-1.2.0.tar.gz<br />
| BSD<br />
<br />
|-<br />
| neon-0.29.5.tar.gz<br />
| LGPL<br />
<br />
|-<br />
| nss-3.12.6-with-nspr-4.8.4.tar.gz<br />
| MPL<br />
<br />
|-<br />
| openssl-0.9.8l.tar.gz<br />
| OpenSSL License, SSLeay License (both BSD style)<br />
<br />
|-<br />
| pango-1.28.3.tar.gz<br />
| LGPL, parts Freetype License<br />
<br />
|-<br />
| pixman-0.12.0.tar.gz<br />
| <br />
<br />
|-<br />
| Python-2.6.1.tar.bz2<br />
| permissive<br />
<br />
|-<br />
| raptor-1.4.18.tar.gz<br />
| LGPL 2.1+ / GPL 2+ / Apache 2 <br />
<br />
|-<br />
| rasqal-0.9.16.tar.gz<br />
| LGPL 2.1+ / GPL 2+ / Apache 2 <br />
<br />
|-<br />
| redland-1.0.8.tar.gz<br />
| LGPL 2.1+ / GPL 2+ / Apache 2 <br />
<br />
|-<br />
| rhino1_5R5.zip<br />
| MPL<br />
<br />
|-<br />
| sacjava-1.3.zip<br />
| permissive<br />
<br />
|-<br />
| SampleICC-1.3.2.tar.gz<br />
| permissive<br />
<br />
|-<br />
| seamonkey-1.1.14.source.tar.gz<br />
| MPL<br />
<br />
|-<br />
| silgraphite-2.3.1.tar.gz<br />
| CPL+GPL+LGPL<br />
<br />
|-<br />
| source-9.0.0.7-bj.zip (saxon)<br />
| MPL<br />
<br />
|-<br />
| stax-api-1.0-2-sources.jar<br />
| CDDL+GPL; Apache<br />
<br />
|-<br />
| STLport-4.5.tar.gz<br />
| permissive<br />
<br />
|-<br />
| swingExSrc.zip<br />
| <br />
<br />
|-<br />
| vigra1.4.0.tar.gz<br />
| MIT<br />
<br />
|-<br />
| xmlsec1-1.2.14.tar.gz<br />
| MIT <br />
<br />
|-<br />
| xpdf-3.02.tar.gz<br />
| GPL<br />
<br />
|-<br />
| xsltml_2.1.2.zip<br />
| permissive<br />
<br />
|-<br />
| zlib-1.2.5.tar.gz<br />
| permissive<br />
<br />
|}</div>Sbhttps://wiki.openoffice.org/wiki/ValgrindValgrind2011-04-18T09:41:32Z<p>Sb: /* Definite Errors */</p>
<hr />
<div>'''[http://valgrind.org/ Valgrind]''' is an instrumentation framework for dynamic analysis tools. It can be used to detect memory management and threading bugs and profile programs. It runs on Linux x86 and AMD64, PPC32 and PPC64 are fairly complete.<br />
<br />
== disabling the custom allocator ==<br />
<br />
If you use ooo-build; export OOO_FORCE_SYSALLOC=1 before running, (this is built into [[linkoo]]'s ooenv script).<br />
<br />
If you use a Vanilla build, and your shell is setup for building ooo, use the following wrapper script around valgrind:<br />
<pre><br />
#!/bin/sh<br />
<br />
# instrument soffice with a malloc-based memory allocator.<br />
# Requires libsalalloc_malloc.so to be in the LD_LIBRARY_PATH.<br />
# Forwards all command line arguments to valgrind.<br />
<br />
export LD_PRELOAD=libsalalloc_malloc.so<br />
valgrind $@ <br />
</pre><br />
<br />
which preloads a small interceptor lib, which redirects all allocator calls to malloc.<br />
<br />
== disabling glib's custom allocator ==<br />
<br />
If you want to also track down problems with glib allocated objects, e.g. resource leaks in gconfbe then you need to disable glib's custom allocation as well, e.g. <br />
<br />
<pre><br />
G_SLICE=always-malloc valgrind ...<br />
</pre><br />
<br />
== disabling the STLport custom allocator ==<br />
<br />
The [http://www.sgi.com/tech/stl/Allocators.html STLport default allocator] uses a static free list (<code>_S_free_list</code> in <code>_alloc.h</code>) and there appears to be no functionality to flush it upon exit (like <code>__libc_freeres</code> in the GNU C library). Thus, Valgrind can erroneously consider memory as still reachable at program termination.<br />
<br />
The easiest workaround is probably to use a build that does not use STLport, like using a 64-bit <code>unxlngx6</code> build.<br />
<br />
== Helgrind <code>__cxa_guard_acquire</code> problems ==<br />
<br />
The <code>libstdc++.so.6</code> included in <code>unxlngx6</code> Hamburg builds (and probably the one included in <code>unxlngi6</code> builds as well) apparently has a <code>__cxa_guard_acquire</code> that uses a single mutex for all the various statics, leading to many false complaints about lock order violation.<br />
<br />
As a workaround, move the instances of <code>libgcc_s.so.1</code> and <code>libstdc++.so.6</code> within the OOo installation set out of the way (and thus use the ones from the system, which are hopefully recent enough).<br />
<br />
== Errors Found ==<br />
<br />
=== Definite Errors ===<br />
<br />
Open as of <code>DEV300_m99</code>:<br />
<br />
* {{issue|114718}} &ldquo;forms/qa/unoapi: crash in remote async release call&rdquo;<br />
* {{issue|116785}} &ldquo;framework::[Module]ImageManager kept alive by ring ref&rdquo;<br />
* {{issue|116786}} &ldquo;framework::ToolBarLayoutManger::m_p{AddonOptions,GlobalSettings} leak&rdquo;<br />
* {{issue|116850}} &ldquo;SvLBox::OnCurrentEntryChanged: Conditional jump or move depends on uninitialised value(s)&rdquo;<br />
* {{issue|116885}} &ldquo;utl::TextSearch::CachedTextSearch::~CachedTextSearch called too late&rdquo;<br />
* {{issue|116891}} &ldquo;framework::AddonMenuManager::BuildMenu leaks MenuConfiguration::Attributes&rdquo;<br />
* {{issue|116910}} &ldquo;desktop::Acceptor leaks Thread_Impl&rdquo;<br />
* {{issue|116915}} &ldquo;osl_getSystemPathFromFileURL leaks rtl_uStrings&rdquo;<br />
* {{issue|116981}} &ldquo;rtl/source/bootstrap.cxx does not clean up memory&rdquo;<br />
* {{issue|117082}} &ldquo;editengine: static maTypeSequence instances destroyed too late&rdquo;<br />
* {{issue|117083}} &ldquo;document window leaks framework::WindowCommandDispatch instance&rdquo;<br />
* {{issue|117084}} &ldquo;Desktop::Main leaks Lockfile instance&rdquo;<br />
* {{issue|117119}} &ldquo;lock-order violation in comprehensive cppu_detail_getUnoType&rdquo;<br />
* {{issue|117153}} &ldquo;utl::Bootstrap leaks Impl&rdquo;<br />
* {{issue|117154}} &ldquo;Desktop::GetCommandLineArgs leaks CommandLineArgs&rdquo;<br />
* {{issue|117292}} &ldquo;lock order violation in io service implementations&rdquo;<br />
* {{issue|117294}} &ldquo;lock order violation in SFX_IMPL_XSERVICEINFO&rdquo;<br />
* {{issue|117295}} &ldquo;lock order violation in cpp_uno bridge RTTI&rdquo;<br />
* {{issue|117296}} &ldquo;lock order violation in fileaccess service implementation&rdquo;<br />
* {{issue|117884}} &ldquo;registry: ORegKey::openSubKeys leaks memory&rdquo;<br />
<br />
=== Definite False Positives ===<br />
<br />
Open as of <code>DEV300_m99</code>:<br />
<br />
* {{issue|116872}} &ldquo;drawinglayer: BPixelRasterToBitmapEx causes false valgrind positive in rtl_crc32&rdquo;<br />
<br />
* On <code>unxlngx6</code>, executing <code>DEV300_m100</code> <code>sfx2/qa/complex</code>, a 14 byte <code>com.sun.star.util.DateTime</code> struct (consisting of seven <code>unsigned short</code> members) is filled with two 64 bit writes.<br />
<pre><br />
Invalid write of size 8<br />
at 0x1558BBAC: x86_64::fill_struct(_typelib_TypeDescriptionReference*, unsigned long const*, double const*, void*) (in /opt/openoffice.org/ure/lib/libgcc3_uno.so)<br />
by 0x15591965: callVirtualMethod(void*, unsigned int, void*, _typelib_TypeDescriptionReference*, bool, unsigned long*, unsigned int, unsigned long*, unsigned int, double*, unsigned int) (in /opt/openoffice.org/ure/lib/libgcc3_uno.so)<br />
by 0x1559240D: cpp_call(bridges::cpp_uno::shared::UnoInterfaceProxy*, bridges::cpp_uno::shared::VtableSlot, _typelib_TypeDescriptionReference*, int, _typelib_MethodParameter*, void*, void**, _uno_Any**) (in /opt/openoffice.org/ure/lib/libgcc3_uno.so)<br />
by 0x15592B8A: bridges::cpp_uno::shared::unoInterfaceProxyDispatch(_uno_Interface*, _typelib_TypeDescription const*, void*, void**, _uno_Any**) (in /opt/openoffice.org/ure/lib/libgcc3_uno.so)<br />
by 0x1A15C688: binaryurp::IncomingRequest::execute_throw(binaryurp::BinaryAny*, std::vector<binaryurp::BinaryAny, std::allocator<binaryurp::BinaryAny> >*) const (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A15CC45: binaryurp::IncomingRequest::execute() const (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A16B09A: request (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x70057CA: cppu_threadpool::JobQueue::enter(long, unsigned char) (in /opt/openoffice.org/ure/lib/libuno_cppu.so.3)<br />
by 0x70062C2: cppu_threadpool::ORequestThread::run() (in /opt/openoffice.org/ure/lib/libuno_cppu.so.3)<br />
by 0x70065F2: cppu_requestThreadWorker (in /opt/openoffice.org/ure/lib/libuno_cppu.so.3)<br />
by 0x4E5F72E: osl_thread_start_Impl (in /opt/openoffice.org/ure/lib/libuno_sal.so.3)<br />
by 0x67679C9: start_thread (pthread_create.c:300)<br />
Address 0xeb32480 is 16 bytes inside a block of size 22 alloc'd<br />
at 0x4C274A8: malloc (vg_replace_malloc.c:236)<br />
by 0x4E9A7CC: rtl_allocateMemory (in /opt/openoffice.org/ure/lib/libuno_sal.so.3)<br />
by 0x4013EE: allocate(unsigned long, (anonymous namespace)::AllocatorTraits const&) (in /opt/openoffice.org3/program/soffice.bin)<br />
by 0x4014C5: operator new(unsigned long) (in /opt/openoffice.org3/program/soffice.bin)<br />
by 0x1A15E77E: __gnu_cxx::new_allocator<char>::allocate(unsigned long, void const*) (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A15E7A6: std::_Vector_base<char, std::allocator<char> >::_M_allocate(unsigned long) (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A15E7D8: std::_Vector_base<char, std::allocator<char> >::_Vector_base(unsigned long, std::allocator<char> const&) (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A15F686: std::vector<char, std::allocator<char> >::vector(unsigned long, char const&, std::allocator<char> const&) (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A15C57A: binaryurp::IncomingRequest::execute_throw(binaryurp::BinaryAny*, std::vector<binaryurp::BinaryAny, std::allocator<binaryurp::BinaryAny> >*) const (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A15CC45: binaryurp::IncomingRequest::execute() const (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A16B09A: request (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x70057CA: cppu_threadpool::JobQueue::enter(long, unsigned char) (in /opt/openoffice.org/ure/lib/libuno_cppu.so.3)<br />
</pre><br />
<br />
* On <code>unxlngx6</code>, executing <code>DEV300_m100</code> <code>sfx2/qa/complex</code> triggers the below report, which appears to be a false positive caused by what appears to be an error in valgrind, see [https://bugs.kde.org/show_bug.cgi?id=266990 &ldquo;setns instruction causes false positive&rdquo;].<br />
<pre><br />
Conditional jump or move depends on uninitialised value(s)<br />
at 0x22694A93: SwLayAction::_FormatCntnt(SwCntntFrm const*, SwPageFrm const*) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x226982DD: SwLayAction::_FormatFlyCntnt(SwFlyFrm const*) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x226A0349: SwObjectFormatter::_FormatObj(SwAnchoredObject&) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x226A14CB: SwObjectFormatterTxtFrm::DoFormatObj(SwAnchoredObject&, bool) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x226A01C2: SwObjectFormatter::_FormatObjsAtFrm(SwTxtFrm*) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x226A115B: SwObjectFormatterTxtFrm::DoFormatObjs() (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x2269FF52: SwObjectFormatter::FormatObjsAtFrm(SwFrm&, SwPageFrm const&, SwLayAction*) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x2269501E: SwLayAction::FormatCntnt(SwPageFrm const*) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x22696E9B: SwLayAction::InternalAction() (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x226975A7: SwLayAction::Action() (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x22885D50: ViewShell::ImplEndAction(unsigned char) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x225155A2: ViewShell::EndAction(unsigned char) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
</pre><br />
<br />
=== Potentially False Positives ===<br />
<br />
<pre><br />
Conditional jump or move depends on uninitialised value(s)<br />
at 0x9440A18: XcursorImageHash (in /usr/lib/libXcursor.so.1.0.2)<br />
by 0x9440ED7: XcursorNoticePutBitmap (in /usr/lib/libXcursor.so.1.0.2)<br />
by 0x42F5EF8: _XNoticePutBitmap (in /usr/lib/libX11.so.6.3.0)<br />
by 0x430D3A7: XPutImage (in /usr/lib/libX11.so.6.3.0)<br />
by 0x938107E: ImplSalDDB::ImplSalDDB(_XImage*, unsigned long, int, SalTwoRect const&) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x9382E77: X11SalBitmap::ImplGetDDB(unsigned long, int, long, SalTwoRect const&) const (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x9382F52: X11SalBitmap::ImplDraw(unsigned long, int, long, SalTwoRect const&, _XGC* const&) const (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x937DC2A: X11SalGraphics::drawMaskedBitmap(SalTwoRect const*, SalBitmap const&, SalBitmap const&) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x937DF70: X11SalGraphics::drawBitmap(SalTwoRect const*, SalBitmap const&, SalBitmap const&) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x5BAE9FB: SalGraphics::DrawBitmap(SalTwoRect const*, SalBitmap const&, SalBitmap const&, OutputDevice const*) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclli.so)<br />
by 0x5B92D9C: OutputDevice::ImplDrawBitmapEx(Point const&, Size const&, Point const&, Size const&, BitmapEx const&, unsigned long) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclli.so)<br />
by 0x5B9320D: OutputDevice::DrawBitmapEx(Point const&, Size const&, BitmapEx const&) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclli.so)<br />
</pre><br />
might be a false positive, [http://code.google.com/p/microblog-purple/source/browse/branches/0.3/valgrind-suppressions?r=353#27] specifies a suppression block for the head of that stack,<br />
<pre><br />
{<br />
X oddness 3<br />
Memcheck:Cond<br />
fun:XcursorImageHash<br />
fun:XcursorNoticePutBitmap<br />
fun:_XNoticePutBitmap<br />
fun:XPutImage<br />
}<br />
</pre><br />
<br />
== more information ==<br />
<br />
There's also some Writer document about Valgrind: http://tools.openoffice.org/debugging/usingvalgrind.sxw<br />
<br />
TODO: move (!) its content here, not just copy but also remove there, so we don't end up with a fork.<br />
<br />
TODO: '''Run recent version''' <br/><br />
Someone should run the latest version o OO.o, as Valgrind 3.3.0 re-introduces Hellgrind which helps e.g. to hunt down deadlocks. See [http://www.valgrind.org/docs/manual/dist.news.html] for more.<br />
<br />
== Callgrind Profiling How-To ==<br />
<br />
There's a [[Callgrind| Callgrind How-To]].<br />
<br />
<br />
[[Category:Developer Tools]]</div>Sbhttps://wiki.openoffice.org/wiki/Test_CleanupTest Cleanup2011-04-11T12:20:38Z<p>Sb: /* unoapi Tests */</p>
<hr />
<div>= Test Cleanup Project =<br />
<br />
The demand for automated (unit) testing should be obvious. See the [http://www.openoffice.org/servlets/ReadMsg?list=dev&msgNo=26189 mission statement mail] and [[Media:JustTestingPresentation.odp|slides]] from a [http://fosdem.org/2010/schedule/events/ooo_testing FOSDEM'10 talk] and an [http://www.ooocon.org/index.php/ooocon/2010/paper/view/188 OOoCon&nbsp;2010 presentation] for more information and further links.<br />
<br />
For examples of how to write xUnit based tests in the OOo code base, see [http://hg.services.openoffice.org/DEV300/file/87f4911ea629/basegfx/test <code>basegfx/test/</code>], [http://hg.services.openoffice.org/DEV300/file/87f4911ea629/sal/qa/ByteSequence <code>sal/qa/ByteSequence/</code>], and [http://hg.services.openoffice.org/DEV300/file/87f4911ea629/smoketestoo_native <code>smoketest_native/</code>]. However, the hard part should not be how to write test code, anyway, but how to write ''testable'' code; see [http://misko.hevery.com/2008/11/04/clean-code-talks-unit-testing/ The Clean Code Talks&mdash;Unit Testing].<br />
<br />
When testing C++ code that merely uses UNO types (no services), but uses them in a way that requires UNO to be bootstrapped so that the relevant type information is available (e.g., putting instances of complex UNO types into <code>com::sun::star::uno::Any</code>), one approach is as follows: In the <code>makefile.mk</code>, instead of <code>.INCLUDE: _cppunit.mk</code> use<br />
<source lang="make"><br />
.IF "$(OS)" == "WNT"<br />
my_file = file:///<br />
.ELSE<br />
my_file = file://<br />
.END<br />
<br />
ALLTAR : test<br />
<br />
test .PHONY : $(SHL1TARGETN)<br />
$(CPPUNITTESTER) $(SHL1TARGETN) \<br />
-env:UNO_TYPES=$(my_file)$(SOLARBINDIR)/types.rdb<br />
</source><br />
and in the test code once call <code>cppu::defaultBootstrap_InitialComponentContext()</code>.<br />
<br />
== User Interface ==<br />
<br />
=== CppUnit ===<br />
<br />
For tests in C++, plain CppUnit (at least version 1.12.1) is available. (OOo bundles CppUnit 1.12.1 as an external module; alternatively, you can configure <code>--with-system-cppunit</code>.)<br />
<br />
Implement the test code as a dynamic library, following CppUnit conventions (i.e., using [http://cppunit.sourceforge.net/doc/lastest/group___creating_test_suite.html#ga0 <code>CPPUNIT_TEST_SUITE_REGISTRATION</code>] and [http://cppunit.sourceforge.net/doc/lastest/_test_plug_in_8h.html#a2 <code>CPPUNIT_PLUGIN_IMPLEMENT</code>] macros). The following settings are needed in the <code>makefile.mk</code>:<br />
* <code>ENABLE_EXCEPTIONS = TRUE</code><br />
* <code>CFLAGSCXX += $(CPPUNIT_CFLAGS)</code><br />
* <code>SHL<var>n</var>RPATH = NONE</code><br />
* <code>SHL<var>n</var>STDLIBS += $(CPPUNITLIB)</code><br />
* <code>SHL<var>n</var>VERSIONMAP = <var>version.map</var></code>, where that file must contain the following (see [[#CppUnit_1.12.1|details]] below for improving this):<br />
UDK_3_0_0 {<br />
global:<br />
cppunitTestPlugIn;<br />
local:<br />
*;<br />
};<br />
<br />
To run tests, <code>sal/cppunittester</code> delivers a <code>cppunittester</code> executable that has some advantages over the plain CppUnit <code>DllPlugInTester</code>:<br />
* It uses <code>SAL_IMPLEMENT_MAIN</code> to properly set up the per-process settings required by URE. Test code as well as tested code based on URE will expect this and would fail in a process that is not set up in this way.<br />
* Getting CppUnit to build as an external module within the Windows OOo build is a non-trivial task. The less parts of it that need to be built, the better.<br />
<br />
Something like the following in <code>makefile.mk</code> will execute the tests:<br />
ALLTAR : test<br />
test .PHONY : $(SHL1TARGETN)<br />
$(CPPUNITTESTER) $(SHL1TARGETN)<br />
<br />
<code>$(CPPUNITTESTER)</code> internally uses <code>$(AUGMENT_LIBRARY_PATH_LOCAL)</code> to favor library instances in the local output tree over ones in solver. Alternatively to the above, <code>.INCLUDE: _cppunit.mk</code> calls <code>$(CPPUNITTESTER)</code> on each of <code>$(SHL1TARGETN)</code>, &hellip;, <code>$(SHL10TARGETN)</code> that is defined.<br />
<br />
=== JUnit ===<br />
<br />
For tests in Java, plain JUnit (at least version 4) is available. (OOo requires JUnit as a prerequisite, see [http://junit.org/ junit.org] for downloads; you can configure <code>--with-junit=<var>&hellip;</var></code> if it is not automatically found; alternatively, you can configure <code>--without-junit</code>, disabling JUnit-based tests.)<br />
<br />
=== <code>subsequenttests</code> ===<br />
<br />
Some tests have build and/or run time dependencies on modules further up in the hierarchy, or modules that the rest of the module in question does not have dependencies on (and which are thus not listed in the module's <code>build.lst</code>). The extreme case are tests that need a complete OOo installation as their test environment.<br />
<br />
For such tests, the whole <code>makefile.mk</code> should be wrapped in:<br />
.IF "$(OOO_SUBSEQUENT_TESTS)" == ""<br />
nothing .PHONY :<br />
.ELSE<br />
...<br />
.END<br />
(and the directory included in the module's <code>build.lst</code>).<br />
<br />
The idea is to do a complete OOo build first (<code>cd smoketestoo_native && build --all</code>) and then build and execute those tests either selectively or wholesale.<br />
<br />
Selectively building a specific such test directory can be done with <code>cd <var>&hellip;</var> && OOO_SUBSEQUENT_TESTS=TRUE dmake</code>.<br />
<br />
To build and execute ''all'' these test directories, the tool <code>subsequenttests</code> (in <code>solenv/bin</code>) exists. It scans the <code>build.lst</code> files of all modules for <code>makefile.mk</code>s that mention <code>OOO_SUBSEQUENT_TESTS</code> and simply executes <code>dmake</code> in all those directories, with <code>OOO_SUBSEQUENT_TESTS</code> set. It supports a <code>-P<var>n</var></code> switch to build <var>n</var> directories in parallel.<br />
<br />
=== Helpers ===<br />
<br />
A new module <code>test</code> shall collect reusable code snippets for C++ and Java tests.<br />
<br />
For now, it concentrates on letting a test connect to an OOo instance via remote UNO: A C++ test class can hold a <code>test::OfficeConnection</code> as class member and, in its CppUnit <code>setUp</code> and <code>tearDown</code> functions, call <code>OfficeConnection::setUp</code> and <code>OfficeConnection::tearDown</code>, respectively. Tests obtain access to the OOo instance via <code>OfficeConnection::getFactory</code>. Similarly, a Java test class can use an <code>org.openoffice.test.OfficeConnection</code> instance, offering the same functionality as its C++ counterpart.<br />
<br />
For this to work, three additional steps are necessary:<br />
* First, in <code>instsetoo_native</code>, building an installation set for the <code>openoffice</code> product in the default language (<code>en-US</code>) in any package format now takes care to always also build an archive package format (<code>tar.gz</code> resp. <code>zip</code>) of that product.<br />
* Second, building <code>smoketestoo_native</code> permanently installs that archive into the solver. (Except on Windows, where problems with resulting long pathnames prevent this; there, as a workaround, each test individually unzips the archive to some local temporary directory.) <br />
* Third, a test that requires an OOo instance includes <code>installationtest.mk</code> in its <code>makefile.mk</code>. That file makes sure to call the CppUnit and JUnit test runners with the information necessary for the helper classes to start the correct OOo instance with a fresh <code>UserInstallation</code> and set up an URP pipe connection. The information is tunneled into the test runner executables as UNO bootstrap parameters.<br />
<br />
For debugging purposes, which OOo instance the tests use can manually be overridden, see [http://www.openoffice.org/servlets/ReadMsg?list=interface-announce&msgNo=1285 &ldquo;OOO_TEST_SOFFICE: allow override of tested soffice process&rdquo;].<br />
<br />
=== <code>unoapi</code> Tests ===<br />
<br />
The <code>unoapi</code> tests are redesigned to use the new test framework. They are plain JUnit tests and use the mechanisms described above to connect to running OOo instances. However, due to the large amount of logic encoded in <code>qadevOOo</code>, those JUnit tests for now are only thin wrappers around <code>org.openoffice.Runner.run</code>. This is intended to change over time.<br />
<br />
The <code>cwscheckapi</code> tool to run the <code>unoapi</code> tests has been subsumed by <code>subsequenttests</code>. The latter always runs all tests, while the former had mechanisms to run only tests for modules that had been changed by a CWS. The hope is that the parallel mode of <code>subsequenttests</code> makes it fast enough so that running all tests all of the times becomes feasible.<br />
<br />
Unfortunately, running the <code>unoapi</code> tests is still not stable enough to give useful results. Therefore, running <code>subsequenttests</code> has been disabled in the build bots for now. Making the tests sufficiently stable is ongoing work.<br />
<br />
== Details ==<br />
<br />
Working on {{CWS|sb118}}, {{CWS|sb120}}.<br />
<br />
=== CppUnit 1.12.1 ===<br />
<br />
* Replace existing <code>cppunit</code> and <code>testshl2</code> combo with latest CppUnit 1.12.1.<br />
* OOo <code>configure --with-system-cppunit</code> (for now only if also <code>--with-system-stl</code>!); minimal required version for now arbitrarily 1.12.1.<br />
* '''TODO:''' Upstream <code>PATCH_FILES</code> (<code>windows.patch</code>?!?).<br />
* '''TODO:''' <code>RPATH</code> in generated libraries and executables.<br />
* '''TODO:''' Improve <code>CPPUNIT_PLUGIN_EXPORT</code> and get rid of version maps (GCC exception problems?).<br />
* '''TODO:''' <code>cppunit/makefile.mk</code> <code>MY_LIBS = -lm</code> Solaris hack.<br />
* '''TODO:''' In general OOo build environment, no longer set <code>CFLAGS</code> etc. as environment variables; have package-specific <code>OOO_<var>package</var>_CFLAGS</code> etc. and combine those into <code>CFLAGS</code> etc. where necessary (see <code>OOO_STLPORT_CXXFLAGS</code> etc. in <code>cppunit/makefile.mk</code>).<br />
* '''TODO:''' Why use <code>cppunittester</code> instead of <code>DllPlugInTester</code>? (Remove building/delivering <code>DllPlugInTester</code>.)<br />
* '''TODO:''' Make <code>operator &lt;&lt;(std::basic_ostream &amp;, rtl::OUString const &amp;)</code> from <code>test/oustringstreaminserter.hxx</code> generally available?<br />
* '''TODO:''' Make STLport <code>num_put</code> symbols available on platforms other than Linux (see <code>solenv/bin/addsym.awk</code>), too, so that <code>CPPUNIT_ASSERT_EQUAL</code> actually outputs numeric values.<br />
<br />
==== Is CppUnit an active project? ====<br />
<br />
When I wrote<br />
<pre><br />
Message-ID: <4D67B884.8080101@oracle.com><br />
Date: Fri, 25 Feb 2011 15:11:16 +0100<br />
From: Stephan Bergmann <stephan.bergmann@oracle.com><br />
MIME-Version: 1.0<br />
To: cppunit-devel@lists.sourceforge.net<br />
Subject: What part of the API is published?<br />
Content-Type: text/plain; charset=UTF-8; format=flowed<br />
Content-Transfer-Encoding: 7bit<br />
<br />
At least for CppUnit 1.12.1, it is unclear whether for example class <br />
DynamicLibraryManager is supposed to be available to client code.<br />
<br />
The HTML documentation's class list contains DynamicLibraryManager just <br />
like, say, TestCase, and I can't find any hint on the former's page that <br />
it is an implementation detail. However, in DynamicLibraryManager.h, <br />
the class is not decorated with CPPUNIT_API.<br />
<br />
Is there any specification of what is published (i.e., stable, usable by <br />
clients) vs. what is implementation detail (i.e., not to be used by <br />
clients)?<br />
<br />
-Stephan<br />
</pre><br />
the only response I ever got was<br />
<pre><br />
MIME-Version: 1.0<br />
Content-Type: text/plain; charset="us-ascii"<br />
Content-Transfer-Encoding: 7bit<br />
Subject: Your message to Cppunit-devel awaits moderator approval<br />
From: cppunit-devel-bounces@lists.sourceforge.net<br />
To: stephan.bergmann@oracle.com<br />
Message-ID: <mailman.49713.1298643119.7082.cppunit-devel@lists.sourceforge.net><br />
Date: Fri, 25 Feb 2011 14:11:59 +0000<br />
<br />
Your mail to 'Cppunit-devel' with the subject<br />
<br />
What part of the API is published?<br />
<br />
Is being held until the list moderator can review it for approval.<br />
<br />
The reason it is being held:<br />
<br />
Post by non-member to a members-only list<br />
<br />
Either the message will get posted to the list, or you will receive<br />
notification of the moderator's decision. If you would like to cancel<br />
this posting, please visit the following URL:<br />
<br />
https://lists.sourceforge.net/lists/confirm/cppunit-devel/1da27e17e1d5fdfcb7f8ac6860a05bb5ca1eab1d<br />
</pre><br />
and the last message in [http://sourceforge.net/mailarchive/forum.php?forum_name=cppunit-devel the archive] is from January 2010.<br />
<br />
=== <code>testshl2</code> ===<br />
<br />
* <code>solenv/inc_cppunit.mk</code>/<code>cppunit.mk</code>: [http://hg.services.openoffice.org/cws/sb118/rev/cf13421c3774 &ldquo;adapted <code>cppunit.mk</code> to <code>cppunittester</code> and no longer require &lsquo;<code>dmake test</code>&rsquo; to run tests&rdquo;].<br />
* '''TODO:''' <code>DEV300_m68</code> introduced <code>TESTSHL2LIB</code> (which I removed again) and uses it in many <code>qa</code> makefiles (that I need to touch someday, anyway).<br />
<br />
=== Unit Tests ===<br />
<br />
* <code>OOO_SUBSEQUENT_TESTS</code> (<code>build.lst</code> lists local dependencies of those directories, so that modifying a module and then calling &ldquo;<code>OOO_SUBSEQUENT_TESTS=x build</code>&rdquo; rebuilds the module and executes the tests).<br />
* '''TODO:''' If Build Environment&nbsp;2.0 would build directly to solver (instead of local output tree/deliver), that would simplify tests that currently need to take care to test local libraries instead of solver ones (see, for example, <code>OOO_TEST_PREFIX</code> in the <code>services.rdb</code> of <code>stoc/test/uriproc/makefile.mk</code>).<br />
{{Documentation/Note|Build Environment&nbsp;2.0 will not build directly to solver, but will make a module depend on the targets in the solver, and these are depending on the targets in the workdir (aka the old "local output tree"). Thus on an usual build in a module building and delivering are not two steps anymore. If tests depend on the target in the solver (which they will do automatically in most use cases, as linking against a library automatically creates a dependency on the library in the solver), they can be sure that the target is up to date in the solver '''and''' in the workdir.<br />
<br />
--[[User:B michaelsen|B michaelsen]] 06:32, 27 August 2010 (UTC)}}<br />
* '''TODO:''' Constructs like &ldquo;<code>-env:UNO_<var>&hellip;</var>=$(my_file)<var>&hellip;</var></code>&rdquo; would fail for problematic characters (spaces!) in paths.<br />
<br />
=== Smoke Test ===<br />
<br />
* Redesign <code>smoketestoo_native</code> to use CppUnit and pre-installed OOo.<br />
* [http://hg.services.openoffice.org/cws/sb118/rev/160b248247a0 &ldquo;changed <code>tools/debug</code> to never fall back from writing to shell to writing to file, and read <code>DBGSV_INIT</code> from <code>rtl::Bootstrap</code>; the latter causes problems if <code>tools/debug</code> is called from static code executing before <code>SAL_MAIN</code> has called <code>osl_setCommandArgs</code> &rarr; removed statics from code and added assertions to <code>osl/process</code>; various improvements to <code>smoketests.cxx</code> (incl. passing an appropriate <code>dbgsv.ini</code> for non-pro builds)&rdquo;] followed by [http://hg.services.openoffice.org/cws/sb118/rev/dbbacb9d2fd3 &ldquo;reverted parts of HG <code>-c&nbsp;160b248247a0</code> again: the &lsquo;static code executing before <code>SAL_MAIN</code>&rsquo; problem was too severe; instead, globally set <code>DBGSV_INIT</code> build env var to new <code>solenv/bin/dbgsv.ini</code>&rdquo;]; see also {{issue|109142}} &ldquo;Let assertions abort&rdquo;.<br />
* '''TODO:''' For <code>smoketestoo_native/makefile.mk</code> &ldquo;<code><nowiki>-env:arg-env=$(OOO_LIBRARY_PATH_VAR)"$${{$(OOO_LIBRARY_PATH_VAR)+=$$$(OOO_LIBRARY_PATH_VAR)}}"</nowiki></code>&rdquo; mechanism: <code>osl_executeProcess</code> <code>ustrEnvironments</code> members without &ldquo;<code>=</code>&rdquo;: all platforms; documentation; documentation of <code>osl_executeProcess_WithRedicrectedIO</code>.<br />
* '''TODO:''' <code>-headless</code>? (appears to still display windows on Windows and Mac OS&nbsp;X, however, see {{issue|109052}})<br />
* '''TODO:''' {{issue|113341}} &ldquo;-nofirststartwizard should disable update check&rdquo;<br />
<br />
=== Pre-Installed OOo ===<br />
<br />
* For Sun Hamburg Release Engineering, take MWS archive installation sets from &ldquo;S:&rdquo; instead of solver: [http://hg.services.openoffice.org/cws/sb118/rev/d5dbea724063 &ldquo;take installation set from <code>SHIPDRIVE</code> if appropriate&rdquo;].<br />
* '''TODO:''' <code>PKGFORMAT=installed</code> instead of <code>archive</code>?<br />
<br />
=== <code>unoapi</code> Tests ===<br />
<br />
* Known issues, open (not yet addressed at all; disabled for now on net-yet-integrated CWS; or fixed on not-yet-integrated CWS):<br />
** {{issue|114669}} &ldquo;forms/qa/unoapi forms.OListBoxControl crash&rdquo; (fixed on {{CWS|sb140}})<br />
** {{issue|116120}} &ldquo;vcl: TabControl::ImplGetTabRect negative height leads to X_CreatePixmap BadAlloc&rdquo; (fixed on {{CWS|vcl118}}, integrated into <code>DEV300_m101</code>)<br />
** {{issue|116125}} &ldquo;qadevOOo/qa/complex/junitskeleton failure&rdquo;<br />
** {{issue|116156}} &ldquo;toolkit/qa/unoapi crash in SwAccessibleMap::RemoveContext&rdquo;<br />
** {{issue|116192}} &ldquo;[sw] fixed text fields sometimes get updated&rdquo; (fixed on {{CWS|sw34bf03}}, integrated into <code>DEV300_m102</code>)<br />
** {{issue|116550}} &ldquo;toolkit/qa/unoapi crashes OOo in ~SwAccessibleParagraph vs. SwXTextDocument::close&rdquo;<br />
** {{issue|116583}} &ldquo;comphelper/qa/complex/comphelper failure&rdquo;<br />
** {{issue|116730}} &ldquo;vcl: crash with multiple threads in Window::ImplGrabFocus&rdquo;<br />
** {{issue|116733}} &ldquo;sw: crash in ~SwDrawContact (forms/qa/unoapi)&rdquo;<br />
** {{issue|117381}} &ldquo;ucb/qa/unoapi ucb.UniversalContentBroker::com::sun::star::ucb::XContentProviderManager::deregisterContentProvider() fails with gvfs&rdquo; (fixed on {{CWS|sb140}})<br />
** {{issue|117486}} &ldquo;toolkit/qa/complex/toolkit: "Window pos size wrong"&rdquo; (fixed on {{CWS|sb140}})<br />
** {{issue|117488}} &ldquo;sw/qa/unoapi: sw.SwXViewSettings::com::sun::star::text::ViewSettings::ShowOnlineLayout ShowOnlineLayout/ZoomValue failed&rdquo;<br />
** {{issue|117641}} &ldquo;chart2/qa/unoapi fails in sch.ChXDataPoint::com::sun::star::chart::ChartDataPointProperties due to change to jpeg/prj/d.lst&rdquo; (fixed as <code>DEV300_m106</code> masterfix)<br />
** {{issue|117693}} &ldquo;xmlsecurity/qa/certext fails on wntmsci12 non-pro ("no OPENSSL_Applink")&rdquo;<br />
** {{issue|117774}} &ldquo;static in editengine ImplGetSvxUnoOutlinerTextCursorSvxPropertySet causes deadlock in chart2/qa/unoapi&rdquo;<br />
** {{issue|117777}} &ldquo;vcl: AquaSalFrame::Show deadlock in toolkit/qa/unoapi&rdquo;<br />
** {{issue|117805}} &ldquo;unoxml/qa/complex/unoxml fails on Mac OS X&rdquo;<br />
* Known issues, disabled for now:<br />
** {{issue|109517}} &ldquo;sc/qa/unoapi fails for ScAnnotationObj etc.&rdquo;<br />
** {{issue|109518}} &ldquo;sd/qa/unoapi crash in SfxViewShell::GetController&rdquo;<br />
** {{issue|109643}} &ldquo;toolkit/qa/unoapi tests fail when losing focus&rdquo;<br />
** {{issue|109728}} &ldquo;~ScAutoFormatObj uses cleared ScGlobal&rdquo;<br />
** {{issue|109917}} &ldquo;fragile unoapi test using OnUnfocus event&rdquo;<br />
** {{issue|109939}} &ldquo;toolkit: inconsistent UnoControl locking schemes&rdquo;<br />
** {{issue|110862}} &ldquo;sc/qa/unoapi fails for sc.ScDataPilotTableObj::com::sun::star::sheet::XDataPilotTable::refresh()&rdquo;<br />
** {{issue|110988}} &ldquo;svtools/qa/unoapi fails for svtools.AccessibleBrowseBox etc.&rdquo;<br />
** {{issue|111006}} &ldquo;toolkit: deadlock between UnoControls&rdquo;<br />
** {{issue|111032}} &ldquo;sc/qa/unoapi sc.ScAccessibleCell::com::sun::star::accessibility::XAccessibleText getCharacterBounds() failure&rdquo;<br />
** {{issue|111042}} &ldquo;sd/qa/unoapi sd::DrawController::dispose crash&rdquo;<br />
** {{issue|111043}} &ldquo;sd/qa/unoapi sd::DrawController_OutlineView NullPointerException&rdquo;<br />
** {{issue|111102}} &ldquo;chart2: ChartModelHelper::findDiagram returns null&rdquo;<br />
** {{issue|111111}} &ldquo;xmloff.Impress.XMLImporter::com::sun::star::document::XImporter&rdquo;<br />
** {{issue|111113}} &ldquo;toolkit.AccessibleStatusBarItem unoapi failure&rdquo;<br />
** {{issue|111148}} &ldquo;forms/qa/unoapi forms.OImageControlModel::com::sun::star::beans::XMultiPropertySet deadlock&rdquo;<br />
** {{issue|111169}} &ldquo;svx.AccessiblePageShape unoapi failure&rdquo;<br />
** {{issue|111170}} &ldquo;sun/i18n/qa/unoapi "creating a drawdoc" failure&rdquo;<br />
** {{issue|111178}} &ldquo;sw/qa/unoapi SwView::SelectShell crash&rdquo;<br />
** {{issue|111180}} &ldquo;framework/qa/unoapi fwk.Desktop::com::sun::star::frame::XComponentLoader::loadComponentFromURL() failure&rdquo;<br />
** {{issue|111182}} &ldquo;Desktop::terminate -> ~DropTarget -> _objc_error crash&rdquo;<br />
** {{issue|111184}} &ldquo;sal/qa/osl/pipe uses fixed pipe names&rdquo;<br />
** {{issue|111186}} &ldquo;sw/qa/unoapi sw.PageStyle::com::sun::star::beans::XPropertySet::setPropertyValue() failure&rdquo;<br />
** {{issue|111190}} &ldquo;sw/qa/unoapi sw.SwXShape failure&rdquo;<br />
** {{issue|111194}} &ldquo;sw/qa/unoapi sw.XMLExporter crash&rdquo;<br />
** {{issue|111195}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleScrollBar::com::sun::star::accessibility::XAccessibleValue::setCurrentValue() failure&rdquo;<br />
** {{issue|111197}} &ldquo;sw/qa/unoapi sw.SwAccessibleDocumentPageView failure&rdquo;<br />
** {{issue|111199}} &ldquo;sd/qa/unoapi sd.AccessibleOutlineView failure&rdquo;<br />
** {{issue|111200}} &ldquo;xmloff/qa/unoapi xmloff.Draw.XMLMetaImporter failure&rdquo;<br />
** {{issue|111216}} &ldquo;svx/qa/unoapi accessibility deadlock&rdquo;<br />
** {{issue|111218}} &ldquo;sw/qa/unoapi sw.SwAccessibleParagraphView::com::sun::star::accessibility::XAccessibleEventBroadcaster::removeEventListener() failure&rdquo;<br />
** {{issue|111220}} &ldquo;sw/qa/unoapi sw.XMLContentExporter::com::sun::star::document::XFilter::cancel() failure&rdquo;<br />
** {{issue|111224}} &ldquo;xmloff/qa/unoapi xmloff.Impress.XMLContentExporter crash&rdquo;<br />
** {{issue|111225}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleStatusBar failure&rdquo;<br />
** {{issue|111252}} &ldquo;svx/qa/unoapi svx.AccessibleOLEShape deadlock&rdquo;<br />
** {{issue|111273}} &ldquo;sw/qa/unoapi sw.SwXTextEmbeddedObject::com::sun::star::document::XEmbeddedObjectSupplier::getEmbeddedObject() crash&rdquo;<br />
** {{issue|111278}} &ldquo;svx/qa/unoapi svx.AccessibleEditableTextPara failure&rdquo;<br />
** {{issue|111283}} &ldquo;sfx2/qa/unoapi sfx.StandaloneDocumentInfo failure&rdquo;<br />
** {{issue|111285}} &ldquo;forms/qa/unoapi forms.OButtonModel failure&rdquo;<br />
** {{issue|111287}} &ldquo;xmloff/qa/unoapi XMLSettingsIm-/Exporter crash&rdquo;<br />
** {{issue|111329}} &ldquo;sd/qa/unoapi SdXCustomPresentationAccess::getElementNames/ImpEditEngine::OnlineSpellHdl hang&rdquo;<br />
** {{issue|111332}} &ldquo;sw/qa/unoapi sw.XMLStylesExporter::com::sun::star::document::XFilter crash&rdquo;<br />
** {{issue|111333}} &ldquo;forms/qa/unoapi forms.OImageControlControl::com::sun::star::awt::XControl deadlock&rdquo;<br />
** {{issue|112743}} &ldquo;starmath/qa/unoapi sm.XMLSettingsExporter failure&rdquo;<br />
** {{issue|112746}} &ldquo;framework/qa/unoapi fwk.ModuleManager failure (X11 BadWindow)&rdquo;<br />
** {{issue|112751}} &ldquo;testgraphical/qa/graphical failure&rdquo;<br />
** {{issue|112778}} &ldquo;xmloff/qa/unoapi xmloff.Draw.XMLContentExporter failure&rdquo;<br />
** {{issue|113020}} &ldquo;sw/qa/unoapi sw.SwXTextGraphicObject::com::sun::star::beans::XPropertySet failure&rdquo;<br />
** {{issue|113103}} &ldquo;chart2: deadlock between DiagramHelper and Diagram&rdquo;<br />
** {{issue|113136}} &ldquo;sw/qa/unoapi sw.SwAccessibleParagraphView::com::sun::star::accessibility::XAccessibleEditableText failure&rdquo;<br />
** {{issue|113142}} &ldquo;sw/qa/unoapi SwAccessibleContext::RemoveFrmFromAccessibleMap crash&rdquo;<br />
** {{issue|113161}} &ldquo;sd/qa/unoapi sd.SdLayer::com::sun::star::drawing::Layer::IsVisible failure&rdquo;<br />
** {{issue|113201}} &ldquo;forms/qa/unoapi forms.OEditModel::com::sun::star::form::validation::XValidatableFormComponent failure&rdquo;<br />
** {{issue|113245}} &ldquo;framework/qa/unoapi fwl.TypeDetection failure&rdquo;<br />
** {{issue|113306}} &ldquo;sfx2/qa/unoapi sfx.DocumentTemplates failure&rdquo;<br />
** {{issue|113386}} &ldquo;sd/qa/unoapi sd.AccessibleDrawDocumentView::com::sun::star::accessibility::XAccessibleComponent::containsPoint() failure&rdquo;<br />
** {{issue|113489}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleMenu{,Bar,Separator} failures&rdquo;<br />
** {{issue|114205}} &ldquo;sw/qa/unoapi sw.SwAccessibleParagraphView::com::sun::star::accessibility::XAccessibleText::copyText() failed&rdquo;<br />
** {{issue|114209}} &ldquo;forms/qa/unoapi forms.OGridControlModel::com::sun::star::view::XSelectionSupplier crash&rdquo;<br />
** {{issue|114211}} &ldquo;xmloff/qa/unoapi xmloff.Draw.XMLStylesImporter::com::sun::star::lang::XInitialization crash&rdquo;<br />
** {{issue|114213}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleMenu::com::sun::star::accessibility::XAccessibleSelection failure&rdquo;<br />
** {{issue|114636}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleScrollBar::com::sun::star::accessibility::XAccessibleAction failure&rdquo;<br />
** {{issue|114637}} &ldquo;sw/qa/unoapi sw.SwAccessibleFootnoteView(?) crash&rdquo;<br />
** {{issue|114642}} &ldquo;svx/qa/unoapi svx: svx.SvxUnoTextContent::com::sun::star::style::CharacterProperties crash&rdquo;<br />
** {{issue|114889}} &ldquo;sw/qa/unoapi sw.SwXTextViewCursor::com::sun::star::view::XScreenCursor&rdquo;<br />
** {{issue|116784}} &ldquo;[sfx2] CheckGlobalEventBroadcaster_writer1 fails&rdquo;<br />
** {{issue|116813}} &ldquo;[sfx2] complex.sfx2.UndoManager checkBrokenScripts fails&rdquo;<br />
** {{issue|116814}} &ldquo;[toolkit] unoapi test UnoControlDialogModel: XCloneable fails&rdquo;<br />
* Missing tests:<br />
** {{issue|109564}} &ldquo;qadevOOo/tests/java/ifc/awt/_XSystemChildFactory.java&rdquo;<br />
* Sporadic failures:<br />
** {{issue|111217}} &ldquo;BasicManager::SetGlobalUNOConstant crash during shutdown&rdquo;<br />
** {{issue|111246}} &ldquo;svx::FontHeightToolBoxControl::statusChanged crash (memory corruption)&rdquo;<br />
** {{issue|111271}} &ldquo;Mac OS X: crash during shutdown, __tcf_2 on stack&rdquo;<br />
** {{issue|111400}} &ldquo;Extension Manager does not join spawned uno process (-> smoketestoo_native fails)&rdquo;<br />
** {{issue|112070}} &ldquo;UNO API tests must not use random&rdquo;<br />
** {{issue|113158}} &ldquo;crash with two threads in framework::ToolBarManager dtor&rdquo;<br />
** {{issue|113197}} &ldquo;sw/qa/unoapi sw.SwXTextRange hangs&rdquo;<br />
** {{issue|113367}} &ldquo;sysdtrans deadlock during shutdown&rdquo;<br />
** {{issue|113464}} &ldquo;stoc_smgr::ORegistryServiceManager::dispose crash during shutdown&rdquo;<br />
** {{issue|114207}} &ldquo;framework::ModuleUIConfigurationManager::dispose crash during shutdown&rdquo;<br />
** {{issue|114675}} &ldquo;binary URP bridge race on shut down, crash&rdquo;<br />
** {{issue|114718}} &ldquo;forms/qa/unoapi: crash in remote async release call&rdquo;<br />
** {{issue|116131}} &ldquo;vcl: message unregisterDraggingDestinationHandler: sent to freed object&rdquo;<br />
<br />
[[Category:Effort]][[Category:Test]]</div>Sbhttps://wiki.openoffice.org/wiki/Test_CleanupTest Cleanup2011-04-08T15:43:02Z<p>Sb: /* unoapi Tests */</p>
<hr />
<div>= Test Cleanup Project =<br />
<br />
The demand for automated (unit) testing should be obvious. See the [http://www.openoffice.org/servlets/ReadMsg?list=dev&msgNo=26189 mission statement mail] and [[Media:JustTestingPresentation.odp|slides]] from a [http://fosdem.org/2010/schedule/events/ooo_testing FOSDEM'10 talk] and an [http://www.ooocon.org/index.php/ooocon/2010/paper/view/188 OOoCon&nbsp;2010 presentation] for more information and further links.<br />
<br />
For examples of how to write xUnit based tests in the OOo code base, see [http://hg.services.openoffice.org/DEV300/file/87f4911ea629/basegfx/test <code>basegfx/test/</code>], [http://hg.services.openoffice.org/DEV300/file/87f4911ea629/sal/qa/ByteSequence <code>sal/qa/ByteSequence/</code>], and [http://hg.services.openoffice.org/DEV300/file/87f4911ea629/smoketestoo_native <code>smoketest_native/</code>]. However, the hard part should not be how to write test code, anyway, but how to write ''testable'' code; see [http://misko.hevery.com/2008/11/04/clean-code-talks-unit-testing/ The Clean Code Talks&mdash;Unit Testing].<br />
<br />
When testing C++ code that merely uses UNO types (no services), but uses them in a way that requires UNO to be bootstrapped so that the relevant type information is available (e.g., putting instances of complex UNO types into <code>com::sun::star::uno::Any</code>), one approach is as follows: In the <code>makefile.mk</code>, instead of <code>.INCLUDE: _cppunit.mk</code> use<br />
<source lang="make"><br />
.IF "$(OS)" == "WNT"<br />
my_file = file:///<br />
.ELSE<br />
my_file = file://<br />
.END<br />
<br />
ALLTAR : test<br />
<br />
test .PHONY : $(SHL1TARGETN)<br />
$(CPPUNITTESTER) $(SHL1TARGETN) \<br />
-env:UNO_TYPES=$(my_file)$(SOLARBINDIR)/types.rdb<br />
</source><br />
and in the test code once call <code>cppu::defaultBootstrap_InitialComponentContext()</code>.<br />
<br />
== User Interface ==<br />
<br />
=== CppUnit ===<br />
<br />
For tests in C++, plain CppUnit (at least version 1.12.1) is available. (OOo bundles CppUnit 1.12.1 as an external module; alternatively, you can configure <code>--with-system-cppunit</code>.)<br />
<br />
Implement the test code as a dynamic library, following CppUnit conventions (i.e., using [http://cppunit.sourceforge.net/doc/lastest/group___creating_test_suite.html#ga0 <code>CPPUNIT_TEST_SUITE_REGISTRATION</code>] and [http://cppunit.sourceforge.net/doc/lastest/_test_plug_in_8h.html#a2 <code>CPPUNIT_PLUGIN_IMPLEMENT</code>] macros). The following settings are needed in the <code>makefile.mk</code>:<br />
* <code>ENABLE_EXCEPTIONS = TRUE</code><br />
* <code>CFLAGSCXX += $(CPPUNIT_CFLAGS)</code><br />
* <code>SHL<var>n</var>RPATH = NONE</code><br />
* <code>SHL<var>n</var>STDLIBS += $(CPPUNITLIB)</code><br />
* <code>SHL<var>n</var>VERSIONMAP = <var>version.map</var></code>, where that file must contain the following (see [[#CppUnit_1.12.1|details]] below for improving this):<br />
UDK_3_0_0 {<br />
global:<br />
cppunitTestPlugIn;<br />
local:<br />
*;<br />
};<br />
<br />
To run tests, <code>sal/cppunittester</code> delivers a <code>cppunittester</code> executable that has some advantages over the plain CppUnit <code>DllPlugInTester</code>:<br />
* It uses <code>SAL_IMPLEMENT_MAIN</code> to properly set up the per-process settings required by URE. Test code as well as tested code based on URE will expect this and would fail in a process that is not set up in this way.<br />
* Getting CppUnit to build as an external module within the Windows OOo build is a non-trivial task. The less parts of it that need to be built, the better.<br />
<br />
Something like the following in <code>makefile.mk</code> will execute the tests:<br />
ALLTAR : test<br />
test .PHONY : $(SHL1TARGETN)<br />
$(CPPUNITTESTER) $(SHL1TARGETN)<br />
<br />
<code>$(CPPUNITTESTER)</code> internally uses <code>$(AUGMENT_LIBRARY_PATH_LOCAL)</code> to favor library instances in the local output tree over ones in solver. Alternatively to the above, <code>.INCLUDE: _cppunit.mk</code> calls <code>$(CPPUNITTESTER)</code> on each of <code>$(SHL1TARGETN)</code>, &hellip;, <code>$(SHL10TARGETN)</code> that is defined.<br />
<br />
=== JUnit ===<br />
<br />
For tests in Java, plain JUnit (at least version 4) is available. (OOo requires JUnit as a prerequisite, see [http://junit.org/ junit.org] for downloads; you can configure <code>--with-junit=<var>&hellip;</var></code> if it is not automatically found; alternatively, you can configure <code>--without-junit</code>, disabling JUnit-based tests.)<br />
<br />
=== <code>subsequenttests</code> ===<br />
<br />
Some tests have build and/or run time dependencies on modules further up in the hierarchy, or modules that the rest of the module in question does not have dependencies on (and which are thus not listed in the module's <code>build.lst</code>). The extreme case are tests that need a complete OOo installation as their test environment.<br />
<br />
For such tests, the whole <code>makefile.mk</code> should be wrapped in:<br />
.IF "$(OOO_SUBSEQUENT_TESTS)" == ""<br />
nothing .PHONY :<br />
.ELSE<br />
...<br />
.END<br />
(and the directory included in the module's <code>build.lst</code>).<br />
<br />
The idea is to do a complete OOo build first (<code>cd smoketestoo_native && build --all</code>) and then build and execute those tests either selectively or wholesale.<br />
<br />
Selectively building a specific such test directory can be done with <code>cd <var>&hellip;</var> && OOO_SUBSEQUENT_TESTS=TRUE dmake</code>.<br />
<br />
To build and execute ''all'' these test directories, the tool <code>subsequenttests</code> (in <code>solenv/bin</code>) exists. It scans the <code>build.lst</code> files of all modules for <code>makefile.mk</code>s that mention <code>OOO_SUBSEQUENT_TESTS</code> and simply executes <code>dmake</code> in all those directories, with <code>OOO_SUBSEQUENT_TESTS</code> set. It supports a <code>-P<var>n</var></code> switch to build <var>n</var> directories in parallel.<br />
<br />
=== Helpers ===<br />
<br />
A new module <code>test</code> shall collect reusable code snippets for C++ and Java tests.<br />
<br />
For now, it concentrates on letting a test connect to an OOo instance via remote UNO: A C++ test class can hold a <code>test::OfficeConnection</code> as class member and, in its CppUnit <code>setUp</code> and <code>tearDown</code> functions, call <code>OfficeConnection::setUp</code> and <code>OfficeConnection::tearDown</code>, respectively. Tests obtain access to the OOo instance via <code>OfficeConnection::getFactory</code>. Similarly, a Java test class can use an <code>org.openoffice.test.OfficeConnection</code> instance, offering the same functionality as its C++ counterpart.<br />
<br />
For this to work, three additional steps are necessary:<br />
* First, in <code>instsetoo_native</code>, building an installation set for the <code>openoffice</code> product in the default language (<code>en-US</code>) in any package format now takes care to always also build an archive package format (<code>tar.gz</code> resp. <code>zip</code>) of that product.<br />
* Second, building <code>smoketestoo_native</code> permanently installs that archive into the solver. (Except on Windows, where problems with resulting long pathnames prevent this; there, as a workaround, each test individually unzips the archive to some local temporary directory.) <br />
* Third, a test that requires an OOo instance includes <code>installationtest.mk</code> in its <code>makefile.mk</code>. That file makes sure to call the CppUnit and JUnit test runners with the information necessary for the helper classes to start the correct OOo instance with a fresh <code>UserInstallation</code> and set up an URP pipe connection. The information is tunneled into the test runner executables as UNO bootstrap parameters.<br />
<br />
For debugging purposes, which OOo instance the tests use can manually be overridden, see [http://www.openoffice.org/servlets/ReadMsg?list=interface-announce&msgNo=1285 &ldquo;OOO_TEST_SOFFICE: allow override of tested soffice process&rdquo;].<br />
<br />
=== <code>unoapi</code> Tests ===<br />
<br />
The <code>unoapi</code> tests are redesigned to use the new test framework. They are plain JUnit tests and use the mechanisms described above to connect to running OOo instances. However, due to the large amount of logic encoded in <code>qadevOOo</code>, those JUnit tests for now are only thin wrappers around <code>org.openoffice.Runner.run</code>. This is intended to change over time.<br />
<br />
The <code>cwscheckapi</code> tool to run the <code>unoapi</code> tests has been subsumed by <code>subsequenttests</code>. The latter always runs all tests, while the former had mechanisms to run only tests for modules that had been changed by a CWS. The hope is that the parallel mode of <code>subsequenttests</code> makes it fast enough so that running all tests all of the times becomes feasible.<br />
<br />
Unfortunately, running the <code>unoapi</code> tests is still not stable enough to give useful results. Therefore, running <code>subsequenttests</code> has been disabled in the build bots for now. Making the tests sufficiently stable is ongoing work.<br />
<br />
== Details ==<br />
<br />
Working on {{CWS|sb118}}, {{CWS|sb120}}.<br />
<br />
=== CppUnit 1.12.1 ===<br />
<br />
* Replace existing <code>cppunit</code> and <code>testshl2</code> combo with latest CppUnit 1.12.1.<br />
* OOo <code>configure --with-system-cppunit</code> (for now only if also <code>--with-system-stl</code>!); minimal required version for now arbitrarily 1.12.1.<br />
* '''TODO:''' Upstream <code>PATCH_FILES</code> (<code>windows.patch</code>?!?).<br />
* '''TODO:''' <code>RPATH</code> in generated libraries and executables.<br />
* '''TODO:''' Improve <code>CPPUNIT_PLUGIN_EXPORT</code> and get rid of version maps (GCC exception problems?).<br />
* '''TODO:''' <code>cppunit/makefile.mk</code> <code>MY_LIBS = -lm</code> Solaris hack.<br />
* '''TODO:''' In general OOo build environment, no longer set <code>CFLAGS</code> etc. as environment variables; have package-specific <code>OOO_<var>package</var>_CFLAGS</code> etc. and combine those into <code>CFLAGS</code> etc. where necessary (see <code>OOO_STLPORT_CXXFLAGS</code> etc. in <code>cppunit/makefile.mk</code>).<br />
* '''TODO:''' Why use <code>cppunittester</code> instead of <code>DllPlugInTester</code>? (Remove building/delivering <code>DllPlugInTester</code>.)<br />
* '''TODO:''' Make <code>operator &lt;&lt;(std::basic_ostream &amp;, rtl::OUString const &amp;)</code> from <code>test/oustringstreaminserter.hxx</code> generally available?<br />
* '''TODO:''' Make STLport <code>num_put</code> symbols available on platforms other than Linux (see <code>solenv/bin/addsym.awk</code>), too, so that <code>CPPUNIT_ASSERT_EQUAL</code> actually outputs numeric values.<br />
<br />
==== Is CppUnit an active project? ====<br />
<br />
When I wrote<br />
<pre><br />
Message-ID: <4D67B884.8080101@oracle.com><br />
Date: Fri, 25 Feb 2011 15:11:16 +0100<br />
From: Stephan Bergmann <stephan.bergmann@oracle.com><br />
MIME-Version: 1.0<br />
To: cppunit-devel@lists.sourceforge.net<br />
Subject: What part of the API is published?<br />
Content-Type: text/plain; charset=UTF-8; format=flowed<br />
Content-Transfer-Encoding: 7bit<br />
<br />
At least for CppUnit 1.12.1, it is unclear whether for example class <br />
DynamicLibraryManager is supposed to be available to client code.<br />
<br />
The HTML documentation's class list contains DynamicLibraryManager just <br />
like, say, TestCase, and I can't find any hint on the former's page that <br />
it is an implementation detail. However, in DynamicLibraryManager.h, <br />
the class is not decorated with CPPUNIT_API.<br />
<br />
Is there any specification of what is published (i.e., stable, usable by <br />
clients) vs. what is implementation detail (i.e., not to be used by <br />
clients)?<br />
<br />
-Stephan<br />
</pre><br />
the only response I ever got was<br />
<pre><br />
MIME-Version: 1.0<br />
Content-Type: text/plain; charset="us-ascii"<br />
Content-Transfer-Encoding: 7bit<br />
Subject: Your message to Cppunit-devel awaits moderator approval<br />
From: cppunit-devel-bounces@lists.sourceforge.net<br />
To: stephan.bergmann@oracle.com<br />
Message-ID: <mailman.49713.1298643119.7082.cppunit-devel@lists.sourceforge.net><br />
Date: Fri, 25 Feb 2011 14:11:59 +0000<br />
<br />
Your mail to 'Cppunit-devel' with the subject<br />
<br />
What part of the API is published?<br />
<br />
Is being held until the list moderator can review it for approval.<br />
<br />
The reason it is being held:<br />
<br />
Post by non-member to a members-only list<br />
<br />
Either the message will get posted to the list, or you will receive<br />
notification of the moderator's decision. If you would like to cancel<br />
this posting, please visit the following URL:<br />
<br />
https://lists.sourceforge.net/lists/confirm/cppunit-devel/1da27e17e1d5fdfcb7f8ac6860a05bb5ca1eab1d<br />
</pre><br />
and the last message in [http://sourceforge.net/mailarchive/forum.php?forum_name=cppunit-devel the archive] is from January 2010.<br />
<br />
=== <code>testshl2</code> ===<br />
<br />
* <code>solenv/inc_cppunit.mk</code>/<code>cppunit.mk</code>: [http://hg.services.openoffice.org/cws/sb118/rev/cf13421c3774 &ldquo;adapted <code>cppunit.mk</code> to <code>cppunittester</code> and no longer require &lsquo;<code>dmake test</code>&rsquo; to run tests&rdquo;].<br />
* '''TODO:''' <code>DEV300_m68</code> introduced <code>TESTSHL2LIB</code> (which I removed again) and uses it in many <code>qa</code> makefiles (that I need to touch someday, anyway).<br />
<br />
=== Unit Tests ===<br />
<br />
* <code>OOO_SUBSEQUENT_TESTS</code> (<code>build.lst</code> lists local dependencies of those directories, so that modifying a module and then calling &ldquo;<code>OOO_SUBSEQUENT_TESTS=x build</code>&rdquo; rebuilds the module and executes the tests).<br />
* '''TODO:''' If Build Environment&nbsp;2.0 would build directly to solver (instead of local output tree/deliver), that would simplify tests that currently need to take care to test local libraries instead of solver ones (see, for example, <code>OOO_TEST_PREFIX</code> in the <code>services.rdb</code> of <code>stoc/test/uriproc/makefile.mk</code>).<br />
{{Documentation/Note|Build Environment&nbsp;2.0 will not build directly to solver, but will make a module depend on the targets in the solver, and these are depending on the targets in the workdir (aka the old "local output tree"). Thus on an usual build in a module building and delivering are not two steps anymore. If tests depend on the target in the solver (which they will do automatically in most use cases, as linking against a library automatically creates a dependency on the library in the solver), they can be sure that the target is up to date in the solver '''and''' in the workdir.<br />
<br />
--[[User:B michaelsen|B michaelsen]] 06:32, 27 August 2010 (UTC)}}<br />
* '''TODO:''' Constructs like &ldquo;<code>-env:UNO_<var>&hellip;</var>=$(my_file)<var>&hellip;</var></code>&rdquo; would fail for problematic characters (spaces!) in paths.<br />
<br />
=== Smoke Test ===<br />
<br />
* Redesign <code>smoketestoo_native</code> to use CppUnit and pre-installed OOo.<br />
* [http://hg.services.openoffice.org/cws/sb118/rev/160b248247a0 &ldquo;changed <code>tools/debug</code> to never fall back from writing to shell to writing to file, and read <code>DBGSV_INIT</code> from <code>rtl::Bootstrap</code>; the latter causes problems if <code>tools/debug</code> is called from static code executing before <code>SAL_MAIN</code> has called <code>osl_setCommandArgs</code> &rarr; removed statics from code and added assertions to <code>osl/process</code>; various improvements to <code>smoketests.cxx</code> (incl. passing an appropriate <code>dbgsv.ini</code> for non-pro builds)&rdquo;] followed by [http://hg.services.openoffice.org/cws/sb118/rev/dbbacb9d2fd3 &ldquo;reverted parts of HG <code>-c&nbsp;160b248247a0</code> again: the &lsquo;static code executing before <code>SAL_MAIN</code>&rsquo; problem was too severe; instead, globally set <code>DBGSV_INIT</code> build env var to new <code>solenv/bin/dbgsv.ini</code>&rdquo;]; see also {{issue|109142}} &ldquo;Let assertions abort&rdquo;.<br />
* '''TODO:''' For <code>smoketestoo_native/makefile.mk</code> &ldquo;<code><nowiki>-env:arg-env=$(OOO_LIBRARY_PATH_VAR)"$${{$(OOO_LIBRARY_PATH_VAR)+=$$$(OOO_LIBRARY_PATH_VAR)}}"</nowiki></code>&rdquo; mechanism: <code>osl_executeProcess</code> <code>ustrEnvironments</code> members without &ldquo;<code>=</code>&rdquo;: all platforms; documentation; documentation of <code>osl_executeProcess_WithRedicrectedIO</code>.<br />
* '''TODO:''' <code>-headless</code>? (appears to still display windows on Windows and Mac OS&nbsp;X, however, see {{issue|109052}})<br />
* '''TODO:''' {{issue|113341}} &ldquo;-nofirststartwizard should disable update check&rdquo;<br />
<br />
=== Pre-Installed OOo ===<br />
<br />
* For Sun Hamburg Release Engineering, take MWS archive installation sets from &ldquo;S:&rdquo; instead of solver: [http://hg.services.openoffice.org/cws/sb118/rev/d5dbea724063 &ldquo;take installation set from <code>SHIPDRIVE</code> if appropriate&rdquo;].<br />
* '''TODO:''' <code>PKGFORMAT=installed</code> instead of <code>archive</code>?<br />
<br />
=== <code>unoapi</code> Tests ===<br />
<br />
* Known issues, open (not yet addressed at all; disabled for now on net-yet-integrated CWS; or fixed on not-yet-integrated CWS):<br />
** {{issue|114669}} &ldquo;forms/qa/unoapi forms.OListBoxControl crash&rdquo; (fixed on {{CWS|sb140}})<br />
** {{issue|116120}} &ldquo;vcl: TabControl::ImplGetTabRect negative height leads to X_CreatePixmap BadAlloc&rdquo; (fixed on {{CWS|vcl118}}, integrated into <code>DEV300_m101</code>)<br />
** {{issue|116125}} &ldquo;qadevOOo/qa/complex/junitskeleton failure&rdquo;<br />
** {{issue|116156}} &ldquo;toolkit/qa/unoapi crash in SwAccessibleMap::RemoveContext&rdquo;<br />
** {{issue|116192}} &ldquo;[sw] fixed text fields sometimes get updated&rdquo; (fixed on {{CWS|sw34bf03}}, integrated into <code>DEV300_m102</code>)<br />
** {{issue|116550}} &ldquo;toolkit/qa/unoapi crashes OOo in ~SwAccessibleParagraph vs. SwXTextDocument::close&rdquo;<br />
** {{issue|116583}} &ldquo;comphelper/qa/complex/comphelper failure&rdquo;<br />
** {{issue|116730}} &ldquo;vcl: crash with multiple threads in Window::ImplGrabFocus&rdquo;<br />
** {{issue|116733}} &ldquo;sw: crash in ~SwDrawContact (forms/qa/unoapi)&rdquo;<br />
** {{issue|117381}} &ldquo;ucb/qa/unoapi ucb.UniversalContentBroker::com::sun::star::ucb::XContentProviderManager::deregisterContentProvider() fails with gvfs&rdquo; (fixed on {{CWS|sb140}})<br />
** {{issue|117486}} &ldquo;toolkit/qa/complex/toolkit: "Window pos size wrong"&rdquo; (fixed on {{CWS|sb140}})<br />
** {{issue|117488}} &ldquo;sw/qa/unoapi: sw.SwXViewSettings::com::sun::star::text::ViewSettings::ShowOnlineLayout ShowOnlineLayout/ZoomValue failed&rdquo;<br />
** {{issue|117641}} &ldquo;chart2/qa/unoapi fails in sch.ChXDataPoint::com::sun::star::chart::ChartDataPointProperties due to change to jpeg/prj/d.lst&rdquo; (fixed as <code>DEV300_m106</code> masterfix)<br />
** {{issue|117693}} &ldquo;xmlsecurity/qa/certext fails on wntmsci12 non-pro ("no OPENSSL_Applink")&rdquo;<br />
** {{issue|117774}} &ldquo;static in editengine ImplGetSvxUnoOutlinerTextCursorSvxPropertySet causes deadlock in chart2/qa/unoapi&rdquo;<br />
** {{issue|117777}} &ldquo;vcl: AquaSalFrame::Show deadlock in toolkit/qa/unoapi&rdquo;<br />
* Known issues, disabled for now:<br />
** {{issue|109517}} &ldquo;sc/qa/unoapi fails for ScAnnotationObj etc.&rdquo;<br />
** {{issue|109518}} &ldquo;sd/qa/unoapi crash in SfxViewShell::GetController&rdquo;<br />
** {{issue|109643}} &ldquo;toolkit/qa/unoapi tests fail when losing focus&rdquo;<br />
** {{issue|109728}} &ldquo;~ScAutoFormatObj uses cleared ScGlobal&rdquo;<br />
** {{issue|109917}} &ldquo;fragile unoapi test using OnUnfocus event&rdquo;<br />
** {{issue|109939}} &ldquo;toolkit: inconsistent UnoControl locking schemes&rdquo;<br />
** {{issue|110862}} &ldquo;sc/qa/unoapi fails for sc.ScDataPilotTableObj::com::sun::star::sheet::XDataPilotTable::refresh()&rdquo;<br />
** {{issue|110988}} &ldquo;svtools/qa/unoapi fails for svtools.AccessibleBrowseBox etc.&rdquo;<br />
** {{issue|111006}} &ldquo;toolkit: deadlock between UnoControls&rdquo;<br />
** {{issue|111032}} &ldquo;sc/qa/unoapi sc.ScAccessibleCell::com::sun::star::accessibility::XAccessibleText getCharacterBounds() failure&rdquo;<br />
** {{issue|111042}} &ldquo;sd/qa/unoapi sd::DrawController::dispose crash&rdquo;<br />
** {{issue|111043}} &ldquo;sd/qa/unoapi sd::DrawController_OutlineView NullPointerException&rdquo;<br />
** {{issue|111102}} &ldquo;chart2: ChartModelHelper::findDiagram returns null&rdquo;<br />
** {{issue|111111}} &ldquo;xmloff.Impress.XMLImporter::com::sun::star::document::XImporter&rdquo;<br />
** {{issue|111113}} &ldquo;toolkit.AccessibleStatusBarItem unoapi failure&rdquo;<br />
** {{issue|111148}} &ldquo;forms/qa/unoapi forms.OImageControlModel::com::sun::star::beans::XMultiPropertySet deadlock&rdquo;<br />
** {{issue|111169}} &ldquo;svx.AccessiblePageShape unoapi failure&rdquo;<br />
** {{issue|111170}} &ldquo;sun/i18n/qa/unoapi "creating a drawdoc" failure&rdquo;<br />
** {{issue|111178}} &ldquo;sw/qa/unoapi SwView::SelectShell crash&rdquo;<br />
** {{issue|111180}} &ldquo;framework/qa/unoapi fwk.Desktop::com::sun::star::frame::XComponentLoader::loadComponentFromURL() failure&rdquo;<br />
** {{issue|111182}} &ldquo;Desktop::terminate -> ~DropTarget -> _objc_error crash&rdquo;<br />
** {{issue|111184}} &ldquo;sal/qa/osl/pipe uses fixed pipe names&rdquo;<br />
** {{issue|111186}} &ldquo;sw/qa/unoapi sw.PageStyle::com::sun::star::beans::XPropertySet::setPropertyValue() failure&rdquo;<br />
** {{issue|111190}} &ldquo;sw/qa/unoapi sw.SwXShape failure&rdquo;<br />
** {{issue|111194}} &ldquo;sw/qa/unoapi sw.XMLExporter crash&rdquo;<br />
** {{issue|111195}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleScrollBar::com::sun::star::accessibility::XAccessibleValue::setCurrentValue() failure&rdquo;<br />
** {{issue|111197}} &ldquo;sw/qa/unoapi sw.SwAccessibleDocumentPageView failure&rdquo;<br />
** {{issue|111199}} &ldquo;sd/qa/unoapi sd.AccessibleOutlineView failure&rdquo;<br />
** {{issue|111200}} &ldquo;xmloff/qa/unoapi xmloff.Draw.XMLMetaImporter failure&rdquo;<br />
** {{issue|111216}} &ldquo;svx/qa/unoapi accessibility deadlock&rdquo;<br />
** {{issue|111218}} &ldquo;sw/qa/unoapi sw.SwAccessibleParagraphView::com::sun::star::accessibility::XAccessibleEventBroadcaster::removeEventListener() failure&rdquo;<br />
** {{issue|111220}} &ldquo;sw/qa/unoapi sw.XMLContentExporter::com::sun::star::document::XFilter::cancel() failure&rdquo;<br />
** {{issue|111224}} &ldquo;xmloff/qa/unoapi xmloff.Impress.XMLContentExporter crash&rdquo;<br />
** {{issue|111225}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleStatusBar failure&rdquo;<br />
** {{issue|111252}} &ldquo;svx/qa/unoapi svx.AccessibleOLEShape deadlock&rdquo;<br />
** {{issue|111273}} &ldquo;sw/qa/unoapi sw.SwXTextEmbeddedObject::com::sun::star::document::XEmbeddedObjectSupplier::getEmbeddedObject() crash&rdquo;<br />
** {{issue|111278}} &ldquo;svx/qa/unoapi svx.AccessibleEditableTextPara failure&rdquo;<br />
** {{issue|111283}} &ldquo;sfx2/qa/unoapi sfx.StandaloneDocumentInfo failure&rdquo;<br />
** {{issue|111285}} &ldquo;forms/qa/unoapi forms.OButtonModel failure&rdquo;<br />
** {{issue|111287}} &ldquo;xmloff/qa/unoapi XMLSettingsIm-/Exporter crash&rdquo;<br />
** {{issue|111329}} &ldquo;sd/qa/unoapi SdXCustomPresentationAccess::getElementNames/ImpEditEngine::OnlineSpellHdl hang&rdquo;<br />
** {{issue|111332}} &ldquo;sw/qa/unoapi sw.XMLStylesExporter::com::sun::star::document::XFilter crash&rdquo;<br />
** {{issue|111333}} &ldquo;forms/qa/unoapi forms.OImageControlControl::com::sun::star::awt::XControl deadlock&rdquo;<br />
** {{issue|112743}} &ldquo;starmath/qa/unoapi sm.XMLSettingsExporter failure&rdquo;<br />
** {{issue|112746}} &ldquo;framework/qa/unoapi fwk.ModuleManager failure (X11 BadWindow)&rdquo;<br />
** {{issue|112751}} &ldquo;testgraphical/qa/graphical failure&rdquo;<br />
** {{issue|112778}} &ldquo;xmloff/qa/unoapi xmloff.Draw.XMLContentExporter failure&rdquo;<br />
** {{issue|113020}} &ldquo;sw/qa/unoapi sw.SwXTextGraphicObject::com::sun::star::beans::XPropertySet failure&rdquo;<br />
** {{issue|113103}} &ldquo;chart2: deadlock between DiagramHelper and Diagram&rdquo;<br />
** {{issue|113136}} &ldquo;sw/qa/unoapi sw.SwAccessibleParagraphView::com::sun::star::accessibility::XAccessibleEditableText failure&rdquo;<br />
** {{issue|113142}} &ldquo;sw/qa/unoapi SwAccessibleContext::RemoveFrmFromAccessibleMap crash&rdquo;<br />
** {{issue|113161}} &ldquo;sd/qa/unoapi sd.SdLayer::com::sun::star::drawing::Layer::IsVisible failure&rdquo;<br />
** {{issue|113201}} &ldquo;forms/qa/unoapi forms.OEditModel::com::sun::star::form::validation::XValidatableFormComponent failure&rdquo;<br />
** {{issue|113245}} &ldquo;framework/qa/unoapi fwl.TypeDetection failure&rdquo;<br />
** {{issue|113306}} &ldquo;sfx2/qa/unoapi sfx.DocumentTemplates failure&rdquo;<br />
** {{issue|113386}} &ldquo;sd/qa/unoapi sd.AccessibleDrawDocumentView::com::sun::star::accessibility::XAccessibleComponent::containsPoint() failure&rdquo;<br />
** {{issue|113489}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleMenu{,Bar,Separator} failures&rdquo;<br />
** {{issue|114205}} &ldquo;sw/qa/unoapi sw.SwAccessibleParagraphView::com::sun::star::accessibility::XAccessibleText::copyText() failed&rdquo;<br />
** {{issue|114209}} &ldquo;forms/qa/unoapi forms.OGridControlModel::com::sun::star::view::XSelectionSupplier crash&rdquo;<br />
** {{issue|114211}} &ldquo;xmloff/qa/unoapi xmloff.Draw.XMLStylesImporter::com::sun::star::lang::XInitialization crash&rdquo;<br />
** {{issue|114213}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleMenu::com::sun::star::accessibility::XAccessibleSelection failure&rdquo;<br />
** {{issue|114636}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleScrollBar::com::sun::star::accessibility::XAccessibleAction failure&rdquo;<br />
** {{issue|114637}} &ldquo;sw/qa/unoapi sw.SwAccessibleFootnoteView(?) crash&rdquo;<br />
** {{issue|114642}} &ldquo;svx/qa/unoapi svx: svx.SvxUnoTextContent::com::sun::star::style::CharacterProperties crash&rdquo;<br />
** {{issue|114889}} &ldquo;sw/qa/unoapi sw.SwXTextViewCursor::com::sun::star::view::XScreenCursor&rdquo;<br />
** {{issue|116784}} &ldquo;[sfx2] CheckGlobalEventBroadcaster_writer1 fails&rdquo;<br />
** {{issue|116813}} &ldquo;[sfx2] complex.sfx2.UndoManager checkBrokenScripts fails&rdquo;<br />
** {{issue|116814}} &ldquo;[toolkit] unoapi test UnoControlDialogModel: XCloneable fails&rdquo;<br />
* Missing tests:<br />
** {{issue|109564}} &ldquo;qadevOOo/tests/java/ifc/awt/_XSystemChildFactory.java&rdquo;<br />
* Sporadic failures:<br />
** {{issue|111217}} &ldquo;BasicManager::SetGlobalUNOConstant crash during shutdown&rdquo;<br />
** {{issue|111246}} &ldquo;svx::FontHeightToolBoxControl::statusChanged crash (memory corruption)&rdquo;<br />
** {{issue|111271}} &ldquo;Mac OS X: crash during shutdown, __tcf_2 on stack&rdquo;<br />
** {{issue|111400}} &ldquo;Extension Manager does not join spawned uno process (-> smoketestoo_native fails)&rdquo;<br />
** {{issue|112070}} &ldquo;UNO API tests must not use random&rdquo;<br />
** {{issue|113158}} &ldquo;crash with two threads in framework::ToolBarManager dtor&rdquo;<br />
** {{issue|113197}} &ldquo;sw/qa/unoapi sw.SwXTextRange hangs&rdquo;<br />
** {{issue|113367}} &ldquo;sysdtrans deadlock during shutdown&rdquo;<br />
** {{issue|113464}} &ldquo;stoc_smgr::ORegistryServiceManager::dispose crash during shutdown&rdquo;<br />
** {{issue|114207}} &ldquo;framework::ModuleUIConfigurationManager::dispose crash during shutdown&rdquo;<br />
** {{issue|114675}} &ldquo;binary URP bridge race on shut down, crash&rdquo;<br />
** {{issue|114718}} &ldquo;forms/qa/unoapi: crash in remote async release call&rdquo;<br />
** {{issue|116131}} &ldquo;vcl: message unregisterDraggingDestinationHandler: sent to freed object&rdquo;<br />
<br />
[[Category:Effort]][[Category:Test]]</div>Sbhttps://wiki.openoffice.org/wiki/Test_CleanupTest Cleanup2011-04-08T15:10:17Z<p>Sb: /* unoapi Tests */</p>
<hr />
<div>= Test Cleanup Project =<br />
<br />
The demand for automated (unit) testing should be obvious. See the [http://www.openoffice.org/servlets/ReadMsg?list=dev&msgNo=26189 mission statement mail] and [[Media:JustTestingPresentation.odp|slides]] from a [http://fosdem.org/2010/schedule/events/ooo_testing FOSDEM'10 talk] and an [http://www.ooocon.org/index.php/ooocon/2010/paper/view/188 OOoCon&nbsp;2010 presentation] for more information and further links.<br />
<br />
For examples of how to write xUnit based tests in the OOo code base, see [http://hg.services.openoffice.org/DEV300/file/87f4911ea629/basegfx/test <code>basegfx/test/</code>], [http://hg.services.openoffice.org/DEV300/file/87f4911ea629/sal/qa/ByteSequence <code>sal/qa/ByteSequence/</code>], and [http://hg.services.openoffice.org/DEV300/file/87f4911ea629/smoketestoo_native <code>smoketest_native/</code>]. However, the hard part should not be how to write test code, anyway, but how to write ''testable'' code; see [http://misko.hevery.com/2008/11/04/clean-code-talks-unit-testing/ The Clean Code Talks&mdash;Unit Testing].<br />
<br />
When testing C++ code that merely uses UNO types (no services), but uses them in a way that requires UNO to be bootstrapped so that the relevant type information is available (e.g., putting instances of complex UNO types into <code>com::sun::star::uno::Any</code>), one approach is as follows: In the <code>makefile.mk</code>, instead of <code>.INCLUDE: _cppunit.mk</code> use<br />
<source lang="make"><br />
.IF "$(OS)" == "WNT"<br />
my_file = file:///<br />
.ELSE<br />
my_file = file://<br />
.END<br />
<br />
ALLTAR : test<br />
<br />
test .PHONY : $(SHL1TARGETN)<br />
$(CPPUNITTESTER) $(SHL1TARGETN) \<br />
-env:UNO_TYPES=$(my_file)$(SOLARBINDIR)/types.rdb<br />
</source><br />
and in the test code once call <code>cppu::defaultBootstrap_InitialComponentContext()</code>.<br />
<br />
== User Interface ==<br />
<br />
=== CppUnit ===<br />
<br />
For tests in C++, plain CppUnit (at least version 1.12.1) is available. (OOo bundles CppUnit 1.12.1 as an external module; alternatively, you can configure <code>--with-system-cppunit</code>.)<br />
<br />
Implement the test code as a dynamic library, following CppUnit conventions (i.e., using [http://cppunit.sourceforge.net/doc/lastest/group___creating_test_suite.html#ga0 <code>CPPUNIT_TEST_SUITE_REGISTRATION</code>] and [http://cppunit.sourceforge.net/doc/lastest/_test_plug_in_8h.html#a2 <code>CPPUNIT_PLUGIN_IMPLEMENT</code>] macros). The following settings are needed in the <code>makefile.mk</code>:<br />
* <code>ENABLE_EXCEPTIONS = TRUE</code><br />
* <code>CFLAGSCXX += $(CPPUNIT_CFLAGS)</code><br />
* <code>SHL<var>n</var>RPATH = NONE</code><br />
* <code>SHL<var>n</var>STDLIBS += $(CPPUNITLIB)</code><br />
* <code>SHL<var>n</var>VERSIONMAP = <var>version.map</var></code>, where that file must contain the following (see [[#CppUnit_1.12.1|details]] below for improving this):<br />
UDK_3_0_0 {<br />
global:<br />
cppunitTestPlugIn;<br />
local:<br />
*;<br />
};<br />
<br />
To run tests, <code>sal/cppunittester</code> delivers a <code>cppunittester</code> executable that has some advantages over the plain CppUnit <code>DllPlugInTester</code>:<br />
* It uses <code>SAL_IMPLEMENT_MAIN</code> to properly set up the per-process settings required by URE. Test code as well as tested code based on URE will expect this and would fail in a process that is not set up in this way.<br />
* Getting CppUnit to build as an external module within the Windows OOo build is a non-trivial task. The less parts of it that need to be built, the better.<br />
<br />
Something like the following in <code>makefile.mk</code> will execute the tests:<br />
ALLTAR : test<br />
test .PHONY : $(SHL1TARGETN)<br />
$(CPPUNITTESTER) $(SHL1TARGETN)<br />
<br />
<code>$(CPPUNITTESTER)</code> internally uses <code>$(AUGMENT_LIBRARY_PATH_LOCAL)</code> to favor library instances in the local output tree over ones in solver. Alternatively to the above, <code>.INCLUDE: _cppunit.mk</code> calls <code>$(CPPUNITTESTER)</code> on each of <code>$(SHL1TARGETN)</code>, &hellip;, <code>$(SHL10TARGETN)</code> that is defined.<br />
<br />
=== JUnit ===<br />
<br />
For tests in Java, plain JUnit (at least version 4) is available. (OOo requires JUnit as a prerequisite, see [http://junit.org/ junit.org] for downloads; you can configure <code>--with-junit=<var>&hellip;</var></code> if it is not automatically found; alternatively, you can configure <code>--without-junit</code>, disabling JUnit-based tests.)<br />
<br />
=== <code>subsequenttests</code> ===<br />
<br />
Some tests have build and/or run time dependencies on modules further up in the hierarchy, or modules that the rest of the module in question does not have dependencies on (and which are thus not listed in the module's <code>build.lst</code>). The extreme case are tests that need a complete OOo installation as their test environment.<br />
<br />
For such tests, the whole <code>makefile.mk</code> should be wrapped in:<br />
.IF "$(OOO_SUBSEQUENT_TESTS)" == ""<br />
nothing .PHONY :<br />
.ELSE<br />
...<br />
.END<br />
(and the directory included in the module's <code>build.lst</code>).<br />
<br />
The idea is to do a complete OOo build first (<code>cd smoketestoo_native && build --all</code>) and then build and execute those tests either selectively or wholesale.<br />
<br />
Selectively building a specific such test directory can be done with <code>cd <var>&hellip;</var> && OOO_SUBSEQUENT_TESTS=TRUE dmake</code>.<br />
<br />
To build and execute ''all'' these test directories, the tool <code>subsequenttests</code> (in <code>solenv/bin</code>) exists. It scans the <code>build.lst</code> files of all modules for <code>makefile.mk</code>s that mention <code>OOO_SUBSEQUENT_TESTS</code> and simply executes <code>dmake</code> in all those directories, with <code>OOO_SUBSEQUENT_TESTS</code> set. It supports a <code>-P<var>n</var></code> switch to build <var>n</var> directories in parallel.<br />
<br />
=== Helpers ===<br />
<br />
A new module <code>test</code> shall collect reusable code snippets for C++ and Java tests.<br />
<br />
For now, it concentrates on letting a test connect to an OOo instance via remote UNO: A C++ test class can hold a <code>test::OfficeConnection</code> as class member and, in its CppUnit <code>setUp</code> and <code>tearDown</code> functions, call <code>OfficeConnection::setUp</code> and <code>OfficeConnection::tearDown</code>, respectively. Tests obtain access to the OOo instance via <code>OfficeConnection::getFactory</code>. Similarly, a Java test class can use an <code>org.openoffice.test.OfficeConnection</code> instance, offering the same functionality as its C++ counterpart.<br />
<br />
For this to work, three additional steps are necessary:<br />
* First, in <code>instsetoo_native</code>, building an installation set for the <code>openoffice</code> product in the default language (<code>en-US</code>) in any package format now takes care to always also build an archive package format (<code>tar.gz</code> resp. <code>zip</code>) of that product.<br />
* Second, building <code>smoketestoo_native</code> permanently installs that archive into the solver. (Except on Windows, where problems with resulting long pathnames prevent this; there, as a workaround, each test individually unzips the archive to some local temporary directory.) <br />
* Third, a test that requires an OOo instance includes <code>installationtest.mk</code> in its <code>makefile.mk</code>. That file makes sure to call the CppUnit and JUnit test runners with the information necessary for the helper classes to start the correct OOo instance with a fresh <code>UserInstallation</code> and set up an URP pipe connection. The information is tunneled into the test runner executables as UNO bootstrap parameters.<br />
<br />
For debugging purposes, which OOo instance the tests use can manually be overridden, see [http://www.openoffice.org/servlets/ReadMsg?list=interface-announce&msgNo=1285 &ldquo;OOO_TEST_SOFFICE: allow override of tested soffice process&rdquo;].<br />
<br />
=== <code>unoapi</code> Tests ===<br />
<br />
The <code>unoapi</code> tests are redesigned to use the new test framework. They are plain JUnit tests and use the mechanisms described above to connect to running OOo instances. However, due to the large amount of logic encoded in <code>qadevOOo</code>, those JUnit tests for now are only thin wrappers around <code>org.openoffice.Runner.run</code>. This is intended to change over time.<br />
<br />
The <code>cwscheckapi</code> tool to run the <code>unoapi</code> tests has been subsumed by <code>subsequenttests</code>. The latter always runs all tests, while the former had mechanisms to run only tests for modules that had been changed by a CWS. The hope is that the parallel mode of <code>subsequenttests</code> makes it fast enough so that running all tests all of the times becomes feasible.<br />
<br />
Unfortunately, running the <code>unoapi</code> tests is still not stable enough to give useful results. Therefore, running <code>subsequenttests</code> has been disabled in the build bots for now. Making the tests sufficiently stable is ongoing work.<br />
<br />
== Details ==<br />
<br />
Working on {{CWS|sb118}}, {{CWS|sb120}}.<br />
<br />
=== CppUnit 1.12.1 ===<br />
<br />
* Replace existing <code>cppunit</code> and <code>testshl2</code> combo with latest CppUnit 1.12.1.<br />
* OOo <code>configure --with-system-cppunit</code> (for now only if also <code>--with-system-stl</code>!); minimal required version for now arbitrarily 1.12.1.<br />
* '''TODO:''' Upstream <code>PATCH_FILES</code> (<code>windows.patch</code>?!?).<br />
* '''TODO:''' <code>RPATH</code> in generated libraries and executables.<br />
* '''TODO:''' Improve <code>CPPUNIT_PLUGIN_EXPORT</code> and get rid of version maps (GCC exception problems?).<br />
* '''TODO:''' <code>cppunit/makefile.mk</code> <code>MY_LIBS = -lm</code> Solaris hack.<br />
* '''TODO:''' In general OOo build environment, no longer set <code>CFLAGS</code> etc. as environment variables; have package-specific <code>OOO_<var>package</var>_CFLAGS</code> etc. and combine those into <code>CFLAGS</code> etc. where necessary (see <code>OOO_STLPORT_CXXFLAGS</code> etc. in <code>cppunit/makefile.mk</code>).<br />
* '''TODO:''' Why use <code>cppunittester</code> instead of <code>DllPlugInTester</code>? (Remove building/delivering <code>DllPlugInTester</code>.)<br />
* '''TODO:''' Make <code>operator &lt;&lt;(std::basic_ostream &amp;, rtl::OUString const &amp;)</code> from <code>test/oustringstreaminserter.hxx</code> generally available?<br />
* '''TODO:''' Make STLport <code>num_put</code> symbols available on platforms other than Linux (see <code>solenv/bin/addsym.awk</code>), too, so that <code>CPPUNIT_ASSERT_EQUAL</code> actually outputs numeric values.<br />
<br />
==== Is CppUnit an active project? ====<br />
<br />
When I wrote<br />
<pre><br />
Message-ID: <4D67B884.8080101@oracle.com><br />
Date: Fri, 25 Feb 2011 15:11:16 +0100<br />
From: Stephan Bergmann <stephan.bergmann@oracle.com><br />
MIME-Version: 1.0<br />
To: cppunit-devel@lists.sourceforge.net<br />
Subject: What part of the API is published?<br />
Content-Type: text/plain; charset=UTF-8; format=flowed<br />
Content-Transfer-Encoding: 7bit<br />
<br />
At least for CppUnit 1.12.1, it is unclear whether for example class <br />
DynamicLibraryManager is supposed to be available to client code.<br />
<br />
The HTML documentation's class list contains DynamicLibraryManager just <br />
like, say, TestCase, and I can't find any hint on the former's page that <br />
it is an implementation detail. However, in DynamicLibraryManager.h, <br />
the class is not decorated with CPPUNIT_API.<br />
<br />
Is there any specification of what is published (i.e., stable, usable by <br />
clients) vs. what is implementation detail (i.e., not to be used by <br />
clients)?<br />
<br />
-Stephan<br />
</pre><br />
the only response I ever got was<br />
<pre><br />
MIME-Version: 1.0<br />
Content-Type: text/plain; charset="us-ascii"<br />
Content-Transfer-Encoding: 7bit<br />
Subject: Your message to Cppunit-devel awaits moderator approval<br />
From: cppunit-devel-bounces@lists.sourceforge.net<br />
To: stephan.bergmann@oracle.com<br />
Message-ID: <mailman.49713.1298643119.7082.cppunit-devel@lists.sourceforge.net><br />
Date: Fri, 25 Feb 2011 14:11:59 +0000<br />
<br />
Your mail to 'Cppunit-devel' with the subject<br />
<br />
What part of the API is published?<br />
<br />
Is being held until the list moderator can review it for approval.<br />
<br />
The reason it is being held:<br />
<br />
Post by non-member to a members-only list<br />
<br />
Either the message will get posted to the list, or you will receive<br />
notification of the moderator's decision. If you would like to cancel<br />
this posting, please visit the following URL:<br />
<br />
https://lists.sourceforge.net/lists/confirm/cppunit-devel/1da27e17e1d5fdfcb7f8ac6860a05bb5ca1eab1d<br />
</pre><br />
and the last message in [http://sourceforge.net/mailarchive/forum.php?forum_name=cppunit-devel the archive] is from January 2010.<br />
<br />
=== <code>testshl2</code> ===<br />
<br />
* <code>solenv/inc_cppunit.mk</code>/<code>cppunit.mk</code>: [http://hg.services.openoffice.org/cws/sb118/rev/cf13421c3774 &ldquo;adapted <code>cppunit.mk</code> to <code>cppunittester</code> and no longer require &lsquo;<code>dmake test</code>&rsquo; to run tests&rdquo;].<br />
* '''TODO:''' <code>DEV300_m68</code> introduced <code>TESTSHL2LIB</code> (which I removed again) and uses it in many <code>qa</code> makefiles (that I need to touch someday, anyway).<br />
<br />
=== Unit Tests ===<br />
<br />
* <code>OOO_SUBSEQUENT_TESTS</code> (<code>build.lst</code> lists local dependencies of those directories, so that modifying a module and then calling &ldquo;<code>OOO_SUBSEQUENT_TESTS=x build</code>&rdquo; rebuilds the module and executes the tests).<br />
* '''TODO:''' If Build Environment&nbsp;2.0 would build directly to solver (instead of local output tree/deliver), that would simplify tests that currently need to take care to test local libraries instead of solver ones (see, for example, <code>OOO_TEST_PREFIX</code> in the <code>services.rdb</code> of <code>stoc/test/uriproc/makefile.mk</code>).<br />
{{Documentation/Note|Build Environment&nbsp;2.0 will not build directly to solver, but will make a module depend on the targets in the solver, and these are depending on the targets in the workdir (aka the old "local output tree"). Thus on an usual build in a module building and delivering are not two steps anymore. If tests depend on the target in the solver (which they will do automatically in most use cases, as linking against a library automatically creates a dependency on the library in the solver), they can be sure that the target is up to date in the solver '''and''' in the workdir.<br />
<br />
--[[User:B michaelsen|B michaelsen]] 06:32, 27 August 2010 (UTC)}}<br />
* '''TODO:''' Constructs like &ldquo;<code>-env:UNO_<var>&hellip;</var>=$(my_file)<var>&hellip;</var></code>&rdquo; would fail for problematic characters (spaces!) in paths.<br />
<br />
=== Smoke Test ===<br />
<br />
* Redesign <code>smoketestoo_native</code> to use CppUnit and pre-installed OOo.<br />
* [http://hg.services.openoffice.org/cws/sb118/rev/160b248247a0 &ldquo;changed <code>tools/debug</code> to never fall back from writing to shell to writing to file, and read <code>DBGSV_INIT</code> from <code>rtl::Bootstrap</code>; the latter causes problems if <code>tools/debug</code> is called from static code executing before <code>SAL_MAIN</code> has called <code>osl_setCommandArgs</code> &rarr; removed statics from code and added assertions to <code>osl/process</code>; various improvements to <code>smoketests.cxx</code> (incl. passing an appropriate <code>dbgsv.ini</code> for non-pro builds)&rdquo;] followed by [http://hg.services.openoffice.org/cws/sb118/rev/dbbacb9d2fd3 &ldquo;reverted parts of HG <code>-c&nbsp;160b248247a0</code> again: the &lsquo;static code executing before <code>SAL_MAIN</code>&rsquo; problem was too severe; instead, globally set <code>DBGSV_INIT</code> build env var to new <code>solenv/bin/dbgsv.ini</code>&rdquo;]; see also {{issue|109142}} &ldquo;Let assertions abort&rdquo;.<br />
* '''TODO:''' For <code>smoketestoo_native/makefile.mk</code> &ldquo;<code><nowiki>-env:arg-env=$(OOO_LIBRARY_PATH_VAR)"$${{$(OOO_LIBRARY_PATH_VAR)+=$$$(OOO_LIBRARY_PATH_VAR)}}"</nowiki></code>&rdquo; mechanism: <code>osl_executeProcess</code> <code>ustrEnvironments</code> members without &ldquo;<code>=</code>&rdquo;: all platforms; documentation; documentation of <code>osl_executeProcess_WithRedicrectedIO</code>.<br />
* '''TODO:''' <code>-headless</code>? (appears to still display windows on Windows and Mac OS&nbsp;X, however, see {{issue|109052}})<br />
* '''TODO:''' {{issue|113341}} &ldquo;-nofirststartwizard should disable update check&rdquo;<br />
<br />
=== Pre-Installed OOo ===<br />
<br />
* For Sun Hamburg Release Engineering, take MWS archive installation sets from &ldquo;S:&rdquo; instead of solver: [http://hg.services.openoffice.org/cws/sb118/rev/d5dbea724063 &ldquo;take installation set from <code>SHIPDRIVE</code> if appropriate&rdquo;].<br />
* '''TODO:''' <code>PKGFORMAT=installed</code> instead of <code>archive</code>?<br />
<br />
=== <code>unoapi</code> Tests ===<br />
<br />
* Known issues, open (not yet addressed at all; disabled for now on net-yet-integrated CWS; or fixed on not-yet-integrated CWS):<br />
** {{issue|114669}} &ldquo;forms/qa/unoapi forms.OListBoxControl crash&rdquo; (fixed on {{CWS|sb140}})<br />
** {{issue|116120}} &ldquo;vcl: TabControl::ImplGetTabRect negative height leads to X_CreatePixmap BadAlloc&rdquo; (fixed on {{CWS|vcl118}}, integrated into <code>DEV300_m101</code>)<br />
** {{issue|116125}} &ldquo;qadevOOo/qa/complex/junitskeleton failure&rdquo;<br />
** {{issue|116156}} &ldquo;toolkit/qa/unoapi crash in SwAccessibleMap::RemoveContext&rdquo;<br />
** {{issue|116192}} &ldquo;[sw] fixed text fields sometimes get updated&rdquo; (fixed on {{CWS|sw34bf03}}, integrated into <code>DEV300_m102</code>)<br />
** {{issue|116550}} &ldquo;toolkit/qa/unoapi crashes OOo in ~SwAccessibleParagraph vs. SwXTextDocument::close&rdquo;<br />
** {{issue|116583}} &ldquo;comphelper/qa/complex/comphelper failure&rdquo;<br />
** {{issue|116730}} &ldquo;vcl: crash with multiple threads in Window::ImplGrabFocus&rdquo;<br />
** {{issue|116733}} &ldquo;sw: crash in ~SwDrawContact (forms/qa/unoapi)&rdquo;<br />
** {{issue|117381}} &ldquo;ucb/qa/unoapi ucb.UniversalContentBroker::com::sun::star::ucb::XContentProviderManager::deregisterContentProvider() fails with gvfs&rdquo; (fixed on {{CWS|sb140}})<br />
** {{issue|117486}} &ldquo;toolkit/qa/complex/toolkit: "Window pos size wrong"&rdquo; (fixed on {{CWS|sb140}})<br />
** {{issue|117488}} &ldquo;sw/qa/unoapi: sw.SwXViewSettings::com::sun::star::text::ViewSettings::ShowOnlineLayout ShowOnlineLayout/ZoomValue failed&rdquo;<br />
** {{issue|117641}} &ldquo;chart2/qa/unoapi fails in sch.ChXDataPoint::com::sun::star::chart::ChartDataPointProperties due to change to jpeg/prj/d.lst&rdquo; (fixed as <code>DEV300_m106</code> masterfix)<br />
** {{issue|117693}} &ldquo;xmlsecurity/qa/certext fails on wntmsci12 non-pro ("no OPENSSL_Applink")&rdquo;<br />
** {{issue|117774}} &ldquo;static in editengine ImplGetSvxUnoOutlinerTextCursorSvxPropertySet causes deadlock in chart2/qa/unoapi&rdquo;<br />
* Known issues, disabled for now:<br />
** {{issue|109517}} &ldquo;sc/qa/unoapi fails for ScAnnotationObj etc.&rdquo;<br />
** {{issue|109518}} &ldquo;sd/qa/unoapi crash in SfxViewShell::GetController&rdquo;<br />
** {{issue|109643}} &ldquo;toolkit/qa/unoapi tests fail when losing focus&rdquo;<br />
** {{issue|109728}} &ldquo;~ScAutoFormatObj uses cleared ScGlobal&rdquo;<br />
** {{issue|109917}} &ldquo;fragile unoapi test using OnUnfocus event&rdquo;<br />
** {{issue|109939}} &ldquo;toolkit: inconsistent UnoControl locking schemes&rdquo;<br />
** {{issue|110862}} &ldquo;sc/qa/unoapi fails for sc.ScDataPilotTableObj::com::sun::star::sheet::XDataPilotTable::refresh()&rdquo;<br />
** {{issue|110988}} &ldquo;svtools/qa/unoapi fails for svtools.AccessibleBrowseBox etc.&rdquo;<br />
** {{issue|111006}} &ldquo;toolkit: deadlock between UnoControls&rdquo;<br />
** {{issue|111032}} &ldquo;sc/qa/unoapi sc.ScAccessibleCell::com::sun::star::accessibility::XAccessibleText getCharacterBounds() failure&rdquo;<br />
** {{issue|111042}} &ldquo;sd/qa/unoapi sd::DrawController::dispose crash&rdquo;<br />
** {{issue|111043}} &ldquo;sd/qa/unoapi sd::DrawController_OutlineView NullPointerException&rdquo;<br />
** {{issue|111102}} &ldquo;chart2: ChartModelHelper::findDiagram returns null&rdquo;<br />
** {{issue|111111}} &ldquo;xmloff.Impress.XMLImporter::com::sun::star::document::XImporter&rdquo;<br />
** {{issue|111113}} &ldquo;toolkit.AccessibleStatusBarItem unoapi failure&rdquo;<br />
** {{issue|111148}} &ldquo;forms/qa/unoapi forms.OImageControlModel::com::sun::star::beans::XMultiPropertySet deadlock&rdquo;<br />
** {{issue|111169}} &ldquo;svx.AccessiblePageShape unoapi failure&rdquo;<br />
** {{issue|111170}} &ldquo;sun/i18n/qa/unoapi "creating a drawdoc" failure&rdquo;<br />
** {{issue|111178}} &ldquo;sw/qa/unoapi SwView::SelectShell crash&rdquo;<br />
** {{issue|111180}} &ldquo;framework/qa/unoapi fwk.Desktop::com::sun::star::frame::XComponentLoader::loadComponentFromURL() failure&rdquo;<br />
** {{issue|111182}} &ldquo;Desktop::terminate -> ~DropTarget -> _objc_error crash&rdquo;<br />
** {{issue|111184}} &ldquo;sal/qa/osl/pipe uses fixed pipe names&rdquo;<br />
** {{issue|111186}} &ldquo;sw/qa/unoapi sw.PageStyle::com::sun::star::beans::XPropertySet::setPropertyValue() failure&rdquo;<br />
** {{issue|111190}} &ldquo;sw/qa/unoapi sw.SwXShape failure&rdquo;<br />
** {{issue|111194}} &ldquo;sw/qa/unoapi sw.XMLExporter crash&rdquo;<br />
** {{issue|111195}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleScrollBar::com::sun::star::accessibility::XAccessibleValue::setCurrentValue() failure&rdquo;<br />
** {{issue|111197}} &ldquo;sw/qa/unoapi sw.SwAccessibleDocumentPageView failure&rdquo;<br />
** {{issue|111199}} &ldquo;sd/qa/unoapi sd.AccessibleOutlineView failure&rdquo;<br />
** {{issue|111200}} &ldquo;xmloff/qa/unoapi xmloff.Draw.XMLMetaImporter failure&rdquo;<br />
** {{issue|111216}} &ldquo;svx/qa/unoapi accessibility deadlock&rdquo;<br />
** {{issue|111218}} &ldquo;sw/qa/unoapi sw.SwAccessibleParagraphView::com::sun::star::accessibility::XAccessibleEventBroadcaster::removeEventListener() failure&rdquo;<br />
** {{issue|111220}} &ldquo;sw/qa/unoapi sw.XMLContentExporter::com::sun::star::document::XFilter::cancel() failure&rdquo;<br />
** {{issue|111224}} &ldquo;xmloff/qa/unoapi xmloff.Impress.XMLContentExporter crash&rdquo;<br />
** {{issue|111225}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleStatusBar failure&rdquo;<br />
** {{issue|111252}} &ldquo;svx/qa/unoapi svx.AccessibleOLEShape deadlock&rdquo;<br />
** {{issue|111273}} &ldquo;sw/qa/unoapi sw.SwXTextEmbeddedObject::com::sun::star::document::XEmbeddedObjectSupplier::getEmbeddedObject() crash&rdquo;<br />
** {{issue|111278}} &ldquo;svx/qa/unoapi svx.AccessibleEditableTextPara failure&rdquo;<br />
** {{issue|111283}} &ldquo;sfx2/qa/unoapi sfx.StandaloneDocumentInfo failure&rdquo;<br />
** {{issue|111285}} &ldquo;forms/qa/unoapi forms.OButtonModel failure&rdquo;<br />
** {{issue|111287}} &ldquo;xmloff/qa/unoapi XMLSettingsIm-/Exporter crash&rdquo;<br />
** {{issue|111329}} &ldquo;sd/qa/unoapi SdXCustomPresentationAccess::getElementNames/ImpEditEngine::OnlineSpellHdl hang&rdquo;<br />
** {{issue|111332}} &ldquo;sw/qa/unoapi sw.XMLStylesExporter::com::sun::star::document::XFilter crash&rdquo;<br />
** {{issue|111333}} &ldquo;forms/qa/unoapi forms.OImageControlControl::com::sun::star::awt::XControl deadlock&rdquo;<br />
** {{issue|112743}} &ldquo;starmath/qa/unoapi sm.XMLSettingsExporter failure&rdquo;<br />
** {{issue|112746}} &ldquo;framework/qa/unoapi fwk.ModuleManager failure (X11 BadWindow)&rdquo;<br />
** {{issue|112751}} &ldquo;testgraphical/qa/graphical failure&rdquo;<br />
** {{issue|112778}} &ldquo;xmloff/qa/unoapi xmloff.Draw.XMLContentExporter failure&rdquo;<br />
** {{issue|113020}} &ldquo;sw/qa/unoapi sw.SwXTextGraphicObject::com::sun::star::beans::XPropertySet failure&rdquo;<br />
** {{issue|113103}} &ldquo;chart2: deadlock between DiagramHelper and Diagram&rdquo;<br />
** {{issue|113136}} &ldquo;sw/qa/unoapi sw.SwAccessibleParagraphView::com::sun::star::accessibility::XAccessibleEditableText failure&rdquo;<br />
** {{issue|113142}} &ldquo;sw/qa/unoapi SwAccessibleContext::RemoveFrmFromAccessibleMap crash&rdquo;<br />
** {{issue|113161}} &ldquo;sd/qa/unoapi sd.SdLayer::com::sun::star::drawing::Layer::IsVisible failure&rdquo;<br />
** {{issue|113201}} &ldquo;forms/qa/unoapi forms.OEditModel::com::sun::star::form::validation::XValidatableFormComponent failure&rdquo;<br />
** {{issue|113245}} &ldquo;framework/qa/unoapi fwl.TypeDetection failure&rdquo;<br />
** {{issue|113306}} &ldquo;sfx2/qa/unoapi sfx.DocumentTemplates failure&rdquo;<br />
** {{issue|113386}} &ldquo;sd/qa/unoapi sd.AccessibleDrawDocumentView::com::sun::star::accessibility::XAccessibleComponent::containsPoint() failure&rdquo;<br />
** {{issue|113489}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleMenu{,Bar,Separator} failures&rdquo;<br />
** {{issue|114205}} &ldquo;sw/qa/unoapi sw.SwAccessibleParagraphView::com::sun::star::accessibility::XAccessibleText::copyText() failed&rdquo;<br />
** {{issue|114209}} &ldquo;forms/qa/unoapi forms.OGridControlModel::com::sun::star::view::XSelectionSupplier crash&rdquo;<br />
** {{issue|114211}} &ldquo;xmloff/qa/unoapi xmloff.Draw.XMLStylesImporter::com::sun::star::lang::XInitialization crash&rdquo;<br />
** {{issue|114213}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleMenu::com::sun::star::accessibility::XAccessibleSelection failure&rdquo;<br />
** {{issue|114636}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleScrollBar::com::sun::star::accessibility::XAccessibleAction failure&rdquo;<br />
** {{issue|114637}} &ldquo;sw/qa/unoapi sw.SwAccessibleFootnoteView(?) crash&rdquo;<br />
** {{issue|114642}} &ldquo;svx/qa/unoapi svx: svx.SvxUnoTextContent::com::sun::star::style::CharacterProperties crash&rdquo;<br />
** {{issue|114889}} &ldquo;sw/qa/unoapi sw.SwXTextViewCursor::com::sun::star::view::XScreenCursor&rdquo;<br />
** {{issue|116784}} &ldquo;[sfx2] CheckGlobalEventBroadcaster_writer1 fails&rdquo;<br />
** {{issue|116813}} &ldquo;[sfx2] complex.sfx2.UndoManager checkBrokenScripts fails&rdquo;<br />
** {{issue|116814}} &ldquo;[toolkit] unoapi test UnoControlDialogModel: XCloneable fails&rdquo;<br />
* Missing tests:<br />
** {{issue|109564}} &ldquo;qadevOOo/tests/java/ifc/awt/_XSystemChildFactory.java&rdquo;<br />
* Sporadic failures:<br />
** {{issue|111217}} &ldquo;BasicManager::SetGlobalUNOConstant crash during shutdown&rdquo;<br />
** {{issue|111246}} &ldquo;svx::FontHeightToolBoxControl::statusChanged crash (memory corruption)&rdquo;<br />
** {{issue|111271}} &ldquo;Mac OS X: crash during shutdown, __tcf_2 on stack&rdquo;<br />
** {{issue|111400}} &ldquo;Extension Manager does not join spawned uno process (-> smoketestoo_native fails)&rdquo;<br />
** {{issue|112070}} &ldquo;UNO API tests must not use random&rdquo;<br />
** {{issue|113158}} &ldquo;crash with two threads in framework::ToolBarManager dtor&rdquo;<br />
** {{issue|113197}} &ldquo;sw/qa/unoapi sw.SwXTextRange hangs&rdquo;<br />
** {{issue|113367}} &ldquo;sysdtrans deadlock during shutdown&rdquo;<br />
** {{issue|113464}} &ldquo;stoc_smgr::ORegistryServiceManager::dispose crash during shutdown&rdquo;<br />
** {{issue|114207}} &ldquo;framework::ModuleUIConfigurationManager::dispose crash during shutdown&rdquo;<br />
** {{issue|114675}} &ldquo;binary URP bridge race on shut down, crash&rdquo;<br />
** {{issue|114718}} &ldquo;forms/qa/unoapi: crash in remote async release call&rdquo;<br />
** {{issue|116131}} &ldquo;vcl: message unregisterDraggingDestinationHandler: sent to freed object&rdquo;<br />
<br />
[[Category:Effort]][[Category:Test]]</div>Sbhttps://wiki.openoffice.org/wiki/Test_CleanupTest Cleanup2011-04-07T07:31:18Z<p>Sb: /* unoapi Tests */</p>
<hr />
<div>= Test Cleanup Project =<br />
<br />
The demand for automated (unit) testing should be obvious. See the [http://www.openoffice.org/servlets/ReadMsg?list=dev&msgNo=26189 mission statement mail] and [[Media:JustTestingPresentation.odp|slides]] from a [http://fosdem.org/2010/schedule/events/ooo_testing FOSDEM'10 talk] and an [http://www.ooocon.org/index.php/ooocon/2010/paper/view/188 OOoCon&nbsp;2010 presentation] for more information and further links.<br />
<br />
For examples of how to write xUnit based tests in the OOo code base, see [http://hg.services.openoffice.org/DEV300/file/87f4911ea629/basegfx/test <code>basegfx/test/</code>], [http://hg.services.openoffice.org/DEV300/file/87f4911ea629/sal/qa/ByteSequence <code>sal/qa/ByteSequence/</code>], and [http://hg.services.openoffice.org/DEV300/file/87f4911ea629/smoketestoo_native <code>smoketest_native/</code>]. However, the hard part should not be how to write test code, anyway, but how to write ''testable'' code; see [http://misko.hevery.com/2008/11/04/clean-code-talks-unit-testing/ The Clean Code Talks&mdash;Unit Testing].<br />
<br />
When testing C++ code that merely uses UNO types (no services), but uses them in a way that requires UNO to be bootstrapped so that the relevant type information is available (e.g., putting instances of complex UNO types into <code>com::sun::star::uno::Any</code>), one approach is as follows: In the <code>makefile.mk</code>, instead of <code>.INCLUDE: _cppunit.mk</code> use<br />
<source lang="make"><br />
.IF "$(OS)" == "WNT"<br />
my_file = file:///<br />
.ELSE<br />
my_file = file://<br />
.END<br />
<br />
ALLTAR : test<br />
<br />
test .PHONY : $(SHL1TARGETN)<br />
$(CPPUNITTESTER) $(SHL1TARGETN) \<br />
-env:UNO_TYPES=$(my_file)$(SOLARBINDIR)/types.rdb<br />
</source><br />
and in the test code once call <code>cppu::defaultBootstrap_InitialComponentContext()</code>.<br />
<br />
== User Interface ==<br />
<br />
=== CppUnit ===<br />
<br />
For tests in C++, plain CppUnit (at least version 1.12.1) is available. (OOo bundles CppUnit 1.12.1 as an external module; alternatively, you can configure <code>--with-system-cppunit</code>.)<br />
<br />
Implement the test code as a dynamic library, following CppUnit conventions (i.e., using [http://cppunit.sourceforge.net/doc/lastest/group___creating_test_suite.html#ga0 <code>CPPUNIT_TEST_SUITE_REGISTRATION</code>] and [http://cppunit.sourceforge.net/doc/lastest/_test_plug_in_8h.html#a2 <code>CPPUNIT_PLUGIN_IMPLEMENT</code>] macros). The following settings are needed in the <code>makefile.mk</code>:<br />
* <code>ENABLE_EXCEPTIONS = TRUE</code><br />
* <code>CFLAGSCXX += $(CPPUNIT_CFLAGS)</code><br />
* <code>SHL<var>n</var>RPATH = NONE</code><br />
* <code>SHL<var>n</var>STDLIBS += $(CPPUNITLIB)</code><br />
* <code>SHL<var>n</var>VERSIONMAP = <var>version.map</var></code>, where that file must contain the following (see [[#CppUnit_1.12.1|details]] below for improving this):<br />
UDK_3_0_0 {<br />
global:<br />
cppunitTestPlugIn;<br />
local:<br />
*;<br />
};<br />
<br />
To run tests, <code>sal/cppunittester</code> delivers a <code>cppunittester</code> executable that has some advantages over the plain CppUnit <code>DllPlugInTester</code>:<br />
* It uses <code>SAL_IMPLEMENT_MAIN</code> to properly set up the per-process settings required by URE. Test code as well as tested code based on URE will expect this and would fail in a process that is not set up in this way.<br />
* Getting CppUnit to build as an external module within the Windows OOo build is a non-trivial task. The less parts of it that need to be built, the better.<br />
<br />
Something like the following in <code>makefile.mk</code> will execute the tests:<br />
ALLTAR : test<br />
test .PHONY : $(SHL1TARGETN)<br />
$(CPPUNITTESTER) $(SHL1TARGETN)<br />
<br />
<code>$(CPPUNITTESTER)</code> internally uses <code>$(AUGMENT_LIBRARY_PATH_LOCAL)</code> to favor library instances in the local output tree over ones in solver. Alternatively to the above, <code>.INCLUDE: _cppunit.mk</code> calls <code>$(CPPUNITTESTER)</code> on each of <code>$(SHL1TARGETN)</code>, &hellip;, <code>$(SHL10TARGETN)</code> that is defined.<br />
<br />
=== JUnit ===<br />
<br />
For tests in Java, plain JUnit (at least version 4) is available. (OOo requires JUnit as a prerequisite, see [http://junit.org/ junit.org] for downloads; you can configure <code>--with-junit=<var>&hellip;</var></code> if it is not automatically found; alternatively, you can configure <code>--without-junit</code>, disabling JUnit-based tests.)<br />
<br />
=== <code>subsequenttests</code> ===<br />
<br />
Some tests have build and/or run time dependencies on modules further up in the hierarchy, or modules that the rest of the module in question does not have dependencies on (and which are thus not listed in the module's <code>build.lst</code>). The extreme case are tests that need a complete OOo installation as their test environment.<br />
<br />
For such tests, the whole <code>makefile.mk</code> should be wrapped in:<br />
.IF "$(OOO_SUBSEQUENT_TESTS)" == ""<br />
nothing .PHONY :<br />
.ELSE<br />
...<br />
.END<br />
(and the directory included in the module's <code>build.lst</code>).<br />
<br />
The idea is to do a complete OOo build first (<code>cd smoketestoo_native && build --all</code>) and then build and execute those tests either selectively or wholesale.<br />
<br />
Selectively building a specific such test directory can be done with <code>cd <var>&hellip;</var> && OOO_SUBSEQUENT_TESTS=TRUE dmake</code>.<br />
<br />
To build and execute ''all'' these test directories, the tool <code>subsequenttests</code> (in <code>solenv/bin</code>) exists. It scans the <code>build.lst</code> files of all modules for <code>makefile.mk</code>s that mention <code>OOO_SUBSEQUENT_TESTS</code> and simply executes <code>dmake</code> in all those directories, with <code>OOO_SUBSEQUENT_TESTS</code> set. It supports a <code>-P<var>n</var></code> switch to build <var>n</var> directories in parallel.<br />
<br />
=== Helpers ===<br />
<br />
A new module <code>test</code> shall collect reusable code snippets for C++ and Java tests.<br />
<br />
For now, it concentrates on letting a test connect to an OOo instance via remote UNO: A C++ test class can hold a <code>test::OfficeConnection</code> as class member and, in its CppUnit <code>setUp</code> and <code>tearDown</code> functions, call <code>OfficeConnection::setUp</code> and <code>OfficeConnection::tearDown</code>, respectively. Tests obtain access to the OOo instance via <code>OfficeConnection::getFactory</code>. Similarly, a Java test class can use an <code>org.openoffice.test.OfficeConnection</code> instance, offering the same functionality as its C++ counterpart.<br />
<br />
For this to work, three additional steps are necessary:<br />
* First, in <code>instsetoo_native</code>, building an installation set for the <code>openoffice</code> product in the default language (<code>en-US</code>) in any package format now takes care to always also build an archive package format (<code>tar.gz</code> resp. <code>zip</code>) of that product.<br />
* Second, building <code>smoketestoo_native</code> permanently installs that archive into the solver. (Except on Windows, where problems with resulting long pathnames prevent this; there, as a workaround, each test individually unzips the archive to some local temporary directory.) <br />
* Third, a test that requires an OOo instance includes <code>installationtest.mk</code> in its <code>makefile.mk</code>. That file makes sure to call the CppUnit and JUnit test runners with the information necessary for the helper classes to start the correct OOo instance with a fresh <code>UserInstallation</code> and set up an URP pipe connection. The information is tunneled into the test runner executables as UNO bootstrap parameters.<br />
<br />
For debugging purposes, which OOo instance the tests use can manually be overridden, see [http://www.openoffice.org/servlets/ReadMsg?list=interface-announce&msgNo=1285 &ldquo;OOO_TEST_SOFFICE: allow override of tested soffice process&rdquo;].<br />
<br />
=== <code>unoapi</code> Tests ===<br />
<br />
The <code>unoapi</code> tests are redesigned to use the new test framework. They are plain JUnit tests and use the mechanisms described above to connect to running OOo instances. However, due to the large amount of logic encoded in <code>qadevOOo</code>, those JUnit tests for now are only thin wrappers around <code>org.openoffice.Runner.run</code>. This is intended to change over time.<br />
<br />
The <code>cwscheckapi</code> tool to run the <code>unoapi</code> tests has been subsumed by <code>subsequenttests</code>. The latter always runs all tests, while the former had mechanisms to run only tests for modules that had been changed by a CWS. The hope is that the parallel mode of <code>subsequenttests</code> makes it fast enough so that running all tests all of the times becomes feasible.<br />
<br />
Unfortunately, running the <code>unoapi</code> tests is still not stable enough to give useful results. Therefore, running <code>subsequenttests</code> has been disabled in the build bots for now. Making the tests sufficiently stable is ongoing work.<br />
<br />
== Details ==<br />
<br />
Working on {{CWS|sb118}}, {{CWS|sb120}}.<br />
<br />
=== CppUnit 1.12.1 ===<br />
<br />
* Replace existing <code>cppunit</code> and <code>testshl2</code> combo with latest CppUnit 1.12.1.<br />
* OOo <code>configure --with-system-cppunit</code> (for now only if also <code>--with-system-stl</code>!); minimal required version for now arbitrarily 1.12.1.<br />
* '''TODO:''' Upstream <code>PATCH_FILES</code> (<code>windows.patch</code>?!?).<br />
* '''TODO:''' <code>RPATH</code> in generated libraries and executables.<br />
* '''TODO:''' Improve <code>CPPUNIT_PLUGIN_EXPORT</code> and get rid of version maps (GCC exception problems?).<br />
* '''TODO:''' <code>cppunit/makefile.mk</code> <code>MY_LIBS = -lm</code> Solaris hack.<br />
* '''TODO:''' In general OOo build environment, no longer set <code>CFLAGS</code> etc. as environment variables; have package-specific <code>OOO_<var>package</var>_CFLAGS</code> etc. and combine those into <code>CFLAGS</code> etc. where necessary (see <code>OOO_STLPORT_CXXFLAGS</code> etc. in <code>cppunit/makefile.mk</code>).<br />
* '''TODO:''' Why use <code>cppunittester</code> instead of <code>DllPlugInTester</code>? (Remove building/delivering <code>DllPlugInTester</code>.)<br />
* '''TODO:''' Make <code>operator &lt;&lt;(std::basic_ostream &amp;, rtl::OUString const &amp;)</code> from <code>test/oustringstreaminserter.hxx</code> generally available?<br />
* '''TODO:''' Make STLport <code>num_put</code> symbols available on platforms other than Linux (see <code>solenv/bin/addsym.awk</code>), too, so that <code>CPPUNIT_ASSERT_EQUAL</code> actually outputs numeric values.<br />
<br />
==== Is CppUnit an active project? ====<br />
<br />
When I wrote<br />
<pre><br />
Message-ID: <4D67B884.8080101@oracle.com><br />
Date: Fri, 25 Feb 2011 15:11:16 +0100<br />
From: Stephan Bergmann <stephan.bergmann@oracle.com><br />
MIME-Version: 1.0<br />
To: cppunit-devel@lists.sourceforge.net<br />
Subject: What part of the API is published?<br />
Content-Type: text/plain; charset=UTF-8; format=flowed<br />
Content-Transfer-Encoding: 7bit<br />
<br />
At least for CppUnit 1.12.1, it is unclear whether for example class <br />
DynamicLibraryManager is supposed to be available to client code.<br />
<br />
The HTML documentation's class list contains DynamicLibraryManager just <br />
like, say, TestCase, and I can't find any hint on the former's page that <br />
it is an implementation detail. However, in DynamicLibraryManager.h, <br />
the class is not decorated with CPPUNIT_API.<br />
<br />
Is there any specification of what is published (i.e., stable, usable by <br />
clients) vs. what is implementation detail (i.e., not to be used by <br />
clients)?<br />
<br />
-Stephan<br />
</pre><br />
the only response I ever got was<br />
<pre><br />
MIME-Version: 1.0<br />
Content-Type: text/plain; charset="us-ascii"<br />
Content-Transfer-Encoding: 7bit<br />
Subject: Your message to Cppunit-devel awaits moderator approval<br />
From: cppunit-devel-bounces@lists.sourceforge.net<br />
To: stephan.bergmann@oracle.com<br />
Message-ID: <mailman.49713.1298643119.7082.cppunit-devel@lists.sourceforge.net><br />
Date: Fri, 25 Feb 2011 14:11:59 +0000<br />
<br />
Your mail to 'Cppunit-devel' with the subject<br />
<br />
What part of the API is published?<br />
<br />
Is being held until the list moderator can review it for approval.<br />
<br />
The reason it is being held:<br />
<br />
Post by non-member to a members-only list<br />
<br />
Either the message will get posted to the list, or you will receive<br />
notification of the moderator's decision. If you would like to cancel<br />
this posting, please visit the following URL:<br />
<br />
https://lists.sourceforge.net/lists/confirm/cppunit-devel/1da27e17e1d5fdfcb7f8ac6860a05bb5ca1eab1d<br />
</pre><br />
and the last message in [http://sourceforge.net/mailarchive/forum.php?forum_name=cppunit-devel the archive] is from January 2010.<br />
<br />
=== <code>testshl2</code> ===<br />
<br />
* <code>solenv/inc_cppunit.mk</code>/<code>cppunit.mk</code>: [http://hg.services.openoffice.org/cws/sb118/rev/cf13421c3774 &ldquo;adapted <code>cppunit.mk</code> to <code>cppunittester</code> and no longer require &lsquo;<code>dmake test</code>&rsquo; to run tests&rdquo;].<br />
* '''TODO:''' <code>DEV300_m68</code> introduced <code>TESTSHL2LIB</code> (which I removed again) and uses it in many <code>qa</code> makefiles (that I need to touch someday, anyway).<br />
<br />
=== Unit Tests ===<br />
<br />
* <code>OOO_SUBSEQUENT_TESTS</code> (<code>build.lst</code> lists local dependencies of those directories, so that modifying a module and then calling &ldquo;<code>OOO_SUBSEQUENT_TESTS=x build</code>&rdquo; rebuilds the module and executes the tests).<br />
* '''TODO:''' If Build Environment&nbsp;2.0 would build directly to solver (instead of local output tree/deliver), that would simplify tests that currently need to take care to test local libraries instead of solver ones (see, for example, <code>OOO_TEST_PREFIX</code> in the <code>services.rdb</code> of <code>stoc/test/uriproc/makefile.mk</code>).<br />
{{Documentation/Note|Build Environment&nbsp;2.0 will not build directly to solver, but will make a module depend on the targets in the solver, and these are depending on the targets in the workdir (aka the old "local output tree"). Thus on an usual build in a module building and delivering are not two steps anymore. If tests depend on the target in the solver (which they will do automatically in most use cases, as linking against a library automatically creates a dependency on the library in the solver), they can be sure that the target is up to date in the solver '''and''' in the workdir.<br />
<br />
--[[User:B michaelsen|B michaelsen]] 06:32, 27 August 2010 (UTC)}}<br />
* '''TODO:''' Constructs like &ldquo;<code>-env:UNO_<var>&hellip;</var>=$(my_file)<var>&hellip;</var></code>&rdquo; would fail for problematic characters (spaces!) in paths.<br />
<br />
=== Smoke Test ===<br />
<br />
* Redesign <code>smoketestoo_native</code> to use CppUnit and pre-installed OOo.<br />
* [http://hg.services.openoffice.org/cws/sb118/rev/160b248247a0 &ldquo;changed <code>tools/debug</code> to never fall back from writing to shell to writing to file, and read <code>DBGSV_INIT</code> from <code>rtl::Bootstrap</code>; the latter causes problems if <code>tools/debug</code> is called from static code executing before <code>SAL_MAIN</code> has called <code>osl_setCommandArgs</code> &rarr; removed statics from code and added assertions to <code>osl/process</code>; various improvements to <code>smoketests.cxx</code> (incl. passing an appropriate <code>dbgsv.ini</code> for non-pro builds)&rdquo;] followed by [http://hg.services.openoffice.org/cws/sb118/rev/dbbacb9d2fd3 &ldquo;reverted parts of HG <code>-c&nbsp;160b248247a0</code> again: the &lsquo;static code executing before <code>SAL_MAIN</code>&rsquo; problem was too severe; instead, globally set <code>DBGSV_INIT</code> build env var to new <code>solenv/bin/dbgsv.ini</code>&rdquo;]; see also {{issue|109142}} &ldquo;Let assertions abort&rdquo;.<br />
* '''TODO:''' For <code>smoketestoo_native/makefile.mk</code> &ldquo;<code><nowiki>-env:arg-env=$(OOO_LIBRARY_PATH_VAR)"$${{$(OOO_LIBRARY_PATH_VAR)+=$$$(OOO_LIBRARY_PATH_VAR)}}"</nowiki></code>&rdquo; mechanism: <code>osl_executeProcess</code> <code>ustrEnvironments</code> members without &ldquo;<code>=</code>&rdquo;: all platforms; documentation; documentation of <code>osl_executeProcess_WithRedicrectedIO</code>.<br />
* '''TODO:''' <code>-headless</code>? (appears to still display windows on Windows and Mac OS&nbsp;X, however, see {{issue|109052}})<br />
* '''TODO:''' {{issue|113341}} &ldquo;-nofirststartwizard should disable update check&rdquo;<br />
<br />
=== Pre-Installed OOo ===<br />
<br />
* For Sun Hamburg Release Engineering, take MWS archive installation sets from &ldquo;S:&rdquo; instead of solver: [http://hg.services.openoffice.org/cws/sb118/rev/d5dbea724063 &ldquo;take installation set from <code>SHIPDRIVE</code> if appropriate&rdquo;].<br />
* '''TODO:''' <code>PKGFORMAT=installed</code> instead of <code>archive</code>?<br />
<br />
=== <code>unoapi</code> Tests ===<br />
<br />
* Known issues, open (not yet addressed at all; disabled for now on net-yet-integrated CWS; or fixed on not-yet-integrated CWS):<br />
** {{issue|114669}} &ldquo;forms/qa/unoapi forms.OListBoxControl crash&rdquo; (fixed on {{CWS|sb140}})<br />
** {{issue|116120}} &ldquo;vcl: TabControl::ImplGetTabRect negative height leads to X_CreatePixmap BadAlloc&rdquo; (fixed on {{CWS|vcl118}}, integrated into <code>DEV300_m101</code>)<br />
** {{issue|116125}} &ldquo;qadevOOo/qa/complex/junitskeleton failure&rdquo;<br />
** {{issue|116156}} &ldquo;toolkit/qa/unoapi crash in SwAccessibleMap::RemoveContext&rdquo;<br />
** {{issue|116192}} &ldquo;[sw] fixed text fields sometimes get updated&rdquo; (fixed on {{CWS|sw34bf03}}, integrated into <code>DEV300_m102</code>)<br />
** {{issue|116550}} &ldquo;toolkit/qa/unoapi crashes OOo in ~SwAccessibleParagraph vs. SwXTextDocument::close&rdquo;<br />
** {{issue|116583}} &ldquo;comphelper/qa/complex/comphelper failure&rdquo;<br />
** {{issue|116730}} &ldquo;vcl: crash with multiple threads in Window::ImplGrabFocus&rdquo;<br />
** {{issue|116733}} &ldquo;sw: crash in ~SwDrawContact (forms/qa/unoapi)&rdquo;<br />
** {{issue|117381}} &ldquo;ucb/qa/unoapi ucb.UniversalContentBroker::com::sun::star::ucb::XContentProviderManager::deregisterContentProvider() fails with gvfs&rdquo; (fixed on {{CWS|sb140}})<br />
** {{issue|117486}} &ldquo;toolkit/qa/complex/toolkit: "Window pos size wrong"&rdquo; (fixed on {{CWS|sb140}})<br />
** {{issue|117488}} &ldquo;sw/qa/unoapi: sw.SwXViewSettings::com::sun::star::text::ViewSettings::ShowOnlineLayout ShowOnlineLayout/ZoomValue failed&rdquo;<br />
** {{issue|117641}} &ldquo;chart2/qa/unoapi fails in sch.ChXDataPoint::com::sun::star::chart::ChartDataPointProperties due to change to jpeg/prj/d.lst&rdquo; (fixed as <code>DEV300_m106</code> masterfix)<br />
** {{issue|117693}} &ldquo;xmlsecurity/qa/certext fails on wntmsci12 non-pro ("no OPENSSL_Applink")&rdquo;<br />
* Known issues, disabled for now:<br />
** {{issue|109517}} &ldquo;sc/qa/unoapi fails for ScAnnotationObj etc.&rdquo;<br />
** {{issue|109518}} &ldquo;sd/qa/unoapi crash in SfxViewShell::GetController&rdquo;<br />
** {{issue|109643}} &ldquo;toolkit/qa/unoapi tests fail when losing focus&rdquo;<br />
** {{issue|109728}} &ldquo;~ScAutoFormatObj uses cleared ScGlobal&rdquo;<br />
** {{issue|109917}} &ldquo;fragile unoapi test using OnUnfocus event&rdquo;<br />
** {{issue|109939}} &ldquo;toolkit: inconsistent UnoControl locking schemes&rdquo;<br />
** {{issue|110862}} &ldquo;sc/qa/unoapi fails for sc.ScDataPilotTableObj::com::sun::star::sheet::XDataPilotTable::refresh()&rdquo;<br />
** {{issue|110988}} &ldquo;svtools/qa/unoapi fails for svtools.AccessibleBrowseBox etc.&rdquo;<br />
** {{issue|111006}} &ldquo;toolkit: deadlock between UnoControls&rdquo;<br />
** {{issue|111032}} &ldquo;sc/qa/unoapi sc.ScAccessibleCell::com::sun::star::accessibility::XAccessibleText getCharacterBounds() failure&rdquo;<br />
** {{issue|111042}} &ldquo;sd/qa/unoapi sd::DrawController::dispose crash&rdquo;<br />
** {{issue|111043}} &ldquo;sd/qa/unoapi sd::DrawController_OutlineView NullPointerException&rdquo;<br />
** {{issue|111102}} &ldquo;chart2: ChartModelHelper::findDiagram returns null&rdquo;<br />
** {{issue|111111}} &ldquo;xmloff.Impress.XMLImporter::com::sun::star::document::XImporter&rdquo;<br />
** {{issue|111113}} &ldquo;toolkit.AccessibleStatusBarItem unoapi failure&rdquo;<br />
** {{issue|111148}} &ldquo;forms/qa/unoapi forms.OImageControlModel::com::sun::star::beans::XMultiPropertySet deadlock&rdquo;<br />
** {{issue|111169}} &ldquo;svx.AccessiblePageShape unoapi failure&rdquo;<br />
** {{issue|111170}} &ldquo;sun/i18n/qa/unoapi "creating a drawdoc" failure&rdquo;<br />
** {{issue|111178}} &ldquo;sw/qa/unoapi SwView::SelectShell crash&rdquo;<br />
** {{issue|111180}} &ldquo;framework/qa/unoapi fwk.Desktop::com::sun::star::frame::XComponentLoader::loadComponentFromURL() failure&rdquo;<br />
** {{issue|111182}} &ldquo;Desktop::terminate -> ~DropTarget -> _objc_error crash&rdquo;<br />
** {{issue|111184}} &ldquo;sal/qa/osl/pipe uses fixed pipe names&rdquo;<br />
** {{issue|111186}} &ldquo;sw/qa/unoapi sw.PageStyle::com::sun::star::beans::XPropertySet::setPropertyValue() failure&rdquo;<br />
** {{issue|111190}} &ldquo;sw/qa/unoapi sw.SwXShape failure&rdquo;<br />
** {{issue|111194}} &ldquo;sw/qa/unoapi sw.XMLExporter crash&rdquo;<br />
** {{issue|111195}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleScrollBar::com::sun::star::accessibility::XAccessibleValue::setCurrentValue() failure&rdquo;<br />
** {{issue|111197}} &ldquo;sw/qa/unoapi sw.SwAccessibleDocumentPageView failure&rdquo;<br />
** {{issue|111199}} &ldquo;sd/qa/unoapi sd.AccessibleOutlineView failure&rdquo;<br />
** {{issue|111200}} &ldquo;xmloff/qa/unoapi xmloff.Draw.XMLMetaImporter failure&rdquo;<br />
** {{issue|111216}} &ldquo;svx/qa/unoapi accessibility deadlock&rdquo;<br />
** {{issue|111218}} &ldquo;sw/qa/unoapi sw.SwAccessibleParagraphView::com::sun::star::accessibility::XAccessibleEventBroadcaster::removeEventListener() failure&rdquo;<br />
** {{issue|111220}} &ldquo;sw/qa/unoapi sw.XMLContentExporter::com::sun::star::document::XFilter::cancel() failure&rdquo;<br />
** {{issue|111224}} &ldquo;xmloff/qa/unoapi xmloff.Impress.XMLContentExporter crash&rdquo;<br />
** {{issue|111225}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleStatusBar failure&rdquo;<br />
** {{issue|111252}} &ldquo;svx/qa/unoapi svx.AccessibleOLEShape deadlock&rdquo;<br />
** {{issue|111273}} &ldquo;sw/qa/unoapi sw.SwXTextEmbeddedObject::com::sun::star::document::XEmbeddedObjectSupplier::getEmbeddedObject() crash&rdquo;<br />
** {{issue|111278}} &ldquo;svx/qa/unoapi svx.AccessibleEditableTextPara failure&rdquo;<br />
** {{issue|111283}} &ldquo;sfx2/qa/unoapi sfx.StandaloneDocumentInfo failure&rdquo;<br />
** {{issue|111285}} &ldquo;forms/qa/unoapi forms.OButtonModel failure&rdquo;<br />
** {{issue|111287}} &ldquo;xmloff/qa/unoapi XMLSettingsIm-/Exporter crash&rdquo;<br />
** {{issue|111329}} &ldquo;sd/qa/unoapi SdXCustomPresentationAccess::getElementNames/ImpEditEngine::OnlineSpellHdl hang&rdquo;<br />
** {{issue|111332}} &ldquo;sw/qa/unoapi sw.XMLStylesExporter::com::sun::star::document::XFilter crash&rdquo;<br />
** {{issue|111333}} &ldquo;forms/qa/unoapi forms.OImageControlControl::com::sun::star::awt::XControl deadlock&rdquo;<br />
** {{issue|112743}} &ldquo;starmath/qa/unoapi sm.XMLSettingsExporter failure&rdquo;<br />
** {{issue|112746}} &ldquo;framework/qa/unoapi fwk.ModuleManager failure (X11 BadWindow)&rdquo;<br />
** {{issue|112751}} &ldquo;testgraphical/qa/graphical failure&rdquo;<br />
** {{issue|112778}} &ldquo;xmloff/qa/unoapi xmloff.Draw.XMLContentExporter failure&rdquo;<br />
** {{issue|113020}} &ldquo;sw/qa/unoapi sw.SwXTextGraphicObject::com::sun::star::beans::XPropertySet failure&rdquo;<br />
** {{issue|113103}} &ldquo;chart2: deadlock between DiagramHelper and Diagram&rdquo;<br />
** {{issue|113136}} &ldquo;sw/qa/unoapi sw.SwAccessibleParagraphView::com::sun::star::accessibility::XAccessibleEditableText failure&rdquo;<br />
** {{issue|113142}} &ldquo;sw/qa/unoapi SwAccessibleContext::RemoveFrmFromAccessibleMap crash&rdquo;<br />
** {{issue|113161}} &ldquo;sd/qa/unoapi sd.SdLayer::com::sun::star::drawing::Layer::IsVisible failure&rdquo;<br />
** {{issue|113201}} &ldquo;forms/qa/unoapi forms.OEditModel::com::sun::star::form::validation::XValidatableFormComponent failure&rdquo;<br />
** {{issue|113245}} &ldquo;framework/qa/unoapi fwl.TypeDetection failure&rdquo;<br />
** {{issue|113306}} &ldquo;sfx2/qa/unoapi sfx.DocumentTemplates failure&rdquo;<br />
** {{issue|113386}} &ldquo;sd/qa/unoapi sd.AccessibleDrawDocumentView::com::sun::star::accessibility::XAccessibleComponent::containsPoint() failure&rdquo;<br />
** {{issue|113489}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleMenu{,Bar,Separator} failures&rdquo;<br />
** {{issue|114205}} &ldquo;sw/qa/unoapi sw.SwAccessibleParagraphView::com::sun::star::accessibility::XAccessibleText::copyText() failed&rdquo;<br />
** {{issue|114209}} &ldquo;forms/qa/unoapi forms.OGridControlModel::com::sun::star::view::XSelectionSupplier crash&rdquo;<br />
** {{issue|114211}} &ldquo;xmloff/qa/unoapi xmloff.Draw.XMLStylesImporter::com::sun::star::lang::XInitialization crash&rdquo;<br />
** {{issue|114213}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleMenu::com::sun::star::accessibility::XAccessibleSelection failure&rdquo;<br />
** {{issue|114636}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleScrollBar::com::sun::star::accessibility::XAccessibleAction failure&rdquo;<br />
** {{issue|114637}} &ldquo;sw/qa/unoapi sw.SwAccessibleFootnoteView(?) crash&rdquo;<br />
** {{issue|114642}} &ldquo;svx/qa/unoapi svx: svx.SvxUnoTextContent::com::sun::star::style::CharacterProperties crash&rdquo;<br />
** {{issue|114889}} &ldquo;sw/qa/unoapi sw.SwXTextViewCursor::com::sun::star::view::XScreenCursor&rdquo;<br />
** {{issue|116784}} &ldquo;[sfx2] CheckGlobalEventBroadcaster_writer1 fails&rdquo;<br />
** {{issue|116813}} &ldquo;[sfx2] complex.sfx2.UndoManager checkBrokenScripts fails&rdquo;<br />
** {{issue|116814}} &ldquo;[toolkit] unoapi test UnoControlDialogModel: XCloneable fails&rdquo;<br />
* Missing tests:<br />
** {{issue|109564}} &ldquo;qadevOOo/tests/java/ifc/awt/_XSystemChildFactory.java&rdquo;<br />
* Sporadic failures:<br />
** {{issue|111217}} &ldquo;BasicManager::SetGlobalUNOConstant crash during shutdown&rdquo;<br />
** {{issue|111246}} &ldquo;svx::FontHeightToolBoxControl::statusChanged crash (memory corruption)&rdquo;<br />
** {{issue|111271}} &ldquo;Mac OS X: crash during shutdown, __tcf_2 on stack&rdquo;<br />
** {{issue|111400}} &ldquo;Extension Manager does not join spawned uno process (-> smoketestoo_native fails)&rdquo;<br />
** {{issue|112070}} &ldquo;UNO API tests must not use random&rdquo;<br />
** {{issue|113158}} &ldquo;crash with two threads in framework::ToolBarManager dtor&rdquo;<br />
** {{issue|113197}} &ldquo;sw/qa/unoapi sw.SwXTextRange hangs&rdquo;<br />
** {{issue|113367}} &ldquo;sysdtrans deadlock during shutdown&rdquo;<br />
** {{issue|113464}} &ldquo;stoc_smgr::ORegistryServiceManager::dispose crash during shutdown&rdquo;<br />
** {{issue|114207}} &ldquo;framework::ModuleUIConfigurationManager::dispose crash during shutdown&rdquo;<br />
** {{issue|114675}} &ldquo;binary URP bridge race on shut down, crash&rdquo;<br />
** {{issue|114718}} &ldquo;forms/qa/unoapi: crash in remote async release call&rdquo;<br />
** {{issue|116131}} &ldquo;vcl: message unregisterDraggingDestinationHandler: sent to freed object&rdquo;<br />
<br />
[[Category:Effort]][[Category:Test]]</div>Sbhttps://wiki.openoffice.org/wiki/Test_CleanupTest Cleanup2011-04-07T07:21:05Z<p>Sb: /* unoapi Tests */</p>
<hr />
<div>= Test Cleanup Project =<br />
<br />
The demand for automated (unit) testing should be obvious. See the [http://www.openoffice.org/servlets/ReadMsg?list=dev&msgNo=26189 mission statement mail] and [[Media:JustTestingPresentation.odp|slides]] from a [http://fosdem.org/2010/schedule/events/ooo_testing FOSDEM'10 talk] and an [http://www.ooocon.org/index.php/ooocon/2010/paper/view/188 OOoCon&nbsp;2010 presentation] for more information and further links.<br />
<br />
For examples of how to write xUnit based tests in the OOo code base, see [http://hg.services.openoffice.org/DEV300/file/87f4911ea629/basegfx/test <code>basegfx/test/</code>], [http://hg.services.openoffice.org/DEV300/file/87f4911ea629/sal/qa/ByteSequence <code>sal/qa/ByteSequence/</code>], and [http://hg.services.openoffice.org/DEV300/file/87f4911ea629/smoketestoo_native <code>smoketest_native/</code>]. However, the hard part should not be how to write test code, anyway, but how to write ''testable'' code; see [http://misko.hevery.com/2008/11/04/clean-code-talks-unit-testing/ The Clean Code Talks&mdash;Unit Testing].<br />
<br />
When testing C++ code that merely uses UNO types (no services), but uses them in a way that requires UNO to be bootstrapped so that the relevant type information is available (e.g., putting instances of complex UNO types into <code>com::sun::star::uno::Any</code>), one approach is as follows: In the <code>makefile.mk</code>, instead of <code>.INCLUDE: _cppunit.mk</code> use<br />
<source lang="make"><br />
.IF "$(OS)" == "WNT"<br />
my_file = file:///<br />
.ELSE<br />
my_file = file://<br />
.END<br />
<br />
ALLTAR : test<br />
<br />
test .PHONY : $(SHL1TARGETN)<br />
$(CPPUNITTESTER) $(SHL1TARGETN) \<br />
-env:UNO_TYPES=$(my_file)$(SOLARBINDIR)/types.rdb<br />
</source><br />
and in the test code once call <code>cppu::defaultBootstrap_InitialComponentContext()</code>.<br />
<br />
== User Interface ==<br />
<br />
=== CppUnit ===<br />
<br />
For tests in C++, plain CppUnit (at least version 1.12.1) is available. (OOo bundles CppUnit 1.12.1 as an external module; alternatively, you can configure <code>--with-system-cppunit</code>.)<br />
<br />
Implement the test code as a dynamic library, following CppUnit conventions (i.e., using [http://cppunit.sourceforge.net/doc/lastest/group___creating_test_suite.html#ga0 <code>CPPUNIT_TEST_SUITE_REGISTRATION</code>] and [http://cppunit.sourceforge.net/doc/lastest/_test_plug_in_8h.html#a2 <code>CPPUNIT_PLUGIN_IMPLEMENT</code>] macros). The following settings are needed in the <code>makefile.mk</code>:<br />
* <code>ENABLE_EXCEPTIONS = TRUE</code><br />
* <code>CFLAGSCXX += $(CPPUNIT_CFLAGS)</code><br />
* <code>SHL<var>n</var>RPATH = NONE</code><br />
* <code>SHL<var>n</var>STDLIBS += $(CPPUNITLIB)</code><br />
* <code>SHL<var>n</var>VERSIONMAP = <var>version.map</var></code>, where that file must contain the following (see [[#CppUnit_1.12.1|details]] below for improving this):<br />
UDK_3_0_0 {<br />
global:<br />
cppunitTestPlugIn;<br />
local:<br />
*;<br />
};<br />
<br />
To run tests, <code>sal/cppunittester</code> delivers a <code>cppunittester</code> executable that has some advantages over the plain CppUnit <code>DllPlugInTester</code>:<br />
* It uses <code>SAL_IMPLEMENT_MAIN</code> to properly set up the per-process settings required by URE. Test code as well as tested code based on URE will expect this and would fail in a process that is not set up in this way.<br />
* Getting CppUnit to build as an external module within the Windows OOo build is a non-trivial task. The less parts of it that need to be built, the better.<br />
<br />
Something like the following in <code>makefile.mk</code> will execute the tests:<br />
ALLTAR : test<br />
test .PHONY : $(SHL1TARGETN)<br />
$(CPPUNITTESTER) $(SHL1TARGETN)<br />
<br />
<code>$(CPPUNITTESTER)</code> internally uses <code>$(AUGMENT_LIBRARY_PATH_LOCAL)</code> to favor library instances in the local output tree over ones in solver. Alternatively to the above, <code>.INCLUDE: _cppunit.mk</code> calls <code>$(CPPUNITTESTER)</code> on each of <code>$(SHL1TARGETN)</code>, &hellip;, <code>$(SHL10TARGETN)</code> that is defined.<br />
<br />
=== JUnit ===<br />
<br />
For tests in Java, plain JUnit (at least version 4) is available. (OOo requires JUnit as a prerequisite, see [http://junit.org/ junit.org] for downloads; you can configure <code>--with-junit=<var>&hellip;</var></code> if it is not automatically found; alternatively, you can configure <code>--without-junit</code>, disabling JUnit-based tests.)<br />
<br />
=== <code>subsequenttests</code> ===<br />
<br />
Some tests have build and/or run time dependencies on modules further up in the hierarchy, or modules that the rest of the module in question does not have dependencies on (and which are thus not listed in the module's <code>build.lst</code>). The extreme case are tests that need a complete OOo installation as their test environment.<br />
<br />
For such tests, the whole <code>makefile.mk</code> should be wrapped in:<br />
.IF "$(OOO_SUBSEQUENT_TESTS)" == ""<br />
nothing .PHONY :<br />
.ELSE<br />
...<br />
.END<br />
(and the directory included in the module's <code>build.lst</code>).<br />
<br />
The idea is to do a complete OOo build first (<code>cd smoketestoo_native && build --all</code>) and then build and execute those tests either selectively or wholesale.<br />
<br />
Selectively building a specific such test directory can be done with <code>cd <var>&hellip;</var> && OOO_SUBSEQUENT_TESTS=TRUE dmake</code>.<br />
<br />
To build and execute ''all'' these test directories, the tool <code>subsequenttests</code> (in <code>solenv/bin</code>) exists. It scans the <code>build.lst</code> files of all modules for <code>makefile.mk</code>s that mention <code>OOO_SUBSEQUENT_TESTS</code> and simply executes <code>dmake</code> in all those directories, with <code>OOO_SUBSEQUENT_TESTS</code> set. It supports a <code>-P<var>n</var></code> switch to build <var>n</var> directories in parallel.<br />
<br />
=== Helpers ===<br />
<br />
A new module <code>test</code> shall collect reusable code snippets for C++ and Java tests.<br />
<br />
For now, it concentrates on letting a test connect to an OOo instance via remote UNO: A C++ test class can hold a <code>test::OfficeConnection</code> as class member and, in its CppUnit <code>setUp</code> and <code>tearDown</code> functions, call <code>OfficeConnection::setUp</code> and <code>OfficeConnection::tearDown</code>, respectively. Tests obtain access to the OOo instance via <code>OfficeConnection::getFactory</code>. Similarly, a Java test class can use an <code>org.openoffice.test.OfficeConnection</code> instance, offering the same functionality as its C++ counterpart.<br />
<br />
For this to work, three additional steps are necessary:<br />
* First, in <code>instsetoo_native</code>, building an installation set for the <code>openoffice</code> product in the default language (<code>en-US</code>) in any package format now takes care to always also build an archive package format (<code>tar.gz</code> resp. <code>zip</code>) of that product.<br />
* Second, building <code>smoketestoo_native</code> permanently installs that archive into the solver. (Except on Windows, where problems with resulting long pathnames prevent this; there, as a workaround, each test individually unzips the archive to some local temporary directory.) <br />
* Third, a test that requires an OOo instance includes <code>installationtest.mk</code> in its <code>makefile.mk</code>. That file makes sure to call the CppUnit and JUnit test runners with the information necessary for the helper classes to start the correct OOo instance with a fresh <code>UserInstallation</code> and set up an URP pipe connection. The information is tunneled into the test runner executables as UNO bootstrap parameters.<br />
<br />
For debugging purposes, which OOo instance the tests use can manually be overridden, see [http://www.openoffice.org/servlets/ReadMsg?list=interface-announce&msgNo=1285 &ldquo;OOO_TEST_SOFFICE: allow override of tested soffice process&rdquo;].<br />
<br />
=== <code>unoapi</code> Tests ===<br />
<br />
The <code>unoapi</code> tests are redesigned to use the new test framework. They are plain JUnit tests and use the mechanisms described above to connect to running OOo instances. However, due to the large amount of logic encoded in <code>qadevOOo</code>, those JUnit tests for now are only thin wrappers around <code>org.openoffice.Runner.run</code>. This is intended to change over time.<br />
<br />
The <code>cwscheckapi</code> tool to run the <code>unoapi</code> tests has been subsumed by <code>subsequenttests</code>. The latter always runs all tests, while the former had mechanisms to run only tests for modules that had been changed by a CWS. The hope is that the parallel mode of <code>subsequenttests</code> makes it fast enough so that running all tests all of the times becomes feasible.<br />
<br />
Unfortunately, running the <code>unoapi</code> tests is still not stable enough to give useful results. Therefore, running <code>subsequenttests</code> has been disabled in the build bots for now. Making the tests sufficiently stable is ongoing work.<br />
<br />
== Details ==<br />
<br />
Working on {{CWS|sb118}}, {{CWS|sb120}}.<br />
<br />
=== CppUnit 1.12.1 ===<br />
<br />
* Replace existing <code>cppunit</code> and <code>testshl2</code> combo with latest CppUnit 1.12.1.<br />
* OOo <code>configure --with-system-cppunit</code> (for now only if also <code>--with-system-stl</code>!); minimal required version for now arbitrarily 1.12.1.<br />
* '''TODO:''' Upstream <code>PATCH_FILES</code> (<code>windows.patch</code>?!?).<br />
* '''TODO:''' <code>RPATH</code> in generated libraries and executables.<br />
* '''TODO:''' Improve <code>CPPUNIT_PLUGIN_EXPORT</code> and get rid of version maps (GCC exception problems?).<br />
* '''TODO:''' <code>cppunit/makefile.mk</code> <code>MY_LIBS = -lm</code> Solaris hack.<br />
* '''TODO:''' In general OOo build environment, no longer set <code>CFLAGS</code> etc. as environment variables; have package-specific <code>OOO_<var>package</var>_CFLAGS</code> etc. and combine those into <code>CFLAGS</code> etc. where necessary (see <code>OOO_STLPORT_CXXFLAGS</code> etc. in <code>cppunit/makefile.mk</code>).<br />
* '''TODO:''' Why use <code>cppunittester</code> instead of <code>DllPlugInTester</code>? (Remove building/delivering <code>DllPlugInTester</code>.)<br />
* '''TODO:''' Make <code>operator &lt;&lt;(std::basic_ostream &amp;, rtl::OUString const &amp;)</code> from <code>test/oustringstreaminserter.hxx</code> generally available?<br />
* '''TODO:''' Make STLport <code>num_put</code> symbols available on platforms other than Linux (see <code>solenv/bin/addsym.awk</code>), too, so that <code>CPPUNIT_ASSERT_EQUAL</code> actually outputs numeric values.<br />
<br />
==== Is CppUnit an active project? ====<br />
<br />
When I wrote<br />
<pre><br />
Message-ID: <4D67B884.8080101@oracle.com><br />
Date: Fri, 25 Feb 2011 15:11:16 +0100<br />
From: Stephan Bergmann <stephan.bergmann@oracle.com><br />
MIME-Version: 1.0<br />
To: cppunit-devel@lists.sourceforge.net<br />
Subject: What part of the API is published?<br />
Content-Type: text/plain; charset=UTF-8; format=flowed<br />
Content-Transfer-Encoding: 7bit<br />
<br />
At least for CppUnit 1.12.1, it is unclear whether for example class <br />
DynamicLibraryManager is supposed to be available to client code.<br />
<br />
The HTML documentation's class list contains DynamicLibraryManager just <br />
like, say, TestCase, and I can't find any hint on the former's page that <br />
it is an implementation detail. However, in DynamicLibraryManager.h, <br />
the class is not decorated with CPPUNIT_API.<br />
<br />
Is there any specification of what is published (i.e., stable, usable by <br />
clients) vs. what is implementation detail (i.e., not to be used by <br />
clients)?<br />
<br />
-Stephan<br />
</pre><br />
the only response I ever got was<br />
<pre><br />
MIME-Version: 1.0<br />
Content-Type: text/plain; charset="us-ascii"<br />
Content-Transfer-Encoding: 7bit<br />
Subject: Your message to Cppunit-devel awaits moderator approval<br />
From: cppunit-devel-bounces@lists.sourceforge.net<br />
To: stephan.bergmann@oracle.com<br />
Message-ID: <mailman.49713.1298643119.7082.cppunit-devel@lists.sourceforge.net><br />
Date: Fri, 25 Feb 2011 14:11:59 +0000<br />
<br />
Your mail to 'Cppunit-devel' with the subject<br />
<br />
What part of the API is published?<br />
<br />
Is being held until the list moderator can review it for approval.<br />
<br />
The reason it is being held:<br />
<br />
Post by non-member to a members-only list<br />
<br />
Either the message will get posted to the list, or you will receive<br />
notification of the moderator's decision. If you would like to cancel<br />
this posting, please visit the following URL:<br />
<br />
https://lists.sourceforge.net/lists/confirm/cppunit-devel/1da27e17e1d5fdfcb7f8ac6860a05bb5ca1eab1d<br />
</pre><br />
and the last message in [http://sourceforge.net/mailarchive/forum.php?forum_name=cppunit-devel the archive] is from January 2010.<br />
<br />
=== <code>testshl2</code> ===<br />
<br />
* <code>solenv/inc_cppunit.mk</code>/<code>cppunit.mk</code>: [http://hg.services.openoffice.org/cws/sb118/rev/cf13421c3774 &ldquo;adapted <code>cppunit.mk</code> to <code>cppunittester</code> and no longer require &lsquo;<code>dmake test</code>&rsquo; to run tests&rdquo;].<br />
* '''TODO:''' <code>DEV300_m68</code> introduced <code>TESTSHL2LIB</code> (which I removed again) and uses it in many <code>qa</code> makefiles (that I need to touch someday, anyway).<br />
<br />
=== Unit Tests ===<br />
<br />
* <code>OOO_SUBSEQUENT_TESTS</code> (<code>build.lst</code> lists local dependencies of those directories, so that modifying a module and then calling &ldquo;<code>OOO_SUBSEQUENT_TESTS=x build</code>&rdquo; rebuilds the module and executes the tests).<br />
* '''TODO:''' If Build Environment&nbsp;2.0 would build directly to solver (instead of local output tree/deliver), that would simplify tests that currently need to take care to test local libraries instead of solver ones (see, for example, <code>OOO_TEST_PREFIX</code> in the <code>services.rdb</code> of <code>stoc/test/uriproc/makefile.mk</code>).<br />
{{Documentation/Note|Build Environment&nbsp;2.0 will not build directly to solver, but will make a module depend on the targets in the solver, and these are depending on the targets in the workdir (aka the old "local output tree"). Thus on an usual build in a module building and delivering are not two steps anymore. If tests depend on the target in the solver (which they will do automatically in most use cases, as linking against a library automatically creates a dependency on the library in the solver), they can be sure that the target is up to date in the solver '''and''' in the workdir.<br />
<br />
--[[User:B michaelsen|B michaelsen]] 06:32, 27 August 2010 (UTC)}}<br />
* '''TODO:''' Constructs like &ldquo;<code>-env:UNO_<var>&hellip;</var>=$(my_file)<var>&hellip;</var></code>&rdquo; would fail for problematic characters (spaces!) in paths.<br />
<br />
=== Smoke Test ===<br />
<br />
* Redesign <code>smoketestoo_native</code> to use CppUnit and pre-installed OOo.<br />
* [http://hg.services.openoffice.org/cws/sb118/rev/160b248247a0 &ldquo;changed <code>tools/debug</code> to never fall back from writing to shell to writing to file, and read <code>DBGSV_INIT</code> from <code>rtl::Bootstrap</code>; the latter causes problems if <code>tools/debug</code> is called from static code executing before <code>SAL_MAIN</code> has called <code>osl_setCommandArgs</code> &rarr; removed statics from code and added assertions to <code>osl/process</code>; various improvements to <code>smoketests.cxx</code> (incl. passing an appropriate <code>dbgsv.ini</code> for non-pro builds)&rdquo;] followed by [http://hg.services.openoffice.org/cws/sb118/rev/dbbacb9d2fd3 &ldquo;reverted parts of HG <code>-c&nbsp;160b248247a0</code> again: the &lsquo;static code executing before <code>SAL_MAIN</code>&rsquo; problem was too severe; instead, globally set <code>DBGSV_INIT</code> build env var to new <code>solenv/bin/dbgsv.ini</code>&rdquo;]; see also {{issue|109142}} &ldquo;Let assertions abort&rdquo;.<br />
* '''TODO:''' For <code>smoketestoo_native/makefile.mk</code> &ldquo;<code><nowiki>-env:arg-env=$(OOO_LIBRARY_PATH_VAR)"$${{$(OOO_LIBRARY_PATH_VAR)+=$$$(OOO_LIBRARY_PATH_VAR)}}"</nowiki></code>&rdquo; mechanism: <code>osl_executeProcess</code> <code>ustrEnvironments</code> members without &ldquo;<code>=</code>&rdquo;: all platforms; documentation; documentation of <code>osl_executeProcess_WithRedicrectedIO</code>.<br />
* '''TODO:''' <code>-headless</code>? (appears to still display windows on Windows and Mac OS&nbsp;X, however, see {{issue|109052}})<br />
* '''TODO:''' {{issue|113341}} &ldquo;-nofirststartwizard should disable update check&rdquo;<br />
<br />
=== Pre-Installed OOo ===<br />
<br />
* For Sun Hamburg Release Engineering, take MWS archive installation sets from &ldquo;S:&rdquo; instead of solver: [http://hg.services.openoffice.org/cws/sb118/rev/d5dbea724063 &ldquo;take installation set from <code>SHIPDRIVE</code> if appropriate&rdquo;].<br />
* '''TODO:''' <code>PKGFORMAT=installed</code> instead of <code>archive</code>?<br />
<br />
=== <code>unoapi</code> Tests ===<br />
<br />
* Known issues, open (not yet addressed at all; disabled for now on net-yet-integrated CWS; or fixed on not-yet-integrated CWS):<br />
** {{issue|114669}} &ldquo;forms/qa/unoapi forms.OListBoxControl crash&rdquo; (fixed on {{CWS|sb140}})<br />
** {{issue|116120}} &ldquo;vcl: TabControl::ImplGetTabRect negative height leads to X_CreatePixmap BadAlloc&rdquo; (fixed on {{CWS|vcl118}}, integrated into <code>DEV300_m101</code>)<br />
** {{issue|116125}} &ldquo;qadevOOo/qa/complex/junitskeleton failure&rdquo;<br />
** {{issue|116156}} &ldquo;toolkit/qa/unoapi crash in SwAccessibleMap::RemoveContext&rdquo;<br />
** {{issue|116192}} &ldquo;[sw] fixed text fields sometimes get updated&rdquo; (fixed on {{CWS|sw34bf03}}, integrated into <code>DEV300_m102</code>)<br />
** {{issue|116550}} &ldquo;toolkit/qa/unoapi crashes OOo in ~SwAccessibleParagraph vs. SwXTextDocument::close&rdquo;<br />
** {{issue|116583}} &ldquo;comphelper/qa/complex/comphelper failure&rdquo;<br />
** {{issue|116730}} &ldquo;vcl: crash with multiple threads in Window::ImplGrabFocus&rdquo;<br />
** {{issue|116733}} &ldquo;sw: crash in ~SwDrawContact (forms/qa/unoapi)&rdquo;<br />
** {{issue|117381}} &ldquo;ucb/qa/unoapi ucb.UniversalContentBroker::com::sun::star::ucb::XContentProviderManager::deregisterContentProvider() fails with gvfs&rdquo; (fixed on {{CWS|sb140}})<br />
** {{issue|117486}} &ldquo;toolkit/qa/complex/toolkit: "Window pos size wrong"&rdquo; (fixed on {{CWS|sb140}})<br />
** {{issue|117488}} &ldquo;sw/qa/unoapi: sw.SwXViewSettings::com::sun::star::text::ViewSettings::ShowOnlineLayout ShowOnlineLayout/ZoomValue failed&rdquo;<br />
** {{issue|117641}} &ldquo;chart2/qa/unoapi fails in sch.ChXDataPoint::com::sun::star::chart::ChartDataPointProperties due to change to jpeg/prj/d.lst&rdquo;<br />
** {{issue|117693}} &ldquo;xmlsecurity/qa/certext fails on wntmsci12 non-pro ("no OPENSSL_Applink")&rdquo;<br />
* Known issues, disabled for now:<br />
** {{issue|109517}} &ldquo;sc/qa/unoapi fails for ScAnnotationObj etc.&rdquo;<br />
** {{issue|109518}} &ldquo;sd/qa/unoapi crash in SfxViewShell::GetController&rdquo;<br />
** {{issue|109643}} &ldquo;toolkit/qa/unoapi tests fail when losing focus&rdquo;<br />
** {{issue|109728}} &ldquo;~ScAutoFormatObj uses cleared ScGlobal&rdquo;<br />
** {{issue|109917}} &ldquo;fragile unoapi test using OnUnfocus event&rdquo;<br />
** {{issue|109939}} &ldquo;toolkit: inconsistent UnoControl locking schemes&rdquo;<br />
** {{issue|110862}} &ldquo;sc/qa/unoapi fails for sc.ScDataPilotTableObj::com::sun::star::sheet::XDataPilotTable::refresh()&rdquo;<br />
** {{issue|110988}} &ldquo;svtools/qa/unoapi fails for svtools.AccessibleBrowseBox etc.&rdquo;<br />
** {{issue|111006}} &ldquo;toolkit: deadlock between UnoControls&rdquo;<br />
** {{issue|111032}} &ldquo;sc/qa/unoapi sc.ScAccessibleCell::com::sun::star::accessibility::XAccessibleText getCharacterBounds() failure&rdquo;<br />
** {{issue|111042}} &ldquo;sd/qa/unoapi sd::DrawController::dispose crash&rdquo;<br />
** {{issue|111043}} &ldquo;sd/qa/unoapi sd::DrawController_OutlineView NullPointerException&rdquo;<br />
** {{issue|111102}} &ldquo;chart2: ChartModelHelper::findDiagram returns null&rdquo;<br />
** {{issue|111111}} &ldquo;xmloff.Impress.XMLImporter::com::sun::star::document::XImporter&rdquo;<br />
** {{issue|111113}} &ldquo;toolkit.AccessibleStatusBarItem unoapi failure&rdquo;<br />
** {{issue|111148}} &ldquo;forms/qa/unoapi forms.OImageControlModel::com::sun::star::beans::XMultiPropertySet deadlock&rdquo;<br />
** {{issue|111169}} &ldquo;svx.AccessiblePageShape unoapi failure&rdquo;<br />
** {{issue|111170}} &ldquo;sun/i18n/qa/unoapi "creating a drawdoc" failure&rdquo;<br />
** {{issue|111178}} &ldquo;sw/qa/unoapi SwView::SelectShell crash&rdquo;<br />
** {{issue|111180}} &ldquo;framework/qa/unoapi fwk.Desktop::com::sun::star::frame::XComponentLoader::loadComponentFromURL() failure&rdquo;<br />
** {{issue|111182}} &ldquo;Desktop::terminate -> ~DropTarget -> _objc_error crash&rdquo;<br />
** {{issue|111184}} &ldquo;sal/qa/osl/pipe uses fixed pipe names&rdquo;<br />
** {{issue|111186}} &ldquo;sw/qa/unoapi sw.PageStyle::com::sun::star::beans::XPropertySet::setPropertyValue() failure&rdquo;<br />
** {{issue|111190}} &ldquo;sw/qa/unoapi sw.SwXShape failure&rdquo;<br />
** {{issue|111194}} &ldquo;sw/qa/unoapi sw.XMLExporter crash&rdquo;<br />
** {{issue|111195}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleScrollBar::com::sun::star::accessibility::XAccessibleValue::setCurrentValue() failure&rdquo;<br />
** {{issue|111197}} &ldquo;sw/qa/unoapi sw.SwAccessibleDocumentPageView failure&rdquo;<br />
** {{issue|111199}} &ldquo;sd/qa/unoapi sd.AccessibleOutlineView failure&rdquo;<br />
** {{issue|111200}} &ldquo;xmloff/qa/unoapi xmloff.Draw.XMLMetaImporter failure&rdquo;<br />
** {{issue|111216}} &ldquo;svx/qa/unoapi accessibility deadlock&rdquo;<br />
** {{issue|111218}} &ldquo;sw/qa/unoapi sw.SwAccessibleParagraphView::com::sun::star::accessibility::XAccessibleEventBroadcaster::removeEventListener() failure&rdquo;<br />
** {{issue|111220}} &ldquo;sw/qa/unoapi sw.XMLContentExporter::com::sun::star::document::XFilter::cancel() failure&rdquo;<br />
** {{issue|111224}} &ldquo;xmloff/qa/unoapi xmloff.Impress.XMLContentExporter crash&rdquo;<br />
** {{issue|111225}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleStatusBar failure&rdquo;<br />
** {{issue|111252}} &ldquo;svx/qa/unoapi svx.AccessibleOLEShape deadlock&rdquo;<br />
** {{issue|111273}} &ldquo;sw/qa/unoapi sw.SwXTextEmbeddedObject::com::sun::star::document::XEmbeddedObjectSupplier::getEmbeddedObject() crash&rdquo;<br />
** {{issue|111278}} &ldquo;svx/qa/unoapi svx.AccessibleEditableTextPara failure&rdquo;<br />
** {{issue|111283}} &ldquo;sfx2/qa/unoapi sfx.StandaloneDocumentInfo failure&rdquo;<br />
** {{issue|111285}} &ldquo;forms/qa/unoapi forms.OButtonModel failure&rdquo;<br />
** {{issue|111287}} &ldquo;xmloff/qa/unoapi XMLSettingsIm-/Exporter crash&rdquo;<br />
** {{issue|111329}} &ldquo;sd/qa/unoapi SdXCustomPresentationAccess::getElementNames/ImpEditEngine::OnlineSpellHdl hang&rdquo;<br />
** {{issue|111332}} &ldquo;sw/qa/unoapi sw.XMLStylesExporter::com::sun::star::document::XFilter crash&rdquo;<br />
** {{issue|111333}} &ldquo;forms/qa/unoapi forms.OImageControlControl::com::sun::star::awt::XControl deadlock&rdquo;<br />
** {{issue|112743}} &ldquo;starmath/qa/unoapi sm.XMLSettingsExporter failure&rdquo;<br />
** {{issue|112746}} &ldquo;framework/qa/unoapi fwk.ModuleManager failure (X11 BadWindow)&rdquo;<br />
** {{issue|112751}} &ldquo;testgraphical/qa/graphical failure&rdquo;<br />
** {{issue|112778}} &ldquo;xmloff/qa/unoapi xmloff.Draw.XMLContentExporter failure&rdquo;<br />
** {{issue|113020}} &ldquo;sw/qa/unoapi sw.SwXTextGraphicObject::com::sun::star::beans::XPropertySet failure&rdquo;<br />
** {{issue|113103}} &ldquo;chart2: deadlock between DiagramHelper and Diagram&rdquo;<br />
** {{issue|113136}} &ldquo;sw/qa/unoapi sw.SwAccessibleParagraphView::com::sun::star::accessibility::XAccessibleEditableText failure&rdquo;<br />
** {{issue|113142}} &ldquo;sw/qa/unoapi SwAccessibleContext::RemoveFrmFromAccessibleMap crash&rdquo;<br />
** {{issue|113161}} &ldquo;sd/qa/unoapi sd.SdLayer::com::sun::star::drawing::Layer::IsVisible failure&rdquo;<br />
** {{issue|113201}} &ldquo;forms/qa/unoapi forms.OEditModel::com::sun::star::form::validation::XValidatableFormComponent failure&rdquo;<br />
** {{issue|113245}} &ldquo;framework/qa/unoapi fwl.TypeDetection failure&rdquo;<br />
** {{issue|113306}} &ldquo;sfx2/qa/unoapi sfx.DocumentTemplates failure&rdquo;<br />
** {{issue|113386}} &ldquo;sd/qa/unoapi sd.AccessibleDrawDocumentView::com::sun::star::accessibility::XAccessibleComponent::containsPoint() failure&rdquo;<br />
** {{issue|113489}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleMenu{,Bar,Separator} failures&rdquo;<br />
** {{issue|114205}} &ldquo;sw/qa/unoapi sw.SwAccessibleParagraphView::com::sun::star::accessibility::XAccessibleText::copyText() failed&rdquo;<br />
** {{issue|114209}} &ldquo;forms/qa/unoapi forms.OGridControlModel::com::sun::star::view::XSelectionSupplier crash&rdquo;<br />
** {{issue|114211}} &ldquo;xmloff/qa/unoapi xmloff.Draw.XMLStylesImporter::com::sun::star::lang::XInitialization crash&rdquo;<br />
** {{issue|114213}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleMenu::com::sun::star::accessibility::XAccessibleSelection failure&rdquo;<br />
** {{issue|114636}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleScrollBar::com::sun::star::accessibility::XAccessibleAction failure&rdquo;<br />
** {{issue|114637}} &ldquo;sw/qa/unoapi sw.SwAccessibleFootnoteView(?) crash&rdquo;<br />
** {{issue|114642}} &ldquo;svx/qa/unoapi svx: svx.SvxUnoTextContent::com::sun::star::style::CharacterProperties crash&rdquo;<br />
** {{issue|114889}} &ldquo;sw/qa/unoapi sw.SwXTextViewCursor::com::sun::star::view::XScreenCursor&rdquo;<br />
** {{issue|116784}} &ldquo;[sfx2] CheckGlobalEventBroadcaster_writer1 fails&rdquo;<br />
** {{issue|116813}} &ldquo;[sfx2] complex.sfx2.UndoManager checkBrokenScripts fails&rdquo;<br />
** {{issue|116814}} &ldquo;[toolkit] unoapi test UnoControlDialogModel: XCloneable fails&rdquo;<br />
* Missing tests:<br />
** {{issue|109564}} &ldquo;qadevOOo/tests/java/ifc/awt/_XSystemChildFactory.java&rdquo;<br />
* Sporadic failures:<br />
** {{issue|111217}} &ldquo;BasicManager::SetGlobalUNOConstant crash during shutdown&rdquo;<br />
** {{issue|111246}} &ldquo;svx::FontHeightToolBoxControl::statusChanged crash (memory corruption)&rdquo;<br />
** {{issue|111271}} &ldquo;Mac OS X: crash during shutdown, __tcf_2 on stack&rdquo;<br />
** {{issue|111400}} &ldquo;Extension Manager does not join spawned uno process (-> smoketestoo_native fails)&rdquo;<br />
** {{issue|112070}} &ldquo;UNO API tests must not use random&rdquo;<br />
** {{issue|113158}} &ldquo;crash with two threads in framework::ToolBarManager dtor&rdquo;<br />
** {{issue|113197}} &ldquo;sw/qa/unoapi sw.SwXTextRange hangs&rdquo;<br />
** {{issue|113367}} &ldquo;sysdtrans deadlock during shutdown&rdquo;<br />
** {{issue|113464}} &ldquo;stoc_smgr::ORegistryServiceManager::dispose crash during shutdown&rdquo;<br />
** {{issue|114207}} &ldquo;framework::ModuleUIConfigurationManager::dispose crash during shutdown&rdquo;<br />
** {{issue|114675}} &ldquo;binary URP bridge race on shut down, crash&rdquo;<br />
** {{issue|114718}} &ldquo;forms/qa/unoapi: crash in remote async release call&rdquo;<br />
** {{issue|116131}} &ldquo;vcl: message unregisterDraggingDestinationHandler: sent to freed object&rdquo;<br />
<br />
[[Category:Effort]][[Category:Test]]</div>Sbhttps://wiki.openoffice.org/wiki/Uno/Java/Specifications/Type_MappingUno/Java/Specifications/Type Mapping2011-04-06T14:30:27Z<p>Sb: /* Mapping Values of Type ANY */</p>
<hr />
<div>Mapping between Uno and Java Types<br />
<br />
See [http://udk.openoffice.org/common/man/typesystem.html UNO Type System] for a specification of the UNO type system and some related terms.<br />
<br />
==Mapping Types==<br />
The mapping between UNO types and Java types is as follows:<br />
* <code>VOID</code>: <code>void</code>.<br />
* <code>BOOLEAN</code>: <code>boolean</code>.<br />
* <code>BYTE</code>: <code>byte</code>.<br />
* <code>SHORT</code>: <code>short</code>.<br />
* <code>UNSIGNED SHORT</code>: <code>short</code>. (UNO 2<SUP>15</SUP> maps to Java &minus;2<SUP>15</SUP>, &hellip;, UNO 2<SUP>16</SUP>&nbsp;&minus;&nbsp;1 maps to Java &minus;1.)<br />
* <code>LONG</code>: <code>int</code>.<br />
* <code>UNSIGNED LONG</code>: <code>int</code>. (UNO 2<SUP>31</SUP> maps to Java &minus;2<SUP>31</SUP>, &hellip;, UNO 2<SUP>32</SUP>&nbsp;&minus;&nbsp;1 maps to Java &minus;1.)<br />
* <code>HYPER</code>: <code>long</code>.<br />
* <code>UNSIGNED HYPER</code>: <code>long</code>. (UNO 2<SUP>63</SUP> maps to Java &minus;2<SUP>63</SUP>, &hellip;, UNO 2<SUP>64</SUP>&nbsp;&minus;&nbsp;1 maps to Java &minus;1.)<br />
* <code>FLOAT</code>: <code>float</code>.<br />
* <code>DOUBLE</code>: <code>double</code>.<br />
* <code>CHAR</code>: <code>char</code>.<br />
* <code>STRING</code>: <code>java.lang.String</code>. (Only non-null references are valid values.)<br />
* <code>TYPE</code>: <code>com.sun.star.uno.Type</code>. (Only non-null references are valid values.)<br />
* <code>ANY</code>: <code>java.lang.Object</code>. (See Section [http://udk.openoffice.org/java/man/types.html#mapany Mapping Values of Type ANY] for a discussion of valid values.)<br />
* Sequence type of component type T: array of mapped type T′, where T′ is recursively defined by this list. (Only non-null references are valid values.)<br />
* Enum type named&nbsp;<VAR>N</VAR>: class type named&nbsp;<VAR>N</VAR>&prime;, extending com.sun.star.uno.Enum. (Only non-null references are valid values.)<br />
* Struct type named&nbsp;<VAR>N</VAR>, possibly derived from a base struct type named&nbsp;<VAR>N2</VAR>: class type named&nbsp;<VAR>N</VAR>&prime, extending (a)&nbsp;the mapped type&nbsp;<VAR>N2</VAR>&prime; in case <VAR>N</VAR> is derived from&nbsp;<VAR>N2</VAR>, or (b)&nbsp;<CODE>java.lang.Object</CODE> otherwise. (Only non-null references are valid values.)<br />
* Exception type named&nbsp;<VAR>N</VAR>, possibly derived from a base exception type named&nbsp;<VAR>N2</VAR>: class type named&nbsp;<VAR>N</VAR>&prime;, extending (a)&nbsp;<CODE>java.lang.Exception</CODE> if <VAR>N</VAR> is <CODE>com.sun.star.uno.Exception</CODE>, or (b)&nbsp;<CODE>java.lang.RuntimeException</CODE> if <VAR>N</VAR> is <CODE>com.sun.star.uno.RuntimeException</CODE>, or (c)&nbsp;the mapped type&nbsp;<VAR>N2</VAR>&prime; in case <VAR>N</VAR> is derived from&nbsp;<VAR>N2</VAR>. (Only non-null references are valid values.)<br />
* Interface type named&nbsp;<VAR>N</VAR>, with direct bases named <VAR>N</VAR><SUB>1</SUB>, &hellip;, <VAR>N</VAR><SUB><VAR>k</VAR></SUB>, <VAR>k</VAR> &ge; 0: interface type named&nbsp;<VAR>N</VAR>&prime;, extending the mapped types <VAR>N</VAR><SUB>1</SUB>&prime;, &hellip;, <VAR>N</VAR><SUB><VAR>k</VAR></SUB>&prime;. The interface type named <CODE>com.sun.star.uno.XInterface</CODE> is special: Only when that type is used as a base type of another interface type is it mapped to the Java type <CODE>com.sun.star.uno.XInterface</CODE>. In all other cases (when used as the component type of a sequence type, as a member of a struct or exception type, or as a parameter or return value of an interface method) it is mapped to the Java type <CODE>java.lang.Object</CODE>. (See Section [http://udk.openoffice.org/java/man/types.html#mapvalue Mapping Values] for a discussion of valid values.)<br />
<br />
==Mapping Values==<br />
Values of type <code>VOID</code> are not mapped (type <code>VOID</code> is only used in two places: as a return type for interface methods, where it denotes no return value&mdash;see Section [http://udk.openoffice.org/java/man/types.html#iface Interface Methods]; and as a possible type contained in a value of type <code>ANY</code>—see Section [http://udk.openoffice.org/java/man/types.html#mapany Mapping Values of Type ANY]).<br />
<br />
Values of type <code>BOOLEAN</code>, <code>BYTE</code>, <code>SHORT</code>, <code>LONG</code>, <code>HYPER</code>, <code>FLOAT</code>, <code>DOUBLE</code>, and <code>CHAR</code> are mapped directly to values of the corresponding Java types.<br />
<br />
Values of type <code>UNSIGNED SHORT</code>, <code>UNSIGNED LONG</code>, and <code>UNSIGNED HYPER</code> are mapped to values of the corresponding (signed) Java types, modulo 2<SUP><VAR>N</VAR></SUP>.<br />
<br />
Values of type <code>STRING</code> are mapped to non-null references to <code>java.lang.String</code>.<br />
<br />
Values of type <code>TYPE</code> are mapped to non-null references to <code>com.sun.star.uno.Type</code>.<br />
<br />
Values of sequence types are mapped to non-null references to the corresponding Java array types. (Non-null references to other array types that are assignment compatible to those types may also be used, but that can cause <code>java.lang.ArrayStoreExceptions</code>.)<br />
<br />
Values of enum types, struct types, and exception types are mapped to non-null references to the corresponding Java class types.<br />
<br />
Values of interface types (i.e., the null reference plus references to UNO objects implementing those interfaces) are mapped to references to Java objects that implement (directly, or indirectly through inheritance) the corresponding Java interface types and that do not extend any of <code>com.sun.star.uno.Any</code>, <code>com.sun.star.uno.Enum</code>, com.sun.star.uno.Type</code>, and <code>java.lang.Throwable</code>. Particularly, the UNO null reference maps to the Java null reference. Even though <code>com.sun.star.uno.XInterface</code> is mapped to <code>java.lang.Object</code> in certain cases (see Section [http://udk.openoffice.org/java/man/types.html#maptype Mapping Types]), valid Java values of that type are only the Java null reference and references to those instances of <code>java.lang.Object</code> that implement <code>com.sun.star.uno.XInterface</code> and do not extend any of <code>com.sun.star.uno.Any</code>, <code>com.sun.star.uno.Enum</code>, <code>com.sun.star.uno.Type</code>, and <code>java.lang.Throwable</code>.<br />
<br />
===Mapping Values of Type <code>ANY</code>===<br />
Generally, there is a mapping between UNO <CODE>ANY</code> values and instances of the Java class type <CODE>com.sun.star.uno.Any</code>. Conceptionally, for a UNO <CODE>ANY</code> represented as &lang;<VAR>t</VAR>,&nbsp;<VAR>v</VAR>&rang; (where <VAR>t</VAR> is of type<br />
<CODE>TYPE</CODE> and <VAR>v</VAR> is of type&nbsp;<VAR>t</VAR>), the<br />
corresponding <CODE>com.sun.star.uno.Any</CODE> instance can be represented as<br />
&lang;<VAR>t</VAR>&prime;,&nbsp;<VAR>v</VAR>&prime;&rang; (where<br />
<VAR>t</VAR>&prime; is of type <CODE>com.sun.star.uno.Type</CODE> and<br />
<VAR>v</VAR>&prime; is of type <CODE>java.lang.Object</CODE>). Given a<br />
type&nbsp;<VAR>t</VAR> (which cannot be <CODE>ANY</CODE>), the general mapping<br />
between <VAR>v</VAR> and <VAR>v</VAR>&prime; is as follows:<br />
* <CODE>VOID</CODE>: no mapping of values (this is where the concept breaks that <CODE>com.sun.star.uno.Any</CODE> is represented as &lang;<VAR>t</VAR>&prime;,&nbsp;<VAR>v</VAR>&prime;&rang;).<br />
* <code>BOOLEAN</code>: non-null references to java.lang.Boolean.<br />
* <code>BYTE</code>: non-null references to java.lang.Byte.<br />
* <code>SHORT</code>: non-null references to java.lang.Short.<br />
* <code>UNSIGNED SHORT</code>: non-null references to java.lang.Short. (UNO 2<SUP>15</SUP>maps to Java &minus;2<SUP>15</SUP>, &hellip;, UNO 2<SUP>16</SUP>&nbsp;&minus;&nbsp;1 maps to Java &minus;1.)<br />
* <code>LONG</code>: non-null references to java.lang.Integer.<br />
* <code>UNSIGNED LONG</code>: non-null references to java.lang.Integer. (UNO 2<SUP>31</SUP> maps to Java &minus;2<SUP>31</SUP>, &hellip;, UNO 2<SUP>32</SUP>&nbsp;&minus;&nbsp;1 maps to Java &minus;1.)<br />
* <code>HYPER</code>: non-null references to java.lang.Long.<br />
* <code>UNSIGNED HYPER</code>: non-null references to java.lang.Long. (UNO 2<SUP>63</SUP> maps to Java &minus;2<SUP>63</SUP>, &hellip;, UNO 2<SUP>64</SUP>&nbsp;&minus;&nbsp;1 maps to Java &minus;1.)<br />
* <code>FLOAT</code>: non-null references to java.lang.Float.<br />
* <code>DOUBLE</code>: non-null references to java.lang.Double.<br />
* <code>CHAR</code>: non-null references to java.lang.Character.<br />
* <code>STRING</code>: non-null references to java.lang.String.<br />
* <code>TYPE</code>: non-null references to com.sun.star.uno.Type.<br />
* Sequence type of component type&nbsp;<VAR>T</VAR>: non-null references to arrays of mapped type&nbsp;<VAR>T</VAR>&prime;, where <VAR>T</VAR>&prime; is as defined in Section [http://udk.openoffice.org/java/man/types.html#maptype Mapping Types]. (Non-null references to other array types that are assignment compatible to <VAR>T</VAR>&prime;<CODE>[]</CODE> may also be used, but that can cause <CODE>java.lang.ArrayStoreException</CODE>s.)<br />
* Enum type named&nbsp;<VAR>N</VAR>: non-null references to mapped type&nbsp;<VAR>N</VAR>&prime;.<br />
* Struct type named&nbsp;<VAR>N</VAR>: non-null references to mapped type&nbsp;<VAR>N</VAR>&prime;.<br />
* Exception type named&nbsp;<VAR>N</VAR>: non-null references to mapped type&nbsp;<VAR>N</VAR>&prime;.<br />
* Interface type named&nbsp;<VAR>N</VAR>: references to classes implementing the mapped type&nbsp;<VAR>N</VAR>&prime;.<br />
<br />
For certain UNO <CODE>ANY</CODE> values &lang;<VAR>t</VAR>,&nbsp;<VAR>v</VAR>&rang;, the corresponding Java value (which would generally be an instance of <CODE>com.sun.star.uno.Any</CODE> represented as &lang;<VAR>t</VAR>&prime;,&nbsp;<VAR>v</VAR>&prime;&rang;) can also be shortcut to&nbsp;<VAR>v</VAR>&prime;. This holds when <VAR>t</VAR> is any of the following:<br />
* Any of <CODE>BOOLEAN</CODE>, <CODE>BYTE</CODE>, <CODE>SHORT</CODE>, <CODE>LONG</CODE>, <CODE>HYPER</CODE>, <CODE>FLOAT</CODE>, <CODE>DOUBLE</CODE>, <CODE>CHAR</CODE>, <CODE>STRING</CODE>, or <CODE>TYPE</CODE>.<br />
* Any sequence type whose component type is contained in the following list:<br />
** Any of <CODE>BOOLEAN</CODE>, <CODE>BYTE</CODE>, <CODE>SHORT</CODE>, <CODE>LONG</CODE>, <CODE>HYPER</CODE>, <CODE>FLOAT</CODE>, <CODE>DOUBLE</CODE>, <CODE>CHAR</CODE>, or <CODE>STRING</CODE>.<br />
** <CODE>TYPE</CODE>, provided that the Java array value&nbsp;<VAR>v</VAR>&prime; is exactly of the corresponding Java array type&nbsp;<VAR>t</VAR>&prime;, not of another, assignment-compatible array type. (Unfortunately, the Java type <CODE>com.sun.star.uno.Type</CODE> is not final.)<br />
** <CODE>ANY</CODE>, provided that the Java array value&nbsp;<VAR>v</VAR>&prime; is exactly of a Java array type with a base component type of either <CODE>java.lang.Object</CODE> or <CODE>com.sun.star.uno.Any</CODE>, not of another, assignment-compatible array type.<br />
** Any sequence type whose component type is recursively contained in this list.<br />
** Any enum type, plain struct type, or exception type, provided that the Java array value&nbsp;<VAR>v</VAR>&prime; is exactly of the corresponding Java array type&nbsp;<VAR>t</VAR>&prime;, not of another, assignment-compatible array type.<br />
** Any interface type named&nbsp;<VAR>N</VAR>, provided that the Java array value&nbsp;<VAR>v</VAR>&prime; is exactly of a Java array type with a base component type of <VAR>N</VAR>&prime;, not of another, assignment-compatible array type. If <VAR>N</VAR> is <CODE>com.sun.star.uno.XInterface</CODE>, the corresponding <VAR>N</VAR>&prime; is the Java interface type <CODE>com.sun.star.uno.XInterface</CODE>, not <CODE>java.lang.Object</CODE>.<br />
* Any enum type, plain struct type, or exception type, provided that theJava value&nbsp;<VAR>v</VAR>&prime; is exactly of the corresponding type&nbsp;<VAR>t</VAR>&prime;, not of another, assignment-compatible type.<br />
* The interface type named <code>com.sun.star.uno.XInterface</code>.<br />
<br />
This is an optimization, avoiding creation of instances of class <code>com.sun.star.uno.Any</code>.<br />
<br />
;Examples: A UNO <code>ANY</code> containing the value 5 of type <code>LONG</code> can be mapped either<br />
* to an instance of <code>com.sun.star.uno.Any</code>, containing a <code>java.lang.Integer</code> of value 5, or<br />
* directly to an instance of <code>java.lang.Integer</code> containing 5.<br />
<br />
A UNO <code>ANY</code> containing a sequence of type <code>LONG</code> with one element of value 5 can be mapped either<br />
* to an instance of <code>com.sun.star.uno.Any</code>, containing an <code>int[]</code> with one element of value 5, or<br />
* directly to an instance of <code>int[]</code> with one element of value 5,<br />
but it cannot be mapped to an instance of <code>java.lang.Integer[]</code> (or a <code>com.sun.star.uno.Any</code> containing a <code>java.lang.Integer[]</code>).<br />
<br />
A UNO <code>ANY</code> containing the null reference to the interface type named <code>com.sun.star.uno.XInterface</code> can be mapped either<br />
* to an instance of <code>com.sun.star.uno.Any</code>, containing the Java value null, or<br />
* directly to the Java value null.<br />
<br />
But a UNO <code>ANY</code> containing the null reference to some interface type other than <code>com.sun.star.uno.XInterface</code> must always be mapped as an instance of <code>com.sun.star.uno.Any</code>.<br />
<br />
A UNO <code>ANY</code> containing a sequence of interface type <code>com.sun.star.uno.XInterface</code>, which in turn has as a single element the null reference, can be mapped either<br />
* to an instance of <code>com.sun.star.uno.Any</code>, containing a <code>java.lang.Object[]</code> with one element of value null, or<br />
* to an instance of <code>com.sun.star.uno.Any</code>, containing a <code>com.sun.star.uno.XInterface[]</code> with one element of value null, or<br />
* directly to an instance of <code>com.sun.star.uno.XInterface[]</code> with one element of value null,<br />
but it cannot be mapped to a plain instance of <code>java.lang.Object[]</code>.<br />
<br />
A UNO <code>ANY</code> containing a sequence of type <code>ANY</code> can be mapped either<br />
* to an instance of <code>com.sun.star.uno.Any</code>, containing a <code>java.lang.Object[]</code>, or<br />
* to an instance of <code>com.sun.star.uno.Any</code>, containing a <code>com.sun.star.uno.Any[]</code>, or<br />
* directly to an instance of <code>java.lang.Object[]</code>, or<br />
* directly to an instance of <code>com.sun.star.uno.Any[]</code>.<br />
<br />
==Interface Methods==<br />
UNO interface methods use types for the ''return value'', any ''parameters'', and any ''exception specifications''. The return<br />
value must be of non-exception type, the parameters must be of non-void, non-exception types, and the exception specifications must be of exception<br />
types. Parameters may be ''in'', ''out'', or ''in-out'' parameters. Generally, the mapping of types and values used in interface methods is as described in Section [http://udk.openoffice.org/java/man/types.html#mapvalue Mapping Values], but out and in-out parameters need further special handling.<br />
<br />
Out and in-out parameters of type&nbsp;<VAR>T</VAR> are mapped to Java arrays of mapped type&nbsp;<VAR>T</VAR>&prime; (see Section [http://udk.openoffice.org/java/man/types.html#maptype Mapping Types]). At runtime, the (Java) argument will be a non-null reference to an array of exactly the mapped type&nbsp;<VAR>T</VAR>&prime; (not another, assignment-compatible type) and length at least&nbsp;1. For in-out parameters, the value of the first element will be the (Java-mapped) in argument; for out parameters, the value of the first element will be undefined. Upon normal return (i.e., no exception is thrown), the first element of that array must contain the (Java-mapped) out argument.<br />
<br />
<br />
[[Category:Uno]]<br />
[[Category:Uno:Java]]<br />
[[Category:Spec]]</div>Sbhttps://wiki.openoffice.org/wiki/Uno/Java/Specifications/Type_MappingUno/Java/Specifications/Type Mapping2011-04-06T14:29:37Z<p>Sb: /* Mapping Values of Type ANY */</p>
<hr />
<div>Mapping between Uno and Java Types<br />
<br />
See [http://udk.openoffice.org/common/man/typesystem.html UNO Type System] for a specification of the UNO type system and some related terms.<br />
<br />
==Mapping Types==<br />
The mapping between UNO types and Java types is as follows:<br />
* <code>VOID</code>: <code>void</code>.<br />
* <code>BOOLEAN</code>: <code>boolean</code>.<br />
* <code>BYTE</code>: <code>byte</code>.<br />
* <code>SHORT</code>: <code>short</code>.<br />
* <code>UNSIGNED SHORT</code>: <code>short</code>. (UNO 2<SUP>15</SUP> maps to Java &minus;2<SUP>15</SUP>, &hellip;, UNO 2<SUP>16</SUP>&nbsp;&minus;&nbsp;1 maps to Java &minus;1.)<br />
* <code>LONG</code>: <code>int</code>.<br />
* <code>UNSIGNED LONG</code>: <code>int</code>. (UNO 2<SUP>31</SUP> maps to Java &minus;2<SUP>31</SUP>, &hellip;, UNO 2<SUP>32</SUP>&nbsp;&minus;&nbsp;1 maps to Java &minus;1.)<br />
* <code>HYPER</code>: <code>long</code>.<br />
* <code>UNSIGNED HYPER</code>: <code>long</code>. (UNO 2<SUP>63</SUP> maps to Java &minus;2<SUP>63</SUP>, &hellip;, UNO 2<SUP>64</SUP>&nbsp;&minus;&nbsp;1 maps to Java &minus;1.)<br />
* <code>FLOAT</code>: <code>float</code>.<br />
* <code>DOUBLE</code>: <code>double</code>.<br />
* <code>CHAR</code>: <code>char</code>.<br />
* <code>STRING</code>: <code>java.lang.String</code>. (Only non-null references are valid values.)<br />
* <code>TYPE</code>: <code>com.sun.star.uno.Type</code>. (Only non-null references are valid values.)<br />
* <code>ANY</code>: <code>java.lang.Object</code>. (See Section [http://udk.openoffice.org/java/man/types.html#mapany Mapping Values of Type ANY] for a discussion of valid values.)<br />
* Sequence type of component type T: array of mapped type T′, where T′ is recursively defined by this list. (Only non-null references are valid values.)<br />
* Enum type named&nbsp;<VAR>N</VAR>: class type named&nbsp;<VAR>N</VAR>&prime;, extending com.sun.star.uno.Enum. (Only non-null references are valid values.)<br />
* Struct type named&nbsp;<VAR>N</VAR>, possibly derived from a base struct type named&nbsp;<VAR>N2</VAR>: class type named&nbsp;<VAR>N</VAR>&prime, extending (a)&nbsp;the mapped type&nbsp;<VAR>N2</VAR>&prime; in case <VAR>N</VAR> is derived from&nbsp;<VAR>N2</VAR>, or (b)&nbsp;<CODE>java.lang.Object</CODE> otherwise. (Only non-null references are valid values.)<br />
* Exception type named&nbsp;<VAR>N</VAR>, possibly derived from a base exception type named&nbsp;<VAR>N2</VAR>: class type named&nbsp;<VAR>N</VAR>&prime;, extending (a)&nbsp;<CODE>java.lang.Exception</CODE> if <VAR>N</VAR> is <CODE>com.sun.star.uno.Exception</CODE>, or (b)&nbsp;<CODE>java.lang.RuntimeException</CODE> if <VAR>N</VAR> is <CODE>com.sun.star.uno.RuntimeException</CODE>, or (c)&nbsp;the mapped type&nbsp;<VAR>N2</VAR>&prime; in case <VAR>N</VAR> is derived from&nbsp;<VAR>N2</VAR>. (Only non-null references are valid values.)<br />
* Interface type named&nbsp;<VAR>N</VAR>, with direct bases named <VAR>N</VAR><SUB>1</SUB>, &hellip;, <VAR>N</VAR><SUB><VAR>k</VAR></SUB>, <VAR>k</VAR> &ge; 0: interface type named&nbsp;<VAR>N</VAR>&prime;, extending the mapped types <VAR>N</VAR><SUB>1</SUB>&prime;, &hellip;, <VAR>N</VAR><SUB><VAR>k</VAR></SUB>&prime;. The interface type named <CODE>com.sun.star.uno.XInterface</CODE> is special: Only when that type is used as a base type of another interface type is it mapped to the Java type <CODE>com.sun.star.uno.XInterface</CODE>. In all other cases (when used as the component type of a sequence type, as a member of a struct or exception type, or as a parameter or return value of an interface method) it is mapped to the Java type <CODE>java.lang.Object</CODE>. (See Section [http://udk.openoffice.org/java/man/types.html#mapvalue Mapping Values] for a discussion of valid values.)<br />
<br />
==Mapping Values==<br />
Values of type <code>VOID</code> are not mapped (type <code>VOID</code> is only used in two places: as a return type for interface methods, where it denotes no return value&mdash;see Section [http://udk.openoffice.org/java/man/types.html#iface Interface Methods]; and as a possible type contained in a value of type <code>ANY</code>—see Section [http://udk.openoffice.org/java/man/types.html#mapany Mapping Values of Type ANY]).<br />
<br />
Values of type <code>BOOLEAN</code>, <code>BYTE</code>, <code>SHORT</code>, <code>LONG</code>, <code>HYPER</code>, <code>FLOAT</code>, <code>DOUBLE</code>, and <code>CHAR</code> are mapped directly to values of the corresponding Java types.<br />
<br />
Values of type <code>UNSIGNED SHORT</code>, <code>UNSIGNED LONG</code>, and <code>UNSIGNED HYPER</code> are mapped to values of the corresponding (signed) Java types, modulo 2<SUP><VAR>N</VAR></SUP>.<br />
<br />
Values of type <code>STRING</code> are mapped to non-null references to <code>java.lang.String</code>.<br />
<br />
Values of type <code>TYPE</code> are mapped to non-null references to <code>com.sun.star.uno.Type</code>.<br />
<br />
Values of sequence types are mapped to non-null references to the corresponding Java array types. (Non-null references to other array types that are assignment compatible to those types may also be used, but that can cause <code>java.lang.ArrayStoreExceptions</code>.)<br />
<br />
Values of enum types, struct types, and exception types are mapped to non-null references to the corresponding Java class types.<br />
<br />
Values of interface types (i.e., the null reference plus references to UNO objects implementing those interfaces) are mapped to references to Java objects that implement (directly, or indirectly through inheritance) the corresponding Java interface types and that do not extend any of <code>com.sun.star.uno.Any</code>, <code>com.sun.star.uno.Enum</code>, com.sun.star.uno.Type</code>, and <code>java.lang.Throwable</code>. Particularly, the UNO null reference maps to the Java null reference. Even though <code>com.sun.star.uno.XInterface</code> is mapped to <code>java.lang.Object</code> in certain cases (see Section [http://udk.openoffice.org/java/man/types.html#maptype Mapping Types]), valid Java values of that type are only the Java null reference and references to those instances of <code>java.lang.Object</code> that implement <code>com.sun.star.uno.XInterface</code> and do not extend any of <code>com.sun.star.uno.Any</code>, <code>com.sun.star.uno.Enum</code>, <code>com.sun.star.uno.Type</code>, and <code>java.lang.Throwable</code>.<br />
<br />
===Mapping Values of Type <code>ANY</code>===<br />
Generally, there is a mapping between UNO <CODE>ANY</code> values and instances of the Java class type <CODE>com.sun.star.uno.Any</code>. Conceptionally, for a UNO <CODE>ANY</code> represented as &lang;<VAR>t</VAR>,&nbsp;<VAR>v</VAR>&rang; (where <VAR>t</VAR> is of type<br />
<CODE>TYPE</CODE> and <VAR>v</VAR> is of type&nbsp;<VAR>t</VAR>), the<br />
corresponding <CODE>com.sun.star.uno.Any</CODE> instance can be represented as<br />
&lang;<VAR>t</VAR>&prime;,&nbsp;<VAR>v</VAR>&prime;&rang; (where<br />
<VAR>t</VAR>&prime; is of type <CODE>com.sun.star.uno.Type</CODE> and<br />
<VAR>v</VAR>&prime; is of type <CODE>java.lang.Object</CODE>). Given a<br />
type&nbsp;<VAR>t</VAR> (which cannot be <CODE>ANY</CODE>), the general mapping<br />
between <VAR>v</VAR> and <VAR>v</VAR>&prime; is as follows:<br />
* <CODE>VOID</CODE>: no mapping of values (this is where the concept breaks that <CODE>com.sun.star.uno.Any</CODE> is represented as &lang;<VAR>t</VAR>&prime;,&nbsp;<VAR>v</VAR>&prime;&rang;).<br />
* <code>BOOLEAN</code>: non-null references to java.lang.Boolean.<br />
* <code>BYTE</code>: non-null references to java.lang.Byte.<br />
* <code>SHORT</code>: non-null references to java.lang.Short.<br />
* <code>UNSIGNED SHORT</code>: non-null references to java.lang.Short. (UNO 2<SUP>15</SUP>maps to Java &minus;2<SUP>15</SUP>, &hellip;, UNO 2<SUP>16</SUP>&nbsp;&minus;&nbsp;1 maps to Java &minus;1.)<br />
* <code>LONG</code>: non-null references to java.lang.Integer.<br />
* <code>UNSIGNED LONG</code>: non-null references to java.lang.Integer. (UNO 2<SUP>31</SUP> maps to Java &minus;2<SUP>31</SUP>, &hellip;, UNO 2<SUP>32</SUP>&nbsp;&minus;&nbsp;1 maps to Java &minus;1.)<br />
* <code>HYPER</code>: non-null references to java.lang.Long.<br />
* <code>UNSIGNED HYPER</code>: non-null references to java.lang.Long. (UNO 2<SUP>63</SUP> maps to Java &minus;2<SUP>63</SUP>, &hellip;, UNO 2<SUP>64</SUP>&nbsp;&minus;&nbsp;1 maps to Java &minus;1.)<br />
* <code>FLOAT</code>: non-null references to java.lang.Float.<br />
* <code>DOUBLE</code>: non-null references to java.lang.Double.<br />
* <code>CHAR</code>: non-null references to java.lang.Character.<br />
* <code>STRING</code>: non-null references to java.lang.String.<br />
* <code>TYPE</code>: non-null references to com.sun.star.uno.Type.<br />
* Sequence type of component type&nbsp;<VAR>T</VAR>: non-null references to arrays of mapped type&nbsp;<VAR>T</VAR>&prime;, where <VAR>T</VAR>&prime; is as defined in Section [http://udk.openoffice.org/java/man/types.html#maptype Mapping Types]. (Non-null references to other array types that are assignment compatible to <VAR>T</VAR>&prime;<CODE>[]</CODE> may also be used, but that can cause <CODE>java.lang.ArrayStoreException</CODE>s.)<br />
* Enum type named&nbsp;<VAR>N</VAR>: non-null references to mapped type&nbsp;<VAR>N</VAR>&prime;.<br />
* Struct type named&nbsp;<VAR>N</VAR>: non-null references to mapped type&nbsp;<VAR>N</VAR>&prime;.<br />
* Exception type named&nbsp;<VAR>N</VAR>: non-null references to mapped type&nbsp;<VAR>N</VAR>&prime;.<br />
* Interface type named&nbsp;<VAR>N</VAR>: references to classes implementing the mapped type&nbsp;<VAR>N</VAR>&prime;.<br />
<br />
For certain UNO <CODE>ANY</CODE> values &lang;<VAR>t</VAR>,&nbsp;<VAR>v</VAR>&rang;, the corresponding Java value (which would generally be an instance of <CODE>com.sun.star.uno.Any</CODE> represented as &lang<VAR>t</VAR>&prime;,&nbsp;<VAR>v</VAR>&prime;&rang;) can also be shortcut to&nbsp;<VAR>v</VAR>&prime;. This holds when <VAR>t</VAR> is any of the following:<br />
* Any of <CODE>BOOLEAN</CODE>, <CODE>BYTE</CODE>, <CODE>SHORT</CODE>, <CODE>LONG</CODE>, <CODE>HYPER</CODE>, <CODE>FLOAT</CODE>, <CODE>DOUBLE</CODE>, <CODE>CHAR</CODE>, <CODE>STRING</CODE>, or <CODE>TYPE</CODE>.<br />
* Any sequence type whose component type is contained in the following list:<br />
** Any of <CODE>BOOLEAN</CODE>, <CODE>BYTE</CODE>, <CODE>SHORT</CODE>, <CODE>LONG</CODE>, <CODE>HYPER</CODE>, <CODE>FLOAT</CODE>, <CODE>DOUBLE</CODE>, <CODE>CHAR</CODE>, or <CODE>STRING</CODE>.<br />
** <CODE>TYPE</CODE>, provided that the Java array value&nbsp;<VAR>v</VAR>&prime; is exactly of the corresponding Java array type&nbsp;<VAR>t</VAR>&prime;, not of another, assignment-compatible array type. (Unfortunately, the Java type <CODE>com.sun.star.uno.Type</CODE> is not final.)<br />
** <CODE>ANY</CODE>, provided that the Java array value&nbsp;<VAR>v</VAR>&prime; is exactly of a Java array type with a base component type of either <CODE>java.lang.Object</CODE> or <CODE>com.sun.star.uno.Any</CODE>, not of another, assignment-compatible array type.<br />
** Any sequence type whose component type is recursively contained in this list.<br />
** Any enum type, plain struct type, or exception type, provided that the Java array value&nbsp;<VAR>v</VAR>&prime; is exactly of the corresponding Java array type&nbsp;<VAR>t</VAR>&prime;, not of another, assignment-compatible array type.<br />
** Any interface type named&nbsp;<VAR>N</VAR>, provided that the Java array value&nbsp;<VAR>v</VAR>&prime; is exactly of a Java array type with a base component type of <VAR>N</VAR>&prime;, not of another, assignment-compatible array type. If <VAR>N</VAR> is <CODE>com.sun.star.uno.XInterface</CODE>, the corresponding <VAR>N</VAR>&prime; is the Java interface type <CODE>com.sun.star.uno.XInterface</CODE>, not <CODE>java.lang.Object</CODE>.<br />
* Any enum type, plain struct type, or exception type, provided that theJava value&nbsp;<VAR>v</VAR>&prime; is exactly of the corresponding type&nbsp;<VAR>t</VAR>&prime;, not of another, assignment-compatible type.<br />
* The interface type named <code>com.sun.star.uno.XInterface</code>.<br />
<br />
This is an optimization, avoiding creation of instances of class <code>com.sun.star.uno.Any</code>.<br />
<br />
;Examples: A UNO <code>ANY</code> containing the value 5 of type <code>LONG</code> can be mapped either<br />
* to an instance of <code>com.sun.star.uno.Any</code>, containing a <code>java.lang.Integer</code> of value 5, or<br />
* directly to an instance of <code>java.lang.Integer</code> containing 5.<br />
<br />
A UNO <code>ANY</code> containing a sequence of type <code>LONG</code> with one element of value 5 can be mapped either<br />
* to an instance of <code>com.sun.star.uno.Any</code>, containing an <code>int[]</code> with one element of value 5, or<br />
* directly to an instance of <code>int[]</code> with one element of value 5,<br />
but it cannot be mapped to an instance of <code>java.lang.Integer[]</code> (or a <code>com.sun.star.uno.Any</code> containing a <code>java.lang.Integer[]</code>).<br />
<br />
A UNO <code>ANY</code> containing the null reference to the interface type named <code>com.sun.star.uno.XInterface</code> can be mapped either<br />
* to an instance of <code>com.sun.star.uno.Any</code>, containing the Java value null, or<br />
* directly to the Java value null.<br />
<br />
But a UNO <code>ANY</code> containing the null reference to some interface type other than <code>com.sun.star.uno.XInterface</code> must always be mapped as an instance of <code>com.sun.star.uno.Any</code>.<br />
<br />
A UNO <code>ANY</code> containing a sequence of interface type <code>com.sun.star.uno.XInterface</code>, which in turn has as a single element the null reference, can be mapped either<br />
* to an instance of <code>com.sun.star.uno.Any</code>, containing a <code>java.lang.Object[]</code> with one element of value null, or<br />
* to an instance of <code>com.sun.star.uno.Any</code>, containing a <code>com.sun.star.uno.XInterface[]</code> with one element of value null, or<br />
* directly to an instance of <code>com.sun.star.uno.XInterface[]</code> with one element of value null,<br />
but it cannot be mapped to a plain instance of <code>java.lang.Object[]</code>.<br />
<br />
A UNO <code>ANY</code> containing a sequence of type <code>ANY</code> can be mapped either<br />
* to an instance of <code>com.sun.star.uno.Any</code>, containing a <code>java.lang.Object[]</code>, or<br />
* to an instance of <code>com.sun.star.uno.Any</code>, containing a <code>com.sun.star.uno.Any[]</code>, or<br />
* directly to an instance of <code>java.lang.Object[]</code>, or<br />
* directly to an instance of <code>com.sun.star.uno.Any[]</code>.<br />
<br />
==Interface Methods==<br />
UNO interface methods use types for the ''return value'', any ''parameters'', and any ''exception specifications''. The return<br />
value must be of non-exception type, the parameters must be of non-void, non-exception types, and the exception specifications must be of exception<br />
types. Parameters may be ''in'', ''out'', or ''in-out'' parameters. Generally, the mapping of types and values used in interface methods is as described in Section [http://udk.openoffice.org/java/man/types.html#mapvalue Mapping Values], but out and in-out parameters need further special handling.<br />
<br />
Out and in-out parameters of type&nbsp;<VAR>T</VAR> are mapped to Java arrays of mapped type&nbsp;<VAR>T</VAR>&prime; (see Section [http://udk.openoffice.org/java/man/types.html#maptype Mapping Types]). At runtime, the (Java) argument will be a non-null reference to an array of exactly the mapped type&nbsp;<VAR>T</VAR>&prime; (not another, assignment-compatible type) and length at least&nbsp;1. For in-out parameters, the value of the first element will be the (Java-mapped) in argument; for out parameters, the value of the first element will be undefined. Upon normal return (i.e., no exception is thrown), the first element of that array must contain the (Java-mapped) out argument.<br />
<br />
<br />
[[Category:Uno]]<br />
[[Category:Uno:Java]]<br />
[[Category:Spec]]</div>Sbhttps://wiki.openoffice.org/wiki/Test_CleanupTest Cleanup2011-04-05T13:33:27Z<p>Sb: /* unoapi Tests */</p>
<hr />
<div>= Test Cleanup Project =<br />
<br />
The demand for automated (unit) testing should be obvious. See the [http://www.openoffice.org/servlets/ReadMsg?list=dev&msgNo=26189 mission statement mail] and [[Media:JustTestingPresentation.odp|slides]] from a [http://fosdem.org/2010/schedule/events/ooo_testing FOSDEM'10 talk] and an [http://www.ooocon.org/index.php/ooocon/2010/paper/view/188 OOoCon&nbsp;2010 presentation] for more information and further links.<br />
<br />
For examples of how to write xUnit based tests in the OOo code base, see [http://hg.services.openoffice.org/DEV300/file/87f4911ea629/basegfx/test <code>basegfx/test/</code>], [http://hg.services.openoffice.org/DEV300/file/87f4911ea629/sal/qa/ByteSequence <code>sal/qa/ByteSequence/</code>], and [http://hg.services.openoffice.org/DEV300/file/87f4911ea629/smoketestoo_native <code>smoketest_native/</code>]. However, the hard part should not be how to write test code, anyway, but how to write ''testable'' code; see [http://misko.hevery.com/2008/11/04/clean-code-talks-unit-testing/ The Clean Code Talks&mdash;Unit Testing].<br />
<br />
When testing C++ code that merely uses UNO types (no services), but uses them in a way that requires UNO to be bootstrapped so that the relevant type information is available (e.g., putting instances of complex UNO types into <code>com::sun::star::uno::Any</code>), one approach is as follows: In the <code>makefile.mk</code>, instead of <code>.INCLUDE: _cppunit.mk</code> use<br />
<source lang="make"><br />
.IF "$(OS)" == "WNT"<br />
my_file = file:///<br />
.ELSE<br />
my_file = file://<br />
.END<br />
<br />
ALLTAR : test<br />
<br />
test .PHONY : $(SHL1TARGETN)<br />
$(CPPUNITTESTER) $(SHL1TARGETN) \<br />
-env:UNO_TYPES=$(my_file)$(SOLARBINDIR)/types.rdb<br />
</source><br />
and in the test code once call <code>cppu::defaultBootstrap_InitialComponentContext()</code>.<br />
<br />
== User Interface ==<br />
<br />
=== CppUnit ===<br />
<br />
For tests in C++, plain CppUnit (at least version 1.12.1) is available. (OOo bundles CppUnit 1.12.1 as an external module; alternatively, you can configure <code>--with-system-cppunit</code>.)<br />
<br />
Implement the test code as a dynamic library, following CppUnit conventions (i.e., using [http://cppunit.sourceforge.net/doc/lastest/group___creating_test_suite.html#ga0 <code>CPPUNIT_TEST_SUITE_REGISTRATION</code>] and [http://cppunit.sourceforge.net/doc/lastest/_test_plug_in_8h.html#a2 <code>CPPUNIT_PLUGIN_IMPLEMENT</code>] macros). The following settings are needed in the <code>makefile.mk</code>:<br />
* <code>ENABLE_EXCEPTIONS = TRUE</code><br />
* <code>CFLAGSCXX += $(CPPUNIT_CFLAGS)</code><br />
* <code>SHL<var>n</var>RPATH = NONE</code><br />
* <code>SHL<var>n</var>STDLIBS += $(CPPUNITLIB)</code><br />
* <code>SHL<var>n</var>VERSIONMAP = <var>version.map</var></code>, where that file must contain the following (see [[#CppUnit_1.12.1|details]] below for improving this):<br />
UDK_3_0_0 {<br />
global:<br />
cppunitTestPlugIn;<br />
local:<br />
*;<br />
};<br />
<br />
To run tests, <code>sal/cppunittester</code> delivers a <code>cppunittester</code> executable that has some advantages over the plain CppUnit <code>DllPlugInTester</code>:<br />
* It uses <code>SAL_IMPLEMENT_MAIN</code> to properly set up the per-process settings required by URE. Test code as well as tested code based on URE will expect this and would fail in a process that is not set up in this way.<br />
* Getting CppUnit to build as an external module within the Windows OOo build is a non-trivial task. The less parts of it that need to be built, the better.<br />
<br />
Something like the following in <code>makefile.mk</code> will execute the tests:<br />
ALLTAR : test<br />
test .PHONY : $(SHL1TARGETN)<br />
$(CPPUNITTESTER) $(SHL1TARGETN)<br />
<br />
<code>$(CPPUNITTESTER)</code> internally uses <code>$(AUGMENT_LIBRARY_PATH_LOCAL)</code> to favor library instances in the local output tree over ones in solver. Alternatively to the above, <code>.INCLUDE: _cppunit.mk</code> calls <code>$(CPPUNITTESTER)</code> on each of <code>$(SHL1TARGETN)</code>, &hellip;, <code>$(SHL10TARGETN)</code> that is defined.<br />
<br />
=== JUnit ===<br />
<br />
For tests in Java, plain JUnit (at least version 4) is available. (OOo requires JUnit as a prerequisite, see [http://junit.org/ junit.org] for downloads; you can configure <code>--with-junit=<var>&hellip;</var></code> if it is not automatically found; alternatively, you can configure <code>--without-junit</code>, disabling JUnit-based tests.)<br />
<br />
=== <code>subsequenttests</code> ===<br />
<br />
Some tests have build and/or run time dependencies on modules further up in the hierarchy, or modules that the rest of the module in question does not have dependencies on (and which are thus not listed in the module's <code>build.lst</code>). The extreme case are tests that need a complete OOo installation as their test environment.<br />
<br />
For such tests, the whole <code>makefile.mk</code> should be wrapped in:<br />
.IF "$(OOO_SUBSEQUENT_TESTS)" == ""<br />
nothing .PHONY :<br />
.ELSE<br />
...<br />
.END<br />
(and the directory included in the module's <code>build.lst</code>).<br />
<br />
The idea is to do a complete OOo build first (<code>cd smoketestoo_native && build --all</code>) and then build and execute those tests either selectively or wholesale.<br />
<br />
Selectively building a specific such test directory can be done with <code>cd <var>&hellip;</var> && OOO_SUBSEQUENT_TESTS=TRUE dmake</code>.<br />
<br />
To build and execute ''all'' these test directories, the tool <code>subsequenttests</code> (in <code>solenv/bin</code>) exists. It scans the <code>build.lst</code> files of all modules for <code>makefile.mk</code>s that mention <code>OOO_SUBSEQUENT_TESTS</code> and simply executes <code>dmake</code> in all those directories, with <code>OOO_SUBSEQUENT_TESTS</code> set. It supports a <code>-P<var>n</var></code> switch to build <var>n</var> directories in parallel.<br />
<br />
=== Helpers ===<br />
<br />
A new module <code>test</code> shall collect reusable code snippets for C++ and Java tests.<br />
<br />
For now, it concentrates on letting a test connect to an OOo instance via remote UNO: A C++ test class can hold a <code>test::OfficeConnection</code> as class member and, in its CppUnit <code>setUp</code> and <code>tearDown</code> functions, call <code>OfficeConnection::setUp</code> and <code>OfficeConnection::tearDown</code>, respectively. Tests obtain access to the OOo instance via <code>OfficeConnection::getFactory</code>. Similarly, a Java test class can use an <code>org.openoffice.test.OfficeConnection</code> instance, offering the same functionality as its C++ counterpart.<br />
<br />
For this to work, three additional steps are necessary:<br />
* First, in <code>instsetoo_native</code>, building an installation set for the <code>openoffice</code> product in the default language (<code>en-US</code>) in any package format now takes care to always also build an archive package format (<code>tar.gz</code> resp. <code>zip</code>) of that product.<br />
* Second, building <code>smoketestoo_native</code> permanently installs that archive into the solver. (Except on Windows, where problems with resulting long pathnames prevent this; there, as a workaround, each test individually unzips the archive to some local temporary directory.) <br />
* Third, a test that requires an OOo instance includes <code>installationtest.mk</code> in its <code>makefile.mk</code>. That file makes sure to call the CppUnit and JUnit test runners with the information necessary for the helper classes to start the correct OOo instance with a fresh <code>UserInstallation</code> and set up an URP pipe connection. The information is tunneled into the test runner executables as UNO bootstrap parameters.<br />
<br />
For debugging purposes, which OOo instance the tests use can manually be overridden, see [http://www.openoffice.org/servlets/ReadMsg?list=interface-announce&msgNo=1285 &ldquo;OOO_TEST_SOFFICE: allow override of tested soffice process&rdquo;].<br />
<br />
=== <code>unoapi</code> Tests ===<br />
<br />
The <code>unoapi</code> tests are redesigned to use the new test framework. They are plain JUnit tests and use the mechanisms described above to connect to running OOo instances. However, due to the large amount of logic encoded in <code>qadevOOo</code>, those JUnit tests for now are only thin wrappers around <code>org.openoffice.Runner.run</code>. This is intended to change over time.<br />
<br />
The <code>cwscheckapi</code> tool to run the <code>unoapi</code> tests has been subsumed by <code>subsequenttests</code>. The latter always runs all tests, while the former had mechanisms to run only tests for modules that had been changed by a CWS. The hope is that the parallel mode of <code>subsequenttests</code> makes it fast enough so that running all tests all of the times becomes feasible.<br />
<br />
Unfortunately, running the <code>unoapi</code> tests is still not stable enough to give useful results. Therefore, running <code>subsequenttests</code> has been disabled in the build bots for now. Making the tests sufficiently stable is ongoing work.<br />
<br />
== Details ==<br />
<br />
Working on {{CWS|sb118}}, {{CWS|sb120}}.<br />
<br />
=== CppUnit 1.12.1 ===<br />
<br />
* Replace existing <code>cppunit</code> and <code>testshl2</code> combo with latest CppUnit 1.12.1.<br />
* OOo <code>configure --with-system-cppunit</code> (for now only if also <code>--with-system-stl</code>!); minimal required version for now arbitrarily 1.12.1.<br />
* '''TODO:''' Upstream <code>PATCH_FILES</code> (<code>windows.patch</code>?!?).<br />
* '''TODO:''' <code>RPATH</code> in generated libraries and executables.<br />
* '''TODO:''' Improve <code>CPPUNIT_PLUGIN_EXPORT</code> and get rid of version maps (GCC exception problems?).<br />
* '''TODO:''' <code>cppunit/makefile.mk</code> <code>MY_LIBS = -lm</code> Solaris hack.<br />
* '''TODO:''' In general OOo build environment, no longer set <code>CFLAGS</code> etc. as environment variables; have package-specific <code>OOO_<var>package</var>_CFLAGS</code> etc. and combine those into <code>CFLAGS</code> etc. where necessary (see <code>OOO_STLPORT_CXXFLAGS</code> etc. in <code>cppunit/makefile.mk</code>).<br />
* '''TODO:''' Why use <code>cppunittester</code> instead of <code>DllPlugInTester</code>? (Remove building/delivering <code>DllPlugInTester</code>.)<br />
* '''TODO:''' Make <code>operator &lt;&lt;(std::basic_ostream &amp;, rtl::OUString const &amp;)</code> from <code>test/oustringstreaminserter.hxx</code> generally available?<br />
* '''TODO:''' Make STLport <code>num_put</code> symbols available on platforms other than Linux (see <code>solenv/bin/addsym.awk</code>), too, so that <code>CPPUNIT_ASSERT_EQUAL</code> actually outputs numeric values.<br />
<br />
==== Is CppUnit an active project? ====<br />
<br />
When I wrote<br />
<pre><br />
Message-ID: <4D67B884.8080101@oracle.com><br />
Date: Fri, 25 Feb 2011 15:11:16 +0100<br />
From: Stephan Bergmann <stephan.bergmann@oracle.com><br />
MIME-Version: 1.0<br />
To: cppunit-devel@lists.sourceforge.net<br />
Subject: What part of the API is published?<br />
Content-Type: text/plain; charset=UTF-8; format=flowed<br />
Content-Transfer-Encoding: 7bit<br />
<br />
At least for CppUnit 1.12.1, it is unclear whether for example class <br />
DynamicLibraryManager is supposed to be available to client code.<br />
<br />
The HTML documentation's class list contains DynamicLibraryManager just <br />
like, say, TestCase, and I can't find any hint on the former's page that <br />
it is an implementation detail. However, in DynamicLibraryManager.h, <br />
the class is not decorated with CPPUNIT_API.<br />
<br />
Is there any specification of what is published (i.e., stable, usable by <br />
clients) vs. what is implementation detail (i.e., not to be used by <br />
clients)?<br />
<br />
-Stephan<br />
</pre><br />
the only response I ever got was<br />
<pre><br />
MIME-Version: 1.0<br />
Content-Type: text/plain; charset="us-ascii"<br />
Content-Transfer-Encoding: 7bit<br />
Subject: Your message to Cppunit-devel awaits moderator approval<br />
From: cppunit-devel-bounces@lists.sourceforge.net<br />
To: stephan.bergmann@oracle.com<br />
Message-ID: <mailman.49713.1298643119.7082.cppunit-devel@lists.sourceforge.net><br />
Date: Fri, 25 Feb 2011 14:11:59 +0000<br />
<br />
Your mail to 'Cppunit-devel' with the subject<br />
<br />
What part of the API is published?<br />
<br />
Is being held until the list moderator can review it for approval.<br />
<br />
The reason it is being held:<br />
<br />
Post by non-member to a members-only list<br />
<br />
Either the message will get posted to the list, or you will receive<br />
notification of the moderator's decision. If you would like to cancel<br />
this posting, please visit the following URL:<br />
<br />
https://lists.sourceforge.net/lists/confirm/cppunit-devel/1da27e17e1d5fdfcb7f8ac6860a05bb5ca1eab1d<br />
</pre><br />
and the last message in [http://sourceforge.net/mailarchive/forum.php?forum_name=cppunit-devel the archive] is from January 2010.<br />
<br />
=== <code>testshl2</code> ===<br />
<br />
* <code>solenv/inc_cppunit.mk</code>/<code>cppunit.mk</code>: [http://hg.services.openoffice.org/cws/sb118/rev/cf13421c3774 &ldquo;adapted <code>cppunit.mk</code> to <code>cppunittester</code> and no longer require &lsquo;<code>dmake test</code>&rsquo; to run tests&rdquo;].<br />
* '''TODO:''' <code>DEV300_m68</code> introduced <code>TESTSHL2LIB</code> (which I removed again) and uses it in many <code>qa</code> makefiles (that I need to touch someday, anyway).<br />
<br />
=== Unit Tests ===<br />
<br />
* <code>OOO_SUBSEQUENT_TESTS</code> (<code>build.lst</code> lists local dependencies of those directories, so that modifying a module and then calling &ldquo;<code>OOO_SUBSEQUENT_TESTS=x build</code>&rdquo; rebuilds the module and executes the tests).<br />
* '''TODO:''' If Build Environment&nbsp;2.0 would build directly to solver (instead of local output tree/deliver), that would simplify tests that currently need to take care to test local libraries instead of solver ones (see, for example, <code>OOO_TEST_PREFIX</code> in the <code>services.rdb</code> of <code>stoc/test/uriproc/makefile.mk</code>).<br />
{{Documentation/Note|Build Environment&nbsp;2.0 will not build directly to solver, but will make a module depend on the targets in the solver, and these are depending on the targets in the workdir (aka the old "local output tree"). Thus on an usual build in a module building and delivering are not two steps anymore. If tests depend on the target in the solver (which they will do automatically in most use cases, as linking against a library automatically creates a dependency on the library in the solver), they can be sure that the target is up to date in the solver '''and''' in the workdir.<br />
<br />
--[[User:B michaelsen|B michaelsen]] 06:32, 27 August 2010 (UTC)}}<br />
* '''TODO:''' Constructs like &ldquo;<code>-env:UNO_<var>&hellip;</var>=$(my_file)<var>&hellip;</var></code>&rdquo; would fail for problematic characters (spaces!) in paths.<br />
<br />
=== Smoke Test ===<br />
<br />
* Redesign <code>smoketestoo_native</code> to use CppUnit and pre-installed OOo.<br />
* [http://hg.services.openoffice.org/cws/sb118/rev/160b248247a0 &ldquo;changed <code>tools/debug</code> to never fall back from writing to shell to writing to file, and read <code>DBGSV_INIT</code> from <code>rtl::Bootstrap</code>; the latter causes problems if <code>tools/debug</code> is called from static code executing before <code>SAL_MAIN</code> has called <code>osl_setCommandArgs</code> &rarr; removed statics from code and added assertions to <code>osl/process</code>; various improvements to <code>smoketests.cxx</code> (incl. passing an appropriate <code>dbgsv.ini</code> for non-pro builds)&rdquo;] followed by [http://hg.services.openoffice.org/cws/sb118/rev/dbbacb9d2fd3 &ldquo;reverted parts of HG <code>-c&nbsp;160b248247a0</code> again: the &lsquo;static code executing before <code>SAL_MAIN</code>&rsquo; problem was too severe; instead, globally set <code>DBGSV_INIT</code> build env var to new <code>solenv/bin/dbgsv.ini</code>&rdquo;]; see also {{issue|109142}} &ldquo;Let assertions abort&rdquo;.<br />
* '''TODO:''' For <code>smoketestoo_native/makefile.mk</code> &ldquo;<code><nowiki>-env:arg-env=$(OOO_LIBRARY_PATH_VAR)"$${{$(OOO_LIBRARY_PATH_VAR)+=$$$(OOO_LIBRARY_PATH_VAR)}}"</nowiki></code>&rdquo; mechanism: <code>osl_executeProcess</code> <code>ustrEnvironments</code> members without &ldquo;<code>=</code>&rdquo;: all platforms; documentation; documentation of <code>osl_executeProcess_WithRedicrectedIO</code>.<br />
* '''TODO:''' <code>-headless</code>? (appears to still display windows on Windows and Mac OS&nbsp;X, however, see {{issue|109052}})<br />
* '''TODO:''' {{issue|113341}} &ldquo;-nofirststartwizard should disable update check&rdquo;<br />
<br />
=== Pre-Installed OOo ===<br />
<br />
* For Sun Hamburg Release Engineering, take MWS archive installation sets from &ldquo;S:&rdquo; instead of solver: [http://hg.services.openoffice.org/cws/sb118/rev/d5dbea724063 &ldquo;take installation set from <code>SHIPDRIVE</code> if appropriate&rdquo;].<br />
* '''TODO:''' <code>PKGFORMAT=installed</code> instead of <code>archive</code>?<br />
<br />
=== <code>unoapi</code> Tests ===<br />
<br />
* Known issues, open (not yet addressed at all; disabled for now on net-yet-integrated CWS; or fixed on not-yet-integrated CWS):<br />
** {{issue|114669}} &ldquo;forms/qa/unoapi forms.OListBoxControl crash&rdquo;<br />
** {{issue|116120}} &ldquo;vcl: TabControl::ImplGetTabRect negative height leads to X_CreatePixmap BadAlloc&rdquo; (fixed on {{CWS|vcl118}}, integrated into <code>DEV300_m101</code>)<br />
** {{issue|116125}} &ldquo;qadevOOo/qa/complex/junitskeleton failure&rdquo;<br />
** {{issue|116156}} &ldquo;toolkit/qa/unoapi crash in SwAccessibleMap::RemoveContext&rdquo;<br />
** {{issue|116192}} &ldquo;[sw] fixed text fields sometimes get updated&rdquo; (fixed on {{CWS|sw34bf03}}, integrated into <code>DEV300_m102</code>)<br />
** {{issue|116550}} &ldquo;toolkit/qa/unoapi crashes OOo in ~SwAccessibleParagraph vs. SwXTextDocument::close&rdquo;<br />
** {{issue|116583}} &ldquo;comphelper/qa/complex/comphelper failure&rdquo;<br />
** {{issue|116730}} &ldquo;vcl: crash with multiple threads in Window::ImplGrabFocus&rdquo;<br />
** {{issue|116733}} &ldquo;sw: crash in ~SwDrawContact (forms/qa/unoapi)&rdquo;<br />
** {{issue|117381}} &ldquo;ucb/qa/unoapi ucb.UniversalContentBroker::com::sun::star::ucb::XContentProviderManager::deregisterContentProvider() fails with gvfs&rdquo; (fixed on {{CWS|sb140}})<br />
** {{issue|117486}} &ldquo;toolkit/qa/complex/toolkit: "Window pos size wrong"&rdquo; (fixed on {{CWS|sb140}})<br />
** {{issue|117488}} &ldquo;sw/qa/unoapi: sw.SwXViewSettings::com::sun::star::text::ViewSettings::ShowOnlineLayout ShowOnlineLayout/ZoomValue failed&rdquo;<br />
** {{issue|117641}} &ldquo;chart2/qa/unoapi fails in sch.ChXDataPoint::com::sun::star::chart::ChartDataPointProperties due to change to jpeg/prj/d.lst&rdquo;<br />
** {{issue|117693}} &ldquo;xmlsecurity/qa/certext fails on wntmsci12 non-pro ("no OPENSSL_Applink")&rdquo;<br />
* Known issues, disabled for now:<br />
** {{issue|109517}} &ldquo;sc/qa/unoapi fails for ScAnnotationObj etc.&rdquo;<br />
** {{issue|109518}} &ldquo;sd/qa/unoapi crash in SfxViewShell::GetController&rdquo;<br />
** {{issue|109643}} &ldquo;toolkit/qa/unoapi tests fail when losing focus&rdquo;<br />
** {{issue|109728}} &ldquo;~ScAutoFormatObj uses cleared ScGlobal&rdquo;<br />
** {{issue|109917}} &ldquo;fragile unoapi test using OnUnfocus event&rdquo;<br />
** {{issue|109939}} &ldquo;toolkit: inconsistent UnoControl locking schemes&rdquo;<br />
** {{issue|110862}} &ldquo;sc/qa/unoapi fails for sc.ScDataPilotTableObj::com::sun::star::sheet::XDataPilotTable::refresh()&rdquo;<br />
** {{issue|110988}} &ldquo;svtools/qa/unoapi fails for svtools.AccessibleBrowseBox etc.&rdquo;<br />
** {{issue|111006}} &ldquo;toolkit: deadlock between UnoControls&rdquo;<br />
** {{issue|111032}} &ldquo;sc/qa/unoapi sc.ScAccessibleCell::com::sun::star::accessibility::XAccessibleText getCharacterBounds() failure&rdquo;<br />
** {{issue|111042}} &ldquo;sd/qa/unoapi sd::DrawController::dispose crash&rdquo;<br />
** {{issue|111043}} &ldquo;sd/qa/unoapi sd::DrawController_OutlineView NullPointerException&rdquo;<br />
** {{issue|111102}} &ldquo;chart2: ChartModelHelper::findDiagram returns null&rdquo;<br />
** {{issue|111111}} &ldquo;xmloff.Impress.XMLImporter::com::sun::star::document::XImporter&rdquo;<br />
** {{issue|111113}} &ldquo;toolkit.AccessibleStatusBarItem unoapi failure&rdquo;<br />
** {{issue|111148}} &ldquo;forms/qa/unoapi forms.OImageControlModel::com::sun::star::beans::XMultiPropertySet deadlock&rdquo;<br />
** {{issue|111169}} &ldquo;svx.AccessiblePageShape unoapi failure&rdquo;<br />
** {{issue|111170}} &ldquo;sun/i18n/qa/unoapi "creating a drawdoc" failure&rdquo;<br />
** {{issue|111178}} &ldquo;sw/qa/unoapi SwView::SelectShell crash&rdquo;<br />
** {{issue|111180}} &ldquo;framework/qa/unoapi fwk.Desktop::com::sun::star::frame::XComponentLoader::loadComponentFromURL() failure&rdquo;<br />
** {{issue|111182}} &ldquo;Desktop::terminate -> ~DropTarget -> _objc_error crash&rdquo;<br />
** {{issue|111184}} &ldquo;sal/qa/osl/pipe uses fixed pipe names&rdquo;<br />
** {{issue|111186}} &ldquo;sw/qa/unoapi sw.PageStyle::com::sun::star::beans::XPropertySet::setPropertyValue() failure&rdquo;<br />
** {{issue|111190}} &ldquo;sw/qa/unoapi sw.SwXShape failure&rdquo;<br />
** {{issue|111194}} &ldquo;sw/qa/unoapi sw.XMLExporter crash&rdquo;<br />
** {{issue|111195}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleScrollBar::com::sun::star::accessibility::XAccessibleValue::setCurrentValue() failure&rdquo;<br />
** {{issue|111197}} &ldquo;sw/qa/unoapi sw.SwAccessibleDocumentPageView failure&rdquo;<br />
** {{issue|111199}} &ldquo;sd/qa/unoapi sd.AccessibleOutlineView failure&rdquo;<br />
** {{issue|111200}} &ldquo;xmloff/qa/unoapi xmloff.Draw.XMLMetaImporter failure&rdquo;<br />
** {{issue|111216}} &ldquo;svx/qa/unoapi accessibility deadlock&rdquo;<br />
** {{issue|111218}} &ldquo;sw/qa/unoapi sw.SwAccessibleParagraphView::com::sun::star::accessibility::XAccessibleEventBroadcaster::removeEventListener() failure&rdquo;<br />
** {{issue|111220}} &ldquo;sw/qa/unoapi sw.XMLContentExporter::com::sun::star::document::XFilter::cancel() failure&rdquo;<br />
** {{issue|111224}} &ldquo;xmloff/qa/unoapi xmloff.Impress.XMLContentExporter crash&rdquo;<br />
** {{issue|111225}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleStatusBar failure&rdquo;<br />
** {{issue|111252}} &ldquo;svx/qa/unoapi svx.AccessibleOLEShape deadlock&rdquo;<br />
** {{issue|111273}} &ldquo;sw/qa/unoapi sw.SwXTextEmbeddedObject::com::sun::star::document::XEmbeddedObjectSupplier::getEmbeddedObject() crash&rdquo;<br />
** {{issue|111278}} &ldquo;svx/qa/unoapi svx.AccessibleEditableTextPara failure&rdquo;<br />
** {{issue|111283}} &ldquo;sfx2/qa/unoapi sfx.StandaloneDocumentInfo failure&rdquo;<br />
** {{issue|111285}} &ldquo;forms/qa/unoapi forms.OButtonModel failure&rdquo;<br />
** {{issue|111287}} &ldquo;xmloff/qa/unoapi XMLSettingsIm-/Exporter crash&rdquo;<br />
** {{issue|111329}} &ldquo;sd/qa/unoapi SdXCustomPresentationAccess::getElementNames/ImpEditEngine::OnlineSpellHdl hang&rdquo;<br />
** {{issue|111332}} &ldquo;sw/qa/unoapi sw.XMLStylesExporter::com::sun::star::document::XFilter crash&rdquo;<br />
** {{issue|111333}} &ldquo;forms/qa/unoapi forms.OImageControlControl::com::sun::star::awt::XControl deadlock&rdquo;<br />
** {{issue|112743}} &ldquo;starmath/qa/unoapi sm.XMLSettingsExporter failure&rdquo;<br />
** {{issue|112746}} &ldquo;framework/qa/unoapi fwk.ModuleManager failure (X11 BadWindow)&rdquo;<br />
** {{issue|112751}} &ldquo;testgraphical/qa/graphical failure&rdquo;<br />
** {{issue|112778}} &ldquo;xmloff/qa/unoapi xmloff.Draw.XMLContentExporter failure&rdquo;<br />
** {{issue|113020}} &ldquo;sw/qa/unoapi sw.SwXTextGraphicObject::com::sun::star::beans::XPropertySet failure&rdquo;<br />
** {{issue|113103}} &ldquo;chart2: deadlock between DiagramHelper and Diagram&rdquo;<br />
** {{issue|113136}} &ldquo;sw/qa/unoapi sw.SwAccessibleParagraphView::com::sun::star::accessibility::XAccessibleEditableText failure&rdquo;<br />
** {{issue|113142}} &ldquo;sw/qa/unoapi SwAccessibleContext::RemoveFrmFromAccessibleMap crash&rdquo;<br />
** {{issue|113161}} &ldquo;sd/qa/unoapi sd.SdLayer::com::sun::star::drawing::Layer::IsVisible failure&rdquo;<br />
** {{issue|113201}} &ldquo;forms/qa/unoapi forms.OEditModel::com::sun::star::form::validation::XValidatableFormComponent failure&rdquo;<br />
** {{issue|113245}} &ldquo;framework/qa/unoapi fwl.TypeDetection failure&rdquo;<br />
** {{issue|113306}} &ldquo;sfx2/qa/unoapi sfx.DocumentTemplates failure&rdquo;<br />
** {{issue|113386}} &ldquo;sd/qa/unoapi sd.AccessibleDrawDocumentView::com::sun::star::accessibility::XAccessibleComponent::containsPoint() failure&rdquo;<br />
** {{issue|113489}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleMenu{,Bar,Separator} failures&rdquo;<br />
** {{issue|114205}} &ldquo;sw/qa/unoapi sw.SwAccessibleParagraphView::com::sun::star::accessibility::XAccessibleText::copyText() failed&rdquo;<br />
** {{issue|114209}} &ldquo;forms/qa/unoapi forms.OGridControlModel::com::sun::star::view::XSelectionSupplier crash&rdquo;<br />
** {{issue|114211}} &ldquo;xmloff/qa/unoapi xmloff.Draw.XMLStylesImporter::com::sun::star::lang::XInitialization crash&rdquo;<br />
** {{issue|114213}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleMenu::com::sun::star::accessibility::XAccessibleSelection failure&rdquo;<br />
** {{issue|114636}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleScrollBar::com::sun::star::accessibility::XAccessibleAction failure&rdquo;<br />
** {{issue|114637}} &ldquo;sw/qa/unoapi sw.SwAccessibleFootnoteView(?) crash&rdquo;<br />
** {{issue|114642}} &ldquo;svx/qa/unoapi svx: svx.SvxUnoTextContent::com::sun::star::style::CharacterProperties crash&rdquo;<br />
** {{issue|114889}} &ldquo;sw/qa/unoapi sw.SwXTextViewCursor::com::sun::star::view::XScreenCursor&rdquo;<br />
** {{issue|116784}} &ldquo;[sfx2] CheckGlobalEventBroadcaster_writer1 fails&rdquo;<br />
** {{issue|116813}} &ldquo;[sfx2] complex.sfx2.UndoManager checkBrokenScripts fails&rdquo;<br />
** {{issue|116814}} &ldquo;[toolkit] unoapi test UnoControlDialogModel: XCloneable fails&rdquo;<br />
* Missing tests:<br />
** {{issue|109564}} &ldquo;qadevOOo/tests/java/ifc/awt/_XSystemChildFactory.java&rdquo;<br />
* Sporadic failures:<br />
** {{issue|111217}} &ldquo;BasicManager::SetGlobalUNOConstant crash during shutdown&rdquo;<br />
** {{issue|111246}} &ldquo;svx::FontHeightToolBoxControl::statusChanged crash (memory corruption)&rdquo;<br />
** {{issue|111271}} &ldquo;Mac OS X: crash during shutdown, __tcf_2 on stack&rdquo;<br />
** {{issue|111400}} &ldquo;Extension Manager does not join spawned uno process (-> smoketestoo_native fails)&rdquo;<br />
** {{issue|112070}} &ldquo;UNO API tests must not use random&rdquo;<br />
** {{issue|113158}} &ldquo;crash with two threads in framework::ToolBarManager dtor&rdquo;<br />
** {{issue|113197}} &ldquo;sw/qa/unoapi sw.SwXTextRange hangs&rdquo;<br />
** {{issue|113367}} &ldquo;sysdtrans deadlock during shutdown&rdquo;<br />
** {{issue|113464}} &ldquo;stoc_smgr::ORegistryServiceManager::dispose crash during shutdown&rdquo;<br />
** {{issue|114207}} &ldquo;framework::ModuleUIConfigurationManager::dispose crash during shutdown&rdquo;<br />
** {{issue|114675}} &ldquo;binary URP bridge race on shut down, crash&rdquo;<br />
** {{issue|114718}} &ldquo;forms/qa/unoapi: crash in remote async release call&rdquo;<br />
** {{issue|116131}} &ldquo;vcl: message unregisterDraggingDestinationHandler: sent to freed object&rdquo;<br />
<br />
[[Category:Effort]][[Category:Test]]</div>Sbhttps://wiki.openoffice.org/wiki/Test_CleanupTest Cleanup2011-04-05T10:22:49Z<p>Sb: /* unoapi Tests */</p>
<hr />
<div>= Test Cleanup Project =<br />
<br />
The demand for automated (unit) testing should be obvious. See the [http://www.openoffice.org/servlets/ReadMsg?list=dev&msgNo=26189 mission statement mail] and [[Media:JustTestingPresentation.odp|slides]] from a [http://fosdem.org/2010/schedule/events/ooo_testing FOSDEM'10 talk] and an [http://www.ooocon.org/index.php/ooocon/2010/paper/view/188 OOoCon&nbsp;2010 presentation] for more information and further links.<br />
<br />
For examples of how to write xUnit based tests in the OOo code base, see [http://hg.services.openoffice.org/DEV300/file/87f4911ea629/basegfx/test <code>basegfx/test/</code>], [http://hg.services.openoffice.org/DEV300/file/87f4911ea629/sal/qa/ByteSequence <code>sal/qa/ByteSequence/</code>], and [http://hg.services.openoffice.org/DEV300/file/87f4911ea629/smoketestoo_native <code>smoketest_native/</code>]. However, the hard part should not be how to write test code, anyway, but how to write ''testable'' code; see [http://misko.hevery.com/2008/11/04/clean-code-talks-unit-testing/ The Clean Code Talks&mdash;Unit Testing].<br />
<br />
When testing C++ code that merely uses UNO types (no services), but uses them in a way that requires UNO to be bootstrapped so that the relevant type information is available (e.g., putting instances of complex UNO types into <code>com::sun::star::uno::Any</code>), one approach is as follows: In the <code>makefile.mk</code>, instead of <code>.INCLUDE: _cppunit.mk</code> use<br />
<source lang="make"><br />
.IF "$(OS)" == "WNT"<br />
my_file = file:///<br />
.ELSE<br />
my_file = file://<br />
.END<br />
<br />
ALLTAR : test<br />
<br />
test .PHONY : $(SHL1TARGETN)<br />
$(CPPUNITTESTER) $(SHL1TARGETN) \<br />
-env:UNO_TYPES=$(my_file)$(SOLARBINDIR)/types.rdb<br />
</source><br />
and in the test code once call <code>cppu::defaultBootstrap_InitialComponentContext()</code>.<br />
<br />
== User Interface ==<br />
<br />
=== CppUnit ===<br />
<br />
For tests in C++, plain CppUnit (at least version 1.12.1) is available. (OOo bundles CppUnit 1.12.1 as an external module; alternatively, you can configure <code>--with-system-cppunit</code>.)<br />
<br />
Implement the test code as a dynamic library, following CppUnit conventions (i.e., using [http://cppunit.sourceforge.net/doc/lastest/group___creating_test_suite.html#ga0 <code>CPPUNIT_TEST_SUITE_REGISTRATION</code>] and [http://cppunit.sourceforge.net/doc/lastest/_test_plug_in_8h.html#a2 <code>CPPUNIT_PLUGIN_IMPLEMENT</code>] macros). The following settings are needed in the <code>makefile.mk</code>:<br />
* <code>ENABLE_EXCEPTIONS = TRUE</code><br />
* <code>CFLAGSCXX += $(CPPUNIT_CFLAGS)</code><br />
* <code>SHL<var>n</var>RPATH = NONE</code><br />
* <code>SHL<var>n</var>STDLIBS += $(CPPUNITLIB)</code><br />
* <code>SHL<var>n</var>VERSIONMAP = <var>version.map</var></code>, where that file must contain the following (see [[#CppUnit_1.12.1|details]] below for improving this):<br />
UDK_3_0_0 {<br />
global:<br />
cppunitTestPlugIn;<br />
local:<br />
*;<br />
};<br />
<br />
To run tests, <code>sal/cppunittester</code> delivers a <code>cppunittester</code> executable that has some advantages over the plain CppUnit <code>DllPlugInTester</code>:<br />
* It uses <code>SAL_IMPLEMENT_MAIN</code> to properly set up the per-process settings required by URE. Test code as well as tested code based on URE will expect this and would fail in a process that is not set up in this way.<br />
* Getting CppUnit to build as an external module within the Windows OOo build is a non-trivial task. The less parts of it that need to be built, the better.<br />
<br />
Something like the following in <code>makefile.mk</code> will execute the tests:<br />
ALLTAR : test<br />
test .PHONY : $(SHL1TARGETN)<br />
$(CPPUNITTESTER) $(SHL1TARGETN)<br />
<br />
<code>$(CPPUNITTESTER)</code> internally uses <code>$(AUGMENT_LIBRARY_PATH_LOCAL)</code> to favor library instances in the local output tree over ones in solver. Alternatively to the above, <code>.INCLUDE: _cppunit.mk</code> calls <code>$(CPPUNITTESTER)</code> on each of <code>$(SHL1TARGETN)</code>, &hellip;, <code>$(SHL10TARGETN)</code> that is defined.<br />
<br />
=== JUnit ===<br />
<br />
For tests in Java, plain JUnit (at least version 4) is available. (OOo requires JUnit as a prerequisite, see [http://junit.org/ junit.org] for downloads; you can configure <code>--with-junit=<var>&hellip;</var></code> if it is not automatically found; alternatively, you can configure <code>--without-junit</code>, disabling JUnit-based tests.)<br />
<br />
=== <code>subsequenttests</code> ===<br />
<br />
Some tests have build and/or run time dependencies on modules further up in the hierarchy, or modules that the rest of the module in question does not have dependencies on (and which are thus not listed in the module's <code>build.lst</code>). The extreme case are tests that need a complete OOo installation as their test environment.<br />
<br />
For such tests, the whole <code>makefile.mk</code> should be wrapped in:<br />
.IF "$(OOO_SUBSEQUENT_TESTS)" == ""<br />
nothing .PHONY :<br />
.ELSE<br />
...<br />
.END<br />
(and the directory included in the module's <code>build.lst</code>).<br />
<br />
The idea is to do a complete OOo build first (<code>cd smoketestoo_native && build --all</code>) and then build and execute those tests either selectively or wholesale.<br />
<br />
Selectively building a specific such test directory can be done with <code>cd <var>&hellip;</var> && OOO_SUBSEQUENT_TESTS=TRUE dmake</code>.<br />
<br />
To build and execute ''all'' these test directories, the tool <code>subsequenttests</code> (in <code>solenv/bin</code>) exists. It scans the <code>build.lst</code> files of all modules for <code>makefile.mk</code>s that mention <code>OOO_SUBSEQUENT_TESTS</code> and simply executes <code>dmake</code> in all those directories, with <code>OOO_SUBSEQUENT_TESTS</code> set. It supports a <code>-P<var>n</var></code> switch to build <var>n</var> directories in parallel.<br />
<br />
=== Helpers ===<br />
<br />
A new module <code>test</code> shall collect reusable code snippets for C++ and Java tests.<br />
<br />
For now, it concentrates on letting a test connect to an OOo instance via remote UNO: A C++ test class can hold a <code>test::OfficeConnection</code> as class member and, in its CppUnit <code>setUp</code> and <code>tearDown</code> functions, call <code>OfficeConnection::setUp</code> and <code>OfficeConnection::tearDown</code>, respectively. Tests obtain access to the OOo instance via <code>OfficeConnection::getFactory</code>. Similarly, a Java test class can use an <code>org.openoffice.test.OfficeConnection</code> instance, offering the same functionality as its C++ counterpart.<br />
<br />
For this to work, three additional steps are necessary:<br />
* First, in <code>instsetoo_native</code>, building an installation set for the <code>openoffice</code> product in the default language (<code>en-US</code>) in any package format now takes care to always also build an archive package format (<code>tar.gz</code> resp. <code>zip</code>) of that product.<br />
* Second, building <code>smoketestoo_native</code> permanently installs that archive into the solver. (Except on Windows, where problems with resulting long pathnames prevent this; there, as a workaround, each test individually unzips the archive to some local temporary directory.) <br />
* Third, a test that requires an OOo instance includes <code>installationtest.mk</code> in its <code>makefile.mk</code>. That file makes sure to call the CppUnit and JUnit test runners with the information necessary for the helper classes to start the correct OOo instance with a fresh <code>UserInstallation</code> and set up an URP pipe connection. The information is tunneled into the test runner executables as UNO bootstrap parameters.<br />
<br />
For debugging purposes, which OOo instance the tests use can manually be overridden, see [http://www.openoffice.org/servlets/ReadMsg?list=interface-announce&msgNo=1285 &ldquo;OOO_TEST_SOFFICE: allow override of tested soffice process&rdquo;].<br />
<br />
=== <code>unoapi</code> Tests ===<br />
<br />
The <code>unoapi</code> tests are redesigned to use the new test framework. They are plain JUnit tests and use the mechanisms described above to connect to running OOo instances. However, due to the large amount of logic encoded in <code>qadevOOo</code>, those JUnit tests for now are only thin wrappers around <code>org.openoffice.Runner.run</code>. This is intended to change over time.<br />
<br />
The <code>cwscheckapi</code> tool to run the <code>unoapi</code> tests has been subsumed by <code>subsequenttests</code>. The latter always runs all tests, while the former had mechanisms to run only tests for modules that had been changed by a CWS. The hope is that the parallel mode of <code>subsequenttests</code> makes it fast enough so that running all tests all of the times becomes feasible.<br />
<br />
Unfortunately, running the <code>unoapi</code> tests is still not stable enough to give useful results. Therefore, running <code>subsequenttests</code> has been disabled in the build bots for now. Making the tests sufficiently stable is ongoing work.<br />
<br />
== Details ==<br />
<br />
Working on {{CWS|sb118}}, {{CWS|sb120}}.<br />
<br />
=== CppUnit 1.12.1 ===<br />
<br />
* Replace existing <code>cppunit</code> and <code>testshl2</code> combo with latest CppUnit 1.12.1.<br />
* OOo <code>configure --with-system-cppunit</code> (for now only if also <code>--with-system-stl</code>!); minimal required version for now arbitrarily 1.12.1.<br />
* '''TODO:''' Upstream <code>PATCH_FILES</code> (<code>windows.patch</code>?!?).<br />
* '''TODO:''' <code>RPATH</code> in generated libraries and executables.<br />
* '''TODO:''' Improve <code>CPPUNIT_PLUGIN_EXPORT</code> and get rid of version maps (GCC exception problems?).<br />
* '''TODO:''' <code>cppunit/makefile.mk</code> <code>MY_LIBS = -lm</code> Solaris hack.<br />
* '''TODO:''' In general OOo build environment, no longer set <code>CFLAGS</code> etc. as environment variables; have package-specific <code>OOO_<var>package</var>_CFLAGS</code> etc. and combine those into <code>CFLAGS</code> etc. where necessary (see <code>OOO_STLPORT_CXXFLAGS</code> etc. in <code>cppunit/makefile.mk</code>).<br />
* '''TODO:''' Why use <code>cppunittester</code> instead of <code>DllPlugInTester</code>? (Remove building/delivering <code>DllPlugInTester</code>.)<br />
* '''TODO:''' Make <code>operator &lt;&lt;(std::basic_ostream &amp;, rtl::OUString const &amp;)</code> from <code>test/oustringstreaminserter.hxx</code> generally available?<br />
* '''TODO:''' Make STLport <code>num_put</code> symbols available on platforms other than Linux (see <code>solenv/bin/addsym.awk</code>), too, so that <code>CPPUNIT_ASSERT_EQUAL</code> actually outputs numeric values.<br />
<br />
==== Is CppUnit an active project? ====<br />
<br />
When I wrote<br />
<pre><br />
Message-ID: <4D67B884.8080101@oracle.com><br />
Date: Fri, 25 Feb 2011 15:11:16 +0100<br />
From: Stephan Bergmann <stephan.bergmann@oracle.com><br />
MIME-Version: 1.0<br />
To: cppunit-devel@lists.sourceforge.net<br />
Subject: What part of the API is published?<br />
Content-Type: text/plain; charset=UTF-8; format=flowed<br />
Content-Transfer-Encoding: 7bit<br />
<br />
At least for CppUnit 1.12.1, it is unclear whether for example class <br />
DynamicLibraryManager is supposed to be available to client code.<br />
<br />
The HTML documentation's class list contains DynamicLibraryManager just <br />
like, say, TestCase, and I can't find any hint on the former's page that <br />
it is an implementation detail. However, in DynamicLibraryManager.h, <br />
the class is not decorated with CPPUNIT_API.<br />
<br />
Is there any specification of what is published (i.e., stable, usable by <br />
clients) vs. what is implementation detail (i.e., not to be used by <br />
clients)?<br />
<br />
-Stephan<br />
</pre><br />
the only response I ever got was<br />
<pre><br />
MIME-Version: 1.0<br />
Content-Type: text/plain; charset="us-ascii"<br />
Content-Transfer-Encoding: 7bit<br />
Subject: Your message to Cppunit-devel awaits moderator approval<br />
From: cppunit-devel-bounces@lists.sourceforge.net<br />
To: stephan.bergmann@oracle.com<br />
Message-ID: <mailman.49713.1298643119.7082.cppunit-devel@lists.sourceforge.net><br />
Date: Fri, 25 Feb 2011 14:11:59 +0000<br />
<br />
Your mail to 'Cppunit-devel' with the subject<br />
<br />
What part of the API is published?<br />
<br />
Is being held until the list moderator can review it for approval.<br />
<br />
The reason it is being held:<br />
<br />
Post by non-member to a members-only list<br />
<br />
Either the message will get posted to the list, or you will receive<br />
notification of the moderator's decision. If you would like to cancel<br />
this posting, please visit the following URL:<br />
<br />
https://lists.sourceforge.net/lists/confirm/cppunit-devel/1da27e17e1d5fdfcb7f8ac6860a05bb5ca1eab1d<br />
</pre><br />
and the last message in [http://sourceforge.net/mailarchive/forum.php?forum_name=cppunit-devel the archive] is from January 2010.<br />
<br />
=== <code>testshl2</code> ===<br />
<br />
* <code>solenv/inc_cppunit.mk</code>/<code>cppunit.mk</code>: [http://hg.services.openoffice.org/cws/sb118/rev/cf13421c3774 &ldquo;adapted <code>cppunit.mk</code> to <code>cppunittester</code> and no longer require &lsquo;<code>dmake test</code>&rsquo; to run tests&rdquo;].<br />
* '''TODO:''' <code>DEV300_m68</code> introduced <code>TESTSHL2LIB</code> (which I removed again) and uses it in many <code>qa</code> makefiles (that I need to touch someday, anyway).<br />
<br />
=== Unit Tests ===<br />
<br />
* <code>OOO_SUBSEQUENT_TESTS</code> (<code>build.lst</code> lists local dependencies of those directories, so that modifying a module and then calling &ldquo;<code>OOO_SUBSEQUENT_TESTS=x build</code>&rdquo; rebuilds the module and executes the tests).<br />
* '''TODO:''' If Build Environment&nbsp;2.0 would build directly to solver (instead of local output tree/deliver), that would simplify tests that currently need to take care to test local libraries instead of solver ones (see, for example, <code>OOO_TEST_PREFIX</code> in the <code>services.rdb</code> of <code>stoc/test/uriproc/makefile.mk</code>).<br />
{{Documentation/Note|Build Environment&nbsp;2.0 will not build directly to solver, but will make a module depend on the targets in the solver, and these are depending on the targets in the workdir (aka the old "local output tree"). Thus on an usual build in a module building and delivering are not two steps anymore. If tests depend on the target in the solver (which they will do automatically in most use cases, as linking against a library automatically creates a dependency on the library in the solver), they can be sure that the target is up to date in the solver '''and''' in the workdir.<br />
<br />
--[[User:B michaelsen|B michaelsen]] 06:32, 27 August 2010 (UTC)}}<br />
* '''TODO:''' Constructs like &ldquo;<code>-env:UNO_<var>&hellip;</var>=$(my_file)<var>&hellip;</var></code>&rdquo; would fail for problematic characters (spaces!) in paths.<br />
<br />
=== Smoke Test ===<br />
<br />
* Redesign <code>smoketestoo_native</code> to use CppUnit and pre-installed OOo.<br />
* [http://hg.services.openoffice.org/cws/sb118/rev/160b248247a0 &ldquo;changed <code>tools/debug</code> to never fall back from writing to shell to writing to file, and read <code>DBGSV_INIT</code> from <code>rtl::Bootstrap</code>; the latter causes problems if <code>tools/debug</code> is called from static code executing before <code>SAL_MAIN</code> has called <code>osl_setCommandArgs</code> &rarr; removed statics from code and added assertions to <code>osl/process</code>; various improvements to <code>smoketests.cxx</code> (incl. passing an appropriate <code>dbgsv.ini</code> for non-pro builds)&rdquo;] followed by [http://hg.services.openoffice.org/cws/sb118/rev/dbbacb9d2fd3 &ldquo;reverted parts of HG <code>-c&nbsp;160b248247a0</code> again: the &lsquo;static code executing before <code>SAL_MAIN</code>&rsquo; problem was too severe; instead, globally set <code>DBGSV_INIT</code> build env var to new <code>solenv/bin/dbgsv.ini</code>&rdquo;]; see also {{issue|109142}} &ldquo;Let assertions abort&rdquo;.<br />
* '''TODO:''' For <code>smoketestoo_native/makefile.mk</code> &ldquo;<code><nowiki>-env:arg-env=$(OOO_LIBRARY_PATH_VAR)"$${{$(OOO_LIBRARY_PATH_VAR)+=$$$(OOO_LIBRARY_PATH_VAR)}}"</nowiki></code>&rdquo; mechanism: <code>osl_executeProcess</code> <code>ustrEnvironments</code> members without &ldquo;<code>=</code>&rdquo;: all platforms; documentation; documentation of <code>osl_executeProcess_WithRedicrectedIO</code>.<br />
* '''TODO:''' <code>-headless</code>? (appears to still display windows on Windows and Mac OS&nbsp;X, however, see {{issue|109052}})<br />
* '''TODO:''' {{issue|113341}} &ldquo;-nofirststartwizard should disable update check&rdquo;<br />
<br />
=== Pre-Installed OOo ===<br />
<br />
* For Sun Hamburg Release Engineering, take MWS archive installation sets from &ldquo;S:&rdquo; instead of solver: [http://hg.services.openoffice.org/cws/sb118/rev/d5dbea724063 &ldquo;take installation set from <code>SHIPDRIVE</code> if appropriate&rdquo;].<br />
* '''TODO:''' <code>PKGFORMAT=installed</code> instead of <code>archive</code>?<br />
<br />
=== <code>unoapi</code> Tests ===<br />
<br />
* Known issues, open (not yet addressed at all; disabled for now on net-yet-integrated CWS; or fixed on not-yet-integrated CWS):<br />
** {{issue|116120}} &ldquo;vcl: TabControl::ImplGetTabRect negative height leads to X_CreatePixmap BadAlloc&rdquo; (fixed on {{CWS|vcl118}}, integrated into <code>DEV300_m101</code>)<br />
** {{issue|116125}} &ldquo;qadevOOo/qa/complex/junitskeleton failure&rdquo;<br />
** {{issue|116156}} &ldquo;toolkit/qa/unoapi crash in SwAccessibleMap::RemoveContext&rdquo;<br />
** {{issue|116192}} &ldquo;[sw] fixed text fields sometimes get updated&rdquo; (fixed on {{CWS|sw34bf03}}, integrated into <code>DEV300_m102</code>)<br />
** {{issue|116550}} &ldquo;toolkit/qa/unoapi crashes OOo in ~SwAccessibleParagraph vs. SwXTextDocument::close&rdquo;<br />
** {{issue|116583}} &ldquo;comphelper/qa/complex/comphelper failure&rdquo;<br />
** {{issue|116730}} &ldquo;vcl: crash with multiple threads in Window::ImplGrabFocus&rdquo;<br />
** {{issue|116733}} &ldquo;sw: crash in ~SwDrawContact (forms/qa/unoapi)&rdquo;<br />
** {{issue|117381}} &ldquo;ucb/qa/unoapi ucb.UniversalContentBroker::com::sun::star::ucb::XContentProviderManager::deregisterContentProvider() fails with gvfs&rdquo; (fixed on {{CWS|sb140}})<br />
** {{issue|117486}} &ldquo;toolkit/qa/complex/toolkit: "Window pos size wrong"&rdquo; (fixed on {{CWS|sb140}})<br />
** {{issue|117488}} &ldquo;sw/qa/unoapi: sw.SwXViewSettings::com::sun::star::text::ViewSettings::ShowOnlineLayout ShowOnlineLayout/ZoomValue failed&rdquo;<br />
** {{issue|117641}} &ldquo;chart2/qa/unoapi fails in sch.ChXDataPoint::com::sun::star::chart::ChartDataPointProperties due to change to jpeg/prj/d.lst&rdquo;<br />
** {{issue|117693}} &ldquo;xmlsecurity/qa/certext fails on wntmsci12 non-pro ("no OPENSSL_Applink")&rdquo;<br />
* Known issues, disabled for now:<br />
** {{issue|109517}} &ldquo;sc/qa/unoapi fails for ScAnnotationObj etc.&rdquo;<br />
** {{issue|109518}} &ldquo;sd/qa/unoapi crash in SfxViewShell::GetController&rdquo;<br />
** {{issue|109643}} &ldquo;toolkit/qa/unoapi tests fail when losing focus&rdquo;<br />
** {{issue|109728}} &ldquo;~ScAutoFormatObj uses cleared ScGlobal&rdquo;<br />
** {{issue|109917}} &ldquo;fragile unoapi test using OnUnfocus event&rdquo;<br />
** {{issue|109939}} &ldquo;toolkit: inconsistent UnoControl locking schemes&rdquo;<br />
** {{issue|110862}} &ldquo;sc/qa/unoapi fails for sc.ScDataPilotTableObj::com::sun::star::sheet::XDataPilotTable::refresh()&rdquo;<br />
** {{issue|110988}} &ldquo;svtools/qa/unoapi fails for svtools.AccessibleBrowseBox etc.&rdquo;<br />
** {{issue|111006}} &ldquo;toolkit: deadlock between UnoControls&rdquo;<br />
** {{issue|111032}} &ldquo;sc/qa/unoapi sc.ScAccessibleCell::com::sun::star::accessibility::XAccessibleText getCharacterBounds() failure&rdquo;<br />
** {{issue|111042}} &ldquo;sd/qa/unoapi sd::DrawController::dispose crash&rdquo;<br />
** {{issue|111043}} &ldquo;sd/qa/unoapi sd::DrawController_OutlineView NullPointerException&rdquo;<br />
** {{issue|111102}} &ldquo;chart2: ChartModelHelper::findDiagram returns null&rdquo;<br />
** {{issue|111111}} &ldquo;xmloff.Impress.XMLImporter::com::sun::star::document::XImporter&rdquo;<br />
** {{issue|111113}} &ldquo;toolkit.AccessibleStatusBarItem unoapi failure&rdquo;<br />
** {{issue|111148}} &ldquo;forms/qa/unoapi forms.OImageControlModel::com::sun::star::beans::XMultiPropertySet deadlock&rdquo;<br />
** {{issue|111169}} &ldquo;svx.AccessiblePageShape unoapi failure&rdquo;<br />
** {{issue|111170}} &ldquo;sun/i18n/qa/unoapi "creating a drawdoc" failure&rdquo;<br />
** {{issue|111178}} &ldquo;sw/qa/unoapi SwView::SelectShell crash&rdquo;<br />
** {{issue|111180}} &ldquo;framework/qa/unoapi fwk.Desktop::com::sun::star::frame::XComponentLoader::loadComponentFromURL() failure&rdquo;<br />
** {{issue|111182}} &ldquo;Desktop::terminate -> ~DropTarget -> _objc_error crash&rdquo;<br />
** {{issue|111184}} &ldquo;sal/qa/osl/pipe uses fixed pipe names&rdquo;<br />
** {{issue|111186}} &ldquo;sw/qa/unoapi sw.PageStyle::com::sun::star::beans::XPropertySet::setPropertyValue() failure&rdquo;<br />
** {{issue|111190}} &ldquo;sw/qa/unoapi sw.SwXShape failure&rdquo;<br />
** {{issue|111194}} &ldquo;sw/qa/unoapi sw.XMLExporter crash&rdquo;<br />
** {{issue|111195}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleScrollBar::com::sun::star::accessibility::XAccessibleValue::setCurrentValue() failure&rdquo;<br />
** {{issue|111197}} &ldquo;sw/qa/unoapi sw.SwAccessibleDocumentPageView failure&rdquo;<br />
** {{issue|111199}} &ldquo;sd/qa/unoapi sd.AccessibleOutlineView failure&rdquo;<br />
** {{issue|111200}} &ldquo;xmloff/qa/unoapi xmloff.Draw.XMLMetaImporter failure&rdquo;<br />
** {{issue|111216}} &ldquo;svx/qa/unoapi accessibility deadlock&rdquo;<br />
** {{issue|111218}} &ldquo;sw/qa/unoapi sw.SwAccessibleParagraphView::com::sun::star::accessibility::XAccessibleEventBroadcaster::removeEventListener() failure&rdquo;<br />
** {{issue|111220}} &ldquo;sw/qa/unoapi sw.XMLContentExporter::com::sun::star::document::XFilter::cancel() failure&rdquo;<br />
** {{issue|111224}} &ldquo;xmloff/qa/unoapi xmloff.Impress.XMLContentExporter crash&rdquo;<br />
** {{issue|111225}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleStatusBar failure&rdquo;<br />
** {{issue|111252}} &ldquo;svx/qa/unoapi svx.AccessibleOLEShape deadlock&rdquo;<br />
** {{issue|111273}} &ldquo;sw/qa/unoapi sw.SwXTextEmbeddedObject::com::sun::star::document::XEmbeddedObjectSupplier::getEmbeddedObject() crash&rdquo;<br />
** {{issue|111278}} &ldquo;svx/qa/unoapi svx.AccessibleEditableTextPara failure&rdquo;<br />
** {{issue|111283}} &ldquo;sfx2/qa/unoapi sfx.StandaloneDocumentInfo failure&rdquo;<br />
** {{issue|111285}} &ldquo;forms/qa/unoapi forms.OButtonModel failure&rdquo;<br />
** {{issue|111287}} &ldquo;xmloff/qa/unoapi XMLSettingsIm-/Exporter crash&rdquo;<br />
** {{issue|111329}} &ldquo;sd/qa/unoapi SdXCustomPresentationAccess::getElementNames/ImpEditEngine::OnlineSpellHdl hang&rdquo;<br />
** {{issue|111332}} &ldquo;sw/qa/unoapi sw.XMLStylesExporter::com::sun::star::document::XFilter crash&rdquo;<br />
** {{issue|111333}} &ldquo;forms/qa/unoapi forms.OImageControlControl::com::sun::star::awt::XControl deadlock&rdquo;<br />
** {{issue|112743}} &ldquo;starmath/qa/unoapi sm.XMLSettingsExporter failure&rdquo;<br />
** {{issue|112746}} &ldquo;framework/qa/unoapi fwk.ModuleManager failure (X11 BadWindow)&rdquo;<br />
** {{issue|112751}} &ldquo;testgraphical/qa/graphical failure&rdquo;<br />
** {{issue|112778}} &ldquo;xmloff/qa/unoapi xmloff.Draw.XMLContentExporter failure&rdquo;<br />
** {{issue|113020}} &ldquo;sw/qa/unoapi sw.SwXTextGraphicObject::com::sun::star::beans::XPropertySet failure&rdquo;<br />
** {{issue|113103}} &ldquo;chart2: deadlock between DiagramHelper and Diagram&rdquo;<br />
** {{issue|113136}} &ldquo;sw/qa/unoapi sw.SwAccessibleParagraphView::com::sun::star::accessibility::XAccessibleEditableText failure&rdquo;<br />
** {{issue|113142}} &ldquo;sw/qa/unoapi SwAccessibleContext::RemoveFrmFromAccessibleMap crash&rdquo;<br />
** {{issue|113161}} &ldquo;sd/qa/unoapi sd.SdLayer::com::sun::star::drawing::Layer::IsVisible failure&rdquo;<br />
** {{issue|113201}} &ldquo;forms/qa/unoapi forms.OEditModel::com::sun::star::form::validation::XValidatableFormComponent failure&rdquo;<br />
** {{issue|113245}} &ldquo;framework/qa/unoapi fwl.TypeDetection failure&rdquo;<br />
** {{issue|113306}} &ldquo;sfx2/qa/unoapi sfx.DocumentTemplates failure&rdquo;<br />
** {{issue|113386}} &ldquo;sd/qa/unoapi sd.AccessibleDrawDocumentView::com::sun::star::accessibility::XAccessibleComponent::containsPoint() failure&rdquo;<br />
** {{issue|113489}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleMenu{,Bar,Separator} failures&rdquo;<br />
** {{issue|114205}} &ldquo;sw/qa/unoapi sw.SwAccessibleParagraphView::com::sun::star::accessibility::XAccessibleText::copyText() failed&rdquo;<br />
** {{issue|114209}} &ldquo;forms/qa/unoapi forms.OGridControlModel::com::sun::star::view::XSelectionSupplier crash&rdquo;<br />
** {{issue|114211}} &ldquo;xmloff/qa/unoapi xmloff.Draw.XMLStylesImporter::com::sun::star::lang::XInitialization crash&rdquo;<br />
** {{issue|114213}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleMenu::com::sun::star::accessibility::XAccessibleSelection failure&rdquo;<br />
** {{issue|114636}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleScrollBar::com::sun::star::accessibility::XAccessibleAction failure&rdquo;<br />
** {{issue|114637}} &ldquo;sw/qa/unoapi sw.SwAccessibleFootnoteView(?) crash&rdquo;<br />
** {{issue|114642}} &ldquo;svx/qa/unoapi svx: svx.SvxUnoTextContent::com::sun::star::style::CharacterProperties crash&rdquo;<br />
** {{issue|114669}} &ldquo;forms/qa/unoapi forms.OListBoxControl crash&rdquo;<br />
** {{issue|114889}} &ldquo;sw/qa/unoapi sw.SwXTextViewCursor::com::sun::star::view::XScreenCursor&rdquo;<br />
** {{issue|116784}} &ldquo;[sfx2] CheckGlobalEventBroadcaster_writer1 fails&rdquo;<br />
** {{issue|116813}} &ldquo;[sfx2] complex.sfx2.UndoManager checkBrokenScripts fails&rdquo;<br />
** {{issue|116814}} &ldquo;[toolkit] unoapi test UnoControlDialogModel: XCloneable fails&rdquo;<br />
* Missing tests:<br />
** {{issue|109564}} &ldquo;qadevOOo/tests/java/ifc/awt/_XSystemChildFactory.java&rdquo;<br />
* Sporadic failures:<br />
** {{issue|111217}} &ldquo;BasicManager::SetGlobalUNOConstant crash during shutdown&rdquo;<br />
** {{issue|111246}} &ldquo;svx::FontHeightToolBoxControl::statusChanged crash (memory corruption)&rdquo;<br />
** {{issue|111271}} &ldquo;Mac OS X: crash during shutdown, __tcf_2 on stack&rdquo;<br />
** {{issue|111400}} &ldquo;Extension Manager does not join spawned uno process (-> smoketestoo_native fails)&rdquo;<br />
** {{issue|112070}} &ldquo;UNO API tests must not use random&rdquo;<br />
** {{issue|113158}} &ldquo;crash with two threads in framework::ToolBarManager dtor&rdquo;<br />
** {{issue|113197}} &ldquo;sw/qa/unoapi sw.SwXTextRange hangs&rdquo;<br />
** {{issue|113367}} &ldquo;sysdtrans deadlock during shutdown&rdquo;<br />
** {{issue|113464}} &ldquo;stoc_smgr::ORegistryServiceManager::dispose crash during shutdown&rdquo;<br />
** {{issue|114207}} &ldquo;framework::ModuleUIConfigurationManager::dispose crash during shutdown&rdquo;<br />
** {{issue|114675}} &ldquo;binary URP bridge race on shut down, crash&rdquo;<br />
** {{issue|114718}} &ldquo;forms/qa/unoapi: crash in remote async release call&rdquo;<br />
** {{issue|116131}} &ldquo;vcl: message unregisterDraggingDestinationHandler: sent to freed object&rdquo;<br />
<br />
[[Category:Effort]][[Category:Test]]</div>Sbhttps://wiki.openoffice.org/wiki/Test_CleanupTest Cleanup2011-04-01T09:42:45Z<p>Sb: /* unoapi Tests */</p>
<hr />
<div>= Test Cleanup Project =<br />
<br />
The demand for automated (unit) testing should be obvious. See the [http://www.openoffice.org/servlets/ReadMsg?list=dev&msgNo=26189 mission statement mail] and [[Media:JustTestingPresentation.odp|slides]] from a [http://fosdem.org/2010/schedule/events/ooo_testing FOSDEM'10 talk] and an [http://www.ooocon.org/index.php/ooocon/2010/paper/view/188 OOoCon&nbsp;2010 presentation] for more information and further links.<br />
<br />
For examples of how to write xUnit based tests in the OOo code base, see [http://hg.services.openoffice.org/DEV300/file/87f4911ea629/basegfx/test <code>basegfx/test/</code>], [http://hg.services.openoffice.org/DEV300/file/87f4911ea629/sal/qa/ByteSequence <code>sal/qa/ByteSequence/</code>], and [http://hg.services.openoffice.org/DEV300/file/87f4911ea629/smoketestoo_native <code>smoketest_native/</code>]. However, the hard part should not be how to write test code, anyway, but how to write ''testable'' code; see [http://misko.hevery.com/2008/11/04/clean-code-talks-unit-testing/ The Clean Code Talks&mdash;Unit Testing].<br />
<br />
When testing C++ code that merely uses UNO types (no services), but uses them in a way that requires UNO to be bootstrapped so that the relevant type information is available (e.g., putting instances of complex UNO types into <code>com::sun::star::uno::Any</code>), one approach is as follows: In the <code>makefile.mk</code>, instead of <code>.INCLUDE: _cppunit.mk</code> use<br />
<source lang="make"><br />
.IF "$(OS)" == "WNT"<br />
my_file = file:///<br />
.ELSE<br />
my_file = file://<br />
.END<br />
<br />
ALLTAR : test<br />
<br />
test .PHONY : $(SHL1TARGETN)<br />
$(CPPUNITTESTER) $(SHL1TARGETN) \<br />
-env:UNO_TYPES=$(my_file)$(SOLARBINDIR)/types.rdb<br />
</source><br />
and in the test code once call <code>cppu::defaultBootstrap_InitialComponentContext()</code>.<br />
<br />
== User Interface ==<br />
<br />
=== CppUnit ===<br />
<br />
For tests in C++, plain CppUnit (at least version 1.12.1) is available. (OOo bundles CppUnit 1.12.1 as an external module; alternatively, you can configure <code>--with-system-cppunit</code>.)<br />
<br />
Implement the test code as a dynamic library, following CppUnit conventions (i.e., using [http://cppunit.sourceforge.net/doc/lastest/group___creating_test_suite.html#ga0 <code>CPPUNIT_TEST_SUITE_REGISTRATION</code>] and [http://cppunit.sourceforge.net/doc/lastest/_test_plug_in_8h.html#a2 <code>CPPUNIT_PLUGIN_IMPLEMENT</code>] macros). The following settings are needed in the <code>makefile.mk</code>:<br />
* <code>ENABLE_EXCEPTIONS = TRUE</code><br />
* <code>CFLAGSCXX += $(CPPUNIT_CFLAGS)</code><br />
* <code>SHL<var>n</var>RPATH = NONE</code><br />
* <code>SHL<var>n</var>STDLIBS += $(CPPUNITLIB)</code><br />
* <code>SHL<var>n</var>VERSIONMAP = <var>version.map</var></code>, where that file must contain the following (see [[#CppUnit_1.12.1|details]] below for improving this):<br />
UDK_3_0_0 {<br />
global:<br />
cppunitTestPlugIn;<br />
local:<br />
*;<br />
};<br />
<br />
To run tests, <code>sal/cppunittester</code> delivers a <code>cppunittester</code> executable that has some advantages over the plain CppUnit <code>DllPlugInTester</code>:<br />
* It uses <code>SAL_IMPLEMENT_MAIN</code> to properly set up the per-process settings required by URE. Test code as well as tested code based on URE will expect this and would fail in a process that is not set up in this way.<br />
* Getting CppUnit to build as an external module within the Windows OOo build is a non-trivial task. The less parts of it that need to be built, the better.<br />
<br />
Something like the following in <code>makefile.mk</code> will execute the tests:<br />
ALLTAR : test<br />
test .PHONY : $(SHL1TARGETN)<br />
$(CPPUNITTESTER) $(SHL1TARGETN)<br />
<br />
<code>$(CPPUNITTESTER)</code> internally uses <code>$(AUGMENT_LIBRARY_PATH_LOCAL)</code> to favor library instances in the local output tree over ones in solver. Alternatively to the above, <code>.INCLUDE: _cppunit.mk</code> calls <code>$(CPPUNITTESTER)</code> on each of <code>$(SHL1TARGETN)</code>, &hellip;, <code>$(SHL10TARGETN)</code> that is defined.<br />
<br />
=== JUnit ===<br />
<br />
For tests in Java, plain JUnit (at least version 4) is available. (OOo requires JUnit as a prerequisite, see [http://junit.org/ junit.org] for downloads; you can configure <code>--with-junit=<var>&hellip;</var></code> if it is not automatically found; alternatively, you can configure <code>--without-junit</code>, disabling JUnit-based tests.)<br />
<br />
=== <code>subsequenttests</code> ===<br />
<br />
Some tests have build and/or run time dependencies on modules further up in the hierarchy, or modules that the rest of the module in question does not have dependencies on (and which are thus not listed in the module's <code>build.lst</code>). The extreme case are tests that need a complete OOo installation as their test environment.<br />
<br />
For such tests, the whole <code>makefile.mk</code> should be wrapped in:<br />
.IF "$(OOO_SUBSEQUENT_TESTS)" == ""<br />
nothing .PHONY :<br />
.ELSE<br />
...<br />
.END<br />
(and the directory included in the module's <code>build.lst</code>).<br />
<br />
The idea is to do a complete OOo build first (<code>cd smoketestoo_native && build --all</code>) and then build and execute those tests either selectively or wholesale.<br />
<br />
Selectively building a specific such test directory can be done with <code>cd <var>&hellip;</var> && OOO_SUBSEQUENT_TESTS=TRUE dmake</code>.<br />
<br />
To build and execute ''all'' these test directories, the tool <code>subsequenttests</code> (in <code>solenv/bin</code>) exists. It scans the <code>build.lst</code> files of all modules for <code>makefile.mk</code>s that mention <code>OOO_SUBSEQUENT_TESTS</code> and simply executes <code>dmake</code> in all those directories, with <code>OOO_SUBSEQUENT_TESTS</code> set. It supports a <code>-P<var>n</var></code> switch to build <var>n</var> directories in parallel.<br />
<br />
=== Helpers ===<br />
<br />
A new module <code>test</code> shall collect reusable code snippets for C++ and Java tests.<br />
<br />
For now, it concentrates on letting a test connect to an OOo instance via remote UNO: A C++ test class can hold a <code>test::OfficeConnection</code> as class member and, in its CppUnit <code>setUp</code> and <code>tearDown</code> functions, call <code>OfficeConnection::setUp</code> and <code>OfficeConnection::tearDown</code>, respectively. Tests obtain access to the OOo instance via <code>OfficeConnection::getFactory</code>. Similarly, a Java test class can use an <code>org.openoffice.test.OfficeConnection</code> instance, offering the same functionality as its C++ counterpart.<br />
<br />
For this to work, three additional steps are necessary:<br />
* First, in <code>instsetoo_native</code>, building an installation set for the <code>openoffice</code> product in the default language (<code>en-US</code>) in any package format now takes care to always also build an archive package format (<code>tar.gz</code> resp. <code>zip</code>) of that product.<br />
* Second, building <code>smoketestoo_native</code> permanently installs that archive into the solver. (Except on Windows, where problems with resulting long pathnames prevent this; there, as a workaround, each test individually unzips the archive to some local temporary directory.) <br />
* Third, a test that requires an OOo instance includes <code>installationtest.mk</code> in its <code>makefile.mk</code>. That file makes sure to call the CppUnit and JUnit test runners with the information necessary for the helper classes to start the correct OOo instance with a fresh <code>UserInstallation</code> and set up an URP pipe connection. The information is tunneled into the test runner executables as UNO bootstrap parameters.<br />
<br />
For debugging purposes, which OOo instance the tests use can manually be overridden, see [http://www.openoffice.org/servlets/ReadMsg?list=interface-announce&msgNo=1285 &ldquo;OOO_TEST_SOFFICE: allow override of tested soffice process&rdquo;].<br />
<br />
=== <code>unoapi</code> Tests ===<br />
<br />
The <code>unoapi</code> tests are redesigned to use the new test framework. They are plain JUnit tests and use the mechanisms described above to connect to running OOo instances. However, due to the large amount of logic encoded in <code>qadevOOo</code>, those JUnit tests for now are only thin wrappers around <code>org.openoffice.Runner.run</code>. This is intended to change over time.<br />
<br />
The <code>cwscheckapi</code> tool to run the <code>unoapi</code> tests has been subsumed by <code>subsequenttests</code>. The latter always runs all tests, while the former had mechanisms to run only tests for modules that had been changed by a CWS. The hope is that the parallel mode of <code>subsequenttests</code> makes it fast enough so that running all tests all of the times becomes feasible.<br />
<br />
Unfortunately, running the <code>unoapi</code> tests is still not stable enough to give useful results. Therefore, running <code>subsequenttests</code> has been disabled in the build bots for now. Making the tests sufficiently stable is ongoing work.<br />
<br />
== Details ==<br />
<br />
Working on {{CWS|sb118}}, {{CWS|sb120}}.<br />
<br />
=== CppUnit 1.12.1 ===<br />
<br />
* Replace existing <code>cppunit</code> and <code>testshl2</code> combo with latest CppUnit 1.12.1.<br />
* OOo <code>configure --with-system-cppunit</code> (for now only if also <code>--with-system-stl</code>!); minimal required version for now arbitrarily 1.12.1.<br />
* '''TODO:''' Upstream <code>PATCH_FILES</code> (<code>windows.patch</code>?!?).<br />
* '''TODO:''' <code>RPATH</code> in generated libraries and executables.<br />
* '''TODO:''' Improve <code>CPPUNIT_PLUGIN_EXPORT</code> and get rid of version maps (GCC exception problems?).<br />
* '''TODO:''' <code>cppunit/makefile.mk</code> <code>MY_LIBS = -lm</code> Solaris hack.<br />
* '''TODO:''' In general OOo build environment, no longer set <code>CFLAGS</code> etc. as environment variables; have package-specific <code>OOO_<var>package</var>_CFLAGS</code> etc. and combine those into <code>CFLAGS</code> etc. where necessary (see <code>OOO_STLPORT_CXXFLAGS</code> etc. in <code>cppunit/makefile.mk</code>).<br />
* '''TODO:''' Why use <code>cppunittester</code> instead of <code>DllPlugInTester</code>? (Remove building/delivering <code>DllPlugInTester</code>.)<br />
* '''TODO:''' Make <code>operator &lt;&lt;(std::basic_ostream &amp;, rtl::OUString const &amp;)</code> from <code>test/oustringstreaminserter.hxx</code> generally available?<br />
* '''TODO:''' Make STLport <code>num_put</code> symbols available on platforms other than Linux (see <code>solenv/bin/addsym.awk</code>), too, so that <code>CPPUNIT_ASSERT_EQUAL</code> actually outputs numeric values.<br />
<br />
==== Is CppUnit an active project? ====<br />
<br />
When I wrote<br />
<pre><br />
Message-ID: <4D67B884.8080101@oracle.com><br />
Date: Fri, 25 Feb 2011 15:11:16 +0100<br />
From: Stephan Bergmann <stephan.bergmann@oracle.com><br />
MIME-Version: 1.0<br />
To: cppunit-devel@lists.sourceforge.net<br />
Subject: What part of the API is published?<br />
Content-Type: text/plain; charset=UTF-8; format=flowed<br />
Content-Transfer-Encoding: 7bit<br />
<br />
At least for CppUnit 1.12.1, it is unclear whether for example class <br />
DynamicLibraryManager is supposed to be available to client code.<br />
<br />
The HTML documentation's class list contains DynamicLibraryManager just <br />
like, say, TestCase, and I can't find any hint on the former's page that <br />
it is an implementation detail. However, in DynamicLibraryManager.h, <br />
the class is not decorated with CPPUNIT_API.<br />
<br />
Is there any specification of what is published (i.e., stable, usable by <br />
clients) vs. what is implementation detail (i.e., not to be used by <br />
clients)?<br />
<br />
-Stephan<br />
</pre><br />
the only response I ever got was<br />
<pre><br />
MIME-Version: 1.0<br />
Content-Type: text/plain; charset="us-ascii"<br />
Content-Transfer-Encoding: 7bit<br />
Subject: Your message to Cppunit-devel awaits moderator approval<br />
From: cppunit-devel-bounces@lists.sourceforge.net<br />
To: stephan.bergmann@oracle.com<br />
Message-ID: <mailman.49713.1298643119.7082.cppunit-devel@lists.sourceforge.net><br />
Date: Fri, 25 Feb 2011 14:11:59 +0000<br />
<br />
Your mail to 'Cppunit-devel' with the subject<br />
<br />
What part of the API is published?<br />
<br />
Is being held until the list moderator can review it for approval.<br />
<br />
The reason it is being held:<br />
<br />
Post by non-member to a members-only list<br />
<br />
Either the message will get posted to the list, or you will receive<br />
notification of the moderator's decision. If you would like to cancel<br />
this posting, please visit the following URL:<br />
<br />
https://lists.sourceforge.net/lists/confirm/cppunit-devel/1da27e17e1d5fdfcb7f8ac6860a05bb5ca1eab1d<br />
</pre><br />
and the last message in [http://sourceforge.net/mailarchive/forum.php?forum_name=cppunit-devel the archive] is from January 2010.<br />
<br />
=== <code>testshl2</code> ===<br />
<br />
* <code>solenv/inc_cppunit.mk</code>/<code>cppunit.mk</code>: [http://hg.services.openoffice.org/cws/sb118/rev/cf13421c3774 &ldquo;adapted <code>cppunit.mk</code> to <code>cppunittester</code> and no longer require &lsquo;<code>dmake test</code>&rsquo; to run tests&rdquo;].<br />
* '''TODO:''' <code>DEV300_m68</code> introduced <code>TESTSHL2LIB</code> (which I removed again) and uses it in many <code>qa</code> makefiles (that I need to touch someday, anyway).<br />
<br />
=== Unit Tests ===<br />
<br />
* <code>OOO_SUBSEQUENT_TESTS</code> (<code>build.lst</code> lists local dependencies of those directories, so that modifying a module and then calling &ldquo;<code>OOO_SUBSEQUENT_TESTS=x build</code>&rdquo; rebuilds the module and executes the tests).<br />
* '''TODO:''' If Build Environment&nbsp;2.0 would build directly to solver (instead of local output tree/deliver), that would simplify tests that currently need to take care to test local libraries instead of solver ones (see, for example, <code>OOO_TEST_PREFIX</code> in the <code>services.rdb</code> of <code>stoc/test/uriproc/makefile.mk</code>).<br />
{{Documentation/Note|Build Environment&nbsp;2.0 will not build directly to solver, but will make a module depend on the targets in the solver, and these are depending on the targets in the workdir (aka the old "local output tree"). Thus on an usual build in a module building and delivering are not two steps anymore. If tests depend on the target in the solver (which they will do automatically in most use cases, as linking against a library automatically creates a dependency on the library in the solver), they can be sure that the target is up to date in the solver '''and''' in the workdir.<br />
<br />
--[[User:B michaelsen|B michaelsen]] 06:32, 27 August 2010 (UTC)}}<br />
* '''TODO:''' Constructs like &ldquo;<code>-env:UNO_<var>&hellip;</var>=$(my_file)<var>&hellip;</var></code>&rdquo; would fail for problematic characters (spaces!) in paths.<br />
<br />
=== Smoke Test ===<br />
<br />
* Redesign <code>smoketestoo_native</code> to use CppUnit and pre-installed OOo.<br />
* [http://hg.services.openoffice.org/cws/sb118/rev/160b248247a0 &ldquo;changed <code>tools/debug</code> to never fall back from writing to shell to writing to file, and read <code>DBGSV_INIT</code> from <code>rtl::Bootstrap</code>; the latter causes problems if <code>tools/debug</code> is called from static code executing before <code>SAL_MAIN</code> has called <code>osl_setCommandArgs</code> &rarr; removed statics from code and added assertions to <code>osl/process</code>; various improvements to <code>smoketests.cxx</code> (incl. passing an appropriate <code>dbgsv.ini</code> for non-pro builds)&rdquo;] followed by [http://hg.services.openoffice.org/cws/sb118/rev/dbbacb9d2fd3 &ldquo;reverted parts of HG <code>-c&nbsp;160b248247a0</code> again: the &lsquo;static code executing before <code>SAL_MAIN</code>&rsquo; problem was too severe; instead, globally set <code>DBGSV_INIT</code> build env var to new <code>solenv/bin/dbgsv.ini</code>&rdquo;]; see also {{issue|109142}} &ldquo;Let assertions abort&rdquo;.<br />
* '''TODO:''' For <code>smoketestoo_native/makefile.mk</code> &ldquo;<code><nowiki>-env:arg-env=$(OOO_LIBRARY_PATH_VAR)"$${{$(OOO_LIBRARY_PATH_VAR)+=$$$(OOO_LIBRARY_PATH_VAR)}}"</nowiki></code>&rdquo; mechanism: <code>osl_executeProcess</code> <code>ustrEnvironments</code> members without &ldquo;<code>=</code>&rdquo;: all platforms; documentation; documentation of <code>osl_executeProcess_WithRedicrectedIO</code>.<br />
* '''TODO:''' <code>-headless</code>? (appears to still display windows on Windows and Mac OS&nbsp;X, however, see {{issue|109052}})<br />
* '''TODO:''' {{issue|113341}} &ldquo;-nofirststartwizard should disable update check&rdquo;<br />
<br />
=== Pre-Installed OOo ===<br />
<br />
* For Sun Hamburg Release Engineering, take MWS archive installation sets from &ldquo;S:&rdquo; instead of solver: [http://hg.services.openoffice.org/cws/sb118/rev/d5dbea724063 &ldquo;take installation set from <code>SHIPDRIVE</code> if appropriate&rdquo;].<br />
* '''TODO:''' <code>PKGFORMAT=installed</code> instead of <code>archive</code>?<br />
<br />
=== <code>unoapi</code> Tests ===<br />
<br />
* Known issues, open (not yet addressed at all; disabled for now on net-yet-integrated CWS; or fixed on not-yet-integrated CWS):<br />
** {{issue|116120}} &ldquo;vcl: TabControl::ImplGetTabRect negative height leads to X_CreatePixmap BadAlloc&rdquo; (fixed on {{CWS|vcl118}}, integrated into <code>DEV300_m101</code>)<br />
** {{issue|116125}} &ldquo;qadevOOo/qa/complex/junitskeleton failure&rdquo;<br />
** {{issue|116156}} &ldquo;toolkit/qa/unoapi crash in SwAccessibleMap::RemoveContext&rdquo;<br />
** {{issue|116192}} &ldquo;[sw] fixed text fields sometimes get updated&rdquo; (fixed on {{CWS|sw34bf03}}, integrated into <code>DEV300_m102</code>)<br />
** {{issue|116550}} &ldquo;toolkit/qa/unoapi crashes OOo in ~SwAccessibleParagraph vs. SwXTextDocument::close&rdquo;<br />
** {{issue|116583}} &ldquo;comphelper/qa/complex/comphelper failure&rdquo;<br />
** {{issue|116730}} &ldquo;vcl: crash with multiple threads in Window::ImplGrabFocus&rdquo;<br />
** {{issue|116733}} &ldquo;sw: crash in ~SwDrawContact (forms/qa/unoapi)&rdquo;<br />
** {{issue|117381}} &ldquo;ucb/qa/unoapi ucb.UniversalContentBroker::com::sun::star::ucb::XContentProviderManager::deregisterContentProvider() fails with gvfs&rdquo; (fixed on {{CWS|sb140}})<br />
** {{issue|117486}} &ldquo;toolkit/qa/complex/toolkit: "Window pos size wrong"&rdquo; (fixed on {{CWS|sb140}})<br />
** {{issue|117488}} &ldquo;sw/qa/unoapi: sw.SwXViewSettings::com::sun::star::text::ViewSettings::ShowOnlineLayout ShowOnlineLayout/ZoomValue failed&rdquo;<br />
** {{issue|117641}} &ldquo;chart2/qa/unoapi fails in sch.ChXDataPoint::com::sun::star::chart::ChartDataPointProperties due to change to jpeg/prj/d.lst&rdquo;<br />
* Known issues, disabled for now:<br />
** {{issue|109517}} &ldquo;sc/qa/unoapi fails for ScAnnotationObj etc.&rdquo;<br />
** {{issue|109518}} &ldquo;sd/qa/unoapi crash in SfxViewShell::GetController&rdquo;<br />
** {{issue|109643}} &ldquo;toolkit/qa/unoapi tests fail when losing focus&rdquo;<br />
** {{issue|109728}} &ldquo;~ScAutoFormatObj uses cleared ScGlobal&rdquo;<br />
** {{issue|109917}} &ldquo;fragile unoapi test using OnUnfocus event&rdquo;<br />
** {{issue|109939}} &ldquo;toolkit: inconsistent UnoControl locking schemes&rdquo;<br />
** {{issue|110862}} &ldquo;sc/qa/unoapi fails for sc.ScDataPilotTableObj::com::sun::star::sheet::XDataPilotTable::refresh()&rdquo;<br />
** {{issue|110988}} &ldquo;svtools/qa/unoapi fails for svtools.AccessibleBrowseBox etc.&rdquo;<br />
** {{issue|111006}} &ldquo;toolkit: deadlock between UnoControls&rdquo;<br />
** {{issue|111032}} &ldquo;sc/qa/unoapi sc.ScAccessibleCell::com::sun::star::accessibility::XAccessibleText getCharacterBounds() failure&rdquo;<br />
** {{issue|111042}} &ldquo;sd/qa/unoapi sd::DrawController::dispose crash&rdquo;<br />
** {{issue|111043}} &ldquo;sd/qa/unoapi sd::DrawController_OutlineView NullPointerException&rdquo;<br />
** {{issue|111102}} &ldquo;chart2: ChartModelHelper::findDiagram returns null&rdquo;<br />
** {{issue|111111}} &ldquo;xmloff.Impress.XMLImporter::com::sun::star::document::XImporter&rdquo;<br />
** {{issue|111113}} &ldquo;toolkit.AccessibleStatusBarItem unoapi failure&rdquo;<br />
** {{issue|111148}} &ldquo;forms/qa/unoapi forms.OImageControlModel::com::sun::star::beans::XMultiPropertySet deadlock&rdquo;<br />
** {{issue|111169}} &ldquo;svx.AccessiblePageShape unoapi failure&rdquo;<br />
** {{issue|111170}} &ldquo;sun/i18n/qa/unoapi "creating a drawdoc" failure&rdquo;<br />
** {{issue|111178}} &ldquo;sw/qa/unoapi SwView::SelectShell crash&rdquo;<br />
** {{issue|111180}} &ldquo;framework/qa/unoapi fwk.Desktop::com::sun::star::frame::XComponentLoader::loadComponentFromURL() failure&rdquo;<br />
** {{issue|111182}} &ldquo;Desktop::terminate -> ~DropTarget -> _objc_error crash&rdquo;<br />
** {{issue|111184}} &ldquo;sal/qa/osl/pipe uses fixed pipe names&rdquo;<br />
** {{issue|111186}} &ldquo;sw/qa/unoapi sw.PageStyle::com::sun::star::beans::XPropertySet::setPropertyValue() failure&rdquo;<br />
** {{issue|111190}} &ldquo;sw/qa/unoapi sw.SwXShape failure&rdquo;<br />
** {{issue|111194}} &ldquo;sw/qa/unoapi sw.XMLExporter crash&rdquo;<br />
** {{issue|111195}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleScrollBar::com::sun::star::accessibility::XAccessibleValue::setCurrentValue() failure&rdquo;<br />
** {{issue|111197}} &ldquo;sw/qa/unoapi sw.SwAccessibleDocumentPageView failure&rdquo;<br />
** {{issue|111199}} &ldquo;sd/qa/unoapi sd.AccessibleOutlineView failure&rdquo;<br />
** {{issue|111200}} &ldquo;xmloff/qa/unoapi xmloff.Draw.XMLMetaImporter failure&rdquo;<br />
** {{issue|111216}} &ldquo;svx/qa/unoapi accessibility deadlock&rdquo;<br />
** {{issue|111218}} &ldquo;sw/qa/unoapi sw.SwAccessibleParagraphView::com::sun::star::accessibility::XAccessibleEventBroadcaster::removeEventListener() failure&rdquo;<br />
** {{issue|111220}} &ldquo;sw/qa/unoapi sw.XMLContentExporter::com::sun::star::document::XFilter::cancel() failure&rdquo;<br />
** {{issue|111224}} &ldquo;xmloff/qa/unoapi xmloff.Impress.XMLContentExporter crash&rdquo;<br />
** {{issue|111225}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleStatusBar failure&rdquo;<br />
** {{issue|111252}} &ldquo;svx/qa/unoapi svx.AccessibleOLEShape deadlock&rdquo;<br />
** {{issue|111273}} &ldquo;sw/qa/unoapi sw.SwXTextEmbeddedObject::com::sun::star::document::XEmbeddedObjectSupplier::getEmbeddedObject() crash&rdquo;<br />
** {{issue|111278}} &ldquo;svx/qa/unoapi svx.AccessibleEditableTextPara failure&rdquo;<br />
** {{issue|111283}} &ldquo;sfx2/qa/unoapi sfx.StandaloneDocumentInfo failure&rdquo;<br />
** {{issue|111285}} &ldquo;forms/qa/unoapi forms.OButtonModel failure&rdquo;<br />
** {{issue|111287}} &ldquo;xmloff/qa/unoapi XMLSettingsIm-/Exporter crash&rdquo;<br />
** {{issue|111329}} &ldquo;sd/qa/unoapi SdXCustomPresentationAccess::getElementNames/ImpEditEngine::OnlineSpellHdl hang&rdquo;<br />
** {{issue|111332}} &ldquo;sw/qa/unoapi sw.XMLStylesExporter::com::sun::star::document::XFilter crash&rdquo;<br />
** {{issue|111333}} &ldquo;forms/qa/unoapi forms.OImageControlControl::com::sun::star::awt::XControl deadlock&rdquo;<br />
** {{issue|112743}} &ldquo;starmath/qa/unoapi sm.XMLSettingsExporter failure&rdquo;<br />
** {{issue|112746}} &ldquo;framework/qa/unoapi fwk.ModuleManager failure (X11 BadWindow)&rdquo;<br />
** {{issue|112751}} &ldquo;testgraphical/qa/graphical failure&rdquo;<br />
** {{issue|112778}} &ldquo;xmloff/qa/unoapi xmloff.Draw.XMLContentExporter failure&rdquo;<br />
** {{issue|113020}} &ldquo;sw/qa/unoapi sw.SwXTextGraphicObject::com::sun::star::beans::XPropertySet failure&rdquo;<br />
** {{issue|113103}} &ldquo;chart2: deadlock between DiagramHelper and Diagram&rdquo;<br />
** {{issue|113136}} &ldquo;sw/qa/unoapi sw.SwAccessibleParagraphView::com::sun::star::accessibility::XAccessibleEditableText failure&rdquo;<br />
** {{issue|113142}} &ldquo;sw/qa/unoapi SwAccessibleContext::RemoveFrmFromAccessibleMap crash&rdquo;<br />
** {{issue|113161}} &ldquo;sd/qa/unoapi sd.SdLayer::com::sun::star::drawing::Layer::IsVisible failure&rdquo;<br />
** {{issue|113201}} &ldquo;forms/qa/unoapi forms.OEditModel::com::sun::star::form::validation::XValidatableFormComponent failure&rdquo;<br />
** {{issue|113245}} &ldquo;framework/qa/unoapi fwl.TypeDetection failure&rdquo;<br />
** {{issue|113306}} &ldquo;sfx2/qa/unoapi sfx.DocumentTemplates failure&rdquo;<br />
** {{issue|113386}} &ldquo;sd/qa/unoapi sd.AccessibleDrawDocumentView::com::sun::star::accessibility::XAccessibleComponent::containsPoint() failure&rdquo;<br />
** {{issue|113489}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleMenu{,Bar,Separator} failures&rdquo;<br />
** {{issue|114205}} &ldquo;sw/qa/unoapi sw.SwAccessibleParagraphView::com::sun::star::accessibility::XAccessibleText::copyText() failed&rdquo;<br />
** {{issue|114209}} &ldquo;forms/qa/unoapi forms.OGridControlModel::com::sun::star::view::XSelectionSupplier crash&rdquo;<br />
** {{issue|114211}} &ldquo;xmloff/qa/unoapi xmloff.Draw.XMLStylesImporter::com::sun::star::lang::XInitialization crash&rdquo;<br />
** {{issue|114213}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleMenu::com::sun::star::accessibility::XAccessibleSelection failure&rdquo;<br />
** {{issue|114636}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleScrollBar::com::sun::star::accessibility::XAccessibleAction failure&rdquo;<br />
** {{issue|114637}} &ldquo;sw/qa/unoapi sw.SwAccessibleFootnoteView(?) crash&rdquo;<br />
** {{issue|114642}} &ldquo;svx/qa/unoapi svx: svx.SvxUnoTextContent::com::sun::star::style::CharacterProperties crash&rdquo;<br />
** {{issue|114669}} &ldquo;forms/qa/unoapi forms.OListBoxControl crash&rdquo;<br />
** {{issue|114889}} &ldquo;sw/qa/unoapi sw.SwXTextViewCursor::com::sun::star::view::XScreenCursor&rdquo;<br />
** {{issue|116784}} &ldquo;[sfx2] CheckGlobalEventBroadcaster_writer1 fails&rdquo;<br />
** {{issue|116813}} &ldquo;[sfx2] complex.sfx2.UndoManager checkBrokenScripts fails&rdquo;<br />
** {{issue|116814}} &ldquo;[toolkit] unoapi test UnoControlDialogModel: XCloneable fails&rdquo;<br />
* Missing tests:<br />
** {{issue|109564}} &ldquo;qadevOOo/tests/java/ifc/awt/_XSystemChildFactory.java&rdquo;<br />
* Sporadic failures:<br />
** {{issue|111217}} &ldquo;BasicManager::SetGlobalUNOConstant crash during shutdown&rdquo;<br />
** {{issue|111246}} &ldquo;svx::FontHeightToolBoxControl::statusChanged crash (memory corruption)&rdquo;<br />
** {{issue|111271}} &ldquo;Mac OS X: crash during shutdown, __tcf_2 on stack&rdquo;<br />
** {{issue|111400}} &ldquo;Extension Manager does not join spawned uno process (-> smoketestoo_native fails)&rdquo;<br />
** {{issue|112070}} &ldquo;UNO API tests must not use random&rdquo;<br />
** {{issue|113158}} &ldquo;crash with two threads in framework::ToolBarManager dtor&rdquo;<br />
** {{issue|113197}} &ldquo;sw/qa/unoapi sw.SwXTextRange hangs&rdquo;<br />
** {{issue|113367}} &ldquo;sysdtrans deadlock during shutdown&rdquo;<br />
** {{issue|113464}} &ldquo;stoc_smgr::ORegistryServiceManager::dispose crash during shutdown&rdquo;<br />
** {{issue|114207}} &ldquo;framework::ModuleUIConfigurationManager::dispose crash during shutdown&rdquo;<br />
** {{issue|114675}} &ldquo;binary URP bridge race on shut down, crash&rdquo;<br />
** {{issue|114718}} &ldquo;forms/qa/unoapi: crash in remote async release call&rdquo;<br />
** {{issue|116131}} &ldquo;vcl: message unregisterDraggingDestinationHandler: sent to freed object&rdquo;<br />
<br />
[[Category:Effort]][[Category:Test]]</div>Sbhttps://wiki.openoffice.org/wiki/Build_Environment_Effort/Current_workBuild Environment Effort/Current work2011-03-30T13:07:32Z<p>Sb: /* Current work on module migration */</p>
<hr />
<div>{{Build Environment Effort}}<br />
<br />
==The complete progress of module migration is tracked [[Build_Environment_Effort/Module_Status|here]]==<br />
<br />
== Current work on module migration ==<br />
<br />
We decided to use priorities for our future work on the new build environment. Issues found in integrated milestones and new requirements found in converting modules to the new build system get highest priority. The planned module conversions are:<br />
<br />
* wizards (done in CWS gnumake4)<br />
* writerfilter (done in CWS writerfilter10)<br />
* starmath (done in CWS gnumake4)<br />
* sax (done in CWS gunmake4)<br />
* regexp (done in CWS gnumake4)<br />
* basegfx (done in CWS gnumake4)<br />
* basebmp (done in CWS gnumake4)<br />
* filter<br />
* i18npool<br />
* connectivity<br />
* drawinglayer<br />
* avmedia<br />
* rsc<br />
* basic<br />
* shell<br />
* writerperfect<br />
* cppcanvas (done in CWS gnumake4)<br />
* canvas (done in CWS gnumake4)<br />
* oox (in progress in CWS writerfilter10)<br />
* vcl (done in CWS vcl2gnumake)<br />
* linguistic (done in CWS gnumake4)<br />
* idl (done in CWS gnumake4)<br />
* xmlscript (done in CWS gnumake4)<br />
* unotools (done in CWS gnumake4)<br />
* ucbhelper (done inc CWS gnumake4)<br />
* udkapi (in progress in cws ause130)<br />
* offapi (in progress in cws ause130)<br />
* vbaapi (in progress in cws ause130)<br />
* offuh (in progress in cws ause130)<br />
* unoxml (done in CWS xmlfix3)<br />
* padmin (done in CWS vcl118)<br />
* sd (done in cws sd2gbuild)<br />
* xmlreader (done in CWS gnumake4)<br />
* binaryurp (done in {{CWS|sb143}})<br />
* configmgr (done in {{CWS|sb143}})<br />
<br />
This will create a complete module chain from sw to tools and this will allow us to get better performance predictions for the new build system.<br />
<br />
Of course everybody is free to convert any other modules now, moreover, this would be appreciated a lot! Please add the modules you have converted to the list shown above. In case this would create new requirements, we will give them high priority. If you want to support us by converting other modules, please refer to [[Build_Environment_Effort/Module_Migration|Module Migration]].<br />
<br />
== Actions ==<br />
<br />
* bug fixes:<br />
<br />
* new features:<br />
** native resources (done in CWS vcl2gnumake)<br />
** idl compilation (started in cws ause130)<br />
** compilation of jar files (done in CWS gnmake4)<br />
** zipped packages (done in CWS gnumake4)</div>Sbhttps://wiki.openoffice.org/wiki/Talk:Build_Environment_Effort/Current_workTalk:Build Environment Effort/Current work2011-03-30T12:29:30Z<p>Sb: Created page with 'Why have the list at Build_Environment_Effort/Current_work#Current_work_on_module_migration duplicate information available at Build_Environment_Effort/Module_Status? (A…'</p>
<hr />
<div>Why have the list at [[Build_Environment_Effort/Current_work#Current_work_on_module_migration]] duplicate information available at [[Build_Environment_Effort/Module_Status]]? (At least I only updated the latter, being unaware of the former.) [[User:Sb|Sb]] 12:29, 30 March 2011 (UTC)</div>Sbhttps://wiki.openoffice.org/wiki/Test_CleanupTest Cleanup2011-03-21T12:14:43Z<p>Sb: /* unoapi Tests */</p>
<hr />
<div>= Test Cleanup Project =<br />
<br />
The demand for automated (unit) testing should be obvious. See the [http://www.openoffice.org/servlets/ReadMsg?list=dev&msgNo=26189 mission statement mail] and [[Media:JustTestingPresentation.odp|slides]] from a [http://fosdem.org/2010/schedule/events/ooo_testing FOSDEM'10 talk] and an [http://www.ooocon.org/index.php/ooocon/2010/paper/view/188 OOoCon&nbsp;2010 presentation] for more information and further links.<br />
<br />
For examples of how to write xUnit based tests in the OOo code base, see [http://hg.services.openoffice.org/DEV300/file/87f4911ea629/basegfx/test <code>basegfx/test/</code>], [http://hg.services.openoffice.org/DEV300/file/87f4911ea629/sal/qa/ByteSequence <code>sal/qa/ByteSequence/</code>], and [http://hg.services.openoffice.org/DEV300/file/87f4911ea629/smoketestoo_native <code>smoketest_native/</code>]. However, the hard part should not be how to write test code, anyway, but how to write ''testable'' code; see [http://misko.hevery.com/2008/11/04/clean-code-talks-unit-testing/ The Clean Code Talks&mdash;Unit Testing].<br />
<br />
When testing C++ code that merely uses UNO types (no services), but uses them in a way that requires UNO to be bootstrapped so that the relevant type information is available (e.g., putting instances of complex UNO types into <code>com::sun::star::uno::Any</code>), one approach is as follows: In the <code>makefile.mk</code>, instead of <code>.INCLUDE: _cppunit.mk</code> use<br />
<source lang="make"><br />
.IF "$(OS)" == "WNT"<br />
my_file = file:///<br />
.ELSE<br />
my_file = file://<br />
.END<br />
<br />
ALLTAR : test<br />
<br />
test .PHONY : $(SHL1TARGETN)<br />
$(CPPUNITTESTER) $(SHL1TARGETN) \<br />
-env:UNO_TYPES=$(my_file)$(SOLARBINDIR)/types.rdb<br />
</source><br />
and in the test code once call <code>cppu::defaultBootstrap_InitialComponentContext()</code>.<br />
<br />
== User Interface ==<br />
<br />
=== CppUnit ===<br />
<br />
For tests in C++, plain CppUnit (at least version 1.12.1) is available. (OOo bundles CppUnit 1.12.1 as an external module; alternatively, you can configure <code>--with-system-cppunit</code>.)<br />
<br />
Implement the test code as a dynamic library, following CppUnit conventions (i.e., using [http://cppunit.sourceforge.net/doc/lastest/group___creating_test_suite.html#ga0 <code>CPPUNIT_TEST_SUITE_REGISTRATION</code>] and [http://cppunit.sourceforge.net/doc/lastest/_test_plug_in_8h.html#a2 <code>CPPUNIT_PLUGIN_IMPLEMENT</code>] macros). The following settings are needed in the <code>makefile.mk</code>:<br />
* <code>ENABLE_EXCEPTIONS = TRUE</code><br />
* <code>CFLAGSCXX += $(CPPUNIT_CFLAGS)</code><br />
* <code>SHL<var>n</var>RPATH = NONE</code><br />
* <code>SHL<var>n</var>STDLIBS += $(CPPUNITLIB)</code><br />
* <code>SHL<var>n</var>VERSIONMAP = <var>version.map</var></code>, where that file must contain the following (see [[#CppUnit_1.12.1|details]] below for improving this):<br />
UDK_3_0_0 {<br />
global:<br />
cppunitTestPlugIn;<br />
local:<br />
*;<br />
};<br />
<br />
To run tests, <code>sal/cppunittester</code> delivers a <code>cppunittester</code> executable that has some advantages over the plain CppUnit <code>DllPlugInTester</code>:<br />
* It uses <code>SAL_IMPLEMENT_MAIN</code> to properly set up the per-process settings required by URE. Test code as well as tested code based on URE will expect this and would fail in a process that is not set up in this way.<br />
* Getting CppUnit to build as an external module within the Windows OOo build is a non-trivial task. The less parts of it that need to be built, the better.<br />
<br />
Something like the following in <code>makefile.mk</code> will execute the tests:<br />
ALLTAR : test<br />
test .PHONY : $(SHL1TARGETN)<br />
$(CPPUNITTESTER) $(SHL1TARGETN)<br />
<br />
<code>$(CPPUNITTESTER)</code> internally uses <code>$(AUGMENT_LIBRARY_PATH_LOCAL)</code> to favor library instances in the local output tree over ones in solver. Alternatively to the above, <code>.INCLUDE: _cppunit.mk</code> calls <code>$(CPPUNITTESTER)</code> on each of <code>$(SHL1TARGETN)</code>, &hellip;, <code>$(SHL10TARGETN)</code> that is defined.<br />
<br />
=== JUnit ===<br />
<br />
For tests in Java, plain JUnit (at least version 4) is available. (OOo requires JUnit as a prerequisite, see [http://junit.org/ junit.org] for downloads; you can configure <code>--with-junit=<var>&hellip;</var></code> if it is not automatically found; alternatively, you can configure <code>--without-junit</code>, disabling JUnit-based tests.)<br />
<br />
=== <code>subsequenttests</code> ===<br />
<br />
Some tests have build and/or run time dependencies on modules further up in the hierarchy, or modules that the rest of the module in question does not have dependencies on (and which are thus not listed in the module's <code>build.lst</code>). The extreme case are tests that need a complete OOo installation as their test environment.<br />
<br />
For such tests, the whole <code>makefile.mk</code> should be wrapped in:<br />
.IF "$(OOO_SUBSEQUENT_TESTS)" == ""<br />
nothing .PHONY :<br />
.ELSE<br />
...<br />
.END<br />
(and the directory included in the module's <code>build.lst</code>).<br />
<br />
The idea is to do a complete OOo build first (<code>cd smoketestoo_native && build --all</code>) and then build and execute those tests either selectively or wholesale.<br />
<br />
Selectively building a specific such test directory can be done with <code>cd <var>&hellip;</var> && OOO_SUBSEQUENT_TESTS=TRUE dmake</code>.<br />
<br />
To build and execute ''all'' these test directories, the tool <code>subsequenttests</code> (in <code>solenv/bin</code>) exists. It scans the <code>build.lst</code> files of all modules for <code>makefile.mk</code>s that mention <code>OOO_SUBSEQUENT_TESTS</code> and simply executes <code>dmake</code> in all those directories, with <code>OOO_SUBSEQUENT_TESTS</code> set. It supports a <code>-P<var>n</var></code> switch to build <var>n</var> directories in parallel.<br />
<br />
=== Helpers ===<br />
<br />
A new module <code>test</code> shall collect reusable code snippets for C++ and Java tests.<br />
<br />
For now, it concentrates on letting a test connect to an OOo instance via remote UNO: A C++ test class can hold a <code>test::OfficeConnection</code> as class member and, in its CppUnit <code>setUp</code> and <code>tearDown</code> functions, call <code>OfficeConnection::setUp</code> and <code>OfficeConnection::tearDown</code>, respectively. Tests obtain access to the OOo instance via <code>OfficeConnection::getFactory</code>. Similarly, a Java test class can use an <code>org.openoffice.test.OfficeConnection</code> instance, offering the same functionality as its C++ counterpart.<br />
<br />
For this to work, three additional steps are necessary:<br />
* First, in <code>instsetoo_native</code>, building an installation set for the <code>openoffice</code> product in the default language (<code>en-US</code>) in any package format now takes care to always also build an archive package format (<code>tar.gz</code> resp. <code>zip</code>) of that product.<br />
* Second, building <code>smoketestoo_native</code> permanently installs that archive into the solver. (Except on Windows, where problems with resulting long pathnames prevent this; there, as a workaround, each test individually unzips the archive to some local temporary directory.) <br />
* Third, a test that requires an OOo instance includes <code>installationtest.mk</code> in its <code>makefile.mk</code>. That file makes sure to call the CppUnit and JUnit test runners with the information necessary for the helper classes to start the correct OOo instance with a fresh <code>UserInstallation</code> and set up an URP pipe connection. The information is tunneled into the test runner executables as UNO bootstrap parameters.<br />
<br />
For debugging purposes, which OOo instance the tests use can manually be overridden, see [http://www.openoffice.org/servlets/ReadMsg?list=interface-announce&msgNo=1285 &ldquo;OOO_TEST_SOFFICE: allow override of tested soffice process&rdquo;].<br />
<br />
=== <code>unoapi</code> Tests ===<br />
<br />
The <code>unoapi</code> tests are redesigned to use the new test framework. They are plain JUnit tests and use the mechanisms described above to connect to running OOo instances. However, due to the large amount of logic encoded in <code>qadevOOo</code>, those JUnit tests for now are only thin wrappers around <code>org.openoffice.Runner.run</code>. This is intended to change over time.<br />
<br />
The <code>cwscheckapi</code> tool to run the <code>unoapi</code> tests has been subsumed by <code>subsequenttests</code>. The latter always runs all tests, while the former had mechanisms to run only tests for modules that had been changed by a CWS. The hope is that the parallel mode of <code>subsequenttests</code> makes it fast enough so that running all tests all of the times becomes feasible.<br />
<br />
Unfortunately, running the <code>unoapi</code> tests is still not stable enough to give useful results. Therefore, running <code>subsequenttests</code> has been disabled in the build bots for now. Making the tests sufficiently stable is ongoing work.<br />
<br />
== Details ==<br />
<br />
Working on {{CWS|sb118}}, {{CWS|sb120}}.<br />
<br />
=== CppUnit 1.12.1 ===<br />
<br />
* Replace existing <code>cppunit</code> and <code>testshl2</code> combo with latest CppUnit 1.12.1.<br />
* OOo <code>configure --with-system-cppunit</code> (for now only if also <code>--with-system-stl</code>!); minimal required version for now arbitrarily 1.12.1.<br />
* '''TODO:''' Upstream <code>PATCH_FILES</code> (<code>windows.patch</code>?!?).<br />
* '''TODO:''' <code>RPATH</code> in generated libraries and executables.<br />
* '''TODO:''' Improve <code>CPPUNIT_PLUGIN_EXPORT</code> and get rid of version maps (GCC exception problems?).<br />
* '''TODO:''' <code>cppunit/makefile.mk</code> <code>MY_LIBS = -lm</code> Solaris hack.<br />
* '''TODO:''' In general OOo build environment, no longer set <code>CFLAGS</code> etc. as environment variables; have package-specific <code>OOO_<var>package</var>_CFLAGS</code> etc. and combine those into <code>CFLAGS</code> etc. where necessary (see <code>OOO_STLPORT_CXXFLAGS</code> etc. in <code>cppunit/makefile.mk</code>).<br />
* '''TODO:''' Why use <code>cppunittester</code> instead of <code>DllPlugInTester</code>? (Remove building/delivering <code>DllPlugInTester</code>.)<br />
* '''TODO:''' Make <code>operator &lt;&lt;(std::basic_ostream &amp;, rtl::OUString const &amp;)</code> from <code>test/oustringstreaminserter.hxx</code> generally available?<br />
* '''TODO:''' Make STLport <code>num_put</code> symbols available on platforms other than Linux (see <code>solenv/bin/addsym.awk</code>), too, so that <code>CPPUNIT_ASSERT_EQUAL</code> actually outputs numeric values.<br />
<br />
==== Is CppUnit an active project? ====<br />
<br />
When I wrote<br />
<pre><br />
Message-ID: <4D67B884.8080101@oracle.com><br />
Date: Fri, 25 Feb 2011 15:11:16 +0100<br />
From: Stephan Bergmann <stephan.bergmann@oracle.com><br />
MIME-Version: 1.0<br />
To: cppunit-devel@lists.sourceforge.net<br />
Subject: What part of the API is published?<br />
Content-Type: text/plain; charset=UTF-8; format=flowed<br />
Content-Transfer-Encoding: 7bit<br />
<br />
At least for CppUnit 1.12.1, it is unclear whether for example class <br />
DynamicLibraryManager is supposed to be available to client code.<br />
<br />
The HTML documentation's class list contains DynamicLibraryManager just <br />
like, say, TestCase, and I can't find any hint on the former's page that <br />
it is an implementation detail. However, in DynamicLibraryManager.h, <br />
the class is not decorated with CPPUNIT_API.<br />
<br />
Is there any specification of what is published (i.e., stable, usable by <br />
clients) vs. what is implementation detail (i.e., not to be used by <br />
clients)?<br />
<br />
-Stephan<br />
</pre><br />
the only response I ever got was<br />
<pre><br />
MIME-Version: 1.0<br />
Content-Type: text/plain; charset="us-ascii"<br />
Content-Transfer-Encoding: 7bit<br />
Subject: Your message to Cppunit-devel awaits moderator approval<br />
From: cppunit-devel-bounces@lists.sourceforge.net<br />
To: stephan.bergmann@oracle.com<br />
Message-ID: <mailman.49713.1298643119.7082.cppunit-devel@lists.sourceforge.net><br />
Date: Fri, 25 Feb 2011 14:11:59 +0000<br />
<br />
Your mail to 'Cppunit-devel' with the subject<br />
<br />
What part of the API is published?<br />
<br />
Is being held until the list moderator can review it for approval.<br />
<br />
The reason it is being held:<br />
<br />
Post by non-member to a members-only list<br />
<br />
Either the message will get posted to the list, or you will receive<br />
notification of the moderator's decision. If you would like to cancel<br />
this posting, please visit the following URL:<br />
<br />
https://lists.sourceforge.net/lists/confirm/cppunit-devel/1da27e17e1d5fdfcb7f8ac6860a05bb5ca1eab1d<br />
</pre><br />
and the last message in [http://sourceforge.net/mailarchive/forum.php?forum_name=cppunit-devel the archive] is from January 2010.<br />
<br />
=== <code>testshl2</code> ===<br />
<br />
* <code>solenv/inc_cppunit.mk</code>/<code>cppunit.mk</code>: [http://hg.services.openoffice.org/cws/sb118/rev/cf13421c3774 &ldquo;adapted <code>cppunit.mk</code> to <code>cppunittester</code> and no longer require &lsquo;<code>dmake test</code>&rsquo; to run tests&rdquo;].<br />
* '''TODO:''' <code>DEV300_m68</code> introduced <code>TESTSHL2LIB</code> (which I removed again) and uses it in many <code>qa</code> makefiles (that I need to touch someday, anyway).<br />
<br />
=== Unit Tests ===<br />
<br />
* <code>OOO_SUBSEQUENT_TESTS</code> (<code>build.lst</code> lists local dependencies of those directories, so that modifying a module and then calling &ldquo;<code>OOO_SUBSEQUENT_TESTS=x build</code>&rdquo; rebuilds the module and executes the tests).<br />
* '''TODO:''' If Build Environment&nbsp;2.0 would build directly to solver (instead of local output tree/deliver), that would simplify tests that currently need to take care to test local libraries instead of solver ones (see, for example, <code>OOO_TEST_PREFIX</code> in the <code>services.rdb</code> of <code>stoc/test/uriproc/makefile.mk</code>).<br />
{{Documentation/Note|Build Environment&nbsp;2.0 will not build directly to solver, but will make a module depend on the targets in the solver, and these are depending on the targets in the workdir (aka the old "local output tree"). Thus on an usual build in a module building and delivering are not two steps anymore. If tests depend on the target in the solver (which they will do automatically in most use cases, as linking against a library automatically creates a dependency on the library in the solver), they can be sure that the target is up to date in the solver '''and''' in the workdir.<br />
<br />
--[[User:B michaelsen|B michaelsen]] 06:32, 27 August 2010 (UTC)}}<br />
* '''TODO:''' Constructs like &ldquo;<code>-env:UNO_<var>&hellip;</var>=$(my_file)<var>&hellip;</var></code>&rdquo; would fail for problematic characters (spaces!) in paths.<br />
<br />
=== Smoke Test ===<br />
<br />
* Redesign <code>smoketestoo_native</code> to use CppUnit and pre-installed OOo.<br />
* [http://hg.services.openoffice.org/cws/sb118/rev/160b248247a0 &ldquo;changed <code>tools/debug</code> to never fall back from writing to shell to writing to file, and read <code>DBGSV_INIT</code> from <code>rtl::Bootstrap</code>; the latter causes problems if <code>tools/debug</code> is called from static code executing before <code>SAL_MAIN</code> has called <code>osl_setCommandArgs</code> &rarr; removed statics from code and added assertions to <code>osl/process</code>; various improvements to <code>smoketests.cxx</code> (incl. passing an appropriate <code>dbgsv.ini</code> for non-pro builds)&rdquo;] followed by [http://hg.services.openoffice.org/cws/sb118/rev/dbbacb9d2fd3 &ldquo;reverted parts of HG <code>-c&nbsp;160b248247a0</code> again: the &lsquo;static code executing before <code>SAL_MAIN</code>&rsquo; problem was too severe; instead, globally set <code>DBGSV_INIT</code> build env var to new <code>solenv/bin/dbgsv.ini</code>&rdquo;]; see also {{issue|109142}} &ldquo;Let assertions abort&rdquo;.<br />
* '''TODO:''' For <code>smoketestoo_native/makefile.mk</code> &ldquo;<code><nowiki>-env:arg-env=$(OOO_LIBRARY_PATH_VAR)"$${{$(OOO_LIBRARY_PATH_VAR)+=$$$(OOO_LIBRARY_PATH_VAR)}}"</nowiki></code>&rdquo; mechanism: <code>osl_executeProcess</code> <code>ustrEnvironments</code> members without &ldquo;<code>=</code>&rdquo;: all platforms; documentation; documentation of <code>osl_executeProcess_WithRedicrectedIO</code>.<br />
* '''TODO:''' <code>-headless</code>? (appears to still display windows on Windows and Mac OS&nbsp;X, however, see {{issue|109052}})<br />
* '''TODO:''' {{issue|113341}} &ldquo;-nofirststartwizard should disable update check&rdquo;<br />
<br />
=== Pre-Installed OOo ===<br />
<br />
* For Sun Hamburg Release Engineering, take MWS archive installation sets from &ldquo;S:&rdquo; instead of solver: [http://hg.services.openoffice.org/cws/sb118/rev/d5dbea724063 &ldquo;take installation set from <code>SHIPDRIVE</code> if appropriate&rdquo;].<br />
* '''TODO:''' <code>PKGFORMAT=installed</code> instead of <code>archive</code>?<br />
<br />
=== <code>unoapi</code> Tests ===<br />
<br />
* Known issues, open (not yet addressed at all; disabled for now on net-yet-integrated CWS; or fixed on not-yet-integrated CWS):<br />
** {{issue|116120}} &ldquo;vcl: TabControl::ImplGetTabRect negative height leads to X_CreatePixmap BadAlloc&rdquo; (fixed on {{CWS|vcl118}}, integrated into <code>DEV300_m101</code>)<br />
** {{issue|116125}} &ldquo;qadevOOo/qa/complex/junitskeleton failure&rdquo;<br />
** {{issue|116156}} &ldquo;toolkit/qa/unoapi crash in SwAccessibleMap::RemoveContext&rdquo;<br />
** {{issue|116192}} &ldquo;[sw] fixed text fields sometimes get updated&rdquo; (fixed on {{CWS|sw34bf03}}, integrated into <code>DEV300_m102</code>)<br />
** {{issue|116550}} &ldquo;toolkit/qa/unoapi crashes OOo in ~SwAccessibleParagraph vs. SwXTextDocument::close&rdquo;<br />
** {{issue|116583}} &ldquo;comphelper/qa/complex/comphelper failure&rdquo;<br />
** {{issue|116730}} &ldquo;vcl: crash with multiple threads in Window::ImplGrabFocus&rdquo;<br />
** {{issue|116733}} &ldquo;sw: crash in ~SwDrawContact (forms/qa/unoapi)&rdquo;<br />
** {{issue|117381}} &ldquo;ucb/qa/unoapi ucb.UniversalContentBroker::com::sun::star::ucb::XContentProviderManager::deregisterContentProvider() fails with gvfs&rdquo; (fixed on {{CWS|sb140}})<br />
** {{issue|117486}} &ldquo;toolkit/qa/complex/toolkit: "Window pos size wrong"&rdquo; (fixed on {{CWS|sb140}})<br />
** {{issue|117488}} &ldquo;sw/qa/unoapi: sw.SwXViewSettings::com::sun::star::text::ViewSettings::ShowOnlineLayout ShowOnlineLayout/ZoomValue failed&rdquo;<br />
* Known issues, disabled for now:<br />
** {{issue|109517}} &ldquo;sc/qa/unoapi fails for ScAnnotationObj etc.&rdquo;<br />
** {{issue|109518}} &ldquo;sd/qa/unoapi crash in SfxViewShell::GetController&rdquo;<br />
** {{issue|109643}} &ldquo;toolkit/qa/unoapi tests fail when losing focus&rdquo;<br />
** {{issue|109728}} &ldquo;~ScAutoFormatObj uses cleared ScGlobal&rdquo;<br />
** {{issue|109917}} &ldquo;fragile unoapi test using OnUnfocus event&rdquo;<br />
** {{issue|109939}} &ldquo;toolkit: inconsistent UnoControl locking schemes&rdquo;<br />
** {{issue|110862}} &ldquo;sc/qa/unoapi fails for sc.ScDataPilotTableObj::com::sun::star::sheet::XDataPilotTable::refresh()&rdquo;<br />
** {{issue|110988}} &ldquo;svtools/qa/unoapi fails for svtools.AccessibleBrowseBox etc.&rdquo;<br />
** {{issue|111006}} &ldquo;toolkit: deadlock between UnoControls&rdquo;<br />
** {{issue|111032}} &ldquo;sc/qa/unoapi sc.ScAccessibleCell::com::sun::star::accessibility::XAccessibleText getCharacterBounds() failure&rdquo;<br />
** {{issue|111042}} &ldquo;sd/qa/unoapi sd::DrawController::dispose crash&rdquo;<br />
** {{issue|111043}} &ldquo;sd/qa/unoapi sd::DrawController_OutlineView NullPointerException&rdquo;<br />
** {{issue|111102}} &ldquo;chart2: ChartModelHelper::findDiagram returns null&rdquo;<br />
** {{issue|111111}} &ldquo;xmloff.Impress.XMLImporter::com::sun::star::document::XImporter&rdquo;<br />
** {{issue|111113}} &ldquo;toolkit.AccessibleStatusBarItem unoapi failure&rdquo;<br />
** {{issue|111148}} &ldquo;forms/qa/unoapi forms.OImageControlModel::com::sun::star::beans::XMultiPropertySet deadlock&rdquo;<br />
** {{issue|111169}} &ldquo;svx.AccessiblePageShape unoapi failure&rdquo;<br />
** {{issue|111170}} &ldquo;sun/i18n/qa/unoapi "creating a drawdoc" failure&rdquo;<br />
** {{issue|111178}} &ldquo;sw/qa/unoapi SwView::SelectShell crash&rdquo;<br />
** {{issue|111180}} &ldquo;framework/qa/unoapi fwk.Desktop::com::sun::star::frame::XComponentLoader::loadComponentFromURL() failure&rdquo;<br />
** {{issue|111182}} &ldquo;Desktop::terminate -> ~DropTarget -> _objc_error crash&rdquo;<br />
** {{issue|111184}} &ldquo;sal/qa/osl/pipe uses fixed pipe names&rdquo;<br />
** {{issue|111186}} &ldquo;sw/qa/unoapi sw.PageStyle::com::sun::star::beans::XPropertySet::setPropertyValue() failure&rdquo;<br />
** {{issue|111190}} &ldquo;sw/qa/unoapi sw.SwXShape failure&rdquo;<br />
** {{issue|111194}} &ldquo;sw/qa/unoapi sw.XMLExporter crash&rdquo;<br />
** {{issue|111195}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleScrollBar::com::sun::star::accessibility::XAccessibleValue::setCurrentValue() failure&rdquo;<br />
** {{issue|111197}} &ldquo;sw/qa/unoapi sw.SwAccessibleDocumentPageView failure&rdquo;<br />
** {{issue|111199}} &ldquo;sd/qa/unoapi sd.AccessibleOutlineView failure&rdquo;<br />
** {{issue|111200}} &ldquo;xmloff/qa/unoapi xmloff.Draw.XMLMetaImporter failure&rdquo;<br />
** {{issue|111216}} &ldquo;svx/qa/unoapi accessibility deadlock&rdquo;<br />
** {{issue|111218}} &ldquo;sw/qa/unoapi sw.SwAccessibleParagraphView::com::sun::star::accessibility::XAccessibleEventBroadcaster::removeEventListener() failure&rdquo;<br />
** {{issue|111220}} &ldquo;sw/qa/unoapi sw.XMLContentExporter::com::sun::star::document::XFilter::cancel() failure&rdquo;<br />
** {{issue|111224}} &ldquo;xmloff/qa/unoapi xmloff.Impress.XMLContentExporter crash&rdquo;<br />
** {{issue|111225}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleStatusBar failure&rdquo;<br />
** {{issue|111252}} &ldquo;svx/qa/unoapi svx.AccessibleOLEShape deadlock&rdquo;<br />
** {{issue|111273}} &ldquo;sw/qa/unoapi sw.SwXTextEmbeddedObject::com::sun::star::document::XEmbeddedObjectSupplier::getEmbeddedObject() crash&rdquo;<br />
** {{issue|111278}} &ldquo;svx/qa/unoapi svx.AccessibleEditableTextPara failure&rdquo;<br />
** {{issue|111283}} &ldquo;sfx2/qa/unoapi sfx.StandaloneDocumentInfo failure&rdquo;<br />
** {{issue|111285}} &ldquo;forms/qa/unoapi forms.OButtonModel failure&rdquo;<br />
** {{issue|111287}} &ldquo;xmloff/qa/unoapi XMLSettingsIm-/Exporter crash&rdquo;<br />
** {{issue|111329}} &ldquo;sd/qa/unoapi SdXCustomPresentationAccess::getElementNames/ImpEditEngine::OnlineSpellHdl hang&rdquo;<br />
** {{issue|111332}} &ldquo;sw/qa/unoapi sw.XMLStylesExporter::com::sun::star::document::XFilter crash&rdquo;<br />
** {{issue|111333}} &ldquo;forms/qa/unoapi forms.OImageControlControl::com::sun::star::awt::XControl deadlock&rdquo;<br />
** {{issue|112743}} &ldquo;starmath/qa/unoapi sm.XMLSettingsExporter failure&rdquo;<br />
** {{issue|112746}} &ldquo;framework/qa/unoapi fwk.ModuleManager failure (X11 BadWindow)&rdquo;<br />
** {{issue|112751}} &ldquo;testgraphical/qa/graphical failure&rdquo;<br />
** {{issue|112778}} &ldquo;xmloff/qa/unoapi xmloff.Draw.XMLContentExporter failure&rdquo;<br />
** {{issue|113020}} &ldquo;sw/qa/unoapi sw.SwXTextGraphicObject::com::sun::star::beans::XPropertySet failure&rdquo;<br />
** {{issue|113103}} &ldquo;chart2: deadlock between DiagramHelper and Diagram&rdquo;<br />
** {{issue|113136}} &ldquo;sw/qa/unoapi sw.SwAccessibleParagraphView::com::sun::star::accessibility::XAccessibleEditableText failure&rdquo;<br />
** {{issue|113142}} &ldquo;sw/qa/unoapi SwAccessibleContext::RemoveFrmFromAccessibleMap crash&rdquo;<br />
** {{issue|113161}} &ldquo;sd/qa/unoapi sd.SdLayer::com::sun::star::drawing::Layer::IsVisible failure&rdquo;<br />
** {{issue|113201}} &ldquo;forms/qa/unoapi forms.OEditModel::com::sun::star::form::validation::XValidatableFormComponent failure&rdquo;<br />
** {{issue|113245}} &ldquo;framework/qa/unoapi fwl.TypeDetection failure&rdquo;<br />
** {{issue|113306}} &ldquo;sfx2/qa/unoapi sfx.DocumentTemplates failure&rdquo;<br />
** {{issue|113386}} &ldquo;sd/qa/unoapi sd.AccessibleDrawDocumentView::com::sun::star::accessibility::XAccessibleComponent::containsPoint() failure&rdquo;<br />
** {{issue|113489}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleMenu{,Bar,Separator} failures&rdquo;<br />
** {{issue|114205}} &ldquo;sw/qa/unoapi sw.SwAccessibleParagraphView::com::sun::star::accessibility::XAccessibleText::copyText() failed&rdquo;<br />
** {{issue|114209}} &ldquo;forms/qa/unoapi forms.OGridControlModel::com::sun::star::view::XSelectionSupplier crash&rdquo;<br />
** {{issue|114211}} &ldquo;xmloff/qa/unoapi xmloff.Draw.XMLStylesImporter::com::sun::star::lang::XInitialization crash&rdquo;<br />
** {{issue|114213}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleMenu::com::sun::star::accessibility::XAccessibleSelection failure&rdquo;<br />
** {{issue|114636}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleScrollBar::com::sun::star::accessibility::XAccessibleAction failure&rdquo;<br />
** {{issue|114637}} &ldquo;sw/qa/unoapi sw.SwAccessibleFootnoteView(?) crash&rdquo;<br />
** {{issue|114642}} &ldquo;svx/qa/unoapi svx: svx.SvxUnoTextContent::com::sun::star::style::CharacterProperties crash&rdquo;<br />
** {{issue|114669}} &ldquo;forms/qa/unoapi forms.OListBoxControl crash&rdquo;<br />
** {{issue|114889}} &ldquo;sw/qa/unoapi sw.SwXTextViewCursor::com::sun::star::view::XScreenCursor&rdquo;<br />
** {{issue|116784}} &ldquo;[sfx2] CheckGlobalEventBroadcaster_writer1 fails&rdquo;<br />
** {{issue|116813}} &ldquo;[sfx2] complex.sfx2.UndoManager checkBrokenScripts fails&rdquo;<br />
** {{issue|116814}} &ldquo;[toolkit] unoapi test UnoControlDialogModel: XCloneable fails&rdquo;<br />
* Missing tests:<br />
** {{issue|109564}} &ldquo;qadevOOo/tests/java/ifc/awt/_XSystemChildFactory.java&rdquo;<br />
* Sporadic failures:<br />
** {{issue|111217}} &ldquo;BasicManager::SetGlobalUNOConstant crash during shutdown&rdquo;<br />
** {{issue|111246}} &ldquo;svx::FontHeightToolBoxControl::statusChanged crash (memory corruption)&rdquo;<br />
** {{issue|111271}} &ldquo;Mac OS X: crash during shutdown, __tcf_2 on stack&rdquo;<br />
** {{issue|111400}} &ldquo;Extension Manager does not join spawned uno process (-> smoketestoo_native fails)&rdquo;<br />
** {{issue|112070}} &ldquo;UNO API tests must not use random&rdquo;<br />
** {{issue|113158}} &ldquo;crash with two threads in framework::ToolBarManager dtor&rdquo;<br />
** {{issue|113197}} &ldquo;sw/qa/unoapi sw.SwXTextRange hangs&rdquo;<br />
** {{issue|113367}} &ldquo;sysdtrans deadlock during shutdown&rdquo;<br />
** {{issue|113464}} &ldquo;stoc_smgr::ORegistryServiceManager::dispose crash during shutdown&rdquo;<br />
** {{issue|114207}} &ldquo;framework::ModuleUIConfigurationManager::dispose crash during shutdown&rdquo;<br />
** {{issue|114675}} &ldquo;binary URP bridge race on shut down, crash&rdquo;<br />
** {{issue|114718}} &ldquo;forms/qa/unoapi: crash in remote async release call&rdquo;<br />
** {{issue|116131}} &ldquo;vcl: message unregisterDraggingDestinationHandler: sent to freed object&rdquo;<br />
<br />
[[Category:Effort]][[Category:Test]]</div>Sbhttps://wiki.openoffice.org/wiki/Test_CleanupTest Cleanup2011-03-21T10:28:20Z<p>Sb: /* unoapi Tests */</p>
<hr />
<div>= Test Cleanup Project =<br />
<br />
The demand for automated (unit) testing should be obvious. See the [http://www.openoffice.org/servlets/ReadMsg?list=dev&msgNo=26189 mission statement mail] and [[Media:JustTestingPresentation.odp|slides]] from a [http://fosdem.org/2010/schedule/events/ooo_testing FOSDEM'10 talk] and an [http://www.ooocon.org/index.php/ooocon/2010/paper/view/188 OOoCon&nbsp;2010 presentation] for more information and further links.<br />
<br />
For examples of how to write xUnit based tests in the OOo code base, see [http://hg.services.openoffice.org/DEV300/file/87f4911ea629/basegfx/test <code>basegfx/test/</code>], [http://hg.services.openoffice.org/DEV300/file/87f4911ea629/sal/qa/ByteSequence <code>sal/qa/ByteSequence/</code>], and [http://hg.services.openoffice.org/DEV300/file/87f4911ea629/smoketestoo_native <code>smoketest_native/</code>]. However, the hard part should not be how to write test code, anyway, but how to write ''testable'' code; see [http://misko.hevery.com/2008/11/04/clean-code-talks-unit-testing/ The Clean Code Talks&mdash;Unit Testing].<br />
<br />
When testing C++ code that merely uses UNO types (no services), but uses them in a way that requires UNO to be bootstrapped so that the relevant type information is available (e.g., putting instances of complex UNO types into <code>com::sun::star::uno::Any</code>), one approach is as follows: In the <code>makefile.mk</code>, instead of <code>.INCLUDE: _cppunit.mk</code> use<br />
<source lang="make"><br />
.IF "$(OS)" == "WNT"<br />
my_file = file:///<br />
.ELSE<br />
my_file = file://<br />
.END<br />
<br />
ALLTAR : test<br />
<br />
test .PHONY : $(SHL1TARGETN)<br />
$(CPPUNITTESTER) $(SHL1TARGETN) \<br />
-env:UNO_TYPES=$(my_file)$(SOLARBINDIR)/types.rdb<br />
</source><br />
and in the test code once call <code>cppu::defaultBootstrap_InitialComponentContext()</code>.<br />
<br />
== User Interface ==<br />
<br />
=== CppUnit ===<br />
<br />
For tests in C++, plain CppUnit (at least version 1.12.1) is available. (OOo bundles CppUnit 1.12.1 as an external module; alternatively, you can configure <code>--with-system-cppunit</code>.)<br />
<br />
Implement the test code as a dynamic library, following CppUnit conventions (i.e., using [http://cppunit.sourceforge.net/doc/lastest/group___creating_test_suite.html#ga0 <code>CPPUNIT_TEST_SUITE_REGISTRATION</code>] and [http://cppunit.sourceforge.net/doc/lastest/_test_plug_in_8h.html#a2 <code>CPPUNIT_PLUGIN_IMPLEMENT</code>] macros). The following settings are needed in the <code>makefile.mk</code>:<br />
* <code>ENABLE_EXCEPTIONS = TRUE</code><br />
* <code>CFLAGSCXX += $(CPPUNIT_CFLAGS)</code><br />
* <code>SHL<var>n</var>RPATH = NONE</code><br />
* <code>SHL<var>n</var>STDLIBS += $(CPPUNITLIB)</code><br />
* <code>SHL<var>n</var>VERSIONMAP = <var>version.map</var></code>, where that file must contain the following (see [[#CppUnit_1.12.1|details]] below for improving this):<br />
UDK_3_0_0 {<br />
global:<br />
cppunitTestPlugIn;<br />
local:<br />
*;<br />
};<br />
<br />
To run tests, <code>sal/cppunittester</code> delivers a <code>cppunittester</code> executable that has some advantages over the plain CppUnit <code>DllPlugInTester</code>:<br />
* It uses <code>SAL_IMPLEMENT_MAIN</code> to properly set up the per-process settings required by URE. Test code as well as tested code based on URE will expect this and would fail in a process that is not set up in this way.<br />
* Getting CppUnit to build as an external module within the Windows OOo build is a non-trivial task. The less parts of it that need to be built, the better.<br />
<br />
Something like the following in <code>makefile.mk</code> will execute the tests:<br />
ALLTAR : test<br />
test .PHONY : $(SHL1TARGETN)<br />
$(CPPUNITTESTER) $(SHL1TARGETN)<br />
<br />
<code>$(CPPUNITTESTER)</code> internally uses <code>$(AUGMENT_LIBRARY_PATH_LOCAL)</code> to favor library instances in the local output tree over ones in solver. Alternatively to the above, <code>.INCLUDE: _cppunit.mk</code> calls <code>$(CPPUNITTESTER)</code> on each of <code>$(SHL1TARGETN)</code>, &hellip;, <code>$(SHL10TARGETN)</code> that is defined.<br />
<br />
=== JUnit ===<br />
<br />
For tests in Java, plain JUnit (at least version 4) is available. (OOo requires JUnit as a prerequisite, see [http://junit.org/ junit.org] for downloads; you can configure <code>--with-junit=<var>&hellip;</var></code> if it is not automatically found; alternatively, you can configure <code>--without-junit</code>, disabling JUnit-based tests.)<br />
<br />
=== <code>subsequenttests</code> ===<br />
<br />
Some tests have build and/or run time dependencies on modules further up in the hierarchy, or modules that the rest of the module in question does not have dependencies on (and which are thus not listed in the module's <code>build.lst</code>). The extreme case are tests that need a complete OOo installation as their test environment.<br />
<br />
For such tests, the whole <code>makefile.mk</code> should be wrapped in:<br />
.IF "$(OOO_SUBSEQUENT_TESTS)" == ""<br />
nothing .PHONY :<br />
.ELSE<br />
...<br />
.END<br />
(and the directory included in the module's <code>build.lst</code>).<br />
<br />
The idea is to do a complete OOo build first (<code>cd smoketestoo_native && build --all</code>) and then build and execute those tests either selectively or wholesale.<br />
<br />
Selectively building a specific such test directory can be done with <code>cd <var>&hellip;</var> && OOO_SUBSEQUENT_TESTS=TRUE dmake</code>.<br />
<br />
To build and execute ''all'' these test directories, the tool <code>subsequenttests</code> (in <code>solenv/bin</code>) exists. It scans the <code>build.lst</code> files of all modules for <code>makefile.mk</code>s that mention <code>OOO_SUBSEQUENT_TESTS</code> and simply executes <code>dmake</code> in all those directories, with <code>OOO_SUBSEQUENT_TESTS</code> set. It supports a <code>-P<var>n</var></code> switch to build <var>n</var> directories in parallel.<br />
<br />
=== Helpers ===<br />
<br />
A new module <code>test</code> shall collect reusable code snippets for C++ and Java tests.<br />
<br />
For now, it concentrates on letting a test connect to an OOo instance via remote UNO: A C++ test class can hold a <code>test::OfficeConnection</code> as class member and, in its CppUnit <code>setUp</code> and <code>tearDown</code> functions, call <code>OfficeConnection::setUp</code> and <code>OfficeConnection::tearDown</code>, respectively. Tests obtain access to the OOo instance via <code>OfficeConnection::getFactory</code>. Similarly, a Java test class can use an <code>org.openoffice.test.OfficeConnection</code> instance, offering the same functionality as its C++ counterpart.<br />
<br />
For this to work, three additional steps are necessary:<br />
* First, in <code>instsetoo_native</code>, building an installation set for the <code>openoffice</code> product in the default language (<code>en-US</code>) in any package format now takes care to always also build an archive package format (<code>tar.gz</code> resp. <code>zip</code>) of that product.<br />
* Second, building <code>smoketestoo_native</code> permanently installs that archive into the solver. (Except on Windows, where problems with resulting long pathnames prevent this; there, as a workaround, each test individually unzips the archive to some local temporary directory.) <br />
* Third, a test that requires an OOo instance includes <code>installationtest.mk</code> in its <code>makefile.mk</code>. That file makes sure to call the CppUnit and JUnit test runners with the information necessary for the helper classes to start the correct OOo instance with a fresh <code>UserInstallation</code> and set up an URP pipe connection. The information is tunneled into the test runner executables as UNO bootstrap parameters.<br />
<br />
For debugging purposes, which OOo instance the tests use can manually be overridden, see [http://www.openoffice.org/servlets/ReadMsg?list=interface-announce&msgNo=1285 &ldquo;OOO_TEST_SOFFICE: allow override of tested soffice process&rdquo;].<br />
<br />
=== <code>unoapi</code> Tests ===<br />
<br />
The <code>unoapi</code> tests are redesigned to use the new test framework. They are plain JUnit tests and use the mechanisms described above to connect to running OOo instances. However, due to the large amount of logic encoded in <code>qadevOOo</code>, those JUnit tests for now are only thin wrappers around <code>org.openoffice.Runner.run</code>. This is intended to change over time.<br />
<br />
The <code>cwscheckapi</code> tool to run the <code>unoapi</code> tests has been subsumed by <code>subsequenttests</code>. The latter always runs all tests, while the former had mechanisms to run only tests for modules that had been changed by a CWS. The hope is that the parallel mode of <code>subsequenttests</code> makes it fast enough so that running all tests all of the times becomes feasible.<br />
<br />
Unfortunately, running the <code>unoapi</code> tests is still not stable enough to give useful results. Therefore, running <code>subsequenttests</code> has been disabled in the build bots for now. Making the tests sufficiently stable is ongoing work.<br />
<br />
== Details ==<br />
<br />
Working on {{CWS|sb118}}, {{CWS|sb120}}.<br />
<br />
=== CppUnit 1.12.1 ===<br />
<br />
* Replace existing <code>cppunit</code> and <code>testshl2</code> combo with latest CppUnit 1.12.1.<br />
* OOo <code>configure --with-system-cppunit</code> (for now only if also <code>--with-system-stl</code>!); minimal required version for now arbitrarily 1.12.1.<br />
* '''TODO:''' Upstream <code>PATCH_FILES</code> (<code>windows.patch</code>?!?).<br />
* '''TODO:''' <code>RPATH</code> in generated libraries and executables.<br />
* '''TODO:''' Improve <code>CPPUNIT_PLUGIN_EXPORT</code> and get rid of version maps (GCC exception problems?).<br />
* '''TODO:''' <code>cppunit/makefile.mk</code> <code>MY_LIBS = -lm</code> Solaris hack.<br />
* '''TODO:''' In general OOo build environment, no longer set <code>CFLAGS</code> etc. as environment variables; have package-specific <code>OOO_<var>package</var>_CFLAGS</code> etc. and combine those into <code>CFLAGS</code> etc. where necessary (see <code>OOO_STLPORT_CXXFLAGS</code> etc. in <code>cppunit/makefile.mk</code>).<br />
* '''TODO:''' Why use <code>cppunittester</code> instead of <code>DllPlugInTester</code>? (Remove building/delivering <code>DllPlugInTester</code>.)<br />
* '''TODO:''' Make <code>operator &lt;&lt;(std::basic_ostream &amp;, rtl::OUString const &amp;)</code> from <code>test/oustringstreaminserter.hxx</code> generally available?<br />
* '''TODO:''' Make STLport <code>num_put</code> symbols available on platforms other than Linux (see <code>solenv/bin/addsym.awk</code>), too, so that <code>CPPUNIT_ASSERT_EQUAL</code> actually outputs numeric values.<br />
<br />
==== Is CppUnit an active project? ====<br />
<br />
When I wrote<br />
<pre><br />
Message-ID: <4D67B884.8080101@oracle.com><br />
Date: Fri, 25 Feb 2011 15:11:16 +0100<br />
From: Stephan Bergmann <stephan.bergmann@oracle.com><br />
MIME-Version: 1.0<br />
To: cppunit-devel@lists.sourceforge.net<br />
Subject: What part of the API is published?<br />
Content-Type: text/plain; charset=UTF-8; format=flowed<br />
Content-Transfer-Encoding: 7bit<br />
<br />
At least for CppUnit 1.12.1, it is unclear whether for example class <br />
DynamicLibraryManager is supposed to be available to client code.<br />
<br />
The HTML documentation's class list contains DynamicLibraryManager just <br />
like, say, TestCase, and I can't find any hint on the former's page that <br />
it is an implementation detail. However, in DynamicLibraryManager.h, <br />
the class is not decorated with CPPUNIT_API.<br />
<br />
Is there any specification of what is published (i.e., stable, usable by <br />
clients) vs. what is implementation detail (i.e., not to be used by <br />
clients)?<br />
<br />
-Stephan<br />
</pre><br />
the only response I ever got was<br />
<pre><br />
MIME-Version: 1.0<br />
Content-Type: text/plain; charset="us-ascii"<br />
Content-Transfer-Encoding: 7bit<br />
Subject: Your message to Cppunit-devel awaits moderator approval<br />
From: cppunit-devel-bounces@lists.sourceforge.net<br />
To: stephan.bergmann@oracle.com<br />
Message-ID: <mailman.49713.1298643119.7082.cppunit-devel@lists.sourceforge.net><br />
Date: Fri, 25 Feb 2011 14:11:59 +0000<br />
<br />
Your mail to 'Cppunit-devel' with the subject<br />
<br />
What part of the API is published?<br />
<br />
Is being held until the list moderator can review it for approval.<br />
<br />
The reason it is being held:<br />
<br />
Post by non-member to a members-only list<br />
<br />
Either the message will get posted to the list, or you will receive<br />
notification of the moderator's decision. If you would like to cancel<br />
this posting, please visit the following URL:<br />
<br />
https://lists.sourceforge.net/lists/confirm/cppunit-devel/1da27e17e1d5fdfcb7f8ac6860a05bb5ca1eab1d<br />
</pre><br />
and the last message in [http://sourceforge.net/mailarchive/forum.php?forum_name=cppunit-devel the archive] is from January 2010.<br />
<br />
=== <code>testshl2</code> ===<br />
<br />
* <code>solenv/inc_cppunit.mk</code>/<code>cppunit.mk</code>: [http://hg.services.openoffice.org/cws/sb118/rev/cf13421c3774 &ldquo;adapted <code>cppunit.mk</code> to <code>cppunittester</code> and no longer require &lsquo;<code>dmake test</code>&rsquo; to run tests&rdquo;].<br />
* '''TODO:''' <code>DEV300_m68</code> introduced <code>TESTSHL2LIB</code> (which I removed again) and uses it in many <code>qa</code> makefiles (that I need to touch someday, anyway).<br />
<br />
=== Unit Tests ===<br />
<br />
* <code>OOO_SUBSEQUENT_TESTS</code> (<code>build.lst</code> lists local dependencies of those directories, so that modifying a module and then calling &ldquo;<code>OOO_SUBSEQUENT_TESTS=x build</code>&rdquo; rebuilds the module and executes the tests).<br />
* '''TODO:''' If Build Environment&nbsp;2.0 would build directly to solver (instead of local output tree/deliver), that would simplify tests that currently need to take care to test local libraries instead of solver ones (see, for example, <code>OOO_TEST_PREFIX</code> in the <code>services.rdb</code> of <code>stoc/test/uriproc/makefile.mk</code>).<br />
{{Documentation/Note|Build Environment&nbsp;2.0 will not build directly to solver, but will make a module depend on the targets in the solver, and these are depending on the targets in the workdir (aka the old "local output tree"). Thus on an usual build in a module building and delivering are not two steps anymore. If tests depend on the target in the solver (which they will do automatically in most use cases, as linking against a library automatically creates a dependency on the library in the solver), they can be sure that the target is up to date in the solver '''and''' in the workdir.<br />
<br />
--[[User:B michaelsen|B michaelsen]] 06:32, 27 August 2010 (UTC)}}<br />
* '''TODO:''' Constructs like &ldquo;<code>-env:UNO_<var>&hellip;</var>=$(my_file)<var>&hellip;</var></code>&rdquo; would fail for problematic characters (spaces!) in paths.<br />
<br />
=== Smoke Test ===<br />
<br />
* Redesign <code>smoketestoo_native</code> to use CppUnit and pre-installed OOo.<br />
* [http://hg.services.openoffice.org/cws/sb118/rev/160b248247a0 &ldquo;changed <code>tools/debug</code> to never fall back from writing to shell to writing to file, and read <code>DBGSV_INIT</code> from <code>rtl::Bootstrap</code>; the latter causes problems if <code>tools/debug</code> is called from static code executing before <code>SAL_MAIN</code> has called <code>osl_setCommandArgs</code> &rarr; removed statics from code and added assertions to <code>osl/process</code>; various improvements to <code>smoketests.cxx</code> (incl. passing an appropriate <code>dbgsv.ini</code> for non-pro builds)&rdquo;] followed by [http://hg.services.openoffice.org/cws/sb118/rev/dbbacb9d2fd3 &ldquo;reverted parts of HG <code>-c&nbsp;160b248247a0</code> again: the &lsquo;static code executing before <code>SAL_MAIN</code>&rsquo; problem was too severe; instead, globally set <code>DBGSV_INIT</code> build env var to new <code>solenv/bin/dbgsv.ini</code>&rdquo;]; see also {{issue|109142}} &ldquo;Let assertions abort&rdquo;.<br />
* '''TODO:''' For <code>smoketestoo_native/makefile.mk</code> &ldquo;<code><nowiki>-env:arg-env=$(OOO_LIBRARY_PATH_VAR)"$${{$(OOO_LIBRARY_PATH_VAR)+=$$$(OOO_LIBRARY_PATH_VAR)}}"</nowiki></code>&rdquo; mechanism: <code>osl_executeProcess</code> <code>ustrEnvironments</code> members without &ldquo;<code>=</code>&rdquo;: all platforms; documentation; documentation of <code>osl_executeProcess_WithRedicrectedIO</code>.<br />
* '''TODO:''' <code>-headless</code>? (appears to still display windows on Windows and Mac OS&nbsp;X, however, see {{issue|109052}})<br />
* '''TODO:''' {{issue|113341}} &ldquo;-nofirststartwizard should disable update check&rdquo;<br />
<br />
=== Pre-Installed OOo ===<br />
<br />
* For Sun Hamburg Release Engineering, take MWS archive installation sets from &ldquo;S:&rdquo; instead of solver: [http://hg.services.openoffice.org/cws/sb118/rev/d5dbea724063 &ldquo;take installation set from <code>SHIPDRIVE</code> if appropriate&rdquo;].<br />
* '''TODO:''' <code>PKGFORMAT=installed</code> instead of <code>archive</code>?<br />
<br />
=== <code>unoapi</code> Tests ===<br />
<br />
* Known issues, open (not yet addressed at all; disabled for now on net-yet-integrated CWS; or fixed on not-yet-integrated CWS):<br />
** {{issue|116120}} &ldquo;vcl: TabControl::ImplGetTabRect negative height leads to X_CreatePixmap BadAlloc&rdquo; (fixed on {{CWS|vcl118}}, integrated into <code>DEV300_m101</code>)<br />
** {{issue|116125}} &ldquo;qadevOOo/qa/complex/junitskeleton failure&rdquo;<br />
** {{issue|116156}} &ldquo;toolkit/qa/unoapi crash in SwAccessibleMap::RemoveContext&rdquo;<br />
** {{issue|116192}} &ldquo;[sw] fixed text fields sometimes get updated&rdquo; (fixed on {{CWS|sw34bf03}}, integrated into <code>DEV300_m102</code>)<br />
** {{issue|116550}} &ldquo;toolkit/qa/unoapi crashes OOo in ~SwAccessibleParagraph vs. SwXTextDocument::close&rdquo;<br />
** {{issue|116583}} &ldquo;comphelper/qa/complex/comphelper failure&rdquo;<br />
** {{issue|116730}} &ldquo;vcl: crash with multiple threads in Window::ImplGrabFocus&rdquo;<br />
** {{issue|116733}} &ldquo;sw: crash in ~SwDrawContact (forms/qa/unoapi)&rdquo;<br />
** {{issue|117381}} &ldquo;ucb/qa/unoapi ucb.UniversalContentBroker::com::sun::star::ucb::XContentProviderManager::deregisterContentProvider() fails with gvfs&rdquo; (fixed on {{CWS|sb140}})<br />
** {{issue|117486}} &ldquo;toolkit/qa/complex/toolkit: "Window pos size wrong"&rdquo; (fixed on {{CWS|sb140}})<br />
* Known issues, disabled for now:<br />
** {{issue|109517}} &ldquo;sc/qa/unoapi fails for ScAnnotationObj etc.&rdquo;<br />
** {{issue|109518}} &ldquo;sd/qa/unoapi crash in SfxViewShell::GetController&rdquo;<br />
** {{issue|109643}} &ldquo;toolkit/qa/unoapi tests fail when losing focus&rdquo;<br />
** {{issue|109728}} &ldquo;~ScAutoFormatObj uses cleared ScGlobal&rdquo;<br />
** {{issue|109917}} &ldquo;fragile unoapi test using OnUnfocus event&rdquo;<br />
** {{issue|109939}} &ldquo;toolkit: inconsistent UnoControl locking schemes&rdquo;<br />
** {{issue|110862}} &ldquo;sc/qa/unoapi fails for sc.ScDataPilotTableObj::com::sun::star::sheet::XDataPilotTable::refresh()&rdquo;<br />
** {{issue|110988}} &ldquo;svtools/qa/unoapi fails for svtools.AccessibleBrowseBox etc.&rdquo;<br />
** {{issue|111006}} &ldquo;toolkit: deadlock between UnoControls&rdquo;<br />
** {{issue|111032}} &ldquo;sc/qa/unoapi sc.ScAccessibleCell::com::sun::star::accessibility::XAccessibleText getCharacterBounds() failure&rdquo;<br />
** {{issue|111042}} &ldquo;sd/qa/unoapi sd::DrawController::dispose crash&rdquo;<br />
** {{issue|111043}} &ldquo;sd/qa/unoapi sd::DrawController_OutlineView NullPointerException&rdquo;<br />
** {{issue|111102}} &ldquo;chart2: ChartModelHelper::findDiagram returns null&rdquo;<br />
** {{issue|111111}} &ldquo;xmloff.Impress.XMLImporter::com::sun::star::document::XImporter&rdquo;<br />
** {{issue|111113}} &ldquo;toolkit.AccessibleStatusBarItem unoapi failure&rdquo;<br />
** {{issue|111148}} &ldquo;forms/qa/unoapi forms.OImageControlModel::com::sun::star::beans::XMultiPropertySet deadlock&rdquo;<br />
** {{issue|111169}} &ldquo;svx.AccessiblePageShape unoapi failure&rdquo;<br />
** {{issue|111170}} &ldquo;sun/i18n/qa/unoapi "creating a drawdoc" failure&rdquo;<br />
** {{issue|111178}} &ldquo;sw/qa/unoapi SwView::SelectShell crash&rdquo;<br />
** {{issue|111180}} &ldquo;framework/qa/unoapi fwk.Desktop::com::sun::star::frame::XComponentLoader::loadComponentFromURL() failure&rdquo;<br />
** {{issue|111182}} &ldquo;Desktop::terminate -> ~DropTarget -> _objc_error crash&rdquo;<br />
** {{issue|111184}} &ldquo;sal/qa/osl/pipe uses fixed pipe names&rdquo;<br />
** {{issue|111186}} &ldquo;sw/qa/unoapi sw.PageStyle::com::sun::star::beans::XPropertySet::setPropertyValue() failure&rdquo;<br />
** {{issue|111190}} &ldquo;sw/qa/unoapi sw.SwXShape failure&rdquo;<br />
** {{issue|111194}} &ldquo;sw/qa/unoapi sw.XMLExporter crash&rdquo;<br />
** {{issue|111195}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleScrollBar::com::sun::star::accessibility::XAccessibleValue::setCurrentValue() failure&rdquo;<br />
** {{issue|111197}} &ldquo;sw/qa/unoapi sw.SwAccessibleDocumentPageView failure&rdquo;<br />
** {{issue|111199}} &ldquo;sd/qa/unoapi sd.AccessibleOutlineView failure&rdquo;<br />
** {{issue|111200}} &ldquo;xmloff/qa/unoapi xmloff.Draw.XMLMetaImporter failure&rdquo;<br />
** {{issue|111216}} &ldquo;svx/qa/unoapi accessibility deadlock&rdquo;<br />
** {{issue|111218}} &ldquo;sw/qa/unoapi sw.SwAccessibleParagraphView::com::sun::star::accessibility::XAccessibleEventBroadcaster::removeEventListener() failure&rdquo;<br />
** {{issue|111220}} &ldquo;sw/qa/unoapi sw.XMLContentExporter::com::sun::star::document::XFilter::cancel() failure&rdquo;<br />
** {{issue|111224}} &ldquo;xmloff/qa/unoapi xmloff.Impress.XMLContentExporter crash&rdquo;<br />
** {{issue|111225}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleStatusBar failure&rdquo;<br />
** {{issue|111252}} &ldquo;svx/qa/unoapi svx.AccessibleOLEShape deadlock&rdquo;<br />
** {{issue|111273}} &ldquo;sw/qa/unoapi sw.SwXTextEmbeddedObject::com::sun::star::document::XEmbeddedObjectSupplier::getEmbeddedObject() crash&rdquo;<br />
** {{issue|111278}} &ldquo;svx/qa/unoapi svx.AccessibleEditableTextPara failure&rdquo;<br />
** {{issue|111283}} &ldquo;sfx2/qa/unoapi sfx.StandaloneDocumentInfo failure&rdquo;<br />
** {{issue|111285}} &ldquo;forms/qa/unoapi forms.OButtonModel failure&rdquo;<br />
** {{issue|111287}} &ldquo;xmloff/qa/unoapi XMLSettingsIm-/Exporter crash&rdquo;<br />
** {{issue|111329}} &ldquo;sd/qa/unoapi SdXCustomPresentationAccess::getElementNames/ImpEditEngine::OnlineSpellHdl hang&rdquo;<br />
** {{issue|111332}} &ldquo;sw/qa/unoapi sw.XMLStylesExporter::com::sun::star::document::XFilter crash&rdquo;<br />
** {{issue|111333}} &ldquo;forms/qa/unoapi forms.OImageControlControl::com::sun::star::awt::XControl deadlock&rdquo;<br />
** {{issue|112743}} &ldquo;starmath/qa/unoapi sm.XMLSettingsExporter failure&rdquo;<br />
** {{issue|112746}} &ldquo;framework/qa/unoapi fwk.ModuleManager failure (X11 BadWindow)&rdquo;<br />
** {{issue|112751}} &ldquo;testgraphical/qa/graphical failure&rdquo;<br />
** {{issue|112778}} &ldquo;xmloff/qa/unoapi xmloff.Draw.XMLContentExporter failure&rdquo;<br />
** {{issue|113020}} &ldquo;sw/qa/unoapi sw.SwXTextGraphicObject::com::sun::star::beans::XPropertySet failure&rdquo;<br />
** {{issue|113103}} &ldquo;chart2: deadlock between DiagramHelper and Diagram&rdquo;<br />
** {{issue|113136}} &ldquo;sw/qa/unoapi sw.SwAccessibleParagraphView::com::sun::star::accessibility::XAccessibleEditableText failure&rdquo;<br />
** {{issue|113142}} &ldquo;sw/qa/unoapi SwAccessibleContext::RemoveFrmFromAccessibleMap crash&rdquo;<br />
** {{issue|113161}} &ldquo;sd/qa/unoapi sd.SdLayer::com::sun::star::drawing::Layer::IsVisible failure&rdquo;<br />
** {{issue|113201}} &ldquo;forms/qa/unoapi forms.OEditModel::com::sun::star::form::validation::XValidatableFormComponent failure&rdquo;<br />
** {{issue|113245}} &ldquo;framework/qa/unoapi fwl.TypeDetection failure&rdquo;<br />
** {{issue|113306}} &ldquo;sfx2/qa/unoapi sfx.DocumentTemplates failure&rdquo;<br />
** {{issue|113386}} &ldquo;sd/qa/unoapi sd.AccessibleDrawDocumentView::com::sun::star::accessibility::XAccessibleComponent::containsPoint() failure&rdquo;<br />
** {{issue|113489}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleMenu{,Bar,Separator} failures&rdquo;<br />
** {{issue|114205}} &ldquo;sw/qa/unoapi sw.SwAccessibleParagraphView::com::sun::star::accessibility::XAccessibleText::copyText() failed&rdquo;<br />
** {{issue|114209}} &ldquo;forms/qa/unoapi forms.OGridControlModel::com::sun::star::view::XSelectionSupplier crash&rdquo;<br />
** {{issue|114211}} &ldquo;xmloff/qa/unoapi xmloff.Draw.XMLStylesImporter::com::sun::star::lang::XInitialization crash&rdquo;<br />
** {{issue|114213}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleMenu::com::sun::star::accessibility::XAccessibleSelection failure&rdquo;<br />
** {{issue|114636}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleScrollBar::com::sun::star::accessibility::XAccessibleAction failure&rdquo;<br />
** {{issue|114637}} &ldquo;sw/qa/unoapi sw.SwAccessibleFootnoteView(?) crash&rdquo;<br />
** {{issue|114642}} &ldquo;svx/qa/unoapi svx: svx.SvxUnoTextContent::com::sun::star::style::CharacterProperties crash&rdquo;<br />
** {{issue|114669}} &ldquo;forms/qa/unoapi forms.OListBoxControl crash&rdquo;<br />
** {{issue|114889}} &ldquo;sw/qa/unoapi sw.SwXTextViewCursor::com::sun::star::view::XScreenCursor&rdquo;<br />
** {{issue|116784}} &ldquo;[sfx2] CheckGlobalEventBroadcaster_writer1 fails&rdquo;<br />
** {{issue|116813}} &ldquo;[sfx2] complex.sfx2.UndoManager checkBrokenScripts fails&rdquo;<br />
** {{issue|116814}} &ldquo;[toolkit] unoapi test UnoControlDialogModel: XCloneable fails&rdquo;<br />
* Missing tests:<br />
** {{issue|109564}} &ldquo;qadevOOo/tests/java/ifc/awt/_XSystemChildFactory.java&rdquo;<br />
* Sporadic failures:<br />
** {{issue|111217}} &ldquo;BasicManager::SetGlobalUNOConstant crash during shutdown&rdquo;<br />
** {{issue|111246}} &ldquo;svx::FontHeightToolBoxControl::statusChanged crash (memory corruption)&rdquo;<br />
** {{issue|111271}} &ldquo;Mac OS X: crash during shutdown, __tcf_2 on stack&rdquo;<br />
** {{issue|111400}} &ldquo;Extension Manager does not join spawned uno process (-> smoketestoo_native fails)&rdquo;<br />
** {{issue|112070}} &ldquo;UNO API tests must not use random&rdquo;<br />
** {{issue|113158}} &ldquo;crash with two threads in framework::ToolBarManager dtor&rdquo;<br />
** {{issue|113197}} &ldquo;sw/qa/unoapi sw.SwXTextRange hangs&rdquo;<br />
** {{issue|113367}} &ldquo;sysdtrans deadlock during shutdown&rdquo;<br />
** {{issue|113464}} &ldquo;stoc_smgr::ORegistryServiceManager::dispose crash during shutdown&rdquo;<br />
** {{issue|114207}} &ldquo;framework::ModuleUIConfigurationManager::dispose crash during shutdown&rdquo;<br />
** {{issue|114675}} &ldquo;binary URP bridge race on shut down, crash&rdquo;<br />
** {{issue|114718}} &ldquo;forms/qa/unoapi: crash in remote async release call&rdquo;<br />
** {{issue|116131}} &ldquo;vcl: message unregisterDraggingDestinationHandler: sent to freed object&rdquo;<br />
<br />
[[Category:Effort]][[Category:Test]]</div>Sbhttps://wiki.openoffice.org/wiki/Test_CleanupTest Cleanup2011-03-21T10:19:38Z<p>Sb: /* unoapi Tests */</p>
<hr />
<div>= Test Cleanup Project =<br />
<br />
The demand for automated (unit) testing should be obvious. See the [http://www.openoffice.org/servlets/ReadMsg?list=dev&msgNo=26189 mission statement mail] and [[Media:JustTestingPresentation.odp|slides]] from a [http://fosdem.org/2010/schedule/events/ooo_testing FOSDEM'10 talk] and an [http://www.ooocon.org/index.php/ooocon/2010/paper/view/188 OOoCon&nbsp;2010 presentation] for more information and further links.<br />
<br />
For examples of how to write xUnit based tests in the OOo code base, see [http://hg.services.openoffice.org/DEV300/file/87f4911ea629/basegfx/test <code>basegfx/test/</code>], [http://hg.services.openoffice.org/DEV300/file/87f4911ea629/sal/qa/ByteSequence <code>sal/qa/ByteSequence/</code>], and [http://hg.services.openoffice.org/DEV300/file/87f4911ea629/smoketestoo_native <code>smoketest_native/</code>]. However, the hard part should not be how to write test code, anyway, but how to write ''testable'' code; see [http://misko.hevery.com/2008/11/04/clean-code-talks-unit-testing/ The Clean Code Talks&mdash;Unit Testing].<br />
<br />
When testing C++ code that merely uses UNO types (no services), but uses them in a way that requires UNO to be bootstrapped so that the relevant type information is available (e.g., putting instances of complex UNO types into <code>com::sun::star::uno::Any</code>), one approach is as follows: In the <code>makefile.mk</code>, instead of <code>.INCLUDE: _cppunit.mk</code> use<br />
<source lang="make"><br />
.IF "$(OS)" == "WNT"<br />
my_file = file:///<br />
.ELSE<br />
my_file = file://<br />
.END<br />
<br />
ALLTAR : test<br />
<br />
test .PHONY : $(SHL1TARGETN)<br />
$(CPPUNITTESTER) $(SHL1TARGETN) \<br />
-env:UNO_TYPES=$(my_file)$(SOLARBINDIR)/types.rdb<br />
</source><br />
and in the test code once call <code>cppu::defaultBootstrap_InitialComponentContext()</code>.<br />
<br />
== User Interface ==<br />
<br />
=== CppUnit ===<br />
<br />
For tests in C++, plain CppUnit (at least version 1.12.1) is available. (OOo bundles CppUnit 1.12.1 as an external module; alternatively, you can configure <code>--with-system-cppunit</code>.)<br />
<br />
Implement the test code as a dynamic library, following CppUnit conventions (i.e., using [http://cppunit.sourceforge.net/doc/lastest/group___creating_test_suite.html#ga0 <code>CPPUNIT_TEST_SUITE_REGISTRATION</code>] and [http://cppunit.sourceforge.net/doc/lastest/_test_plug_in_8h.html#a2 <code>CPPUNIT_PLUGIN_IMPLEMENT</code>] macros). The following settings are needed in the <code>makefile.mk</code>:<br />
* <code>ENABLE_EXCEPTIONS = TRUE</code><br />
* <code>CFLAGSCXX += $(CPPUNIT_CFLAGS)</code><br />
* <code>SHL<var>n</var>RPATH = NONE</code><br />
* <code>SHL<var>n</var>STDLIBS += $(CPPUNITLIB)</code><br />
* <code>SHL<var>n</var>VERSIONMAP = <var>version.map</var></code>, where that file must contain the following (see [[#CppUnit_1.12.1|details]] below for improving this):<br />
UDK_3_0_0 {<br />
global:<br />
cppunitTestPlugIn;<br />
local:<br />
*;<br />
};<br />
<br />
To run tests, <code>sal/cppunittester</code> delivers a <code>cppunittester</code> executable that has some advantages over the plain CppUnit <code>DllPlugInTester</code>:<br />
* It uses <code>SAL_IMPLEMENT_MAIN</code> to properly set up the per-process settings required by URE. Test code as well as tested code based on URE will expect this and would fail in a process that is not set up in this way.<br />
* Getting CppUnit to build as an external module within the Windows OOo build is a non-trivial task. The less parts of it that need to be built, the better.<br />
<br />
Something like the following in <code>makefile.mk</code> will execute the tests:<br />
ALLTAR : test<br />
test .PHONY : $(SHL1TARGETN)<br />
$(CPPUNITTESTER) $(SHL1TARGETN)<br />
<br />
<code>$(CPPUNITTESTER)</code> internally uses <code>$(AUGMENT_LIBRARY_PATH_LOCAL)</code> to favor library instances in the local output tree over ones in solver. Alternatively to the above, <code>.INCLUDE: _cppunit.mk</code> calls <code>$(CPPUNITTESTER)</code> on each of <code>$(SHL1TARGETN)</code>, &hellip;, <code>$(SHL10TARGETN)</code> that is defined.<br />
<br />
=== JUnit ===<br />
<br />
For tests in Java, plain JUnit (at least version 4) is available. (OOo requires JUnit as a prerequisite, see [http://junit.org/ junit.org] for downloads; you can configure <code>--with-junit=<var>&hellip;</var></code> if it is not automatically found; alternatively, you can configure <code>--without-junit</code>, disabling JUnit-based tests.)<br />
<br />
=== <code>subsequenttests</code> ===<br />
<br />
Some tests have build and/or run time dependencies on modules further up in the hierarchy, or modules that the rest of the module in question does not have dependencies on (and which are thus not listed in the module's <code>build.lst</code>). The extreme case are tests that need a complete OOo installation as their test environment.<br />
<br />
For such tests, the whole <code>makefile.mk</code> should be wrapped in:<br />
.IF "$(OOO_SUBSEQUENT_TESTS)" == ""<br />
nothing .PHONY :<br />
.ELSE<br />
...<br />
.END<br />
(and the directory included in the module's <code>build.lst</code>).<br />
<br />
The idea is to do a complete OOo build first (<code>cd smoketestoo_native && build --all</code>) and then build and execute those tests either selectively or wholesale.<br />
<br />
Selectively building a specific such test directory can be done with <code>cd <var>&hellip;</var> && OOO_SUBSEQUENT_TESTS=TRUE dmake</code>.<br />
<br />
To build and execute ''all'' these test directories, the tool <code>subsequenttests</code> (in <code>solenv/bin</code>) exists. It scans the <code>build.lst</code> files of all modules for <code>makefile.mk</code>s that mention <code>OOO_SUBSEQUENT_TESTS</code> and simply executes <code>dmake</code> in all those directories, with <code>OOO_SUBSEQUENT_TESTS</code> set. It supports a <code>-P<var>n</var></code> switch to build <var>n</var> directories in parallel.<br />
<br />
=== Helpers ===<br />
<br />
A new module <code>test</code> shall collect reusable code snippets for C++ and Java tests.<br />
<br />
For now, it concentrates on letting a test connect to an OOo instance via remote UNO: A C++ test class can hold a <code>test::OfficeConnection</code> as class member and, in its CppUnit <code>setUp</code> and <code>tearDown</code> functions, call <code>OfficeConnection::setUp</code> and <code>OfficeConnection::tearDown</code>, respectively. Tests obtain access to the OOo instance via <code>OfficeConnection::getFactory</code>. Similarly, a Java test class can use an <code>org.openoffice.test.OfficeConnection</code> instance, offering the same functionality as its C++ counterpart.<br />
<br />
For this to work, three additional steps are necessary:<br />
* First, in <code>instsetoo_native</code>, building an installation set for the <code>openoffice</code> product in the default language (<code>en-US</code>) in any package format now takes care to always also build an archive package format (<code>tar.gz</code> resp. <code>zip</code>) of that product.<br />
* Second, building <code>smoketestoo_native</code> permanently installs that archive into the solver. (Except on Windows, where problems with resulting long pathnames prevent this; there, as a workaround, each test individually unzips the archive to some local temporary directory.) <br />
* Third, a test that requires an OOo instance includes <code>installationtest.mk</code> in its <code>makefile.mk</code>. That file makes sure to call the CppUnit and JUnit test runners with the information necessary for the helper classes to start the correct OOo instance with a fresh <code>UserInstallation</code> and set up an URP pipe connection. The information is tunneled into the test runner executables as UNO bootstrap parameters.<br />
<br />
For debugging purposes, which OOo instance the tests use can manually be overridden, see [http://www.openoffice.org/servlets/ReadMsg?list=interface-announce&msgNo=1285 &ldquo;OOO_TEST_SOFFICE: allow override of tested soffice process&rdquo;].<br />
<br />
=== <code>unoapi</code> Tests ===<br />
<br />
The <code>unoapi</code> tests are redesigned to use the new test framework. They are plain JUnit tests and use the mechanisms described above to connect to running OOo instances. However, due to the large amount of logic encoded in <code>qadevOOo</code>, those JUnit tests for now are only thin wrappers around <code>org.openoffice.Runner.run</code>. This is intended to change over time.<br />
<br />
The <code>cwscheckapi</code> tool to run the <code>unoapi</code> tests has been subsumed by <code>subsequenttests</code>. The latter always runs all tests, while the former had mechanisms to run only tests for modules that had been changed by a CWS. The hope is that the parallel mode of <code>subsequenttests</code> makes it fast enough so that running all tests all of the times becomes feasible.<br />
<br />
Unfortunately, running the <code>unoapi</code> tests is still not stable enough to give useful results. Therefore, running <code>subsequenttests</code> has been disabled in the build bots for now. Making the tests sufficiently stable is ongoing work.<br />
<br />
== Details ==<br />
<br />
Working on {{CWS|sb118}}, {{CWS|sb120}}.<br />
<br />
=== CppUnit 1.12.1 ===<br />
<br />
* Replace existing <code>cppunit</code> and <code>testshl2</code> combo with latest CppUnit 1.12.1.<br />
* OOo <code>configure --with-system-cppunit</code> (for now only if also <code>--with-system-stl</code>!); minimal required version for now arbitrarily 1.12.1.<br />
* '''TODO:''' Upstream <code>PATCH_FILES</code> (<code>windows.patch</code>?!?).<br />
* '''TODO:''' <code>RPATH</code> in generated libraries and executables.<br />
* '''TODO:''' Improve <code>CPPUNIT_PLUGIN_EXPORT</code> and get rid of version maps (GCC exception problems?).<br />
* '''TODO:''' <code>cppunit/makefile.mk</code> <code>MY_LIBS = -lm</code> Solaris hack.<br />
* '''TODO:''' In general OOo build environment, no longer set <code>CFLAGS</code> etc. as environment variables; have package-specific <code>OOO_<var>package</var>_CFLAGS</code> etc. and combine those into <code>CFLAGS</code> etc. where necessary (see <code>OOO_STLPORT_CXXFLAGS</code> etc. in <code>cppunit/makefile.mk</code>).<br />
* '''TODO:''' Why use <code>cppunittester</code> instead of <code>DllPlugInTester</code>? (Remove building/delivering <code>DllPlugInTester</code>.)<br />
* '''TODO:''' Make <code>operator &lt;&lt;(std::basic_ostream &amp;, rtl::OUString const &amp;)</code> from <code>test/oustringstreaminserter.hxx</code> generally available?<br />
* '''TODO:''' Make STLport <code>num_put</code> symbols available on platforms other than Linux (see <code>solenv/bin/addsym.awk</code>), too, so that <code>CPPUNIT_ASSERT_EQUAL</code> actually outputs numeric values.<br />
<br />
==== Is CppUnit an active project? ====<br />
<br />
When I wrote<br />
<pre><br />
Message-ID: <4D67B884.8080101@oracle.com><br />
Date: Fri, 25 Feb 2011 15:11:16 +0100<br />
From: Stephan Bergmann <stephan.bergmann@oracle.com><br />
MIME-Version: 1.0<br />
To: cppunit-devel@lists.sourceforge.net<br />
Subject: What part of the API is published?<br />
Content-Type: text/plain; charset=UTF-8; format=flowed<br />
Content-Transfer-Encoding: 7bit<br />
<br />
At least for CppUnit 1.12.1, it is unclear whether for example class <br />
DynamicLibraryManager is supposed to be available to client code.<br />
<br />
The HTML documentation's class list contains DynamicLibraryManager just <br />
like, say, TestCase, and I can't find any hint on the former's page that <br />
it is an implementation detail. However, in DynamicLibraryManager.h, <br />
the class is not decorated with CPPUNIT_API.<br />
<br />
Is there any specification of what is published (i.e., stable, usable by <br />
clients) vs. what is implementation detail (i.e., not to be used by <br />
clients)?<br />
<br />
-Stephan<br />
</pre><br />
the only response I ever got was<br />
<pre><br />
MIME-Version: 1.0<br />
Content-Type: text/plain; charset="us-ascii"<br />
Content-Transfer-Encoding: 7bit<br />
Subject: Your message to Cppunit-devel awaits moderator approval<br />
From: cppunit-devel-bounces@lists.sourceforge.net<br />
To: stephan.bergmann@oracle.com<br />
Message-ID: <mailman.49713.1298643119.7082.cppunit-devel@lists.sourceforge.net><br />
Date: Fri, 25 Feb 2011 14:11:59 +0000<br />
<br />
Your mail to 'Cppunit-devel' with the subject<br />
<br />
What part of the API is published?<br />
<br />
Is being held until the list moderator can review it for approval.<br />
<br />
The reason it is being held:<br />
<br />
Post by non-member to a members-only list<br />
<br />
Either the message will get posted to the list, or you will receive<br />
notification of the moderator's decision. If you would like to cancel<br />
this posting, please visit the following URL:<br />
<br />
https://lists.sourceforge.net/lists/confirm/cppunit-devel/1da27e17e1d5fdfcb7f8ac6860a05bb5ca1eab1d<br />
</pre><br />
and the last message in [http://sourceforge.net/mailarchive/forum.php?forum_name=cppunit-devel the archive] is from January 2010.<br />
<br />
=== <code>testshl2</code> ===<br />
<br />
* <code>solenv/inc_cppunit.mk</code>/<code>cppunit.mk</code>: [http://hg.services.openoffice.org/cws/sb118/rev/cf13421c3774 &ldquo;adapted <code>cppunit.mk</code> to <code>cppunittester</code> and no longer require &lsquo;<code>dmake test</code>&rsquo; to run tests&rdquo;].<br />
* '''TODO:''' <code>DEV300_m68</code> introduced <code>TESTSHL2LIB</code> (which I removed again) and uses it in many <code>qa</code> makefiles (that I need to touch someday, anyway).<br />
<br />
=== Unit Tests ===<br />
<br />
* <code>OOO_SUBSEQUENT_TESTS</code> (<code>build.lst</code> lists local dependencies of those directories, so that modifying a module and then calling &ldquo;<code>OOO_SUBSEQUENT_TESTS=x build</code>&rdquo; rebuilds the module and executes the tests).<br />
* '''TODO:''' If Build Environment&nbsp;2.0 would build directly to solver (instead of local output tree/deliver), that would simplify tests that currently need to take care to test local libraries instead of solver ones (see, for example, <code>OOO_TEST_PREFIX</code> in the <code>services.rdb</code> of <code>stoc/test/uriproc/makefile.mk</code>).<br />
{{Documentation/Note|Build Environment&nbsp;2.0 will not build directly to solver, but will make a module depend on the targets in the solver, and these are depending on the targets in the workdir (aka the old "local output tree"). Thus on an usual build in a module building and delivering are not two steps anymore. If tests depend on the target in the solver (which they will do automatically in most use cases, as linking against a library automatically creates a dependency on the library in the solver), they can be sure that the target is up to date in the solver '''and''' in the workdir.<br />
<br />
--[[User:B michaelsen|B michaelsen]] 06:32, 27 August 2010 (UTC)}}<br />
* '''TODO:''' Constructs like &ldquo;<code>-env:UNO_<var>&hellip;</var>=$(my_file)<var>&hellip;</var></code>&rdquo; would fail for problematic characters (spaces!) in paths.<br />
<br />
=== Smoke Test ===<br />
<br />
* Redesign <code>smoketestoo_native</code> to use CppUnit and pre-installed OOo.<br />
* [http://hg.services.openoffice.org/cws/sb118/rev/160b248247a0 &ldquo;changed <code>tools/debug</code> to never fall back from writing to shell to writing to file, and read <code>DBGSV_INIT</code> from <code>rtl::Bootstrap</code>; the latter causes problems if <code>tools/debug</code> is called from static code executing before <code>SAL_MAIN</code> has called <code>osl_setCommandArgs</code> &rarr; removed statics from code and added assertions to <code>osl/process</code>; various improvements to <code>smoketests.cxx</code> (incl. passing an appropriate <code>dbgsv.ini</code> for non-pro builds)&rdquo;] followed by [http://hg.services.openoffice.org/cws/sb118/rev/dbbacb9d2fd3 &ldquo;reverted parts of HG <code>-c&nbsp;160b248247a0</code> again: the &lsquo;static code executing before <code>SAL_MAIN</code>&rsquo; problem was too severe; instead, globally set <code>DBGSV_INIT</code> build env var to new <code>solenv/bin/dbgsv.ini</code>&rdquo;]; see also {{issue|109142}} &ldquo;Let assertions abort&rdquo;.<br />
* '''TODO:''' For <code>smoketestoo_native/makefile.mk</code> &ldquo;<code><nowiki>-env:arg-env=$(OOO_LIBRARY_PATH_VAR)"$${{$(OOO_LIBRARY_PATH_VAR)+=$$$(OOO_LIBRARY_PATH_VAR)}}"</nowiki></code>&rdquo; mechanism: <code>osl_executeProcess</code> <code>ustrEnvironments</code> members without &ldquo;<code>=</code>&rdquo;: all platforms; documentation; documentation of <code>osl_executeProcess_WithRedicrectedIO</code>.<br />
* '''TODO:''' <code>-headless</code>? (appears to still display windows on Windows and Mac OS&nbsp;X, however, see {{issue|109052}})<br />
* '''TODO:''' {{issue|113341}} &ldquo;-nofirststartwizard should disable update check&rdquo;<br />
<br />
=== Pre-Installed OOo ===<br />
<br />
* For Sun Hamburg Release Engineering, take MWS archive installation sets from &ldquo;S:&rdquo; instead of solver: [http://hg.services.openoffice.org/cws/sb118/rev/d5dbea724063 &ldquo;take installation set from <code>SHIPDRIVE</code> if appropriate&rdquo;].<br />
* '''TODO:''' <code>PKGFORMAT=installed</code> instead of <code>archive</code>?<br />
<br />
=== <code>unoapi</code> Tests ===<br />
<br />
* Known issues, open (not yet addressed at all; disabled for now on net-yet-integrated CWS; or fixed on not-yet-integrated CWS):<br />
** {{issue|116120}} &ldquo;vcl: TabControl::ImplGetTabRect negative height leads to X_CreatePixmap BadAlloc&rdquo;<br />
** {{issue|116125}} &ldquo;qadevOOo/qa/complex/junitskeleton failure&rdquo;<br />
** {{issue|116156}} &ldquo;toolkit/qa/unoapi crash in SwAccessibleMap::RemoveContext&rdquo;<br />
** {{issue|116192}} &ldquo;[sw] fixed text fields sometimes get updated&rdquo;<br />
** {{issue|116550}} &ldquo;toolkit/qa/unoapi crashes OOo in ~SwAccessibleParagraph vs. SwXTextDocument::close&rdquo;<br />
** {{issue|116583}} &ldquo;comphelper/qa/complex/comphelper failure&rdquo;<br />
** {{issue|116730}} &ldquo;vcl: crash with multiple threads in Window::ImplGrabFocus&rdquo;<br />
** {{issue|116733}} &ldquo;sw: crash in ~SwDrawContact (forms/qa/unoapi)&rdquo;<br />
** {{issue|117381}} &ldquo;ucb/qa/unoapi ucb.UniversalContentBroker::com::sun::star::ucb::XContentProviderManager::deregisterContentProvider() fails with gvfs&rdquo;<br />
** {{issue|117486}} &ldquo;toolkit/qa/complex/toolkit: "Window pos size wrong"&rdquo;<br />
* Known issues, disabled for now:<br />
** {{issue|109517}} &ldquo;sc/qa/unoapi fails for ScAnnotationObj etc.&rdquo;<br />
** {{issue|109518}} &ldquo;sd/qa/unoapi crash in SfxViewShell::GetController&rdquo;<br />
** {{issue|109643}} &ldquo;toolkit/qa/unoapi tests fail when losing focus&rdquo;<br />
** {{issue|109728}} &ldquo;~ScAutoFormatObj uses cleared ScGlobal&rdquo;<br />
** {{issue|109917}} &ldquo;fragile unoapi test using OnUnfocus event&rdquo;<br />
** {{issue|109939}} &ldquo;toolkit: inconsistent UnoControl locking schemes&rdquo;<br />
** {{issue|110862}} &ldquo;sc/qa/unoapi fails for sc.ScDataPilotTableObj::com::sun::star::sheet::XDataPilotTable::refresh()&rdquo;<br />
** {{issue|110988}} &ldquo;svtools/qa/unoapi fails for svtools.AccessibleBrowseBox etc.&rdquo;<br />
** {{issue|111006}} &ldquo;toolkit: deadlock between UnoControls&rdquo;<br />
** {{issue|111032}} &ldquo;sc/qa/unoapi sc.ScAccessibleCell::com::sun::star::accessibility::XAccessibleText getCharacterBounds() failure&rdquo;<br />
** {{issue|111042}} &ldquo;sd/qa/unoapi sd::DrawController::dispose crash&rdquo;<br />
** {{issue|111043}} &ldquo;sd/qa/unoapi sd::DrawController_OutlineView NullPointerException&rdquo;<br />
** {{issue|111102}} &ldquo;chart2: ChartModelHelper::findDiagram returns null&rdquo;<br />
** {{issue|111111}} &ldquo;xmloff.Impress.XMLImporter::com::sun::star::document::XImporter&rdquo;<br />
** {{issue|111113}} &ldquo;toolkit.AccessibleStatusBarItem unoapi failure&rdquo;<br />
** {{issue|111148}} &ldquo;forms/qa/unoapi forms.OImageControlModel::com::sun::star::beans::XMultiPropertySet deadlock&rdquo;<br />
** {{issue|111169}} &ldquo;svx.AccessiblePageShape unoapi failure&rdquo;<br />
** {{issue|111170}} &ldquo;sun/i18n/qa/unoapi "creating a drawdoc" failure&rdquo;<br />
** {{issue|111178}} &ldquo;sw/qa/unoapi SwView::SelectShell crash&rdquo;<br />
** {{issue|111180}} &ldquo;framework/qa/unoapi fwk.Desktop::com::sun::star::frame::XComponentLoader::loadComponentFromURL() failure&rdquo;<br />
** {{issue|111182}} &ldquo;Desktop::terminate -> ~DropTarget -> _objc_error crash&rdquo;<br />
** {{issue|111184}} &ldquo;sal/qa/osl/pipe uses fixed pipe names&rdquo;<br />
** {{issue|111186}} &ldquo;sw/qa/unoapi sw.PageStyle::com::sun::star::beans::XPropertySet::setPropertyValue() failure&rdquo;<br />
** {{issue|111190}} &ldquo;sw/qa/unoapi sw.SwXShape failure&rdquo;<br />
** {{issue|111194}} &ldquo;sw/qa/unoapi sw.XMLExporter crash&rdquo;<br />
** {{issue|111195}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleScrollBar::com::sun::star::accessibility::XAccessibleValue::setCurrentValue() failure&rdquo;<br />
** {{issue|111197}} &ldquo;sw/qa/unoapi sw.SwAccessibleDocumentPageView failure&rdquo;<br />
** {{issue|111199}} &ldquo;sd/qa/unoapi sd.AccessibleOutlineView failure&rdquo;<br />
** {{issue|111200}} &ldquo;xmloff/qa/unoapi xmloff.Draw.XMLMetaImporter failure&rdquo;<br />
** {{issue|111216}} &ldquo;svx/qa/unoapi accessibility deadlock&rdquo;<br />
** {{issue|111218}} &ldquo;sw/qa/unoapi sw.SwAccessibleParagraphView::com::sun::star::accessibility::XAccessibleEventBroadcaster::removeEventListener() failure&rdquo;<br />
** {{issue|111220}} &ldquo;sw/qa/unoapi sw.XMLContentExporter::com::sun::star::document::XFilter::cancel() failure&rdquo;<br />
** {{issue|111224}} &ldquo;xmloff/qa/unoapi xmloff.Impress.XMLContentExporter crash&rdquo;<br />
** {{issue|111225}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleStatusBar failure&rdquo;<br />
** {{issue|111252}} &ldquo;svx/qa/unoapi svx.AccessibleOLEShape deadlock&rdquo;<br />
** {{issue|111273}} &ldquo;sw/qa/unoapi sw.SwXTextEmbeddedObject::com::sun::star::document::XEmbeddedObjectSupplier::getEmbeddedObject() crash&rdquo;<br />
** {{issue|111278}} &ldquo;svx/qa/unoapi svx.AccessibleEditableTextPara failure&rdquo;<br />
** {{issue|111283}} &ldquo;sfx2/qa/unoapi sfx.StandaloneDocumentInfo failure&rdquo;<br />
** {{issue|111285}} &ldquo;forms/qa/unoapi forms.OButtonModel failure&rdquo;<br />
** {{issue|111287}} &ldquo;xmloff/qa/unoapi XMLSettingsIm-/Exporter crash&rdquo;<br />
** {{issue|111329}} &ldquo;sd/qa/unoapi SdXCustomPresentationAccess::getElementNames/ImpEditEngine::OnlineSpellHdl hang&rdquo;<br />
** {{issue|111332}} &ldquo;sw/qa/unoapi sw.XMLStylesExporter::com::sun::star::document::XFilter crash&rdquo;<br />
** {{issue|111333}} &ldquo;forms/qa/unoapi forms.OImageControlControl::com::sun::star::awt::XControl deadlock&rdquo;<br />
** {{issue|112743}} &ldquo;starmath/qa/unoapi sm.XMLSettingsExporter failure&rdquo;<br />
** {{issue|112746}} &ldquo;framework/qa/unoapi fwk.ModuleManager failure (X11 BadWindow)&rdquo;<br />
** {{issue|112751}} &ldquo;testgraphical/qa/graphical failure&rdquo;<br />
** {{issue|112778}} &ldquo;xmloff/qa/unoapi xmloff.Draw.XMLContentExporter failure&rdquo;<br />
** {{issue|113020}} &ldquo;sw/qa/unoapi sw.SwXTextGraphicObject::com::sun::star::beans::XPropertySet failure&rdquo;<br />
** {{issue|113103}} &ldquo;chart2: deadlock between DiagramHelper and Diagram&rdquo;<br />
** {{issue|113136}} &ldquo;sw/qa/unoapi sw.SwAccessibleParagraphView::com::sun::star::accessibility::XAccessibleEditableText failure&rdquo;<br />
** {{issue|113142}} &ldquo;sw/qa/unoapi SwAccessibleContext::RemoveFrmFromAccessibleMap crash&rdquo;<br />
** {{issue|113161}} &ldquo;sd/qa/unoapi sd.SdLayer::com::sun::star::drawing::Layer::IsVisible failure&rdquo;<br />
** {{issue|113201}} &ldquo;forms/qa/unoapi forms.OEditModel::com::sun::star::form::validation::XValidatableFormComponent failure&rdquo;<br />
** {{issue|113245}} &ldquo;framework/qa/unoapi fwl.TypeDetection failure&rdquo;<br />
** {{issue|113306}} &ldquo;sfx2/qa/unoapi sfx.DocumentTemplates failure&rdquo;<br />
** {{issue|113386}} &ldquo;sd/qa/unoapi sd.AccessibleDrawDocumentView::com::sun::star::accessibility::XAccessibleComponent::containsPoint() failure&rdquo;<br />
** {{issue|113489}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleMenu{,Bar,Separator} failures&rdquo;<br />
** {{issue|114205}} &ldquo;sw/qa/unoapi sw.SwAccessibleParagraphView::com::sun::star::accessibility::XAccessibleText::copyText() failed&rdquo;<br />
** {{issue|114209}} &ldquo;forms/qa/unoapi forms.OGridControlModel::com::sun::star::view::XSelectionSupplier crash&rdquo;<br />
** {{issue|114211}} &ldquo;xmloff/qa/unoapi xmloff.Draw.XMLStylesImporter::com::sun::star::lang::XInitialization crash&rdquo;<br />
** {{issue|114213}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleMenu::com::sun::star::accessibility::XAccessibleSelection failure&rdquo;<br />
** {{issue|114636}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleScrollBar::com::sun::star::accessibility::XAccessibleAction failure&rdquo;<br />
** {{issue|114637}} &ldquo;sw/qa/unoapi sw.SwAccessibleFootnoteView(?) crash&rdquo;<br />
** {{issue|114642}} &ldquo;svx/qa/unoapi svx: svx.SvxUnoTextContent::com::sun::star::style::CharacterProperties crash&rdquo;<br />
** {{issue|114669}} &ldquo;forms/qa/unoapi forms.OListBoxControl crash&rdquo;<br />
** {{issue|114889}} &ldquo;sw/qa/unoapi sw.SwXTextViewCursor::com::sun::star::view::XScreenCursor&rdquo;<br />
** {{issue|116784}} &ldquo;[sfx2] CheckGlobalEventBroadcaster_writer1 fails&rdquo;<br />
** {{issue|116813}} &ldquo;[sfx2] complex.sfx2.UndoManager checkBrokenScripts fails&rdquo;<br />
** {{issue|116814}} &ldquo;[toolkit] unoapi test UnoControlDialogModel: XCloneable fails&rdquo;<br />
* Missing tests:<br />
** {{issue|109564}} &ldquo;qadevOOo/tests/java/ifc/awt/_XSystemChildFactory.java&rdquo;<br />
* Sporadic failures:<br />
** {{issue|111217}} &ldquo;BasicManager::SetGlobalUNOConstant crash during shutdown&rdquo;<br />
** {{issue|111246}} &ldquo;svx::FontHeightToolBoxControl::statusChanged crash (memory corruption)&rdquo;<br />
** {{issue|111271}} &ldquo;Mac OS X: crash during shutdown, __tcf_2 on stack&rdquo;<br />
** {{issue|111400}} &ldquo;Extension Manager does not join spawned uno process (-> smoketestoo_native fails)&rdquo;<br />
** {{issue|112070}} &ldquo;UNO API tests must not use random&rdquo;<br />
** {{issue|113158}} &ldquo;crash with two threads in framework::ToolBarManager dtor&rdquo;<br />
** {{issue|113197}} &ldquo;sw/qa/unoapi sw.SwXTextRange hangs&rdquo;<br />
** {{issue|113367}} &ldquo;sysdtrans deadlock during shutdown&rdquo;<br />
** {{issue|113464}} &ldquo;stoc_smgr::ORegistryServiceManager::dispose crash during shutdown&rdquo;<br />
** {{issue|114207}} &ldquo;framework::ModuleUIConfigurationManager::dispose crash during shutdown&rdquo;<br />
** {{issue|114675}} &ldquo;binary URP bridge race on shut down, crash&rdquo;<br />
** {{issue|114718}} &ldquo;forms/qa/unoapi: crash in remote async release call&rdquo;<br />
** {{issue|116131}} &ldquo;vcl: message unregisterDraggingDestinationHandler: sent to freed object&rdquo;<br />
<br />
[[Category:Effort]][[Category:Test]]</div>Sbhttps://wiki.openoffice.org/wiki/Test_CleanupTest Cleanup2011-03-15T08:48:44Z<p>Sb: /* unoapi Tests */</p>
<hr />
<div>= Test Cleanup Project =<br />
<br />
The demand for automated (unit) testing should be obvious. See the [http://www.openoffice.org/servlets/ReadMsg?list=dev&msgNo=26189 mission statement mail] and [[Media:JustTestingPresentation.odp|slides]] from a [http://fosdem.org/2010/schedule/events/ooo_testing FOSDEM'10 talk] and an [http://www.ooocon.org/index.php/ooocon/2010/paper/view/188 OOoCon&nbsp;2010 presentation] for more information and further links.<br />
<br />
For examples of how to write xUnit based tests in the OOo code base, see [http://hg.services.openoffice.org/DEV300/file/87f4911ea629/basegfx/test <code>basegfx/test/</code>], [http://hg.services.openoffice.org/DEV300/file/87f4911ea629/sal/qa/ByteSequence <code>sal/qa/ByteSequence/</code>], and [http://hg.services.openoffice.org/DEV300/file/87f4911ea629/smoketestoo_native <code>smoketest_native/</code>]. However, the hard part should not be how to write test code, anyway, but how to write ''testable'' code; see [http://misko.hevery.com/2008/11/04/clean-code-talks-unit-testing/ The Clean Code Talks&mdash;Unit Testing].<br />
<br />
When testing C++ code that merely uses UNO types (no services), but uses them in a way that requires UNO to be bootstrapped so that the relevant type information is available (e.g., putting instances of complex UNO types into <code>com::sun::star::uno::Any</code>), one approach is as follows: In the <code>makefile.mk</code>, instead of <code>.INCLUDE: _cppunit.mk</code> use<br />
<source lang="make"><br />
.IF "$(OS)" == "WNT"<br />
my_file = file:///<br />
.ELSE<br />
my_file = file://<br />
.END<br />
<br />
ALLTAR : test<br />
<br />
test .PHONY : $(SHL1TARGETN)<br />
$(CPPUNITTESTER) $(SHL1TARGETN) \<br />
-env:UNO_TYPES=$(my_file)$(SOLARBINDIR)/types.rdb<br />
</source><br />
and in the test code once call <code>cppu::defaultBootstrap_InitialComponentContext()</code>.<br />
<br />
== User Interface ==<br />
<br />
=== CppUnit ===<br />
<br />
For tests in C++, plain CppUnit (at least version 1.12.1) is available. (OOo bundles CppUnit 1.12.1 as an external module; alternatively, you can configure <code>--with-system-cppunit</code>.)<br />
<br />
Implement the test code as a dynamic library, following CppUnit conventions (i.e., using [http://cppunit.sourceforge.net/doc/lastest/group___creating_test_suite.html#ga0 <code>CPPUNIT_TEST_SUITE_REGISTRATION</code>] and [http://cppunit.sourceforge.net/doc/lastest/_test_plug_in_8h.html#a2 <code>CPPUNIT_PLUGIN_IMPLEMENT</code>] macros). The following settings are needed in the <code>makefile.mk</code>:<br />
* <code>ENABLE_EXCEPTIONS = TRUE</code><br />
* <code>CFLAGSCXX += $(CPPUNIT_CFLAGS)</code><br />
* <code>SHL<var>n</var>RPATH = NONE</code><br />
* <code>SHL<var>n</var>STDLIBS += $(CPPUNITLIB)</code><br />
* <code>SHL<var>n</var>VERSIONMAP = <var>version.map</var></code>, where that file must contain the following (see [[#CppUnit_1.12.1|details]] below for improving this):<br />
UDK_3_0_0 {<br />
global:<br />
cppunitTestPlugIn;<br />
local:<br />
*;<br />
};<br />
<br />
To run tests, <code>sal/cppunittester</code> delivers a <code>cppunittester</code> executable that has some advantages over the plain CppUnit <code>DllPlugInTester</code>:<br />
* It uses <code>SAL_IMPLEMENT_MAIN</code> to properly set up the per-process settings required by URE. Test code as well as tested code based on URE will expect this and would fail in a process that is not set up in this way.<br />
* Getting CppUnit to build as an external module within the Windows OOo build is a non-trivial task. The less parts of it that need to be built, the better.<br />
<br />
Something like the following in <code>makefile.mk</code> will execute the tests:<br />
ALLTAR : test<br />
test .PHONY : $(SHL1TARGETN)<br />
$(CPPUNITTESTER) $(SHL1TARGETN)<br />
<br />
<code>$(CPPUNITTESTER)</code> internally uses <code>$(AUGMENT_LIBRARY_PATH_LOCAL)</code> to favor library instances in the local output tree over ones in solver. Alternatively to the above, <code>.INCLUDE: _cppunit.mk</code> calls <code>$(CPPUNITTESTER)</code> on each of <code>$(SHL1TARGETN)</code>, &hellip;, <code>$(SHL10TARGETN)</code> that is defined.<br />
<br />
=== JUnit ===<br />
<br />
For tests in Java, plain JUnit (at least version 4) is available. (OOo requires JUnit as a prerequisite, see [http://junit.org/ junit.org] for downloads; you can configure <code>--with-junit=<var>&hellip;</var></code> if it is not automatically found; alternatively, you can configure <code>--without-junit</code>, disabling JUnit-based tests.)<br />
<br />
=== <code>subsequenttests</code> ===<br />
<br />
Some tests have build and/or run time dependencies on modules further up in the hierarchy, or modules that the rest of the module in question does not have dependencies on (and which are thus not listed in the module's <code>build.lst</code>). The extreme case are tests that need a complete OOo installation as their test environment.<br />
<br />
For such tests, the whole <code>makefile.mk</code> should be wrapped in:<br />
.IF "$(OOO_SUBSEQUENT_TESTS)" == ""<br />
nothing .PHONY :<br />
.ELSE<br />
...<br />
.END<br />
(and the directory included in the module's <code>build.lst</code>).<br />
<br />
The idea is to do a complete OOo build first (<code>cd smoketestoo_native && build --all</code>) and then build and execute those tests either selectively or wholesale.<br />
<br />
Selectively building a specific such test directory can be done with <code>cd <var>&hellip;</var> && OOO_SUBSEQUENT_TESTS=TRUE dmake</code>.<br />
<br />
To build and execute ''all'' these test directories, the tool <code>subsequenttests</code> (in <code>solenv/bin</code>) exists. It scans the <code>build.lst</code> files of all modules for <code>makefile.mk</code>s that mention <code>OOO_SUBSEQUENT_TESTS</code> and simply executes <code>dmake</code> in all those directories, with <code>OOO_SUBSEQUENT_TESTS</code> set. It supports a <code>-P<var>n</var></code> switch to build <var>n</var> directories in parallel.<br />
<br />
=== Helpers ===<br />
<br />
A new module <code>test</code> shall collect reusable code snippets for C++ and Java tests.<br />
<br />
For now, it concentrates on letting a test connect to an OOo instance via remote UNO: A C++ test class can hold a <code>test::OfficeConnection</code> as class member and, in its CppUnit <code>setUp</code> and <code>tearDown</code> functions, call <code>OfficeConnection::setUp</code> and <code>OfficeConnection::tearDown</code>, respectively. Tests obtain access to the OOo instance via <code>OfficeConnection::getFactory</code>. Similarly, a Java test class can use an <code>org.openoffice.test.OfficeConnection</code> instance, offering the same functionality as its C++ counterpart.<br />
<br />
For this to work, three additional steps are necessary:<br />
* First, in <code>instsetoo_native</code>, building an installation set for the <code>openoffice</code> product in the default language (<code>en-US</code>) in any package format now takes care to always also build an archive package format (<code>tar.gz</code> resp. <code>zip</code>) of that product.<br />
* Second, building <code>smoketestoo_native</code> permanently installs that archive into the solver. (Except on Windows, where problems with resulting long pathnames prevent this; there, as a workaround, each test individually unzips the archive to some local temporary directory.) <br />
* Third, a test that requires an OOo instance includes <code>installationtest.mk</code> in its <code>makefile.mk</code>. That file makes sure to call the CppUnit and JUnit test runners with the information necessary for the helper classes to start the correct OOo instance with a fresh <code>UserInstallation</code> and set up an URP pipe connection. The information is tunneled into the test runner executables as UNO bootstrap parameters.<br />
<br />
For debugging purposes, which OOo instance the tests use can manually be overridden, see [http://www.openoffice.org/servlets/ReadMsg?list=interface-announce&msgNo=1285 &ldquo;OOO_TEST_SOFFICE: allow override of tested soffice process&rdquo;].<br />
<br />
=== <code>unoapi</code> Tests ===<br />
<br />
The <code>unoapi</code> tests are redesigned to use the new test framework. They are plain JUnit tests and use the mechanisms described above to connect to running OOo instances. However, due to the large amount of logic encoded in <code>qadevOOo</code>, those JUnit tests for now are only thin wrappers around <code>org.openoffice.Runner.run</code>. This is intended to change over time.<br />
<br />
The <code>cwscheckapi</code> tool to run the <code>unoapi</code> tests has been subsumed by <code>subsequenttests</code>. The latter always runs all tests, while the former had mechanisms to run only tests for modules that had been changed by a CWS. The hope is that the parallel mode of <code>subsequenttests</code> makes it fast enough so that running all tests all of the times becomes feasible.<br />
<br />
Unfortunately, running the <code>unoapi</code> tests is still not stable enough to give useful results. Therefore, running <code>subsequenttests</code> has been disabled in the build bots for now. Making the tests sufficiently stable is ongoing work.<br />
<br />
== Details ==<br />
<br />
Working on {{CWS|sb118}}, {{CWS|sb120}}.<br />
<br />
=== CppUnit 1.12.1 ===<br />
<br />
* Replace existing <code>cppunit</code> and <code>testshl2</code> combo with latest CppUnit 1.12.1.<br />
* OOo <code>configure --with-system-cppunit</code> (for now only if also <code>--with-system-stl</code>!); minimal required version for now arbitrarily 1.12.1.<br />
* '''TODO:''' Upstream <code>PATCH_FILES</code> (<code>windows.patch</code>?!?).<br />
* '''TODO:''' <code>RPATH</code> in generated libraries and executables.<br />
* '''TODO:''' Improve <code>CPPUNIT_PLUGIN_EXPORT</code> and get rid of version maps (GCC exception problems?).<br />
* '''TODO:''' <code>cppunit/makefile.mk</code> <code>MY_LIBS = -lm</code> Solaris hack.<br />
* '''TODO:''' In general OOo build environment, no longer set <code>CFLAGS</code> etc. as environment variables; have package-specific <code>OOO_<var>package</var>_CFLAGS</code> etc. and combine those into <code>CFLAGS</code> etc. where necessary (see <code>OOO_STLPORT_CXXFLAGS</code> etc. in <code>cppunit/makefile.mk</code>).<br />
* '''TODO:''' Why use <code>cppunittester</code> instead of <code>DllPlugInTester</code>? (Remove building/delivering <code>DllPlugInTester</code>.)<br />
* '''TODO:''' Make <code>operator &lt;&lt;(std::basic_ostream &amp;, rtl::OUString const &amp;)</code> from <code>test/oustringstreaminserter.hxx</code> generally available?<br />
* '''TODO:''' Make STLport <code>num_put</code> symbols available on platforms other than Linux (see <code>solenv/bin/addsym.awk</code>), too, so that <code>CPPUNIT_ASSERT_EQUAL</code> actually outputs numeric values.<br />
<br />
==== Is CppUnit an active project? ====<br />
<br />
When I wrote<br />
<pre><br />
Message-ID: <4D67B884.8080101@oracle.com><br />
Date: Fri, 25 Feb 2011 15:11:16 +0100<br />
From: Stephan Bergmann <stephan.bergmann@oracle.com><br />
MIME-Version: 1.0<br />
To: cppunit-devel@lists.sourceforge.net<br />
Subject: What part of the API is published?<br />
Content-Type: text/plain; charset=UTF-8; format=flowed<br />
Content-Transfer-Encoding: 7bit<br />
<br />
At least for CppUnit 1.12.1, it is unclear whether for example class <br />
DynamicLibraryManager is supposed to be available to client code.<br />
<br />
The HTML documentation's class list contains DynamicLibraryManager just <br />
like, say, TestCase, and I can't find any hint on the former's page that <br />
it is an implementation detail. However, in DynamicLibraryManager.h, <br />
the class is not decorated with CPPUNIT_API.<br />
<br />
Is there any specification of what is published (i.e., stable, usable by <br />
clients) vs. what is implementation detail (i.e., not to be used by <br />
clients)?<br />
<br />
-Stephan<br />
</pre><br />
the only response I ever got was<br />
<pre><br />
MIME-Version: 1.0<br />
Content-Type: text/plain; charset="us-ascii"<br />
Content-Transfer-Encoding: 7bit<br />
Subject: Your message to Cppunit-devel awaits moderator approval<br />
From: cppunit-devel-bounces@lists.sourceforge.net<br />
To: stephan.bergmann@oracle.com<br />
Message-ID: <mailman.49713.1298643119.7082.cppunit-devel@lists.sourceforge.net><br />
Date: Fri, 25 Feb 2011 14:11:59 +0000<br />
<br />
Your mail to 'Cppunit-devel' with the subject<br />
<br />
What part of the API is published?<br />
<br />
Is being held until the list moderator can review it for approval.<br />
<br />
The reason it is being held:<br />
<br />
Post by non-member to a members-only list<br />
<br />
Either the message will get posted to the list, or you will receive<br />
notification of the moderator's decision. If you would like to cancel<br />
this posting, please visit the following URL:<br />
<br />
https://lists.sourceforge.net/lists/confirm/cppunit-devel/1da27e17e1d5fdfcb7f8ac6860a05bb5ca1eab1d<br />
</pre><br />
and the last message in [http://sourceforge.net/mailarchive/forum.php?forum_name=cppunit-devel the archive] is from January 2010.<br />
<br />
=== <code>testshl2</code> ===<br />
<br />
* <code>solenv/inc_cppunit.mk</code>/<code>cppunit.mk</code>: [http://hg.services.openoffice.org/cws/sb118/rev/cf13421c3774 &ldquo;adapted <code>cppunit.mk</code> to <code>cppunittester</code> and no longer require &lsquo;<code>dmake test</code>&rsquo; to run tests&rdquo;].<br />
* '''TODO:''' <code>DEV300_m68</code> introduced <code>TESTSHL2LIB</code> (which I removed again) and uses it in many <code>qa</code> makefiles (that I need to touch someday, anyway).<br />
<br />
=== Unit Tests ===<br />
<br />
* <code>OOO_SUBSEQUENT_TESTS</code> (<code>build.lst</code> lists local dependencies of those directories, so that modifying a module and then calling &ldquo;<code>OOO_SUBSEQUENT_TESTS=x build</code>&rdquo; rebuilds the module and executes the tests).<br />
* '''TODO:''' If Build Environment&nbsp;2.0 would build directly to solver (instead of local output tree/deliver), that would simplify tests that currently need to take care to test local libraries instead of solver ones (see, for example, <code>OOO_TEST_PREFIX</code> in the <code>services.rdb</code> of <code>stoc/test/uriproc/makefile.mk</code>).<br />
{{Documentation/Note|Build Environment&nbsp;2.0 will not build directly to solver, but will make a module depend on the targets in the solver, and these are depending on the targets in the workdir (aka the old "local output tree"). Thus on an usual build in a module building and delivering are not two steps anymore. If tests depend on the target in the solver (which they will do automatically in most use cases, as linking against a library automatically creates a dependency on the library in the solver), they can be sure that the target is up to date in the solver '''and''' in the workdir.<br />
<br />
--[[User:B michaelsen|B michaelsen]] 06:32, 27 August 2010 (UTC)}}<br />
* '''TODO:''' Constructs like &ldquo;<code>-env:UNO_<var>&hellip;</var>=$(my_file)<var>&hellip;</var></code>&rdquo; would fail for problematic characters (spaces!) in paths.<br />
<br />
=== Smoke Test ===<br />
<br />
* Redesign <code>smoketestoo_native</code> to use CppUnit and pre-installed OOo.<br />
* [http://hg.services.openoffice.org/cws/sb118/rev/160b248247a0 &ldquo;changed <code>tools/debug</code> to never fall back from writing to shell to writing to file, and read <code>DBGSV_INIT</code> from <code>rtl::Bootstrap</code>; the latter causes problems if <code>tools/debug</code> is called from static code executing before <code>SAL_MAIN</code> has called <code>osl_setCommandArgs</code> &rarr; removed statics from code and added assertions to <code>osl/process</code>; various improvements to <code>smoketests.cxx</code> (incl. passing an appropriate <code>dbgsv.ini</code> for non-pro builds)&rdquo;] followed by [http://hg.services.openoffice.org/cws/sb118/rev/dbbacb9d2fd3 &ldquo;reverted parts of HG <code>-c&nbsp;160b248247a0</code> again: the &lsquo;static code executing before <code>SAL_MAIN</code>&rsquo; problem was too severe; instead, globally set <code>DBGSV_INIT</code> build env var to new <code>solenv/bin/dbgsv.ini</code>&rdquo;]; see also {{issue|109142}} &ldquo;Let assertions abort&rdquo;.<br />
* '''TODO:''' For <code>smoketestoo_native/makefile.mk</code> &ldquo;<code><nowiki>-env:arg-env=$(OOO_LIBRARY_PATH_VAR)"$${{$(OOO_LIBRARY_PATH_VAR)+=$$$(OOO_LIBRARY_PATH_VAR)}}"</nowiki></code>&rdquo; mechanism: <code>osl_executeProcess</code> <code>ustrEnvironments</code> members without &ldquo;<code>=</code>&rdquo;: all platforms; documentation; documentation of <code>osl_executeProcess_WithRedicrectedIO</code>.<br />
* '''TODO:''' <code>-headless</code>? (appears to still display windows on Windows and Mac OS&nbsp;X, however, see {{issue|109052}})<br />
* '''TODO:''' {{issue|113341}} &ldquo;-nofirststartwizard should disable update check&rdquo;<br />
<br />
=== Pre-Installed OOo ===<br />
<br />
* For Sun Hamburg Release Engineering, take MWS archive installation sets from &ldquo;S:&rdquo; instead of solver: [http://hg.services.openoffice.org/cws/sb118/rev/d5dbea724063 &ldquo;take installation set from <code>SHIPDRIVE</code> if appropriate&rdquo;].<br />
* '''TODO:''' <code>PKGFORMAT=installed</code> instead of <code>archive</code>?<br />
<br />
=== <code>unoapi</code> Tests ===<br />
<br />
* Known issues, open (not yet addressed at all; disabled for now on net-yet-integrated CWS; or fixed on not-yet-integrated CWS):<br />
** {{issue|116120}} &ldquo;vcl: TabControl::ImplGetTabRect negative height leads to X_CreatePixmap BadAlloc&rdquo;<br />
** {{issue|116125}} &ldquo;qadevOOo/qa/complex/junitskeleton failure&rdquo;<br />
** {{issue|116156}} &ldquo;toolkit/qa/unoapi crash in SwAccessibleMap::RemoveContext&rdquo;<br />
** {{issue|116192}} &ldquo;[sw] fixed text fields sometimes get updated&rdquo;<br />
** {{issue|116550}} &ldquo;toolkit/qa/unoapi crashes OOo in ~SwAccessibleParagraph vs. SwXTextDocument::close&rdquo;<br />
** {{issue|116583}} &ldquo;comphelper/qa/complex/comphelper failure&rdquo;<br />
** {{issue|116730}} &ldquo;vcl: crash with multiple threads in Window::ImplGrabFocus&rdquo;<br />
** {{issue|116733}} &ldquo;sw: crash in ~SwDrawContact (forms/qa/unoapi)&rdquo;<br />
** {{issue|117381}} &ldquo;ucb/qa/unoapi ucb.UniversalContentBroker::com::sun::star::ucb::XContentProviderManager::deregisterContentProvider() fails with gvfs&rdquo;<br />
* Known issues, disabled for now:<br />
** {{issue|109517}} &ldquo;sc/qa/unoapi fails for ScAnnotationObj etc.&rdquo;<br />
** {{issue|109518}} &ldquo;sd/qa/unoapi crash in SfxViewShell::GetController&rdquo;<br />
** {{issue|109643}} &ldquo;toolkit/qa/unoapi tests fail when losing focus&rdquo;<br />
** {{issue|109728}} &ldquo;~ScAutoFormatObj uses cleared ScGlobal&rdquo;<br />
** {{issue|109917}} &ldquo;fragile unoapi test using OnUnfocus event&rdquo;<br />
** {{issue|109939}} &ldquo;toolkit: inconsistent UnoControl locking schemes&rdquo;<br />
** {{issue|110862}} &ldquo;sc/qa/unoapi fails for sc.ScDataPilotTableObj::com::sun::star::sheet::XDataPilotTable::refresh()&rdquo;<br />
** {{issue|110988}} &ldquo;svtools/qa/unoapi fails for svtools.AccessibleBrowseBox etc.&rdquo;<br />
** {{issue|111006}} &ldquo;toolkit: deadlock between UnoControls&rdquo;<br />
** {{issue|111032}} &ldquo;sc/qa/unoapi sc.ScAccessibleCell::com::sun::star::accessibility::XAccessibleText getCharacterBounds() failure&rdquo;<br />
** {{issue|111042}} &ldquo;sd/qa/unoapi sd::DrawController::dispose crash&rdquo;<br />
** {{issue|111043}} &ldquo;sd/qa/unoapi sd::DrawController_OutlineView NullPointerException&rdquo;<br />
** {{issue|111102}} &ldquo;chart2: ChartModelHelper::findDiagram returns null&rdquo;<br />
** {{issue|111111}} &ldquo;xmloff.Impress.XMLImporter::com::sun::star::document::XImporter&rdquo;<br />
** {{issue|111113}} &ldquo;toolkit.AccessibleStatusBarItem unoapi failure&rdquo;<br />
** {{issue|111148}} &ldquo;forms/qa/unoapi forms.OImageControlModel::com::sun::star::beans::XMultiPropertySet deadlock&rdquo;<br />
** {{issue|111169}} &ldquo;svx.AccessiblePageShape unoapi failure&rdquo;<br />
** {{issue|111170}} &ldquo;sun/i18n/qa/unoapi "creating a drawdoc" failure&rdquo;<br />
** {{issue|111178}} &ldquo;sw/qa/unoapi SwView::SelectShell crash&rdquo;<br />
** {{issue|111180}} &ldquo;framework/qa/unoapi fwk.Desktop::com::sun::star::frame::XComponentLoader::loadComponentFromURL() failure&rdquo;<br />
** {{issue|111182}} &ldquo;Desktop::terminate -> ~DropTarget -> _objc_error crash&rdquo;<br />
** {{issue|111184}} &ldquo;sal/qa/osl/pipe uses fixed pipe names&rdquo;<br />
** {{issue|111186}} &ldquo;sw/qa/unoapi sw.PageStyle::com::sun::star::beans::XPropertySet::setPropertyValue() failure&rdquo;<br />
** {{issue|111190}} &ldquo;sw/qa/unoapi sw.SwXShape failure&rdquo;<br />
** {{issue|111194}} &ldquo;sw/qa/unoapi sw.XMLExporter crash&rdquo;<br />
** {{issue|111195}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleScrollBar::com::sun::star::accessibility::XAccessibleValue::setCurrentValue() failure&rdquo;<br />
** {{issue|111197}} &ldquo;sw/qa/unoapi sw.SwAccessibleDocumentPageView failure&rdquo;<br />
** {{issue|111199}} &ldquo;sd/qa/unoapi sd.AccessibleOutlineView failure&rdquo;<br />
** {{issue|111200}} &ldquo;xmloff/qa/unoapi xmloff.Draw.XMLMetaImporter failure&rdquo;<br />
** {{issue|111216}} &ldquo;svx/qa/unoapi accessibility deadlock&rdquo;<br />
** {{issue|111218}} &ldquo;sw/qa/unoapi sw.SwAccessibleParagraphView::com::sun::star::accessibility::XAccessibleEventBroadcaster::removeEventListener() failure&rdquo;<br />
** {{issue|111220}} &ldquo;sw/qa/unoapi sw.XMLContentExporter::com::sun::star::document::XFilter::cancel() failure&rdquo;<br />
** {{issue|111224}} &ldquo;xmloff/qa/unoapi xmloff.Impress.XMLContentExporter crash&rdquo;<br />
** {{issue|111225}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleStatusBar failure&rdquo;<br />
** {{issue|111252}} &ldquo;svx/qa/unoapi svx.AccessibleOLEShape deadlock&rdquo;<br />
** {{issue|111273}} &ldquo;sw/qa/unoapi sw.SwXTextEmbeddedObject::com::sun::star::document::XEmbeddedObjectSupplier::getEmbeddedObject() crash&rdquo;<br />
** {{issue|111278}} &ldquo;svx/qa/unoapi svx.AccessibleEditableTextPara failure&rdquo;<br />
** {{issue|111283}} &ldquo;sfx2/qa/unoapi sfx.StandaloneDocumentInfo failure&rdquo;<br />
** {{issue|111285}} &ldquo;forms/qa/unoapi forms.OButtonModel failure&rdquo;<br />
** {{issue|111287}} &ldquo;xmloff/qa/unoapi XMLSettingsIm-/Exporter crash&rdquo;<br />
** {{issue|111329}} &ldquo;sd/qa/unoapi SdXCustomPresentationAccess::getElementNames/ImpEditEngine::OnlineSpellHdl hang&rdquo;<br />
** {{issue|111332}} &ldquo;sw/qa/unoapi sw.XMLStylesExporter::com::sun::star::document::XFilter crash&rdquo;<br />
** {{issue|111333}} &ldquo;forms/qa/unoapi forms.OImageControlControl::com::sun::star::awt::XControl deadlock&rdquo;<br />
** {{issue|112743}} &ldquo;starmath/qa/unoapi sm.XMLSettingsExporter failure&rdquo;<br />
** {{issue|112746}} &ldquo;framework/qa/unoapi fwk.ModuleManager failure (X11 BadWindow)&rdquo;<br />
** {{issue|112751}} &ldquo;testgraphical/qa/graphical failure&rdquo;<br />
** {{issue|112778}} &ldquo;xmloff/qa/unoapi xmloff.Draw.XMLContentExporter failure&rdquo;<br />
** {{issue|113020}} &ldquo;sw/qa/unoapi sw.SwXTextGraphicObject::com::sun::star::beans::XPropertySet failure&rdquo;<br />
** {{issue|113103}} &ldquo;chart2: deadlock between DiagramHelper and Diagram&rdquo;<br />
** {{issue|113136}} &ldquo;sw/qa/unoapi sw.SwAccessibleParagraphView::com::sun::star::accessibility::XAccessibleEditableText failure&rdquo;<br />
** {{issue|113142}} &ldquo;sw/qa/unoapi SwAccessibleContext::RemoveFrmFromAccessibleMap crash&rdquo;<br />
** {{issue|113161}} &ldquo;sd/qa/unoapi sd.SdLayer::com::sun::star::drawing::Layer::IsVisible failure&rdquo;<br />
** {{issue|113201}} &ldquo;forms/qa/unoapi forms.OEditModel::com::sun::star::form::validation::XValidatableFormComponent failure&rdquo;<br />
** {{issue|113245}} &ldquo;framework/qa/unoapi fwl.TypeDetection failure&rdquo;<br />
** {{issue|113306}} &ldquo;sfx2/qa/unoapi sfx.DocumentTemplates failure&rdquo;<br />
** {{issue|113386}} &ldquo;sd/qa/unoapi sd.AccessibleDrawDocumentView::com::sun::star::accessibility::XAccessibleComponent::containsPoint() failure&rdquo;<br />
** {{issue|113489}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleMenu{,Bar,Separator} failures&rdquo;<br />
** {{issue|114205}} &ldquo;sw/qa/unoapi sw.SwAccessibleParagraphView::com::sun::star::accessibility::XAccessibleText::copyText() failed&rdquo;<br />
** {{issue|114209}} &ldquo;forms/qa/unoapi forms.OGridControlModel::com::sun::star::view::XSelectionSupplier crash&rdquo;<br />
** {{issue|114211}} &ldquo;xmloff/qa/unoapi xmloff.Draw.XMLStylesImporter::com::sun::star::lang::XInitialization crash&rdquo;<br />
** {{issue|114213}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleMenu::com::sun::star::accessibility::XAccessibleSelection failure&rdquo;<br />
** {{issue|114636}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleScrollBar::com::sun::star::accessibility::XAccessibleAction failure&rdquo;<br />
** {{issue|114637}} &ldquo;sw/qa/unoapi sw.SwAccessibleFootnoteView(?) crash&rdquo;<br />
** {{issue|114642}} &ldquo;svx/qa/unoapi svx: svx.SvxUnoTextContent::com::sun::star::style::CharacterProperties crash&rdquo;<br />
** {{issue|114669}} &ldquo;forms/qa/unoapi forms.OListBoxControl crash&rdquo;<br />
** {{issue|114889}} &ldquo;sw/qa/unoapi sw.SwXTextViewCursor::com::sun::star::view::XScreenCursor&rdquo;<br />
** {{issue|116784}} &ldquo;[sfx2] CheckGlobalEventBroadcaster_writer1 fails&rdquo;<br />
** {{issue|116813}} &ldquo;[sfx2] complex.sfx2.UndoManager checkBrokenScripts fails&rdquo;<br />
** {{issue|116814}} &ldquo;[toolkit] unoapi test UnoControlDialogModel: XCloneable fails&rdquo;<br />
* Missing tests:<br />
** {{issue|109564}} &ldquo;qadevOOo/tests/java/ifc/awt/_XSystemChildFactory.java&rdquo;<br />
* Sporadic failures:<br />
** {{issue|111217}} &ldquo;BasicManager::SetGlobalUNOConstant crash during shutdown&rdquo;<br />
** {{issue|111246}} &ldquo;svx::FontHeightToolBoxControl::statusChanged crash (memory corruption)&rdquo;<br />
** {{issue|111271}} &ldquo;Mac OS X: crash during shutdown, __tcf_2 on stack&rdquo;<br />
** {{issue|111400}} &ldquo;Extension Manager does not join spawned uno process (-> smoketestoo_native fails)&rdquo;<br />
** {{issue|112070}} &ldquo;UNO API tests must not use random&rdquo;<br />
** {{issue|113158}} &ldquo;crash with two threads in framework::ToolBarManager dtor&rdquo;<br />
** {{issue|113197}} &ldquo;sw/qa/unoapi sw.SwXTextRange hangs&rdquo;<br />
** {{issue|113367}} &ldquo;sysdtrans deadlock during shutdown&rdquo;<br />
** {{issue|113464}} &ldquo;stoc_smgr::ORegistryServiceManager::dispose crash during shutdown&rdquo;<br />
** {{issue|114207}} &ldquo;framework::ModuleUIConfigurationManager::dispose crash during shutdown&rdquo;<br />
** {{issue|114675}} &ldquo;binary URP bridge race on shut down, crash&rdquo;<br />
** {{issue|114718}} &ldquo;forms/qa/unoapi: crash in remote async release call&rdquo;<br />
** {{issue|116131}} &ldquo;vcl: message unregisterDraggingDestinationHandler: sent to freed object&rdquo;<br />
<br />
[[Category:Effort]][[Category:Test]]</div>Sbhttps://wiki.openoffice.org/wiki/Build_Environment_Effort/Module_StatusBuild Environment Effort/Module Status2011-03-15T07:31:32Z<p>Sb: </p>
<hr />
<div>{| cellspacing="0" cellpadding="3" border="1"<br />
|-<br />
| module<br />
| migrated in CWS<br />
| integrated in<br />
| remarks<br />
<br />
|-<br />
| accessibility<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| afms<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| agg<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| animations<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| apache-commons <br />
| <br />
| <br />
| <br />
<br />
|-<br />
| apple_remote<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| autodoc<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| automation<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| avmedia<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| basctl<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| basebmp<br />
| gnumake4<br />
| <br />
| needed fixing of exported symbols<br />
<br />
|-<br />
| basegfx<br />
| gnumake4<br />
| <br />
| needed fixing of exported symbols<br />
<br />
|-<br />
| basic<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| bean<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| beanshell<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| berkeleydb<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| binaryurp<br />
| {{CWS|sb143}}<br />
|<br />
|<br />
<br />
<br />
|-<br />
| binfilter<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| boost<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| bridges<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| cairo<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| canvas<br />
| gnumake4<br />
| <br />
| needed fixing of exported symbols <br />
<br />
|-<br />
| chart2<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| cli_ure<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| codemaker<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| comphelper<br />
| gnumake3<br />
| DEV300m100<br />
| <br />
<br />
|-<br />
| configmgr<br />
| {{CWS|sb143}}<br />
| <br />
| <br />
<br />
|-<br />
| connectivity<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| cosv<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| cppcanvas<br />
| gnumake4<br />
| <br />
| <br />
<br />
|-<br />
| cppu<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| cppuhelper<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| cppunit<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| cpputools<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| crashrep<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| cui<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| curl<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| dbaccess<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| default_images<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| desktop<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| dictionaries<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| drawinglayer<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| dtrans<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| editeng<br />
| gnumake3<br />
| DEV300m100<br />
| <br />
<br />
|-<br />
| embeddedobj<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| embedserv<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| epm<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| eventattacher<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| expat<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| extensions<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| external<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| external_images<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| extras<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| fileaccess<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| filter<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| forms<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| formula<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| fpicker<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| framework<br />
| gnumake2<br />
| DEV300m96<br />
| <br />
<br />
|-<br />
| graphite<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| helpcontent2<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| hsqldb<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| hunspell<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| hwpfilter<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| hyphen<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| i18npool<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| i18nutil<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| icc<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| icu<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| idl<br />
| gnumake4<br />
| <br />
| <br />
<br />
|-<br />
| idlc<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| instsetoo_native<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| io<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| javainstaller<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| javaunohelper<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| jfreereport<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| jpeg<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| jurt<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| jvmaccess<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| jvmfwk<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| l10n<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| l10ntools<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| libegg<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| libtextcat<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| libwpd<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| libxml2<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| libxmlsec<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| libxslt<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| lingucomponent<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| linguistic<br />
| gnumake4<br />
| <br />
| needed fixing of exported symbols<br />
<br />
|-<br />
| lpsolve<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| lucene<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| mathmldtd<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| mdds<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| migrationanalysis<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| more_fonts<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| moz<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| mysqlc<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| mysqlcppconn<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| mythes<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| neon<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| np_sdk<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| nss<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| o3tl<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| odk<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| offapi<br />
| ause130<br />
| <br />
| in progress<br />
<br />
|-<br />
| officecfg<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| offuh<br />
| ause130<br />
| <br />
| in progress; will become obsolete<br />
<br />
|-<br />
| ooo_custom_images<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| oovbaapi<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| oox<br />
| writerfilter10<br />
| <br />
| in progress<br />
<br />
|-<br />
| openssl<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| package<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| packimages<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| padmin<br />
| vcl118<br />
| <br />
| <br />
<br />
|-<br />
| postprocess<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| psprint_config<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| python<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| pyuno<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| qadevooo<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| rdbmaker<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| readlicense_oo<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| redland<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| regexp<br />
| cws gnumak4<br />
| <br />
| name of library was changed<br />
<br />
|-<br />
| registry<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| remotebridges<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| reportbuilder<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| reportdesign<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| rhino<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| ridljar<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| rsc<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| sal<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| salhelper<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| sane<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| sax<br />
| gnumake4<br />
| <br />
| sax.uno lib renamed to expwrap.uno.lib because new build system can't separate it from sax library<br />
<br />
|-<br />
| saxon<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| sc<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| scaddins<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| sccomp<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| scp2<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| scripting<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| sd<br />
| sd2gbuild<br />
| <br />
| <br />
<br />
|-<br />
| sdext<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| setup_native<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| sfx2<br />
| gnumake2<br />
| DEV300m96<br />
| <br />
<br />
|-<br />
| shell<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| slideshow<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| smoketestoo_native<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| soldep<br />
| <br />
| <br />
| will be removed <br />
<br />
|-<br />
| soltools<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| sot<br />
| gnumake3<br />
| DEV300m100<br />
| <br />
<br />
|-<br />
| starmath<br />
| gnumake4<br />
| <br />
| <br />
<br />
|-<br />
| stax<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| stlport<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| stoc<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| store<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| svl<br />
| gnumake2<br />
| DEV300m96<br />
| <br />
<br />
|-<br />
| svtools<br />
| gnumake2<br />
| DEV300m96<br />
| <br />
<br />
|-<br />
| svx<br />
| gnumake3<br />
| DEV300m100<br />
| special treatment for globlmn.hrc, srs in solver<br />
<br />
|-<br />
| sw<br />
| gnumake2<br />
| DEV300m96<br />
| <br />
<br />
|-<br />
| swext<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| sysui<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| test<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| testautomation<br />
| <br />
| <br />
| does not build anything<br />
<br />
|-<br />
| testgraphical<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| testtools<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| tomcat<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| toolkit<br />
| gnumake2<br />
| DEV300m96<br />
| <br />
<br />
|-<br />
| tools<br />
| gnumake2<br />
| DEV300m96<br />
| <br />
<br />
|-<br />
| twain<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| ucb<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| ucbhelper<br />
| gnumake4<br />
| <br />
| <br />
<br />
|-<br />
| udkapi<br />
| ause130<br />
| <br />
| in progress<br />
<br />
|-<br />
| udm<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| unixODBC<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| UnoControls<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| unodevtools<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| unoil<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| unotools<br />
| gnumake4<br />
| <br />
| <br />
<br />
|-<br />
| unoxml<br />
| xmlfix3<br />
| <br />
| <br />
<br />
|-<br />
| ure<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| uui<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| vbaapi<br />
| ause130<br />
| <br />
| in progress<br />
<br />
|-<br />
| vbahelper<br />
| gnumake4<br />
| <br />
| <br />
<br />
|-<br />
| vcl<br />
| vcl2gnumake<br />
| <br />
| in progress<br />
<br />
|-<br />
| vigra<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| vos<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| wizards<br />
| gnumake4<br />
| <br />
| <br />
<br />
|-<br />
| writerfilter<br />
| writerfilter10<br />
| <br />
| <br />
<br />
|-<br />
| writerperfect<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| x11_extensions<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| xmerge<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| xml2cmp<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| xmlhelp<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| xmloff<br />
| gnumake2<br />
| DEV300m96<br />
| <br />
<br />
|-<br />
| xmlreader<br />
| {{CWS|gnumake4}}<br />
| <br />
| <br />
<br />
|-<br />
| xmlscript<br />
| gnumake4<br />
| <br />
| <br />
<br />
|-<br />
| xmlsecurity<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| xpdf<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| xsltml<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| zlib<br />
| <br />
| <br />
| <br />
<br />
|}</div>Sbhttps://wiki.openoffice.org/wiki/Build_Environment_Effort/Module_StatusBuild Environment Effort/Module Status2011-03-14T13:00:43Z<p>Sb: </p>
<hr />
<div>{| cellspacing="0" cellpadding="3" border="1"<br />
|-<br />
| module<br />
| migrated in CWS<br />
| integrated in<br />
| remarks<br />
<br />
|-<br />
| accessibility<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| afms<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| agg<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| animations<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| apache-commons <br />
| <br />
| <br />
| <br />
<br />
|-<br />
| apple_remote<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| autodoc<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| automation<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| avmedia<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| basctl<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| basebmp<br />
| gnumake4<br />
| <br />
| needed fixing of exported symbols<br />
<br />
|-<br />
| basegfx<br />
| gnumake4<br />
| <br />
| needed fixing of exported symbols<br />
<br />
|-<br />
| basic<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| bean<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| beanshell<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| berkeleydb<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| binaryurp<br />
| {{CWS|sb143}}<br />
|<br />
|<br />
<br />
<br />
|-<br />
| binfilter<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| boost<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| bridges<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| cairo<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| canvas<br />
| gnumake4<br />
| <br />
| needed fixing of exported symbols <br />
<br />
|-<br />
| chart2<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| cli_ure<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| codemaker<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| comphelper<br />
| gnumake3<br />
| DEV300m100<br />
| <br />
<br />
|-<br />
| configmgr<br />
| {{CWS|sb143}}<br />
| <br />
| <br />
<br />
|-<br />
| connectivity<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| cosv<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| cppcanvas<br />
| gnumake4<br />
| <br />
| <br />
<br />
|-<br />
| cppu<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| cppuhelper<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| cppunit<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| cpputools<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| crashrep<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| cui<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| curl<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| dbaccess<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| default_images<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| desktop<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| dictionaries<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| drawinglayer<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| dtrans<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| editeng<br />
| gnumake3<br />
| DEV300m100<br />
| <br />
<br />
|-<br />
| embeddedobj<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| embedserv<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| epm<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| eventattacher<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| expat<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| extensions<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| external<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| external_images<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| extras<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| fileaccess<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| filter<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| forms<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| formula<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| fpicker<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| framework<br />
| gnumake2<br />
| DEV300m96<br />
| <br />
<br />
|-<br />
| graphite<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| helpcontent2<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| hsqldb<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| hunspell<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| hwpfilter<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| hyphen<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| i18npool<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| i18nutil<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| icc<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| icu<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| idl<br />
| gnumake4<br />
| <br />
| <br />
<br />
|-<br />
| idlc<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| instsetoo_native<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| io<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| javainstaller<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| javaunohelper<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| jfreereport<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| jpeg<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| jurt<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| jvmaccess<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| jvmfwk<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| l10n<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| l10ntools<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| libegg<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| libtextcat<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| libwpd<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| libxml2<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| libxmlsec<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| libxslt<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| lingucomponent<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| linguistic<br />
| gnumake4<br />
| <br />
| needed fixing of exported symbols<br />
<br />
|-<br />
| lpsolve<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| lucene<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| mathmldtd<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| mdds<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| migrationanalysis<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| more_fonts<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| moz<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| mysqlc<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| mysqlcppconn<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| mythes<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| neon<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| np_sdk<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| nss<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| o3tl<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| odk<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| offapi<br />
| ause130<br />
| <br />
| in progress<br />
<br />
|-<br />
| officecfg<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| offuh<br />
| ause130<br />
| <br />
| in progress; will become obsolete<br />
<br />
|-<br />
| ooo_custom_images<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| oovbaapi<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| oox<br />
| writerfilter10<br />
| <br />
| in progress<br />
<br />
|-<br />
| openssl<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| package<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| packimages<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| padmin<br />
| vcl118<br />
| <br />
| <br />
<br />
|-<br />
| postprocess<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| psprint_config<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| python<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| pyuno<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| qadevooo<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| rdbmaker<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| readlicense_oo<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| redland<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| regexp<br />
| cws gnumak4<br />
| <br />
| name of library was changed<br />
<br />
|-<br />
| registry<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| remotebridges<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| reportbuilder<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| reportdesign<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| rhino<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| ridljar<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| rsc<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| sal<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| salhelper<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| sane<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| sax<br />
| gnumake4<br />
| <br />
| sax.uno lib renamed to expwrap.uno.lib because new build system can't separate it from sax library<br />
<br />
|-<br />
| saxon<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| sc<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| scaddins<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| sccomp<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| scp2<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| scripting<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| sd<br />
| sd2gbuild<br />
| <br />
| <br />
<br />
|-<br />
| sdext<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| setup_native<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| sfx2<br />
| gnumake2<br />
| DEV300m96<br />
| <br />
<br />
|-<br />
| shell<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| slideshow<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| smoketestoo_native<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| soldep<br />
| <br />
| <br />
| will be removed <br />
<br />
|-<br />
| soltools<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| sot<br />
| gnumake3<br />
| DEV300m100<br />
| <br />
<br />
|-<br />
| starmath<br />
| gnumake4<br />
| <br />
| <br />
<br />
|-<br />
| stax<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| stlport<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| stoc<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| store<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| svl<br />
| gnumake2<br />
| DEV300m96<br />
| <br />
<br />
|-<br />
| svtools<br />
| gnumake2<br />
| DEV300m96<br />
| <br />
<br />
|-<br />
| svx<br />
| gnumake3<br />
| DEV300m100<br />
| special treatment for globlmn.hrc, srs in solver<br />
<br />
|-<br />
| sw<br />
| gnumake2<br />
| DEV300m96<br />
| <br />
<br />
|-<br />
| swext<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| sysui<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| test<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| testautomation<br />
| <br />
| <br />
| does not build anything<br />
<br />
|-<br />
| testgraphical<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| testtools<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| tomcat<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| toolkit<br />
| gnumake2<br />
| DEV300m96<br />
| <br />
<br />
|-<br />
| tools<br />
| gnumake2<br />
| DEV300m96<br />
| <br />
<br />
|-<br />
| twain<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| ucb<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| ucbhelper<br />
| gnumake4<br />
| <br />
| <br />
<br />
|-<br />
| udkapi<br />
| ause130<br />
| <br />
| in progress<br />
<br />
|-<br />
| udm<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| unixODBC<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| UnoControls<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| unodevtools<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| unoil<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| unotools<br />
| gnumake4<br />
| <br />
| <br />
<br />
|-<br />
| unoxml<br />
| xmlfix3<br />
| <br />
| <br />
<br />
|-<br />
| ure<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| uui<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| vbaapi<br />
| ause130<br />
| <br />
| in progress<br />
<br />
|-<br />
| vbahelper<br />
| gnumake4<br />
| <br />
| <br />
<br />
|-<br />
| vcl<br />
| vcl2gnumake<br />
| <br />
| in progress<br />
<br />
|-<br />
| vigra<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| vos<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| wizards<br />
| gnumake4<br />
| <br />
| <br />
<br />
|-<br />
| writerfilter<br />
| writerfilter10<br />
| <br />
| <br />
<br />
|-<br />
| writerperfect<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| x11_extensions<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| xmerge<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| xml2cmp<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| xmlhelp<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| xmloff<br />
| gnumake2<br />
| DEV300m96<br />
| <br />
<br />
|-<br />
| xmlreader<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| xmlscript<br />
| gnumake4<br />
| <br />
| <br />
<br />
|-<br />
| xmlsecurity<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| xpdf<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| xsltml<br />
| <br />
| <br />
| <br />
<br />
|-<br />
| zlib<br />
| <br />
| <br />
| <br />
<br />
|}</div>Sbhttps://wiki.openoffice.org/wiki/Warning-free_code_statusWarning-free code status2011-03-10T13:48:26Z<p>Sb: </p>
<hr />
<div>See [[Writing_warning-free_code|Writing warning-free code]] for more general information about this project.<br />
<br />
For some of our platforms, the status of any modules not yet warning-free on <code>DEV300_m102</code>:<br />
{| border="1"<br />
! Module<br />
| <code>unxlngi6</code><br />
| <code>unxlngx6</code><br />
| <code>unxmacxi</code><br />
| <code>unxsoli4</code><br />
| <code>unxsols4</code><br />
| <code>wntmsci12</code><br />
|-<br />
| <code>soldep</code><br />
| style="background:red" | [http://www.openoffice.org/issues/show_bug.cgi?id=78138 issue 78138]<br />
| style="background:red" | [http://www.openoffice.org/issues/show_bug.cgi?id=78138 issue 78138]<br />
| style="background:green" |<br />
| style="background:red" | [http://www.openoffice.org/issues/show_bug.cgi?id=78138 issue 78138]<br />
| style="background:red" | [http://www.openoffice.org/issues/show_bug.cgi?id=78138 issue 78138]<br />
| style="background:red" | [http://www.openoffice.org/issues/show_bug.cgi?id=78138 issue 78138]<br />
|}<br />
<br />
By the way, there is a request for naming CWS after a <code>warnings0x</code> pattern [http://www.openoffice.org/servlets/ReadMsg?list=dev&msgNo=17759 on the dev mailing list].<br />
<br />
[[Category:Coding Standards]]</div>Sbhttps://wiki.openoffice.org/wiki/ValgrindValgrind2011-03-09T12:10:10Z<p>Sb: /* Definite Errors */</p>
<hr />
<div>'''[http://valgrind.org/ Valgrind]''' is an instrumentation framework for dynamic analysis tools. It can be used to detect memory management and threading bugs and profile programs. It runs on Linux x86 and AMD64, PPC32 and PPC64 are fairly complete.<br />
<br />
== disabling the custom allocator ==<br />
<br />
If you use ooo-build; export OOO_FORCE_SYSALLOC=1 before running, (this is built into [[linkoo]]'s ooenv script).<br />
<br />
If you use a Vanilla build, and your shell is setup for building ooo, use the following wrapper script around valgrind:<br />
<pre><br />
#!/bin/sh<br />
<br />
# instrument soffice with a malloc-based memory allocator.<br />
# Requires libsalalloc_malloc.so to be in the LD_LIBRARY_PATH.<br />
# Forwards all command line arguments to valgrind.<br />
<br />
export LD_PRELOAD=libsalalloc_malloc.so<br />
valgrind $@ <br />
</pre><br />
<br />
which preloads a small interceptor lib, which redirects all allocator calls to malloc.<br />
<br />
== disabling glib's custom allocator ==<br />
<br />
If you want to also track down problems with glib allocated objects, e.g. resource leaks in gconfbe then you need to disable glib's custom allocation as well, e.g. <br />
<br />
<pre><br />
G_SLICE=always-malloc valgrind ...<br />
</pre><br />
<br />
== disabling the STLport custom allocator ==<br />
<br />
The [http://www.sgi.com/tech/stl/Allocators.html STLport default allocator] uses a static free list (<code>_S_free_list</code> in <code>_alloc.h</code>) and there appears to be no functionality to flush it upon exit (like <code>__libc_freeres</code> in the GNU C library). Thus, Valgrind can erroneously consider memory as still reachable at program termination.<br />
<br />
The easiest workaround is probably to use a build that does not use STLport, like using a 64-bit <code>unxlngx6</code> build.<br />
<br />
== Helgrind <code>__cxa_guard_acquire</code> problems ==<br />
<br />
The <code>libstdc++.so.6</code> included in <code>unxlngx6</code> Hamburg builds (and probably the one included in <code>unxlngi6</code> builds as well) apparently has a <code>__cxa_guard_acquire</code> that uses a single mutex for all the various statics, leading to many false complaints about lock order violation.<br />
<br />
As a workaround, move the instances of <code>libgcc_s.so.1</code> and <code>libstdc++.so.6</code> within the OOo installation set out of the way (and thus use the ones from the system, which are hopefully recent enough).<br />
<br />
== Errors Found ==<br />
<br />
=== Definite Errors ===<br />
<br />
Open as of <code>DEV300_m99</code>:<br />
<br />
* {{issue|114718}} &ldquo;forms/qa/unoapi: crash in remote async release call&rdquo;<br />
* {{issue|116785}} &ldquo;framework::[Module]ImageManager kept alive by ring ref&rdquo;<br />
* {{issue|116786}} &ldquo;framework::ToolBarLayoutManger::m_p{AddonOptions,GlobalSettings} leak&rdquo;<br />
* {{issue|116850}} &ldquo;SvLBox::OnCurrentEntryChanged: Conditional jump or move depends on uninitialised value(s)&rdquo;<br />
* {{issue|116885}} &ldquo;utl::TextSearch::CachedTextSearch::~CachedTextSearch called too late&rdquo;<br />
* {{issue|116891}} &ldquo;framework::AddonMenuManager::BuildMenu leaks MenuConfiguration::Attributes&rdquo;<br />
* {{issue|116910}} &ldquo;desktop::Acceptor leaks Thread_Impl&rdquo;<br />
* {{issue|116915}} &ldquo;osl_getSystemPathFromFileURL leaks rtl_uStrings&rdquo;<br />
* {{issue|116981}} &ldquo;rtl/source/bootstrap.cxx does not clean up memory&rdquo;<br />
* {{issue|117082}} &ldquo;editengine: static maTypeSequence instances destroyed too late&rdquo;<br />
* {{issue|117083}} &ldquo;document window leaks framework::WindowCommandDispatch instance&rdquo;<br />
* {{issue|117084}} &ldquo;Desktop::Main leaks Lockfile instance&rdquo;<br />
* {{issue|117119}} &ldquo;lock-order violation in comprehensive cppu_detail_getUnoType&rdquo;<br />
* {{issue|117153}} &ldquo;utl::Bootstrap leaks Impl&rdquo;<br />
* {{issue|117154}} &ldquo;Desktop::GetCommandLineArgs leaks CommandLineArgs&rdquo;<br />
* {{issue|117292}} &ldquo;lock order violation in io service implementations&rdquo;<br />
* {{issue|117294}} &ldquo;lock order violation in SFX_IMPL_XSERVICEINFO&rdquo;<br />
* {{issue|117295}} &ldquo;lock order violation in cpp_uno bridge RTTI&rdquo;<br />
* {{issue|117296}} &ldquo;lock order violation in fileaccess service implementation&rdquo;<br />
<br />
=== Definite False Positives ===<br />
<br />
Open as of <code>DEV300_m99</code>:<br />
<br />
* {{issue|116872}} &ldquo;drawinglayer: BPixelRasterToBitmapEx causes false valgrind positive in rtl_crc32&rdquo;<br />
<br />
* On <code>unxlngx6</code>, executing <code>DEV300_m100</code> <code>sfx2/qa/complex</code>, a 14 byte <code>com.sun.star.util.DateTime</code> struct (consisting of seven <code>unsigned short</code> members) is filled with two 64 bit writes.<br />
<pre><br />
Invalid write of size 8<br />
at 0x1558BBAC: x86_64::fill_struct(_typelib_TypeDescriptionReference*, unsigned long const*, double const*, void*) (in /opt/openoffice.org/ure/lib/libgcc3_uno.so)<br />
by 0x15591965: callVirtualMethod(void*, unsigned int, void*, _typelib_TypeDescriptionReference*, bool, unsigned long*, unsigned int, unsigned long*, unsigned int, double*, unsigned int) (in /opt/openoffice.org/ure/lib/libgcc3_uno.so)<br />
by 0x1559240D: cpp_call(bridges::cpp_uno::shared::UnoInterfaceProxy*, bridges::cpp_uno::shared::VtableSlot, _typelib_TypeDescriptionReference*, int, _typelib_MethodParameter*, void*, void**, _uno_Any**) (in /opt/openoffice.org/ure/lib/libgcc3_uno.so)<br />
by 0x15592B8A: bridges::cpp_uno::shared::unoInterfaceProxyDispatch(_uno_Interface*, _typelib_TypeDescription const*, void*, void**, _uno_Any**) (in /opt/openoffice.org/ure/lib/libgcc3_uno.so)<br />
by 0x1A15C688: binaryurp::IncomingRequest::execute_throw(binaryurp::BinaryAny*, std::vector<binaryurp::BinaryAny, std::allocator<binaryurp::BinaryAny> >*) const (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A15CC45: binaryurp::IncomingRequest::execute() const (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A16B09A: request (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x70057CA: cppu_threadpool::JobQueue::enter(long, unsigned char) (in /opt/openoffice.org/ure/lib/libuno_cppu.so.3)<br />
by 0x70062C2: cppu_threadpool::ORequestThread::run() (in /opt/openoffice.org/ure/lib/libuno_cppu.so.3)<br />
by 0x70065F2: cppu_requestThreadWorker (in /opt/openoffice.org/ure/lib/libuno_cppu.so.3)<br />
by 0x4E5F72E: osl_thread_start_Impl (in /opt/openoffice.org/ure/lib/libuno_sal.so.3)<br />
by 0x67679C9: start_thread (pthread_create.c:300)<br />
Address 0xeb32480 is 16 bytes inside a block of size 22 alloc'd<br />
at 0x4C274A8: malloc (vg_replace_malloc.c:236)<br />
by 0x4E9A7CC: rtl_allocateMemory (in /opt/openoffice.org/ure/lib/libuno_sal.so.3)<br />
by 0x4013EE: allocate(unsigned long, (anonymous namespace)::AllocatorTraits const&) (in /opt/openoffice.org3/program/soffice.bin)<br />
by 0x4014C5: operator new(unsigned long) (in /opt/openoffice.org3/program/soffice.bin)<br />
by 0x1A15E77E: __gnu_cxx::new_allocator<char>::allocate(unsigned long, void const*) (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A15E7A6: std::_Vector_base<char, std::allocator<char> >::_M_allocate(unsigned long) (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A15E7D8: std::_Vector_base<char, std::allocator<char> >::_Vector_base(unsigned long, std::allocator<char> const&) (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A15F686: std::vector<char, std::allocator<char> >::vector(unsigned long, char const&, std::allocator<char> const&) (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A15C57A: binaryurp::IncomingRequest::execute_throw(binaryurp::BinaryAny*, std::vector<binaryurp::BinaryAny, std::allocator<binaryurp::BinaryAny> >*) const (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A15CC45: binaryurp::IncomingRequest::execute() const (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A16B09A: request (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x70057CA: cppu_threadpool::JobQueue::enter(long, unsigned char) (in /opt/openoffice.org/ure/lib/libuno_cppu.so.3)<br />
</pre><br />
<br />
* On <code>unxlngx6</code>, executing <code>DEV300_m100</code> <code>sfx2/qa/complex</code> triggers the below report, which appears to be a false positive caused by what appears to be an error in valgrind, see [https://bugs.kde.org/show_bug.cgi?id=266990 &ldquo;setns instruction causes false positive&rdquo;].<br />
<pre><br />
Conditional jump or move depends on uninitialised value(s)<br />
at 0x22694A93: SwLayAction::_FormatCntnt(SwCntntFrm const*, SwPageFrm const*) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x226982DD: SwLayAction::_FormatFlyCntnt(SwFlyFrm const*) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x226A0349: SwObjectFormatter::_FormatObj(SwAnchoredObject&) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x226A14CB: SwObjectFormatterTxtFrm::DoFormatObj(SwAnchoredObject&, bool) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x226A01C2: SwObjectFormatter::_FormatObjsAtFrm(SwTxtFrm*) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x226A115B: SwObjectFormatterTxtFrm::DoFormatObjs() (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x2269FF52: SwObjectFormatter::FormatObjsAtFrm(SwFrm&, SwPageFrm const&, SwLayAction*) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x2269501E: SwLayAction::FormatCntnt(SwPageFrm const*) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x22696E9B: SwLayAction::InternalAction() (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x226975A7: SwLayAction::Action() (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x22885D50: ViewShell::ImplEndAction(unsigned char) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x225155A2: ViewShell::EndAction(unsigned char) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
</pre><br />
<br />
=== Potentially False Positives ===<br />
<br />
<pre><br />
Conditional jump or move depends on uninitialised value(s)<br />
at 0x9440A18: XcursorImageHash (in /usr/lib/libXcursor.so.1.0.2)<br />
by 0x9440ED7: XcursorNoticePutBitmap (in /usr/lib/libXcursor.so.1.0.2)<br />
by 0x42F5EF8: _XNoticePutBitmap (in /usr/lib/libX11.so.6.3.0)<br />
by 0x430D3A7: XPutImage (in /usr/lib/libX11.so.6.3.0)<br />
by 0x938107E: ImplSalDDB::ImplSalDDB(_XImage*, unsigned long, int, SalTwoRect const&) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x9382E77: X11SalBitmap::ImplGetDDB(unsigned long, int, long, SalTwoRect const&) const (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x9382F52: X11SalBitmap::ImplDraw(unsigned long, int, long, SalTwoRect const&, _XGC* const&) const (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x937DC2A: X11SalGraphics::drawMaskedBitmap(SalTwoRect const*, SalBitmap const&, SalBitmap const&) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x937DF70: X11SalGraphics::drawBitmap(SalTwoRect const*, SalBitmap const&, SalBitmap const&) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x5BAE9FB: SalGraphics::DrawBitmap(SalTwoRect const*, SalBitmap const&, SalBitmap const&, OutputDevice const*) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclli.so)<br />
by 0x5B92D9C: OutputDevice::ImplDrawBitmapEx(Point const&, Size const&, Point const&, Size const&, BitmapEx const&, unsigned long) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclli.so)<br />
by 0x5B9320D: OutputDevice::DrawBitmapEx(Point const&, Size const&, BitmapEx const&) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclli.so)<br />
</pre><br />
might be a false positive, [http://code.google.com/p/microblog-purple/source/browse/branches/0.3/valgrind-suppressions?r=353#27] specifies a suppression block for the head of that stack,<br />
<pre><br />
{<br />
X oddness 3<br />
Memcheck:Cond<br />
fun:XcursorImageHash<br />
fun:XcursorNoticePutBitmap<br />
fun:_XNoticePutBitmap<br />
fun:XPutImage<br />
}<br />
</pre><br />
<br />
== more information ==<br />
<br />
There's also some Writer document about Valgrind: http://tools.openoffice.org/debugging/usingvalgrind.sxw<br />
<br />
TODO: move (!) its content here, not just copy but also remove there, so we don't end up with a fork.<br />
<br />
TODO: '''Run recent version''' <br/><br />
Someone should run the latest version o OO.o, as Valgrind 3.3.0 re-introduces Hellgrind which helps e.g. to hunt down deadlocks. See [http://www.valgrind.org/docs/manual/dist.news.html] for more.<br />
<br />
== Callgrind Profiling How-To ==<br />
<br />
There's a [[Callgrind| Callgrind How-To]].<br />
<br />
<br />
[[Category:Developer Tools]]</div>Sbhttps://wiki.openoffice.org/wiki/ValgrindValgrind2011-03-09T11:51:12Z<p>Sb: /* Definite Errors */</p>
<hr />
<div>'''[http://valgrind.org/ Valgrind]''' is an instrumentation framework for dynamic analysis tools. It can be used to detect memory management and threading bugs and profile programs. It runs on Linux x86 and AMD64, PPC32 and PPC64 are fairly complete.<br />
<br />
== disabling the custom allocator ==<br />
<br />
If you use ooo-build; export OOO_FORCE_SYSALLOC=1 before running, (this is built into [[linkoo]]'s ooenv script).<br />
<br />
If you use a Vanilla build, and your shell is setup for building ooo, use the following wrapper script around valgrind:<br />
<pre><br />
#!/bin/sh<br />
<br />
# instrument soffice with a malloc-based memory allocator.<br />
# Requires libsalalloc_malloc.so to be in the LD_LIBRARY_PATH.<br />
# Forwards all command line arguments to valgrind.<br />
<br />
export LD_PRELOAD=libsalalloc_malloc.so<br />
valgrind $@ <br />
</pre><br />
<br />
which preloads a small interceptor lib, which redirects all allocator calls to malloc.<br />
<br />
== disabling glib's custom allocator ==<br />
<br />
If you want to also track down problems with glib allocated objects, e.g. resource leaks in gconfbe then you need to disable glib's custom allocation as well, e.g. <br />
<br />
<pre><br />
G_SLICE=always-malloc valgrind ...<br />
</pre><br />
<br />
== disabling the STLport custom allocator ==<br />
<br />
The [http://www.sgi.com/tech/stl/Allocators.html STLport default allocator] uses a static free list (<code>_S_free_list</code> in <code>_alloc.h</code>) and there appears to be no functionality to flush it upon exit (like <code>__libc_freeres</code> in the GNU C library). Thus, Valgrind can erroneously consider memory as still reachable at program termination.<br />
<br />
The easiest workaround is probably to use a build that does not use STLport, like using a 64-bit <code>unxlngx6</code> build.<br />
<br />
== Helgrind <code>__cxa_guard_acquire</code> problems ==<br />
<br />
The <code>libstdc++.so.6</code> included in <code>unxlngx6</code> Hamburg builds (and probably the one included in <code>unxlngi6</code> builds as well) apparently has a <code>__cxa_guard_acquire</code> that uses a single mutex for all the various statics, leading to many false complaints about lock order violation.<br />
<br />
As a workaround, move the instances of <code>libgcc_s.so.1</code> and <code>libstdc++.so.6</code> within the OOo installation set out of the way (and thus use the ones from the system, which are hopefully recent enough).<br />
<br />
== Errors Found ==<br />
<br />
=== Definite Errors ===<br />
<br />
Open as of <code>DEV300_m99</code>:<br />
<br />
* {{issue|114718}} &ldquo;forms/qa/unoapi: crash in remote async release call&rdquo;<br />
* {{issue|116785}} &ldquo;framework::[Module]ImageManager kept alive by ring ref&rdquo;<br />
* {{issue|116786}} &ldquo;framework::ToolBarLayoutManger::m_p{AddonOptions,GlobalSettings} leak&rdquo;<br />
* {{issue|116850}} &ldquo;SvLBox::OnCurrentEntryChanged: Conditional jump or move depends on uninitialised value(s)&rdquo;<br />
* {{issue|116885}} &ldquo;utl::TextSearch::CachedTextSearch::~CachedTextSearch called too late&rdquo;<br />
* {{issue|116891}} &ldquo;framework::AddonMenuManager::BuildMenu leaks MenuConfiguration::Attributes&rdquo;<br />
* {{issue|116910}} &ldquo;desktop::Acceptor leaks Thread_Impl&rdquo;<br />
* {{issue|116915}} &ldquo;osl_getSystemPathFromFileURL leaks rtl_uStrings&rdquo;<br />
* {{issue|116981}} &ldquo;rtl/source/bootstrap.cxx does not clean up memory&rdquo;<br />
* {{issue|117082}} &ldquo;editengine: static maTypeSequence instances destroyed too late&rdquo;<br />
* {{issue|117083}} &ldquo;document window leaks framework::WindowCommandDispatch instance&rdquo;<br />
* {{issue|117084}} &ldquo;Desktop::Main leaks Lockfile instance&rdquo;<br />
* {{issue|117119}} &ldquo;lock-order violation in comprehensive cppu_detail_getUnoType&rdquo;<br />
* {{issue|117153}} &ldquo;utl::Bootstrap leaks Impl&rdquo;<br />
* {{issue|117154}} &ldquo;Desktop::GetCommandLineArgs leaks CommandLineArgs&rdquo;<br />
* {{issue|117292}} &ldquo;lock order violation in io service implementations&rdquo;<br />
* {{issue|117294}} &ldquo;lock order violation in SFX_IMPL_XSERVICEINFO&rdquo;<br />
<br />
=== Definite False Positives ===<br />
<br />
Open as of <code>DEV300_m99</code>:<br />
<br />
* {{issue|116872}} &ldquo;drawinglayer: BPixelRasterToBitmapEx causes false valgrind positive in rtl_crc32&rdquo;<br />
<br />
* On <code>unxlngx6</code>, executing <code>DEV300_m100</code> <code>sfx2/qa/complex</code>, a 14 byte <code>com.sun.star.util.DateTime</code> struct (consisting of seven <code>unsigned short</code> members) is filled with two 64 bit writes.<br />
<pre><br />
Invalid write of size 8<br />
at 0x1558BBAC: x86_64::fill_struct(_typelib_TypeDescriptionReference*, unsigned long const*, double const*, void*) (in /opt/openoffice.org/ure/lib/libgcc3_uno.so)<br />
by 0x15591965: callVirtualMethod(void*, unsigned int, void*, _typelib_TypeDescriptionReference*, bool, unsigned long*, unsigned int, unsigned long*, unsigned int, double*, unsigned int) (in /opt/openoffice.org/ure/lib/libgcc3_uno.so)<br />
by 0x1559240D: cpp_call(bridges::cpp_uno::shared::UnoInterfaceProxy*, bridges::cpp_uno::shared::VtableSlot, _typelib_TypeDescriptionReference*, int, _typelib_MethodParameter*, void*, void**, _uno_Any**) (in /opt/openoffice.org/ure/lib/libgcc3_uno.so)<br />
by 0x15592B8A: bridges::cpp_uno::shared::unoInterfaceProxyDispatch(_uno_Interface*, _typelib_TypeDescription const*, void*, void**, _uno_Any**) (in /opt/openoffice.org/ure/lib/libgcc3_uno.so)<br />
by 0x1A15C688: binaryurp::IncomingRequest::execute_throw(binaryurp::BinaryAny*, std::vector<binaryurp::BinaryAny, std::allocator<binaryurp::BinaryAny> >*) const (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A15CC45: binaryurp::IncomingRequest::execute() const (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A16B09A: request (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x70057CA: cppu_threadpool::JobQueue::enter(long, unsigned char) (in /opt/openoffice.org/ure/lib/libuno_cppu.so.3)<br />
by 0x70062C2: cppu_threadpool::ORequestThread::run() (in /opt/openoffice.org/ure/lib/libuno_cppu.so.3)<br />
by 0x70065F2: cppu_requestThreadWorker (in /opt/openoffice.org/ure/lib/libuno_cppu.so.3)<br />
by 0x4E5F72E: osl_thread_start_Impl (in /opt/openoffice.org/ure/lib/libuno_sal.so.3)<br />
by 0x67679C9: start_thread (pthread_create.c:300)<br />
Address 0xeb32480 is 16 bytes inside a block of size 22 alloc'd<br />
at 0x4C274A8: malloc (vg_replace_malloc.c:236)<br />
by 0x4E9A7CC: rtl_allocateMemory (in /opt/openoffice.org/ure/lib/libuno_sal.so.3)<br />
by 0x4013EE: allocate(unsigned long, (anonymous namespace)::AllocatorTraits const&) (in /opt/openoffice.org3/program/soffice.bin)<br />
by 0x4014C5: operator new(unsigned long) (in /opt/openoffice.org3/program/soffice.bin)<br />
by 0x1A15E77E: __gnu_cxx::new_allocator<char>::allocate(unsigned long, void const*) (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A15E7A6: std::_Vector_base<char, std::allocator<char> >::_M_allocate(unsigned long) (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A15E7D8: std::_Vector_base<char, std::allocator<char> >::_Vector_base(unsigned long, std::allocator<char> const&) (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A15F686: std::vector<char, std::allocator<char> >::vector(unsigned long, char const&, std::allocator<char> const&) (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A15C57A: binaryurp::IncomingRequest::execute_throw(binaryurp::BinaryAny*, std::vector<binaryurp::BinaryAny, std::allocator<binaryurp::BinaryAny> >*) const (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A15CC45: binaryurp::IncomingRequest::execute() const (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A16B09A: request (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x70057CA: cppu_threadpool::JobQueue::enter(long, unsigned char) (in /opt/openoffice.org/ure/lib/libuno_cppu.so.3)<br />
</pre><br />
<br />
* On <code>unxlngx6</code>, executing <code>DEV300_m100</code> <code>sfx2/qa/complex</code> triggers the below report, which appears to be a false positive caused by what appears to be an error in valgrind, see [https://bugs.kde.org/show_bug.cgi?id=266990 &ldquo;setns instruction causes false positive&rdquo;].<br />
<pre><br />
Conditional jump or move depends on uninitialised value(s)<br />
at 0x22694A93: SwLayAction::_FormatCntnt(SwCntntFrm const*, SwPageFrm const*) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x226982DD: SwLayAction::_FormatFlyCntnt(SwFlyFrm const*) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x226A0349: SwObjectFormatter::_FormatObj(SwAnchoredObject&) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x226A14CB: SwObjectFormatterTxtFrm::DoFormatObj(SwAnchoredObject&, bool) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x226A01C2: SwObjectFormatter::_FormatObjsAtFrm(SwTxtFrm*) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x226A115B: SwObjectFormatterTxtFrm::DoFormatObjs() (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x2269FF52: SwObjectFormatter::FormatObjsAtFrm(SwFrm&, SwPageFrm const&, SwLayAction*) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x2269501E: SwLayAction::FormatCntnt(SwPageFrm const*) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x22696E9B: SwLayAction::InternalAction() (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x226975A7: SwLayAction::Action() (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x22885D50: ViewShell::ImplEndAction(unsigned char) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x225155A2: ViewShell::EndAction(unsigned char) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
</pre><br />
<br />
=== Potentially False Positives ===<br />
<br />
<pre><br />
Conditional jump or move depends on uninitialised value(s)<br />
at 0x9440A18: XcursorImageHash (in /usr/lib/libXcursor.so.1.0.2)<br />
by 0x9440ED7: XcursorNoticePutBitmap (in /usr/lib/libXcursor.so.1.0.2)<br />
by 0x42F5EF8: _XNoticePutBitmap (in /usr/lib/libX11.so.6.3.0)<br />
by 0x430D3A7: XPutImage (in /usr/lib/libX11.so.6.3.0)<br />
by 0x938107E: ImplSalDDB::ImplSalDDB(_XImage*, unsigned long, int, SalTwoRect const&) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x9382E77: X11SalBitmap::ImplGetDDB(unsigned long, int, long, SalTwoRect const&) const (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x9382F52: X11SalBitmap::ImplDraw(unsigned long, int, long, SalTwoRect const&, _XGC* const&) const (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x937DC2A: X11SalGraphics::drawMaskedBitmap(SalTwoRect const*, SalBitmap const&, SalBitmap const&) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x937DF70: X11SalGraphics::drawBitmap(SalTwoRect const*, SalBitmap const&, SalBitmap const&) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x5BAE9FB: SalGraphics::DrawBitmap(SalTwoRect const*, SalBitmap const&, SalBitmap const&, OutputDevice const*) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclli.so)<br />
by 0x5B92D9C: OutputDevice::ImplDrawBitmapEx(Point const&, Size const&, Point const&, Size const&, BitmapEx const&, unsigned long) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclli.so)<br />
by 0x5B9320D: OutputDevice::DrawBitmapEx(Point const&, Size const&, BitmapEx const&) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclli.so)<br />
</pre><br />
might be a false positive, [http://code.google.com/p/microblog-purple/source/browse/branches/0.3/valgrind-suppressions?r=353#27] specifies a suppression block for the head of that stack,<br />
<pre><br />
{<br />
X oddness 3<br />
Memcheck:Cond<br />
fun:XcursorImageHash<br />
fun:XcursorNoticePutBitmap<br />
fun:_XNoticePutBitmap<br />
fun:XPutImage<br />
}<br />
</pre><br />
<br />
== more information ==<br />
<br />
There's also some Writer document about Valgrind: http://tools.openoffice.org/debugging/usingvalgrind.sxw<br />
<br />
TODO: move (!) its content here, not just copy but also remove there, so we don't end up with a fork.<br />
<br />
TODO: '''Run recent version''' <br/><br />
Someone should run the latest version o OO.o, as Valgrind 3.3.0 re-introduces Hellgrind which helps e.g. to hunt down deadlocks. See [http://www.valgrind.org/docs/manual/dist.news.html] for more.<br />
<br />
== Callgrind Profiling How-To ==<br />
<br />
There's a [[Callgrind| Callgrind How-To]].<br />
<br />
<br />
[[Category:Developer Tools]]</div>Sbhttps://wiki.openoffice.org/wiki/ValgrindValgrind2011-03-09T10:57:35Z<p>Sb: /* Definite Errors */</p>
<hr />
<div>'''[http://valgrind.org/ Valgrind]''' is an instrumentation framework for dynamic analysis tools. It can be used to detect memory management and threading bugs and profile programs. It runs on Linux x86 and AMD64, PPC32 and PPC64 are fairly complete.<br />
<br />
== disabling the custom allocator ==<br />
<br />
If you use ooo-build; export OOO_FORCE_SYSALLOC=1 before running, (this is built into [[linkoo]]'s ooenv script).<br />
<br />
If you use a Vanilla build, and your shell is setup for building ooo, use the following wrapper script around valgrind:<br />
<pre><br />
#!/bin/sh<br />
<br />
# instrument soffice with a malloc-based memory allocator.<br />
# Requires libsalalloc_malloc.so to be in the LD_LIBRARY_PATH.<br />
# Forwards all command line arguments to valgrind.<br />
<br />
export LD_PRELOAD=libsalalloc_malloc.so<br />
valgrind $@ <br />
</pre><br />
<br />
which preloads a small interceptor lib, which redirects all allocator calls to malloc.<br />
<br />
== disabling glib's custom allocator ==<br />
<br />
If you want to also track down problems with glib allocated objects, e.g. resource leaks in gconfbe then you need to disable glib's custom allocation as well, e.g. <br />
<br />
<pre><br />
G_SLICE=always-malloc valgrind ...<br />
</pre><br />
<br />
== disabling the STLport custom allocator ==<br />
<br />
The [http://www.sgi.com/tech/stl/Allocators.html STLport default allocator] uses a static free list (<code>_S_free_list</code> in <code>_alloc.h</code>) and there appears to be no functionality to flush it upon exit (like <code>__libc_freeres</code> in the GNU C library). Thus, Valgrind can erroneously consider memory as still reachable at program termination.<br />
<br />
The easiest workaround is probably to use a build that does not use STLport, like using a 64-bit <code>unxlngx6</code> build.<br />
<br />
== Helgrind <code>__cxa_guard_acquire</code> problems ==<br />
<br />
The <code>libstdc++.so.6</code> included in <code>unxlngx6</code> Hamburg builds (and probably the one included in <code>unxlngi6</code> builds as well) apparently has a <code>__cxa_guard_acquire</code> that uses a single mutex for all the various statics, leading to many false complaints about lock order violation.<br />
<br />
As a workaround, move the instances of <code>libgcc_s.so.1</code> and <code>libstdc++.so.6</code> within the OOo installation set out of the way (and thus use the ones from the system, which are hopefully recent enough).<br />
<br />
== Errors Found ==<br />
<br />
=== Definite Errors ===<br />
<br />
Open as of <code>DEV300_m99</code>:<br />
<br />
* {{issue|114718}} &ldquo;forms/qa/unoapi: crash in remote async release call&rdquo;<br />
* {{issue|116785}} &ldquo;framework::[Module]ImageManager kept alive by ring ref&rdquo;<br />
* {{issue|116786}} &ldquo;framework::ToolBarLayoutManger::m_p{AddonOptions,GlobalSettings} leak&rdquo;<br />
* {{issue|116850}} &ldquo;SvLBox::OnCurrentEntryChanged: Conditional jump or move depends on uninitialised value(s)&rdquo;<br />
* {{issue|116885}} &ldquo;utl::TextSearch::CachedTextSearch::~CachedTextSearch called too late&rdquo;<br />
* {{issue|116891}} &ldquo;framework::AddonMenuManager::BuildMenu leaks MenuConfiguration::Attributes&rdquo;<br />
* {{issue|116910}} &ldquo;desktop::Acceptor leaks Thread_Impl&rdquo;<br />
* {{issue|116915}} &ldquo;osl_getSystemPathFromFileURL leaks rtl_uStrings&rdquo;<br />
* {{issue|116981}} &ldquo;rtl/source/bootstrap.cxx does not clean up memory&rdquo;<br />
* {{issue|117082}} &ldquo;editengine: static maTypeSequence instances destroyed too late&rdquo;<br />
* {{issue|117083}} &ldquo;document window leaks framework::WindowCommandDispatch instance&rdquo;<br />
* {{issue|117084}} &ldquo;Desktop::Main leaks Lockfile instance&rdquo;<br />
* {{issue|117119}} &ldquo;lock-order violation in comprehensive cppu_detail_getUnoType&rdquo;<br />
* {{issue|117153}} &ldquo;utl::Bootstrap leaks Impl&rdquo;<br />
* {{issue|117154}} &ldquo;Desktop::GetCommandLineArgs leaks CommandLineArgs&rdquo;<br />
* {{issue|117292}} &ldquo;lock order violation in io service implementations&rdquo;<br />
<br />
=== Definite False Positives ===<br />
<br />
Open as of <code>DEV300_m99</code>:<br />
<br />
* {{issue|116872}} &ldquo;drawinglayer: BPixelRasterToBitmapEx causes false valgrind positive in rtl_crc32&rdquo;<br />
<br />
* On <code>unxlngx6</code>, executing <code>DEV300_m100</code> <code>sfx2/qa/complex</code>, a 14 byte <code>com.sun.star.util.DateTime</code> struct (consisting of seven <code>unsigned short</code> members) is filled with two 64 bit writes.<br />
<pre><br />
Invalid write of size 8<br />
at 0x1558BBAC: x86_64::fill_struct(_typelib_TypeDescriptionReference*, unsigned long const*, double const*, void*) (in /opt/openoffice.org/ure/lib/libgcc3_uno.so)<br />
by 0x15591965: callVirtualMethod(void*, unsigned int, void*, _typelib_TypeDescriptionReference*, bool, unsigned long*, unsigned int, unsigned long*, unsigned int, double*, unsigned int) (in /opt/openoffice.org/ure/lib/libgcc3_uno.so)<br />
by 0x1559240D: cpp_call(bridges::cpp_uno::shared::UnoInterfaceProxy*, bridges::cpp_uno::shared::VtableSlot, _typelib_TypeDescriptionReference*, int, _typelib_MethodParameter*, void*, void**, _uno_Any**) (in /opt/openoffice.org/ure/lib/libgcc3_uno.so)<br />
by 0x15592B8A: bridges::cpp_uno::shared::unoInterfaceProxyDispatch(_uno_Interface*, _typelib_TypeDescription const*, void*, void**, _uno_Any**) (in /opt/openoffice.org/ure/lib/libgcc3_uno.so)<br />
by 0x1A15C688: binaryurp::IncomingRequest::execute_throw(binaryurp::BinaryAny*, std::vector<binaryurp::BinaryAny, std::allocator<binaryurp::BinaryAny> >*) const (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A15CC45: binaryurp::IncomingRequest::execute() const (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A16B09A: request (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x70057CA: cppu_threadpool::JobQueue::enter(long, unsigned char) (in /opt/openoffice.org/ure/lib/libuno_cppu.so.3)<br />
by 0x70062C2: cppu_threadpool::ORequestThread::run() (in /opt/openoffice.org/ure/lib/libuno_cppu.so.3)<br />
by 0x70065F2: cppu_requestThreadWorker (in /opt/openoffice.org/ure/lib/libuno_cppu.so.3)<br />
by 0x4E5F72E: osl_thread_start_Impl (in /opt/openoffice.org/ure/lib/libuno_sal.so.3)<br />
by 0x67679C9: start_thread (pthread_create.c:300)<br />
Address 0xeb32480 is 16 bytes inside a block of size 22 alloc'd<br />
at 0x4C274A8: malloc (vg_replace_malloc.c:236)<br />
by 0x4E9A7CC: rtl_allocateMemory (in /opt/openoffice.org/ure/lib/libuno_sal.so.3)<br />
by 0x4013EE: allocate(unsigned long, (anonymous namespace)::AllocatorTraits const&) (in /opt/openoffice.org3/program/soffice.bin)<br />
by 0x4014C5: operator new(unsigned long) (in /opt/openoffice.org3/program/soffice.bin)<br />
by 0x1A15E77E: __gnu_cxx::new_allocator<char>::allocate(unsigned long, void const*) (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A15E7A6: std::_Vector_base<char, std::allocator<char> >::_M_allocate(unsigned long) (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A15E7D8: std::_Vector_base<char, std::allocator<char> >::_Vector_base(unsigned long, std::allocator<char> const&) (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A15F686: std::vector<char, std::allocator<char> >::vector(unsigned long, char const&, std::allocator<char> const&) (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A15C57A: binaryurp::IncomingRequest::execute_throw(binaryurp::BinaryAny*, std::vector<binaryurp::BinaryAny, std::allocator<binaryurp::BinaryAny> >*) const (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A15CC45: binaryurp::IncomingRequest::execute() const (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A16B09A: request (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x70057CA: cppu_threadpool::JobQueue::enter(long, unsigned char) (in /opt/openoffice.org/ure/lib/libuno_cppu.so.3)<br />
</pre><br />
<br />
* On <code>unxlngx6</code>, executing <code>DEV300_m100</code> <code>sfx2/qa/complex</code> triggers the below report, which appears to be a false positive caused by what appears to be an error in valgrind, see [https://bugs.kde.org/show_bug.cgi?id=266990 &ldquo;setns instruction causes false positive&rdquo;].<br />
<pre><br />
Conditional jump or move depends on uninitialised value(s)<br />
at 0x22694A93: SwLayAction::_FormatCntnt(SwCntntFrm const*, SwPageFrm const*) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x226982DD: SwLayAction::_FormatFlyCntnt(SwFlyFrm const*) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x226A0349: SwObjectFormatter::_FormatObj(SwAnchoredObject&) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x226A14CB: SwObjectFormatterTxtFrm::DoFormatObj(SwAnchoredObject&, bool) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x226A01C2: SwObjectFormatter::_FormatObjsAtFrm(SwTxtFrm*) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x226A115B: SwObjectFormatterTxtFrm::DoFormatObjs() (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x2269FF52: SwObjectFormatter::FormatObjsAtFrm(SwFrm&, SwPageFrm const&, SwLayAction*) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x2269501E: SwLayAction::FormatCntnt(SwPageFrm const*) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x22696E9B: SwLayAction::InternalAction() (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x226975A7: SwLayAction::Action() (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x22885D50: ViewShell::ImplEndAction(unsigned char) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x225155A2: ViewShell::EndAction(unsigned char) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
</pre><br />
<br />
=== Potentially False Positives ===<br />
<br />
<pre><br />
Conditional jump or move depends on uninitialised value(s)<br />
at 0x9440A18: XcursorImageHash (in /usr/lib/libXcursor.so.1.0.2)<br />
by 0x9440ED7: XcursorNoticePutBitmap (in /usr/lib/libXcursor.so.1.0.2)<br />
by 0x42F5EF8: _XNoticePutBitmap (in /usr/lib/libX11.so.6.3.0)<br />
by 0x430D3A7: XPutImage (in /usr/lib/libX11.so.6.3.0)<br />
by 0x938107E: ImplSalDDB::ImplSalDDB(_XImage*, unsigned long, int, SalTwoRect const&) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x9382E77: X11SalBitmap::ImplGetDDB(unsigned long, int, long, SalTwoRect const&) const (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x9382F52: X11SalBitmap::ImplDraw(unsigned long, int, long, SalTwoRect const&, _XGC* const&) const (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x937DC2A: X11SalGraphics::drawMaskedBitmap(SalTwoRect const*, SalBitmap const&, SalBitmap const&) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x937DF70: X11SalGraphics::drawBitmap(SalTwoRect const*, SalBitmap const&, SalBitmap const&) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x5BAE9FB: SalGraphics::DrawBitmap(SalTwoRect const*, SalBitmap const&, SalBitmap const&, OutputDevice const*) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclli.so)<br />
by 0x5B92D9C: OutputDevice::ImplDrawBitmapEx(Point const&, Size const&, Point const&, Size const&, BitmapEx const&, unsigned long) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclli.so)<br />
by 0x5B9320D: OutputDevice::DrawBitmapEx(Point const&, Size const&, BitmapEx const&) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclli.so)<br />
</pre><br />
might be a false positive, [http://code.google.com/p/microblog-purple/source/browse/branches/0.3/valgrind-suppressions?r=353#27] specifies a suppression block for the head of that stack,<br />
<pre><br />
{<br />
X oddness 3<br />
Memcheck:Cond<br />
fun:XcursorImageHash<br />
fun:XcursorNoticePutBitmap<br />
fun:_XNoticePutBitmap<br />
fun:XPutImage<br />
}<br />
</pre><br />
<br />
== more information ==<br />
<br />
There's also some Writer document about Valgrind: http://tools.openoffice.org/debugging/usingvalgrind.sxw<br />
<br />
TODO: move (!) its content here, not just copy but also remove there, so we don't end up with a fork.<br />
<br />
TODO: '''Run recent version''' <br/><br />
Someone should run the latest version o OO.o, as Valgrind 3.3.0 re-introduces Hellgrind which helps e.g. to hunt down deadlocks. See [http://www.valgrind.org/docs/manual/dist.news.html] for more.<br />
<br />
== Callgrind Profiling How-To ==<br />
<br />
There's a [[Callgrind| Callgrind How-To]].<br />
<br />
<br />
[[Category:Developer Tools]]</div>Sbhttps://wiki.openoffice.org/wiki/Test_CleanupTest Cleanup2011-03-08T12:49:47Z<p>Sb: /* CppUnit 1.12.1 */</p>
<hr />
<div>= Test Cleanup Project =<br />
<br />
The demand for automated (unit) testing should be obvious. See the [http://www.openoffice.org/servlets/ReadMsg?list=dev&msgNo=26189 mission statement mail] and [[Media:JustTestingPresentation.odp|slides]] from a [http://fosdem.org/2010/schedule/events/ooo_testing FOSDEM'10 talk] and an [http://www.ooocon.org/index.php/ooocon/2010/paper/view/188 OOoCon&nbsp;2010 presentation] for more information and further links.<br />
<br />
For examples of how to write xUnit based tests in the OOo code base, see [http://hg.services.openoffice.org/DEV300/file/87f4911ea629/basegfx/test <code>basegfx/test/</code>], [http://hg.services.openoffice.org/DEV300/file/87f4911ea629/sal/qa/ByteSequence <code>sal/qa/ByteSequence/</code>], and [http://hg.services.openoffice.org/DEV300/file/87f4911ea629/smoketestoo_native <code>smoketest_native/</code>]. However, the hard part should not be how to write test code, anyway, but how to write ''testable'' code; see [http://misko.hevery.com/2008/11/04/clean-code-talks-unit-testing/ The Clean Code Talks&mdash;Unit Testing].<br />
<br />
When testing C++ code that merely uses UNO types (no services), but uses them in a way that requires UNO to be bootstrapped so that the relevant type information is available (e.g., putting instances of complex UNO types into <code>com::sun::star::uno::Any</code>), one approach is as follows: In the <code>makefile.mk</code>, instead of <code>.INCLUDE: _cppunit.mk</code> use<br />
<source lang="make"><br />
.IF "$(OS)" == "WNT"<br />
my_file = file:///<br />
.ELSE<br />
my_file = file://<br />
.END<br />
<br />
ALLTAR : test<br />
<br />
test .PHONY : $(SHL1TARGETN)<br />
$(CPPUNITTESTER) $(SHL1TARGETN) \<br />
-env:UNO_TYPES=$(my_file)$(SOLARBINDIR)/types.rdb<br />
</source><br />
and in the test code once call <code>cppu::defaultBootstrap_InitialComponentContext()</code>.<br />
<br />
== User Interface ==<br />
<br />
=== CppUnit ===<br />
<br />
For tests in C++, plain CppUnit (at least version 1.12.1) is available. (OOo bundles CppUnit 1.12.1 as an external module; alternatively, you can configure <code>--with-system-cppunit</code>.)<br />
<br />
Implement the test code as a dynamic library, following CppUnit conventions (i.e., using [http://cppunit.sourceforge.net/doc/lastest/group___creating_test_suite.html#ga0 <code>CPPUNIT_TEST_SUITE_REGISTRATION</code>] and [http://cppunit.sourceforge.net/doc/lastest/_test_plug_in_8h.html#a2 <code>CPPUNIT_PLUGIN_IMPLEMENT</code>] macros). The following settings are needed in the <code>makefile.mk</code>:<br />
* <code>ENABLE_EXCEPTIONS = TRUE</code><br />
* <code>CFLAGSCXX += $(CPPUNIT_CFLAGS)</code><br />
* <code>SHL<var>n</var>RPATH = NONE</code><br />
* <code>SHL<var>n</var>STDLIBS += $(CPPUNITLIB)</code><br />
* <code>SHL<var>n</var>VERSIONMAP = <var>version.map</var></code>, where that file must contain the following (see [[#CppUnit_1.12.1|details]] below for improving this):<br />
UDK_3_0_0 {<br />
global:<br />
cppunitTestPlugIn;<br />
local:<br />
*;<br />
};<br />
<br />
To run tests, <code>sal/cppunittester</code> delivers a <code>cppunittester</code> executable that has some advantages over the plain CppUnit <code>DllPlugInTester</code>:<br />
* It uses <code>SAL_IMPLEMENT_MAIN</code> to properly set up the per-process settings required by URE. Test code as well as tested code based on URE will expect this and would fail in a process that is not set up in this way.<br />
* Getting CppUnit to build as an external module within the Windows OOo build is a non-trivial task. The less parts of it that need to be built, the better.<br />
<br />
Something like the following in <code>makefile.mk</code> will execute the tests:<br />
ALLTAR : test<br />
test .PHONY : $(SHL1TARGETN)<br />
$(CPPUNITTESTER) $(SHL1TARGETN)<br />
<br />
<code>$(CPPUNITTESTER)</code> internally uses <code>$(AUGMENT_LIBRARY_PATH_LOCAL)</code> to favor library instances in the local output tree over ones in solver. Alternatively to the above, <code>.INCLUDE: _cppunit.mk</code> calls <code>$(CPPUNITTESTER)</code> on each of <code>$(SHL1TARGETN)</code>, &hellip;, <code>$(SHL10TARGETN)</code> that is defined.<br />
<br />
=== JUnit ===<br />
<br />
For tests in Java, plain JUnit (at least version 4) is available. (OOo requires JUnit as a prerequisite, see [http://junit.org/ junit.org] for downloads; you can configure <code>--with-junit=<var>&hellip;</var></code> if it is not automatically found; alternatively, you can configure <code>--without-junit</code>, disabling JUnit-based tests.)<br />
<br />
=== <code>subsequenttests</code> ===<br />
<br />
Some tests have build and/or run time dependencies on modules further up in the hierarchy, or modules that the rest of the module in question does not have dependencies on (and which are thus not listed in the module's <code>build.lst</code>). The extreme case are tests that need a complete OOo installation as their test environment.<br />
<br />
For such tests, the whole <code>makefile.mk</code> should be wrapped in:<br />
.IF "$(OOO_SUBSEQUENT_TESTS)" == ""<br />
nothing .PHONY :<br />
.ELSE<br />
...<br />
.END<br />
(and the directory included in the module's <code>build.lst</code>).<br />
<br />
The idea is to do a complete OOo build first (<code>cd smoketestoo_native && build --all</code>) and then build and execute those tests either selectively or wholesale.<br />
<br />
Selectively building a specific such test directory can be done with <code>cd <var>&hellip;</var> && OOO_SUBSEQUENT_TESTS=TRUE dmake</code>.<br />
<br />
To build and execute ''all'' these test directories, the tool <code>subsequenttests</code> (in <code>solenv/bin</code>) exists. It scans the <code>build.lst</code> files of all modules for <code>makefile.mk</code>s that mention <code>OOO_SUBSEQUENT_TESTS</code> and simply executes <code>dmake</code> in all those directories, with <code>OOO_SUBSEQUENT_TESTS</code> set. It supports a <code>-P<var>n</var></code> switch to build <var>n</var> directories in parallel.<br />
<br />
=== Helpers ===<br />
<br />
A new module <code>test</code> shall collect reusable code snippets for C++ and Java tests.<br />
<br />
For now, it concentrates on letting a test connect to an OOo instance via remote UNO: A C++ test class can hold a <code>test::OfficeConnection</code> as class member and, in its CppUnit <code>setUp</code> and <code>tearDown</code> functions, call <code>OfficeConnection::setUp</code> and <code>OfficeConnection::tearDown</code>, respectively. Tests obtain access to the OOo instance via <code>OfficeConnection::getFactory</code>. Similarly, a Java test class can use an <code>org.openoffice.test.OfficeConnection</code> instance, offering the same functionality as its C++ counterpart.<br />
<br />
For this to work, three additional steps are necessary:<br />
* First, in <code>instsetoo_native</code>, building an installation set for the <code>openoffice</code> product in the default language (<code>en-US</code>) in any package format now takes care to always also build an archive package format (<code>tar.gz</code> resp. <code>zip</code>) of that product.<br />
* Second, building <code>smoketestoo_native</code> permanently installs that archive into the solver. (Except on Windows, where problems with resulting long pathnames prevent this; there, as a workaround, each test individually unzips the archive to some local temporary directory.) <br />
* Third, a test that requires an OOo instance includes <code>installationtest.mk</code> in its <code>makefile.mk</code>. That file makes sure to call the CppUnit and JUnit test runners with the information necessary for the helper classes to start the correct OOo instance with a fresh <code>UserInstallation</code> and set up an URP pipe connection. The information is tunneled into the test runner executables as UNO bootstrap parameters.<br />
<br />
For debugging purposes, which OOo instance the tests use can manually be overridden, see [http://www.openoffice.org/servlets/ReadMsg?list=interface-announce&msgNo=1285 &ldquo;OOO_TEST_SOFFICE: allow override of tested soffice process&rdquo;].<br />
<br />
=== <code>unoapi</code> Tests ===<br />
<br />
The <code>unoapi</code> tests are redesigned to use the new test framework. They are plain JUnit tests and use the mechanisms described above to connect to running OOo instances. However, due to the large amount of logic encoded in <code>qadevOOo</code>, those JUnit tests for now are only thin wrappers around <code>org.openoffice.Runner.run</code>. This is intended to change over time.<br />
<br />
The <code>cwscheckapi</code> tool to run the <code>unoapi</code> tests has been subsumed by <code>subsequenttests</code>. The latter always runs all tests, while the former had mechanisms to run only tests for modules that had been changed by a CWS. The hope is that the parallel mode of <code>subsequenttests</code> makes it fast enough so that running all tests all of the times becomes feasible.<br />
<br />
Unfortunately, running the <code>unoapi</code> tests is still not stable enough to give useful results. Therefore, running <code>subsequenttests</code> has been disabled in the build bots for now. Making the tests sufficiently stable is ongoing work.<br />
<br />
== Details ==<br />
<br />
Working on {{CWS|sb118}}, {{CWS|sb120}}.<br />
<br />
=== CppUnit 1.12.1 ===<br />
<br />
* Replace existing <code>cppunit</code> and <code>testshl2</code> combo with latest CppUnit 1.12.1.<br />
* OOo <code>configure --with-system-cppunit</code> (for now only if also <code>--with-system-stl</code>!); minimal required version for now arbitrarily 1.12.1.<br />
* '''TODO:''' Upstream <code>PATCH_FILES</code> (<code>windows.patch</code>?!?).<br />
* '''TODO:''' <code>RPATH</code> in generated libraries and executables.<br />
* '''TODO:''' Improve <code>CPPUNIT_PLUGIN_EXPORT</code> and get rid of version maps (GCC exception problems?).<br />
* '''TODO:''' <code>cppunit/makefile.mk</code> <code>MY_LIBS = -lm</code> Solaris hack.<br />
* '''TODO:''' In general OOo build environment, no longer set <code>CFLAGS</code> etc. as environment variables; have package-specific <code>OOO_<var>package</var>_CFLAGS</code> etc. and combine those into <code>CFLAGS</code> etc. where necessary (see <code>OOO_STLPORT_CXXFLAGS</code> etc. in <code>cppunit/makefile.mk</code>).<br />
* '''TODO:''' Why use <code>cppunittester</code> instead of <code>DllPlugInTester</code>? (Remove building/delivering <code>DllPlugInTester</code>.)<br />
* '''TODO:''' Make <code>operator &lt;&lt;(std::basic_ostream &amp;, rtl::OUString const &amp;)</code> from <code>test/oustringstreaminserter.hxx</code> generally available?<br />
* '''TODO:''' Make STLport <code>num_put</code> symbols available on platforms other than Linux (see <code>solenv/bin/addsym.awk</code>), too, so that <code>CPPUNIT_ASSERT_EQUAL</code> actually outputs numeric values.<br />
<br />
==== Is CppUnit an active project? ====<br />
<br />
When I wrote<br />
<pre><br />
Message-ID: <4D67B884.8080101@oracle.com><br />
Date: Fri, 25 Feb 2011 15:11:16 +0100<br />
From: Stephan Bergmann <stephan.bergmann@oracle.com><br />
MIME-Version: 1.0<br />
To: cppunit-devel@lists.sourceforge.net<br />
Subject: What part of the API is published?<br />
Content-Type: text/plain; charset=UTF-8; format=flowed<br />
Content-Transfer-Encoding: 7bit<br />
<br />
At least for CppUnit 1.12.1, it is unclear whether for example class <br />
DynamicLibraryManager is supposed to be available to client code.<br />
<br />
The HTML documentation's class list contains DynamicLibraryManager just <br />
like, say, TestCase, and I can't find any hint on the former's page that <br />
it is an implementation detail. However, in DynamicLibraryManager.h, <br />
the class is not decorated with CPPUNIT_API.<br />
<br />
Is there any specification of what is published (i.e., stable, usable by <br />
clients) vs. what is implementation detail (i.e., not to be used by <br />
clients)?<br />
<br />
-Stephan<br />
</pre><br />
the only response I ever got was<br />
<pre><br />
MIME-Version: 1.0<br />
Content-Type: text/plain; charset="us-ascii"<br />
Content-Transfer-Encoding: 7bit<br />
Subject: Your message to Cppunit-devel awaits moderator approval<br />
From: cppunit-devel-bounces@lists.sourceforge.net<br />
To: stephan.bergmann@oracle.com<br />
Message-ID: <mailman.49713.1298643119.7082.cppunit-devel@lists.sourceforge.net><br />
Date: Fri, 25 Feb 2011 14:11:59 +0000<br />
<br />
Your mail to 'Cppunit-devel' with the subject<br />
<br />
What part of the API is published?<br />
<br />
Is being held until the list moderator can review it for approval.<br />
<br />
The reason it is being held:<br />
<br />
Post by non-member to a members-only list<br />
<br />
Either the message will get posted to the list, or you will receive<br />
notification of the moderator's decision. If you would like to cancel<br />
this posting, please visit the following URL:<br />
<br />
https://lists.sourceforge.net/lists/confirm/cppunit-devel/1da27e17e1d5fdfcb7f8ac6860a05bb5ca1eab1d<br />
</pre><br />
and the last message in [http://sourceforge.net/mailarchive/forum.php?forum_name=cppunit-devel the archive] is from January 2010.<br />
<br />
=== <code>testshl2</code> ===<br />
<br />
* <code>solenv/inc_cppunit.mk</code>/<code>cppunit.mk</code>: [http://hg.services.openoffice.org/cws/sb118/rev/cf13421c3774 &ldquo;adapted <code>cppunit.mk</code> to <code>cppunittester</code> and no longer require &lsquo;<code>dmake test</code>&rsquo; to run tests&rdquo;].<br />
* '''TODO:''' <code>DEV300_m68</code> introduced <code>TESTSHL2LIB</code> (which I removed again) and uses it in many <code>qa</code> makefiles (that I need to touch someday, anyway).<br />
<br />
=== Unit Tests ===<br />
<br />
* <code>OOO_SUBSEQUENT_TESTS</code> (<code>build.lst</code> lists local dependencies of those directories, so that modifying a module and then calling &ldquo;<code>OOO_SUBSEQUENT_TESTS=x build</code>&rdquo; rebuilds the module and executes the tests).<br />
* '''TODO:''' If Build Environment&nbsp;2.0 would build directly to solver (instead of local output tree/deliver), that would simplify tests that currently need to take care to test local libraries instead of solver ones (see, for example, <code>OOO_TEST_PREFIX</code> in the <code>services.rdb</code> of <code>stoc/test/uriproc/makefile.mk</code>).<br />
{{Documentation/Note|Build Environment&nbsp;2.0 will not build directly to solver, but will make a module depend on the targets in the solver, and these are depending on the targets in the workdir (aka the old "local output tree"). Thus on an usual build in a module building and delivering are not two steps anymore. If tests depend on the target in the solver (which they will do automatically in most use cases, as linking against a library automatically creates a dependency on the library in the solver), they can be sure that the target is up to date in the solver '''and''' in the workdir.<br />
<br />
--[[User:B michaelsen|B michaelsen]] 06:32, 27 August 2010 (UTC)}}<br />
* '''TODO:''' Constructs like &ldquo;<code>-env:UNO_<var>&hellip;</var>=$(my_file)<var>&hellip;</var></code>&rdquo; would fail for problematic characters (spaces!) in paths.<br />
<br />
=== Smoke Test ===<br />
<br />
* Redesign <code>smoketestoo_native</code> to use CppUnit and pre-installed OOo.<br />
* [http://hg.services.openoffice.org/cws/sb118/rev/160b248247a0 &ldquo;changed <code>tools/debug</code> to never fall back from writing to shell to writing to file, and read <code>DBGSV_INIT</code> from <code>rtl::Bootstrap</code>; the latter causes problems if <code>tools/debug</code> is called from static code executing before <code>SAL_MAIN</code> has called <code>osl_setCommandArgs</code> &rarr; removed statics from code and added assertions to <code>osl/process</code>; various improvements to <code>smoketests.cxx</code> (incl. passing an appropriate <code>dbgsv.ini</code> for non-pro builds)&rdquo;] followed by [http://hg.services.openoffice.org/cws/sb118/rev/dbbacb9d2fd3 &ldquo;reverted parts of HG <code>-c&nbsp;160b248247a0</code> again: the &lsquo;static code executing before <code>SAL_MAIN</code>&rsquo; problem was too severe; instead, globally set <code>DBGSV_INIT</code> build env var to new <code>solenv/bin/dbgsv.ini</code>&rdquo;]; see also {{issue|109142}} &ldquo;Let assertions abort&rdquo;.<br />
* '''TODO:''' For <code>smoketestoo_native/makefile.mk</code> &ldquo;<code><nowiki>-env:arg-env=$(OOO_LIBRARY_PATH_VAR)"$${{$(OOO_LIBRARY_PATH_VAR)+=$$$(OOO_LIBRARY_PATH_VAR)}}"</nowiki></code>&rdquo; mechanism: <code>osl_executeProcess</code> <code>ustrEnvironments</code> members without &ldquo;<code>=</code>&rdquo;: all platforms; documentation; documentation of <code>osl_executeProcess_WithRedicrectedIO</code>.<br />
* '''TODO:''' <code>-headless</code>? (appears to still display windows on Windows and Mac OS&nbsp;X, however, see {{issue|109052}})<br />
* '''TODO:''' {{issue|113341}} &ldquo;-nofirststartwizard should disable update check&rdquo;<br />
<br />
=== Pre-Installed OOo ===<br />
<br />
* For Sun Hamburg Release Engineering, take MWS archive installation sets from &ldquo;S:&rdquo; instead of solver: [http://hg.services.openoffice.org/cws/sb118/rev/d5dbea724063 &ldquo;take installation set from <code>SHIPDRIVE</code> if appropriate&rdquo;].<br />
* '''TODO:''' <code>PKGFORMAT=installed</code> instead of <code>archive</code>?<br />
<br />
=== <code>unoapi</code> Tests ===<br />
<br />
* Known issues, open (not yet addressed at all; disabled for now on net-yet-integrated CWS; or fixed on not-yet-integrated CWS):<br />
** {{issue|116120}} &ldquo;vcl: TabControl::ImplGetTabRect negative height leads to X_CreatePixmap BadAlloc&rdquo;<br />
** {{issue|116125}} &ldquo;qadevOOo/qa/complex/junitskeleton failure&rdquo;<br />
** {{issue|116156}} &ldquo;toolkit/qa/unoapi crash in SwAccessibleMap::RemoveContext&rdquo;<br />
** {{issue|116192}} &ldquo;[sw] fixed text fields sometimes get updated&rdquo;<br />
** {{issue|116550}} &ldquo;toolkit/qa/unoapi crashes OOo in ~SwAccessibleParagraph vs. SwXTextDocument::close&rdquo;<br />
** {{issue|116583}} &ldquo;comphelper/qa/complex/comphelper failure&rdquo;<br />
** {{issue|116730}} &ldquo;vcl: crash with multiple threads in Window::ImplGrabFocus&rdquo;<br />
** {{issue|116733}} &ldquo;sw: crash in ~SwDrawContact (forms/qa/unoapi)&rdquo;<br />
* Known issues, disabled for now:<br />
** {{issue|109517}} &ldquo;sc/qa/unoapi fails for ScAnnotationObj etc.&rdquo;<br />
** {{issue|109518}} &ldquo;sd/qa/unoapi crash in SfxViewShell::GetController&rdquo;<br />
** {{issue|109643}} &ldquo;toolkit/qa/unoapi tests fail when losing focus&rdquo;<br />
** {{issue|109728}} &ldquo;~ScAutoFormatObj uses cleared ScGlobal&rdquo;<br />
** {{issue|109917}} &ldquo;fragile unoapi test using OnUnfocus event&rdquo;<br />
** {{issue|109939}} &ldquo;toolkit: inconsistent UnoControl locking schemes&rdquo;<br />
** {{issue|110862}} &ldquo;sc/qa/unoapi fails for sc.ScDataPilotTableObj::com::sun::star::sheet::XDataPilotTable::refresh()&rdquo;<br />
** {{issue|110988}} &ldquo;svtools/qa/unoapi fails for svtools.AccessibleBrowseBox etc.&rdquo;<br />
** {{issue|111006}} &ldquo;toolkit: deadlock between UnoControls&rdquo;<br />
** {{issue|111032}} &ldquo;sc/qa/unoapi sc.ScAccessibleCell::com::sun::star::accessibility::XAccessibleText getCharacterBounds() failure&rdquo;<br />
** {{issue|111042}} &ldquo;sd/qa/unoapi sd::DrawController::dispose crash&rdquo;<br />
** {{issue|111043}} &ldquo;sd/qa/unoapi sd::DrawController_OutlineView NullPointerException&rdquo;<br />
** {{issue|111102}} &ldquo;chart2: ChartModelHelper::findDiagram returns null&rdquo;<br />
** {{issue|111111}} &ldquo;xmloff.Impress.XMLImporter::com::sun::star::document::XImporter&rdquo;<br />
** {{issue|111113}} &ldquo;toolkit.AccessibleStatusBarItem unoapi failure&rdquo;<br />
** {{issue|111148}} &ldquo;forms/qa/unoapi forms.OImageControlModel::com::sun::star::beans::XMultiPropertySet deadlock&rdquo;<br />
** {{issue|111169}} &ldquo;svx.AccessiblePageShape unoapi failure&rdquo;<br />
** {{issue|111170}} &ldquo;sun/i18n/qa/unoapi "creating a drawdoc" failure&rdquo;<br />
** {{issue|111178}} &ldquo;sw/qa/unoapi SwView::SelectShell crash&rdquo;<br />
** {{issue|111180}} &ldquo;framework/qa/unoapi fwk.Desktop::com::sun::star::frame::XComponentLoader::loadComponentFromURL() failure&rdquo;<br />
** {{issue|111182}} &ldquo;Desktop::terminate -> ~DropTarget -> _objc_error crash&rdquo;<br />
** {{issue|111184}} &ldquo;sal/qa/osl/pipe uses fixed pipe names&rdquo;<br />
** {{issue|111186}} &ldquo;sw/qa/unoapi sw.PageStyle::com::sun::star::beans::XPropertySet::setPropertyValue() failure&rdquo;<br />
** {{issue|111190}} &ldquo;sw/qa/unoapi sw.SwXShape failure&rdquo;<br />
** {{issue|111194}} &ldquo;sw/qa/unoapi sw.XMLExporter crash&rdquo;<br />
** {{issue|111195}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleScrollBar::com::sun::star::accessibility::XAccessibleValue::setCurrentValue() failure&rdquo;<br />
** {{issue|111197}} &ldquo;sw/qa/unoapi sw.SwAccessibleDocumentPageView failure&rdquo;<br />
** {{issue|111199}} &ldquo;sd/qa/unoapi sd.AccessibleOutlineView failure&rdquo;<br />
** {{issue|111200}} &ldquo;xmloff/qa/unoapi xmloff.Draw.XMLMetaImporter failure&rdquo;<br />
** {{issue|111216}} &ldquo;svx/qa/unoapi accessibility deadlock&rdquo;<br />
** {{issue|111218}} &ldquo;sw/qa/unoapi sw.SwAccessibleParagraphView::com::sun::star::accessibility::XAccessibleEventBroadcaster::removeEventListener() failure&rdquo;<br />
** {{issue|111220}} &ldquo;sw/qa/unoapi sw.XMLContentExporter::com::sun::star::document::XFilter::cancel() failure&rdquo;<br />
** {{issue|111224}} &ldquo;xmloff/qa/unoapi xmloff.Impress.XMLContentExporter crash&rdquo;<br />
** {{issue|111225}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleStatusBar failure&rdquo;<br />
** {{issue|111252}} &ldquo;svx/qa/unoapi svx.AccessibleOLEShape deadlock&rdquo;<br />
** {{issue|111273}} &ldquo;sw/qa/unoapi sw.SwXTextEmbeddedObject::com::sun::star::document::XEmbeddedObjectSupplier::getEmbeddedObject() crash&rdquo;<br />
** {{issue|111278}} &ldquo;svx/qa/unoapi svx.AccessibleEditableTextPara failure&rdquo;<br />
** {{issue|111283}} &ldquo;sfx2/qa/unoapi sfx.StandaloneDocumentInfo failure&rdquo;<br />
** {{issue|111285}} &ldquo;forms/qa/unoapi forms.OButtonModel failure&rdquo;<br />
** {{issue|111287}} &ldquo;xmloff/qa/unoapi XMLSettingsIm-/Exporter crash&rdquo;<br />
** {{issue|111329}} &ldquo;sd/qa/unoapi SdXCustomPresentationAccess::getElementNames/ImpEditEngine::OnlineSpellHdl hang&rdquo;<br />
** {{issue|111332}} &ldquo;sw/qa/unoapi sw.XMLStylesExporter::com::sun::star::document::XFilter crash&rdquo;<br />
** {{issue|111333}} &ldquo;forms/qa/unoapi forms.OImageControlControl::com::sun::star::awt::XControl deadlock&rdquo;<br />
** {{issue|112743}} &ldquo;starmath/qa/unoapi sm.XMLSettingsExporter failure&rdquo;<br />
** {{issue|112746}} &ldquo;framework/qa/unoapi fwk.ModuleManager failure (X11 BadWindow)&rdquo;<br />
** {{issue|112751}} &ldquo;testgraphical/qa/graphical failure&rdquo;<br />
** {{issue|112778}} &ldquo;xmloff/qa/unoapi xmloff.Draw.XMLContentExporter failure&rdquo;<br />
** {{issue|113020}} &ldquo;sw/qa/unoapi sw.SwXTextGraphicObject::com::sun::star::beans::XPropertySet failure&rdquo;<br />
** {{issue|113103}} &ldquo;chart2: deadlock between DiagramHelper and Diagram&rdquo;<br />
** {{issue|113136}} &ldquo;sw/qa/unoapi sw.SwAccessibleParagraphView::com::sun::star::accessibility::XAccessibleEditableText failure&rdquo;<br />
** {{issue|113142}} &ldquo;sw/qa/unoapi SwAccessibleContext::RemoveFrmFromAccessibleMap crash&rdquo;<br />
** {{issue|113161}} &ldquo;sd/qa/unoapi sd.SdLayer::com::sun::star::drawing::Layer::IsVisible failure&rdquo;<br />
** {{issue|113201}} &ldquo;forms/qa/unoapi forms.OEditModel::com::sun::star::form::validation::XValidatableFormComponent failure&rdquo;<br />
** {{issue|113245}} &ldquo;framework/qa/unoapi fwl.TypeDetection failure&rdquo;<br />
** {{issue|113306}} &ldquo;sfx2/qa/unoapi sfx.DocumentTemplates failure&rdquo;<br />
** {{issue|113386}} &ldquo;sd/qa/unoapi sd.AccessibleDrawDocumentView::com::sun::star::accessibility::XAccessibleComponent::containsPoint() failure&rdquo;<br />
** {{issue|113489}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleMenu{,Bar,Separator} failures&rdquo;<br />
** {{issue|114205}} &ldquo;sw/qa/unoapi sw.SwAccessibleParagraphView::com::sun::star::accessibility::XAccessibleText::copyText() failed&rdquo;<br />
** {{issue|114209}} &ldquo;forms/qa/unoapi forms.OGridControlModel::com::sun::star::view::XSelectionSupplier crash&rdquo;<br />
** {{issue|114211}} &ldquo;xmloff/qa/unoapi xmloff.Draw.XMLStylesImporter::com::sun::star::lang::XInitialization crash&rdquo;<br />
** {{issue|114213}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleMenu::com::sun::star::accessibility::XAccessibleSelection failure&rdquo;<br />
** {{issue|114636}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleScrollBar::com::sun::star::accessibility::XAccessibleAction failure&rdquo;<br />
** {{issue|114637}} &ldquo;sw/qa/unoapi sw.SwAccessibleFootnoteView(?) crash&rdquo;<br />
** {{issue|114642}} &ldquo;svx/qa/unoapi svx: svx.SvxUnoTextContent::com::sun::star::style::CharacterProperties crash&rdquo;<br />
** {{issue|114669}} &ldquo;forms/qa/unoapi forms.OListBoxControl crash&rdquo;<br />
** {{issue|114889}} &ldquo;sw/qa/unoapi sw.SwXTextViewCursor::com::sun::star::view::XScreenCursor&rdquo;<br />
** {{issue|116784}} &ldquo;[sfx2] CheckGlobalEventBroadcaster_writer1 fails&rdquo;<br />
** {{issue|116813}} &ldquo;[sfx2] complex.sfx2.UndoManager checkBrokenScripts fails&rdquo;<br />
** {{issue|116814}} &ldquo;[toolkit] unoapi test UnoControlDialogModel: XCloneable fails&rdquo;<br />
* Missing tests:<br />
** {{issue|109564}} &ldquo;qadevOOo/tests/java/ifc/awt/_XSystemChildFactory.java&rdquo;<br />
* Sporadic failures:<br />
** {{issue|111217}} &ldquo;BasicManager::SetGlobalUNOConstant crash during shutdown&rdquo;<br />
** {{issue|111246}} &ldquo;svx::FontHeightToolBoxControl::statusChanged crash (memory corruption)&rdquo;<br />
** {{issue|111271}} &ldquo;Mac OS X: crash during shutdown, __tcf_2 on stack&rdquo;<br />
** {{issue|111400}} &ldquo;Extension Manager does not join spawned uno process (-> smoketestoo_native fails)&rdquo;<br />
** {{issue|112070}} &ldquo;UNO API tests must not use random&rdquo;<br />
** {{issue|113158}} &ldquo;crash with two threads in framework::ToolBarManager dtor&rdquo;<br />
** {{issue|113197}} &ldquo;sw/qa/unoapi sw.SwXTextRange hangs&rdquo;<br />
** {{issue|113367}} &ldquo;sysdtrans deadlock during shutdown&rdquo;<br />
** {{issue|113464}} &ldquo;stoc_smgr::ORegistryServiceManager::dispose crash during shutdown&rdquo;<br />
** {{issue|114207}} &ldquo;framework::ModuleUIConfigurationManager::dispose crash during shutdown&rdquo;<br />
** {{issue|114675}} &ldquo;binary URP bridge race on shut down, crash&rdquo;<br />
** {{issue|114718}} &ldquo;forms/qa/unoapi: crash in remote async release call&rdquo;<br />
** {{issue|116131}} &ldquo;vcl: message unregisterDraggingDestinationHandler: sent to freed object&rdquo;<br />
<br />
[[Category:Effort]][[Category:Test]]</div>Sbhttps://wiki.openoffice.org/wiki/ValgrindValgrind2011-03-01T15:49:37Z<p>Sb: /* Definite Errors */</p>
<hr />
<div>'''[http://valgrind.org/ Valgrind]''' is an instrumentation framework for dynamic analysis tools. It can be used to detect memory management and threading bugs and profile programs. It runs on Linux x86 and AMD64, PPC32 and PPC64 are fairly complete.<br />
<br />
== disabling the custom allocator ==<br />
<br />
If you use ooo-build; export OOO_FORCE_SYSALLOC=1 before running, (this is built into [[linkoo]]'s ooenv script).<br />
<br />
If you use a Vanilla build, and your shell is setup for building ooo, use the following wrapper script around valgrind:<br />
<pre><br />
#!/bin/sh<br />
<br />
# instrument soffice with a malloc-based memory allocator.<br />
# Requires libsalalloc_malloc.so to be in the LD_LIBRARY_PATH.<br />
# Forwards all command line arguments to valgrind.<br />
<br />
export LD_PRELOAD=libsalalloc_malloc.so<br />
valgrind $@ <br />
</pre><br />
<br />
which preloads a small interceptor lib, which redirects all allocator calls to malloc.<br />
<br />
== disabling glib's custom allocator ==<br />
<br />
If you want to also track down problems with glib allocated objects, e.g. resource leaks in gconfbe then you need to disable glib's custom allocation as well, e.g. <br />
<br />
<pre><br />
G_SLICE=always-malloc valgrind ...<br />
</pre><br />
<br />
== disabling the STLport custom allocator ==<br />
<br />
The [http://www.sgi.com/tech/stl/Allocators.html STLport default allocator] uses a static free list (<code>_S_free_list</code> in <code>_alloc.h</code>) and there appears to be no functionality to flush it upon exit (like <code>__libc_freeres</code> in the GNU C library). Thus, Valgrind can erroneously consider memory as still reachable at program termination.<br />
<br />
The easiest workaround is probably to use a build that does not use STLport, like using a 64-bit <code>unxlngx6</code> build.<br />
<br />
== Helgrind <code>__cxa_guard_acquire</code> problems ==<br />
<br />
The <code>libstdc++.so.6</code> included in <code>unxlngx6</code> Hamburg builds (and probably the one included in <code>unxlngi6</code> builds as well) apparently has a <code>__cxa_guard_acquire</code> that uses a single mutex for all the various statics, leading to many false complaints about lock order violation.<br />
<br />
As a workaround, move the instances of <code>libgcc_s.so.1</code> and <code>libstdc++.so.6</code> within the OOo installation set out of the way (and thus use the ones from the system, which are hopefully recent enough).<br />
<br />
== Errors Found ==<br />
<br />
=== Definite Errors ===<br />
<br />
Open as of <code>DEV300_m99</code>:<br />
<br />
* {{issue|114718}} &ldquo;forms/qa/unoapi: crash in remote async release call&rdquo;<br />
* {{issue|116785}} &ldquo;framework::[Module]ImageManager kept alive by ring ref&rdquo;<br />
* {{issue|116786}} &ldquo;framework::ToolBarLayoutManger::m_p{AddonOptions,GlobalSettings} leak&rdquo;<br />
* {{issue|116850}} &ldquo;SvLBox::OnCurrentEntryChanged: Conditional jump or move depends on uninitialised value(s)&rdquo;<br />
* {{issue|116885}} &ldquo;utl::TextSearch::CachedTextSearch::~CachedTextSearch called too late&rdquo;<br />
* {{issue|116891}} &ldquo;framework::AddonMenuManager::BuildMenu leaks MenuConfiguration::Attributes&rdquo;<br />
* {{issue|116910}} &ldquo;desktop::Acceptor leaks Thread_Impl&rdquo;<br />
* {{issue|116915}} &ldquo;osl_getSystemPathFromFileURL leaks rtl_uStrings&rdquo;<br />
* {{issue|116981}} &ldquo;rtl/source/bootstrap.cxx does not clean up memory&rdquo;<br />
* {{issue|117082}} &ldquo;editengine: static maTypeSequence instances destroyed too late&rdquo;<br />
* {{issue|117083}} &ldquo;document window leaks framework::WindowCommandDispatch instance&rdquo;<br />
* {{issue|117084}} &ldquo;Desktop::Main leaks Lockfile instance&rdquo;<br />
* {{issue|117119}} &ldquo;lock-order violation in comprehensive cppu_detail_getUnoType&rdquo;<br />
* {{issue|117153}} &ldquo;utl::Bootstrap leaks Impl&rdquo;<br />
* {{issue|117154}} &ldquo;Desktop::GetCommandLineArgs leaks CommandLineArgs&rdquo;<br />
<br />
=== Definite False Positives ===<br />
<br />
Open as of <code>DEV300_m99</code>:<br />
<br />
* {{issue|116872}} &ldquo;drawinglayer: BPixelRasterToBitmapEx causes false valgrind positive in rtl_crc32&rdquo;<br />
<br />
* On <code>unxlngx6</code>, executing <code>DEV300_m100</code> <code>sfx2/qa/complex</code>, a 14 byte <code>com.sun.star.util.DateTime</code> struct (consisting of seven <code>unsigned short</code> members) is filled with two 64 bit writes.<br />
<pre><br />
Invalid write of size 8<br />
at 0x1558BBAC: x86_64::fill_struct(_typelib_TypeDescriptionReference*, unsigned long const*, double const*, void*) (in /opt/openoffice.org/ure/lib/libgcc3_uno.so)<br />
by 0x15591965: callVirtualMethod(void*, unsigned int, void*, _typelib_TypeDescriptionReference*, bool, unsigned long*, unsigned int, unsigned long*, unsigned int, double*, unsigned int) (in /opt/openoffice.org/ure/lib/libgcc3_uno.so)<br />
by 0x1559240D: cpp_call(bridges::cpp_uno::shared::UnoInterfaceProxy*, bridges::cpp_uno::shared::VtableSlot, _typelib_TypeDescriptionReference*, int, _typelib_MethodParameter*, void*, void**, _uno_Any**) (in /opt/openoffice.org/ure/lib/libgcc3_uno.so)<br />
by 0x15592B8A: bridges::cpp_uno::shared::unoInterfaceProxyDispatch(_uno_Interface*, _typelib_TypeDescription const*, void*, void**, _uno_Any**) (in /opt/openoffice.org/ure/lib/libgcc3_uno.so)<br />
by 0x1A15C688: binaryurp::IncomingRequest::execute_throw(binaryurp::BinaryAny*, std::vector<binaryurp::BinaryAny, std::allocator<binaryurp::BinaryAny> >*) const (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A15CC45: binaryurp::IncomingRequest::execute() const (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A16B09A: request (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x70057CA: cppu_threadpool::JobQueue::enter(long, unsigned char) (in /opt/openoffice.org/ure/lib/libuno_cppu.so.3)<br />
by 0x70062C2: cppu_threadpool::ORequestThread::run() (in /opt/openoffice.org/ure/lib/libuno_cppu.so.3)<br />
by 0x70065F2: cppu_requestThreadWorker (in /opt/openoffice.org/ure/lib/libuno_cppu.so.3)<br />
by 0x4E5F72E: osl_thread_start_Impl (in /opt/openoffice.org/ure/lib/libuno_sal.so.3)<br />
by 0x67679C9: start_thread (pthread_create.c:300)<br />
Address 0xeb32480 is 16 bytes inside a block of size 22 alloc'd<br />
at 0x4C274A8: malloc (vg_replace_malloc.c:236)<br />
by 0x4E9A7CC: rtl_allocateMemory (in /opt/openoffice.org/ure/lib/libuno_sal.so.3)<br />
by 0x4013EE: allocate(unsigned long, (anonymous namespace)::AllocatorTraits const&) (in /opt/openoffice.org3/program/soffice.bin)<br />
by 0x4014C5: operator new(unsigned long) (in /opt/openoffice.org3/program/soffice.bin)<br />
by 0x1A15E77E: __gnu_cxx::new_allocator<char>::allocate(unsigned long, void const*) (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A15E7A6: std::_Vector_base<char, std::allocator<char> >::_M_allocate(unsigned long) (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A15E7D8: std::_Vector_base<char, std::allocator<char> >::_Vector_base(unsigned long, std::allocator<char> const&) (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A15F686: std::vector<char, std::allocator<char> >::vector(unsigned long, char const&, std::allocator<char> const&) (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A15C57A: binaryurp::IncomingRequest::execute_throw(binaryurp::BinaryAny*, std::vector<binaryurp::BinaryAny, std::allocator<binaryurp::BinaryAny> >*) const (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A15CC45: binaryurp::IncomingRequest::execute() const (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A16B09A: request (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x70057CA: cppu_threadpool::JobQueue::enter(long, unsigned char) (in /opt/openoffice.org/ure/lib/libuno_cppu.so.3)<br />
</pre><br />
<br />
* On <code>unxlngx6</code>, executing <code>DEV300_m100</code> <code>sfx2/qa/complex</code> triggers the below report, which appears to be a false positive caused by what appears to be an error in valgrind, see [https://bugs.kde.org/show_bug.cgi?id=266990 &ldquo;setns instruction causes false positive&rdquo;].<br />
<pre><br />
Conditional jump or move depends on uninitialised value(s)<br />
at 0x22694A93: SwLayAction::_FormatCntnt(SwCntntFrm const*, SwPageFrm const*) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x226982DD: SwLayAction::_FormatFlyCntnt(SwFlyFrm const*) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x226A0349: SwObjectFormatter::_FormatObj(SwAnchoredObject&) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x226A14CB: SwObjectFormatterTxtFrm::DoFormatObj(SwAnchoredObject&, bool) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x226A01C2: SwObjectFormatter::_FormatObjsAtFrm(SwTxtFrm*) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x226A115B: SwObjectFormatterTxtFrm::DoFormatObjs() (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x2269FF52: SwObjectFormatter::FormatObjsAtFrm(SwFrm&, SwPageFrm const&, SwLayAction*) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x2269501E: SwLayAction::FormatCntnt(SwPageFrm const*) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x22696E9B: SwLayAction::InternalAction() (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x226975A7: SwLayAction::Action() (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x22885D50: ViewShell::ImplEndAction(unsigned char) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x225155A2: ViewShell::EndAction(unsigned char) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
</pre><br />
<br />
=== Potentially False Positives ===<br />
<br />
<pre><br />
Conditional jump or move depends on uninitialised value(s)<br />
at 0x9440A18: XcursorImageHash (in /usr/lib/libXcursor.so.1.0.2)<br />
by 0x9440ED7: XcursorNoticePutBitmap (in /usr/lib/libXcursor.so.1.0.2)<br />
by 0x42F5EF8: _XNoticePutBitmap (in /usr/lib/libX11.so.6.3.0)<br />
by 0x430D3A7: XPutImage (in /usr/lib/libX11.so.6.3.0)<br />
by 0x938107E: ImplSalDDB::ImplSalDDB(_XImage*, unsigned long, int, SalTwoRect const&) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x9382E77: X11SalBitmap::ImplGetDDB(unsigned long, int, long, SalTwoRect const&) const (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x9382F52: X11SalBitmap::ImplDraw(unsigned long, int, long, SalTwoRect const&, _XGC* const&) const (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x937DC2A: X11SalGraphics::drawMaskedBitmap(SalTwoRect const*, SalBitmap const&, SalBitmap const&) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x937DF70: X11SalGraphics::drawBitmap(SalTwoRect const*, SalBitmap const&, SalBitmap const&) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x5BAE9FB: SalGraphics::DrawBitmap(SalTwoRect const*, SalBitmap const&, SalBitmap const&, OutputDevice const*) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclli.so)<br />
by 0x5B92D9C: OutputDevice::ImplDrawBitmapEx(Point const&, Size const&, Point const&, Size const&, BitmapEx const&, unsigned long) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclli.so)<br />
by 0x5B9320D: OutputDevice::DrawBitmapEx(Point const&, Size const&, BitmapEx const&) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclli.so)<br />
</pre><br />
might be a false positive, [http://code.google.com/p/microblog-purple/source/browse/branches/0.3/valgrind-suppressions?r=353#27] specifies a suppression block for the head of that stack,<br />
<pre><br />
{<br />
X oddness 3<br />
Memcheck:Cond<br />
fun:XcursorImageHash<br />
fun:XcursorNoticePutBitmap<br />
fun:_XNoticePutBitmap<br />
fun:XPutImage<br />
}<br />
</pre><br />
<br />
== more information ==<br />
<br />
There's also some Writer document about Valgrind: http://tools.openoffice.org/debugging/usingvalgrind.sxw<br />
<br />
TODO: move (!) its content here, not just copy but also remove there, so we don't end up with a fork.<br />
<br />
TODO: '''Run recent version''' <br/><br />
Someone should run the latest version o OO.o, as Valgrind 3.3.0 re-introduces Hellgrind which helps e.g. to hunt down deadlocks. See [http://www.valgrind.org/docs/manual/dist.news.html] for more.<br />
<br />
== Callgrind Profiling How-To ==<br />
<br />
There's a [[Callgrind| Callgrind How-To]].<br />
<br />
<br />
[[Category:Developer Tools]]</div>Sbhttps://wiki.openoffice.org/wiki/ValgrindValgrind2011-03-01T15:43:18Z<p>Sb: /* Definite Errors */</p>
<hr />
<div>'''[http://valgrind.org/ Valgrind]''' is an instrumentation framework for dynamic analysis tools. It can be used to detect memory management and threading bugs and profile programs. It runs on Linux x86 and AMD64, PPC32 and PPC64 are fairly complete.<br />
<br />
== disabling the custom allocator ==<br />
<br />
If you use ooo-build; export OOO_FORCE_SYSALLOC=1 before running, (this is built into [[linkoo]]'s ooenv script).<br />
<br />
If you use a Vanilla build, and your shell is setup for building ooo, use the following wrapper script around valgrind:<br />
<pre><br />
#!/bin/sh<br />
<br />
# instrument soffice with a malloc-based memory allocator.<br />
# Requires libsalalloc_malloc.so to be in the LD_LIBRARY_PATH.<br />
# Forwards all command line arguments to valgrind.<br />
<br />
export LD_PRELOAD=libsalalloc_malloc.so<br />
valgrind $@ <br />
</pre><br />
<br />
which preloads a small interceptor lib, which redirects all allocator calls to malloc.<br />
<br />
== disabling glib's custom allocator ==<br />
<br />
If you want to also track down problems with glib allocated objects, e.g. resource leaks in gconfbe then you need to disable glib's custom allocation as well, e.g. <br />
<br />
<pre><br />
G_SLICE=always-malloc valgrind ...<br />
</pre><br />
<br />
== disabling the STLport custom allocator ==<br />
<br />
The [http://www.sgi.com/tech/stl/Allocators.html STLport default allocator] uses a static free list (<code>_S_free_list</code> in <code>_alloc.h</code>) and there appears to be no functionality to flush it upon exit (like <code>__libc_freeres</code> in the GNU C library). Thus, Valgrind can erroneously consider memory as still reachable at program termination.<br />
<br />
The easiest workaround is probably to use a build that does not use STLport, like using a 64-bit <code>unxlngx6</code> build.<br />
<br />
== Helgrind <code>__cxa_guard_acquire</code> problems ==<br />
<br />
The <code>libstdc++.so.6</code> included in <code>unxlngx6</code> Hamburg builds (and probably the one included in <code>unxlngi6</code> builds as well) apparently has a <code>__cxa_guard_acquire</code> that uses a single mutex for all the various statics, leading to many false complaints about lock order violation.<br />
<br />
As a workaround, move the instances of <code>libgcc_s.so.1</code> and <code>libstdc++.so.6</code> within the OOo installation set out of the way (and thus use the ones from the system, which are hopefully recent enough).<br />
<br />
== Errors Found ==<br />
<br />
=== Definite Errors ===<br />
<br />
Open as of <code>DEV300_m99</code>:<br />
<br />
* {{issue|114718}} &ldquo;forms/qa/unoapi: crash in remote async release call&rdquo;<br />
* {{issue|116785}} &ldquo;framework::[Module]ImageManager kept alive by ring ref&rdquo;<br />
* {{issue|116786}} &ldquo;framework::ToolBarLayoutManger::m_p{AddonOptions,GlobalSettings} leak&rdquo;<br />
* {{issue|116850}} &ldquo;SvLBox::OnCurrentEntryChanged: Conditional jump or move depends on uninitialised value(s)&rdquo;<br />
* {{issue|116885}} &ldquo;utl::TextSearch::CachedTextSearch::~CachedTextSearch called too late&rdquo;<br />
* {{issue|116891}} &ldquo;framework::AddonMenuManager::BuildMenu leaks MenuConfiguration::Attributes&rdquo;<br />
* {{issue|116910}} &ldquo;desktop::Acceptor leaks Thread_Impl&rdquo;<br />
* {{issue|116915}} &ldquo;osl_getSystemPathFromFileURL leaks rtl_uStrings&rdquo;<br />
* {{issue|116981}} &ldquo;rtl/source/bootstrap.cxx does not clean up memory&rdquo;<br />
* {{issue|117082}} &ldquo;editengine: static maTypeSequence instances destroyed too late&rdquo;<br />
* {{issue|117083}} &ldquo;document window leaks framework::WindowCommandDispatch instance&rdquo;<br />
* {{issue|117084}} &ldquo;Desktop::Main leaks Lockfile instance&rdquo;<br />
* {{issue|117119}} &ldquo;lock-order violation in comprehensive cppu_detail_getUnoType&rdquo;<br />
* {{issue|117153}} &ldquo;utl::Bootstrap leaks Impl&rdquo;<br />
<br />
=== Definite False Positives ===<br />
<br />
Open as of <code>DEV300_m99</code>:<br />
<br />
* {{issue|116872}} &ldquo;drawinglayer: BPixelRasterToBitmapEx causes false valgrind positive in rtl_crc32&rdquo;<br />
<br />
* On <code>unxlngx6</code>, executing <code>DEV300_m100</code> <code>sfx2/qa/complex</code>, a 14 byte <code>com.sun.star.util.DateTime</code> struct (consisting of seven <code>unsigned short</code> members) is filled with two 64 bit writes.<br />
<pre><br />
Invalid write of size 8<br />
at 0x1558BBAC: x86_64::fill_struct(_typelib_TypeDescriptionReference*, unsigned long const*, double const*, void*) (in /opt/openoffice.org/ure/lib/libgcc3_uno.so)<br />
by 0x15591965: callVirtualMethod(void*, unsigned int, void*, _typelib_TypeDescriptionReference*, bool, unsigned long*, unsigned int, unsigned long*, unsigned int, double*, unsigned int) (in /opt/openoffice.org/ure/lib/libgcc3_uno.so)<br />
by 0x1559240D: cpp_call(bridges::cpp_uno::shared::UnoInterfaceProxy*, bridges::cpp_uno::shared::VtableSlot, _typelib_TypeDescriptionReference*, int, _typelib_MethodParameter*, void*, void**, _uno_Any**) (in /opt/openoffice.org/ure/lib/libgcc3_uno.so)<br />
by 0x15592B8A: bridges::cpp_uno::shared::unoInterfaceProxyDispatch(_uno_Interface*, _typelib_TypeDescription const*, void*, void**, _uno_Any**) (in /opt/openoffice.org/ure/lib/libgcc3_uno.so)<br />
by 0x1A15C688: binaryurp::IncomingRequest::execute_throw(binaryurp::BinaryAny*, std::vector<binaryurp::BinaryAny, std::allocator<binaryurp::BinaryAny> >*) const (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A15CC45: binaryurp::IncomingRequest::execute() const (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A16B09A: request (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x70057CA: cppu_threadpool::JobQueue::enter(long, unsigned char) (in /opt/openoffice.org/ure/lib/libuno_cppu.so.3)<br />
by 0x70062C2: cppu_threadpool::ORequestThread::run() (in /opt/openoffice.org/ure/lib/libuno_cppu.so.3)<br />
by 0x70065F2: cppu_requestThreadWorker (in /opt/openoffice.org/ure/lib/libuno_cppu.so.3)<br />
by 0x4E5F72E: osl_thread_start_Impl (in /opt/openoffice.org/ure/lib/libuno_sal.so.3)<br />
by 0x67679C9: start_thread (pthread_create.c:300)<br />
Address 0xeb32480 is 16 bytes inside a block of size 22 alloc'd<br />
at 0x4C274A8: malloc (vg_replace_malloc.c:236)<br />
by 0x4E9A7CC: rtl_allocateMemory (in /opt/openoffice.org/ure/lib/libuno_sal.so.3)<br />
by 0x4013EE: allocate(unsigned long, (anonymous namespace)::AllocatorTraits const&) (in /opt/openoffice.org3/program/soffice.bin)<br />
by 0x4014C5: operator new(unsigned long) (in /opt/openoffice.org3/program/soffice.bin)<br />
by 0x1A15E77E: __gnu_cxx::new_allocator<char>::allocate(unsigned long, void const*) (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A15E7A6: std::_Vector_base<char, std::allocator<char> >::_M_allocate(unsigned long) (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A15E7D8: std::_Vector_base<char, std::allocator<char> >::_Vector_base(unsigned long, std::allocator<char> const&) (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A15F686: std::vector<char, std::allocator<char> >::vector(unsigned long, char const&, std::allocator<char> const&) (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A15C57A: binaryurp::IncomingRequest::execute_throw(binaryurp::BinaryAny*, std::vector<binaryurp::BinaryAny, std::allocator<binaryurp::BinaryAny> >*) const (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A15CC45: binaryurp::IncomingRequest::execute() const (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A16B09A: request (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x70057CA: cppu_threadpool::JobQueue::enter(long, unsigned char) (in /opt/openoffice.org/ure/lib/libuno_cppu.so.3)<br />
</pre><br />
<br />
* On <code>unxlngx6</code>, executing <code>DEV300_m100</code> <code>sfx2/qa/complex</code> triggers the below report, which appears to be a false positive caused by what appears to be an error in valgrind, see [https://bugs.kde.org/show_bug.cgi?id=266990 &ldquo;setns instruction causes false positive&rdquo;].<br />
<pre><br />
Conditional jump or move depends on uninitialised value(s)<br />
at 0x22694A93: SwLayAction::_FormatCntnt(SwCntntFrm const*, SwPageFrm const*) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x226982DD: SwLayAction::_FormatFlyCntnt(SwFlyFrm const*) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x226A0349: SwObjectFormatter::_FormatObj(SwAnchoredObject&) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x226A14CB: SwObjectFormatterTxtFrm::DoFormatObj(SwAnchoredObject&, bool) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x226A01C2: SwObjectFormatter::_FormatObjsAtFrm(SwTxtFrm*) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x226A115B: SwObjectFormatterTxtFrm::DoFormatObjs() (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x2269FF52: SwObjectFormatter::FormatObjsAtFrm(SwFrm&, SwPageFrm const&, SwLayAction*) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x2269501E: SwLayAction::FormatCntnt(SwPageFrm const*) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x22696E9B: SwLayAction::InternalAction() (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x226975A7: SwLayAction::Action() (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x22885D50: ViewShell::ImplEndAction(unsigned char) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x225155A2: ViewShell::EndAction(unsigned char) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
</pre><br />
<br />
=== Potentially False Positives ===<br />
<br />
<pre><br />
Conditional jump or move depends on uninitialised value(s)<br />
at 0x9440A18: XcursorImageHash (in /usr/lib/libXcursor.so.1.0.2)<br />
by 0x9440ED7: XcursorNoticePutBitmap (in /usr/lib/libXcursor.so.1.0.2)<br />
by 0x42F5EF8: _XNoticePutBitmap (in /usr/lib/libX11.so.6.3.0)<br />
by 0x430D3A7: XPutImage (in /usr/lib/libX11.so.6.3.0)<br />
by 0x938107E: ImplSalDDB::ImplSalDDB(_XImage*, unsigned long, int, SalTwoRect const&) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x9382E77: X11SalBitmap::ImplGetDDB(unsigned long, int, long, SalTwoRect const&) const (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x9382F52: X11SalBitmap::ImplDraw(unsigned long, int, long, SalTwoRect const&, _XGC* const&) const (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x937DC2A: X11SalGraphics::drawMaskedBitmap(SalTwoRect const*, SalBitmap const&, SalBitmap const&) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x937DF70: X11SalGraphics::drawBitmap(SalTwoRect const*, SalBitmap const&, SalBitmap const&) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x5BAE9FB: SalGraphics::DrawBitmap(SalTwoRect const*, SalBitmap const&, SalBitmap const&, OutputDevice const*) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclli.so)<br />
by 0x5B92D9C: OutputDevice::ImplDrawBitmapEx(Point const&, Size const&, Point const&, Size const&, BitmapEx const&, unsigned long) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclli.so)<br />
by 0x5B9320D: OutputDevice::DrawBitmapEx(Point const&, Size const&, BitmapEx const&) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclli.so)<br />
</pre><br />
might be a false positive, [http://code.google.com/p/microblog-purple/source/browse/branches/0.3/valgrind-suppressions?r=353#27] specifies a suppression block for the head of that stack,<br />
<pre><br />
{<br />
X oddness 3<br />
Memcheck:Cond<br />
fun:XcursorImageHash<br />
fun:XcursorNoticePutBitmap<br />
fun:_XNoticePutBitmap<br />
fun:XPutImage<br />
}<br />
</pre><br />
<br />
== more information ==<br />
<br />
There's also some Writer document about Valgrind: http://tools.openoffice.org/debugging/usingvalgrind.sxw<br />
<br />
TODO: move (!) its content here, not just copy but also remove there, so we don't end up with a fork.<br />
<br />
TODO: '''Run recent version''' <br/><br />
Someone should run the latest version o OO.o, as Valgrind 3.3.0 re-introduces Hellgrind which helps e.g. to hunt down deadlocks. See [http://www.valgrind.org/docs/manual/dist.news.html] for more.<br />
<br />
== Callgrind Profiling How-To ==<br />
<br />
There's a [[Callgrind| Callgrind How-To]].<br />
<br />
<br />
[[Category:Developer Tools]]</div>Sbhttps://wiki.openoffice.org/wiki/ValgrindValgrind2011-03-01T09:10:37Z<p>Sb: </p>
<hr />
<div>'''[http://valgrind.org/ Valgrind]''' is an instrumentation framework for dynamic analysis tools. It can be used to detect memory management and threading bugs and profile programs. It runs on Linux x86 and AMD64, PPC32 and PPC64 are fairly complete.<br />
<br />
== disabling the custom allocator ==<br />
<br />
If you use ooo-build; export OOO_FORCE_SYSALLOC=1 before running, (this is built into [[linkoo]]'s ooenv script).<br />
<br />
If you use a Vanilla build, and your shell is setup for building ooo, use the following wrapper script around valgrind:<br />
<pre><br />
#!/bin/sh<br />
<br />
# instrument soffice with a malloc-based memory allocator.<br />
# Requires libsalalloc_malloc.so to be in the LD_LIBRARY_PATH.<br />
# Forwards all command line arguments to valgrind.<br />
<br />
export LD_PRELOAD=libsalalloc_malloc.so<br />
valgrind $@ <br />
</pre><br />
<br />
which preloads a small interceptor lib, which redirects all allocator calls to malloc.<br />
<br />
== disabling glib's custom allocator ==<br />
<br />
If you want to also track down problems with glib allocated objects, e.g. resource leaks in gconfbe then you need to disable glib's custom allocation as well, e.g. <br />
<br />
<pre><br />
G_SLICE=always-malloc valgrind ...<br />
</pre><br />
<br />
== disabling the STLport custom allocator ==<br />
<br />
The [http://www.sgi.com/tech/stl/Allocators.html STLport default allocator] uses a static free list (<code>_S_free_list</code> in <code>_alloc.h</code>) and there appears to be no functionality to flush it upon exit (like <code>__libc_freeres</code> in the GNU C library). Thus, Valgrind can erroneously consider memory as still reachable at program termination.<br />
<br />
The easiest workaround is probably to use a build that does not use STLport, like using a 64-bit <code>unxlngx6</code> build.<br />
<br />
== Helgrind <code>__cxa_guard_acquire</code> problems ==<br />
<br />
The <code>libstdc++.so.6</code> included in <code>unxlngx6</code> Hamburg builds (and probably the one included in <code>unxlngi6</code> builds as well) apparently has a <code>__cxa_guard_acquire</code> that uses a single mutex for all the various statics, leading to many false complaints about lock order violation.<br />
<br />
As a workaround, move the instances of <code>libgcc_s.so.1</code> and <code>libstdc++.so.6</code> within the OOo installation set out of the way (and thus use the ones from the system, which are hopefully recent enough).<br />
<br />
== Errors Found ==<br />
<br />
=== Definite Errors ===<br />
<br />
Open as of <code>DEV300_m99</code>:<br />
<br />
* {{issue|114718}} &ldquo;forms/qa/unoapi: crash in remote async release call&rdquo;<br />
* {{issue|116785}} &ldquo;framework::[Module]ImageManager kept alive by ring ref&rdquo;<br />
* {{issue|116786}} &ldquo;framework::ToolBarLayoutManger::m_p{AddonOptions,GlobalSettings} leak&rdquo;<br />
* {{issue|116850}} &ldquo;SvLBox::OnCurrentEntryChanged: Conditional jump or move depends on uninitialised value(s)&rdquo;<br />
* {{issue|116885}} &ldquo;utl::TextSearch::CachedTextSearch::~CachedTextSearch called too late&rdquo;<br />
* {{issue|116891}} &ldquo;framework::AddonMenuManager::BuildMenu leaks MenuConfiguration::Attributes&rdquo;<br />
* {{issue|116910}} &ldquo;desktop::Acceptor leaks Thread_Impl&rdquo;<br />
* {{issue|116915}} &ldquo;osl_getSystemPathFromFileURL leaks rtl_uStrings&rdquo;<br />
* {{issue|116981}} &ldquo;rtl/source/bootstrap.cxx does not clean up memory&rdquo;<br />
* {{issue|117082}} &ldquo;editengine: static maTypeSequence instances destroyed too late&rdquo;<br />
* {{issue|117083}} &ldquo;document window leaks framework::WindowCommandDispatch instance&rdquo;<br />
* {{issue|117084}} &ldquo;Desktop::Main leaks Lockfile instance&rdquo;<br />
* {{issue|117119}} &ldquo;lock-order violation in comprehensive cppu_detail_getUnoType&rdquo;<br />
<br />
=== Definite False Positives ===<br />
<br />
Open as of <code>DEV300_m99</code>:<br />
<br />
* {{issue|116872}} &ldquo;drawinglayer: BPixelRasterToBitmapEx causes false valgrind positive in rtl_crc32&rdquo;<br />
<br />
* On <code>unxlngx6</code>, executing <code>DEV300_m100</code> <code>sfx2/qa/complex</code>, a 14 byte <code>com.sun.star.util.DateTime</code> struct (consisting of seven <code>unsigned short</code> members) is filled with two 64 bit writes.<br />
<pre><br />
Invalid write of size 8<br />
at 0x1558BBAC: x86_64::fill_struct(_typelib_TypeDescriptionReference*, unsigned long const*, double const*, void*) (in /opt/openoffice.org/ure/lib/libgcc3_uno.so)<br />
by 0x15591965: callVirtualMethod(void*, unsigned int, void*, _typelib_TypeDescriptionReference*, bool, unsigned long*, unsigned int, unsigned long*, unsigned int, double*, unsigned int) (in /opt/openoffice.org/ure/lib/libgcc3_uno.so)<br />
by 0x1559240D: cpp_call(bridges::cpp_uno::shared::UnoInterfaceProxy*, bridges::cpp_uno::shared::VtableSlot, _typelib_TypeDescriptionReference*, int, _typelib_MethodParameter*, void*, void**, _uno_Any**) (in /opt/openoffice.org/ure/lib/libgcc3_uno.so)<br />
by 0x15592B8A: bridges::cpp_uno::shared::unoInterfaceProxyDispatch(_uno_Interface*, _typelib_TypeDescription const*, void*, void**, _uno_Any**) (in /opt/openoffice.org/ure/lib/libgcc3_uno.so)<br />
by 0x1A15C688: binaryurp::IncomingRequest::execute_throw(binaryurp::BinaryAny*, std::vector<binaryurp::BinaryAny, std::allocator<binaryurp::BinaryAny> >*) const (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A15CC45: binaryurp::IncomingRequest::execute() const (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A16B09A: request (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x70057CA: cppu_threadpool::JobQueue::enter(long, unsigned char) (in /opt/openoffice.org/ure/lib/libuno_cppu.so.3)<br />
by 0x70062C2: cppu_threadpool::ORequestThread::run() (in /opt/openoffice.org/ure/lib/libuno_cppu.so.3)<br />
by 0x70065F2: cppu_requestThreadWorker (in /opt/openoffice.org/ure/lib/libuno_cppu.so.3)<br />
by 0x4E5F72E: osl_thread_start_Impl (in /opt/openoffice.org/ure/lib/libuno_sal.so.3)<br />
by 0x67679C9: start_thread (pthread_create.c:300)<br />
Address 0xeb32480 is 16 bytes inside a block of size 22 alloc'd<br />
at 0x4C274A8: malloc (vg_replace_malloc.c:236)<br />
by 0x4E9A7CC: rtl_allocateMemory (in /opt/openoffice.org/ure/lib/libuno_sal.so.3)<br />
by 0x4013EE: allocate(unsigned long, (anonymous namespace)::AllocatorTraits const&) (in /opt/openoffice.org3/program/soffice.bin)<br />
by 0x4014C5: operator new(unsigned long) (in /opt/openoffice.org3/program/soffice.bin)<br />
by 0x1A15E77E: __gnu_cxx::new_allocator<char>::allocate(unsigned long, void const*) (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A15E7A6: std::_Vector_base<char, std::allocator<char> >::_M_allocate(unsigned long) (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A15E7D8: std::_Vector_base<char, std::allocator<char> >::_Vector_base(unsigned long, std::allocator<char> const&) (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A15F686: std::vector<char, std::allocator<char> >::vector(unsigned long, char const&, std::allocator<char> const&) (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A15C57A: binaryurp::IncomingRequest::execute_throw(binaryurp::BinaryAny*, std::vector<binaryurp::BinaryAny, std::allocator<binaryurp::BinaryAny> >*) const (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A15CC45: binaryurp::IncomingRequest::execute() const (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A16B09A: request (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x70057CA: cppu_threadpool::JobQueue::enter(long, unsigned char) (in /opt/openoffice.org/ure/lib/libuno_cppu.so.3)<br />
</pre><br />
<br />
* On <code>unxlngx6</code>, executing <code>DEV300_m100</code> <code>sfx2/qa/complex</code> triggers the below report, which appears to be a false positive caused by what appears to be an error in valgrind, see [https://bugs.kde.org/show_bug.cgi?id=266990 &ldquo;setns instruction causes false positive&rdquo;].<br />
<pre><br />
Conditional jump or move depends on uninitialised value(s)<br />
at 0x22694A93: SwLayAction::_FormatCntnt(SwCntntFrm const*, SwPageFrm const*) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x226982DD: SwLayAction::_FormatFlyCntnt(SwFlyFrm const*) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x226A0349: SwObjectFormatter::_FormatObj(SwAnchoredObject&) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x226A14CB: SwObjectFormatterTxtFrm::DoFormatObj(SwAnchoredObject&, bool) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x226A01C2: SwObjectFormatter::_FormatObjsAtFrm(SwTxtFrm*) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x226A115B: SwObjectFormatterTxtFrm::DoFormatObjs() (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x2269FF52: SwObjectFormatter::FormatObjsAtFrm(SwFrm&, SwPageFrm const&, SwLayAction*) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x2269501E: SwLayAction::FormatCntnt(SwPageFrm const*) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x22696E9B: SwLayAction::InternalAction() (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x226975A7: SwLayAction::Action() (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x22885D50: ViewShell::ImplEndAction(unsigned char) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x225155A2: ViewShell::EndAction(unsigned char) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
</pre><br />
<br />
=== Potentially False Positives ===<br />
<br />
<pre><br />
Conditional jump or move depends on uninitialised value(s)<br />
at 0x9440A18: XcursorImageHash (in /usr/lib/libXcursor.so.1.0.2)<br />
by 0x9440ED7: XcursorNoticePutBitmap (in /usr/lib/libXcursor.so.1.0.2)<br />
by 0x42F5EF8: _XNoticePutBitmap (in /usr/lib/libX11.so.6.3.0)<br />
by 0x430D3A7: XPutImage (in /usr/lib/libX11.so.6.3.0)<br />
by 0x938107E: ImplSalDDB::ImplSalDDB(_XImage*, unsigned long, int, SalTwoRect const&) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x9382E77: X11SalBitmap::ImplGetDDB(unsigned long, int, long, SalTwoRect const&) const (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x9382F52: X11SalBitmap::ImplDraw(unsigned long, int, long, SalTwoRect const&, _XGC* const&) const (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x937DC2A: X11SalGraphics::drawMaskedBitmap(SalTwoRect const*, SalBitmap const&, SalBitmap const&) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x937DF70: X11SalGraphics::drawBitmap(SalTwoRect const*, SalBitmap const&, SalBitmap const&) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x5BAE9FB: SalGraphics::DrawBitmap(SalTwoRect const*, SalBitmap const&, SalBitmap const&, OutputDevice const*) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclli.so)<br />
by 0x5B92D9C: OutputDevice::ImplDrawBitmapEx(Point const&, Size const&, Point const&, Size const&, BitmapEx const&, unsigned long) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclli.so)<br />
by 0x5B9320D: OutputDevice::DrawBitmapEx(Point const&, Size const&, BitmapEx const&) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclli.so)<br />
</pre><br />
might be a false positive, [http://code.google.com/p/microblog-purple/source/browse/branches/0.3/valgrind-suppressions?r=353#27] specifies a suppression block for the head of that stack,<br />
<pre><br />
{<br />
X oddness 3<br />
Memcheck:Cond<br />
fun:XcursorImageHash<br />
fun:XcursorNoticePutBitmap<br />
fun:_XNoticePutBitmap<br />
fun:XPutImage<br />
}<br />
</pre><br />
<br />
== more information ==<br />
<br />
There's also some Writer document about Valgrind: http://tools.openoffice.org/debugging/usingvalgrind.sxw<br />
<br />
TODO: move (!) its content here, not just copy but also remove there, so we don't end up with a fork.<br />
<br />
TODO: '''Run recent version''' <br/><br />
Someone should run the latest version o OO.o, as Valgrind 3.3.0 re-introduces Hellgrind which helps e.g. to hunt down deadlocks. See [http://www.valgrind.org/docs/manual/dist.news.html] for more.<br />
<br />
== Callgrind Profiling How-To ==<br />
<br />
There's a [[Callgrind| Callgrind How-To]].<br />
<br />
<br />
[[Category:Developer Tools]]</div>Sbhttps://wiki.openoffice.org/wiki/ValgrindValgrind2011-02-28T14:48:58Z<p>Sb: </p>
<hr />
<div>'''[http://valgrind.org/ Valgrind]''' is an instrumentation framework for dynamic analysis tools. It can be used to detect memory management and threading bugs and profile programs. It runs on Linux x86 and AMD64, PPC32 and PPC64 are fairly complete.<br />
<br />
== disabling the custom allocator ==<br />
<br />
If you use ooo-build; export OOO_FORCE_SYSALLOC=1 before running, (this is built into [[linkoo]]'s ooenv script).<br />
<br />
If you use a Vanilla build, and your shell is setup for building ooo, use the following wrapper script around valgrind:<br />
<pre><br />
#!/bin/sh<br />
<br />
# instrument soffice with a malloc-based memory allocator.<br />
# Requires libsalalloc_malloc.so to be in the LD_LIBRARY_PATH.<br />
# Forwards all command line arguments to valgrind.<br />
<br />
export LD_PRELOAD=libsalalloc_malloc.so<br />
valgrind $@ <br />
</pre><br />
<br />
which preloads a small interceptor lib, which redirects all allocator calls to malloc.<br />
<br />
== disabling glib's custom allocator ==<br />
<br />
If you want to also track down problems with glib allocated objects, e.g. resource leaks in gconfbe then you need to disable glib's custom allocation as well, e.g. <br />
<br />
<pre><br />
G_SLICE=always-malloc valgrind ...<br />
</pre><br />
<br />
== Helgrind <code>__cxa_guard_acquire</code> problems ==<br />
<br />
The <code>libstdc++.so.6</code> included in <code>unxlngx6</code> Hamburg builds (and probably the one included in <code>unxlngi6</code> builds as well) apparently has a <code>__cxa_guard_acquire</code> that uses a single mutex for all the various statics, leading to many false complaints about lock order violation.<br />
<br />
As a workaround, move the instances of <code>libgcc_s.so.1</code> and <code>libstdc++.so.6</code> within the OOo installation set out of the way (and thus use the ones from the system, which are hopefully recent enough).<br />
<br />
== Errors Found ==<br />
<br />
=== Definite Errors ===<br />
<br />
Open as of <code>DEV300_m99</code>:<br />
<br />
* {{issue|114718}} &ldquo;forms/qa/unoapi: crash in remote async release call&rdquo;<br />
* {{issue|116785}} &ldquo;framework::[Module]ImageManager kept alive by ring ref&rdquo;<br />
* {{issue|116786}} &ldquo;framework::ToolBarLayoutManger::m_p{AddonOptions,GlobalSettings} leak&rdquo;<br />
* {{issue|116850}} &ldquo;SvLBox::OnCurrentEntryChanged: Conditional jump or move depends on uninitialised value(s)&rdquo;<br />
* {{issue|116885}} &ldquo;utl::TextSearch::CachedTextSearch::~CachedTextSearch called too late&rdquo;<br />
* {{issue|116891}} &ldquo;framework::AddonMenuManager::BuildMenu leaks MenuConfiguration::Attributes&rdquo;<br />
* {{issue|116910}} &ldquo;desktop::Acceptor leaks Thread_Impl&rdquo;<br />
* {{issue|116915}} &ldquo;osl_getSystemPathFromFileURL leaks rtl_uStrings&rdquo;<br />
* {{issue|116981}} &ldquo;rtl/source/bootstrap.cxx does not clean up memory&rdquo;<br />
* {{issue|117082}} &ldquo;editengine: static maTypeSequence instances destroyed too late&rdquo;<br />
* {{issue|117083}} &ldquo;document window leaks framework::WindowCommandDispatch instance&rdquo;<br />
* {{issue|117084}} &ldquo;Desktop::Main leaks Lockfile instance&rdquo;<br />
* {{issue|117119}} &ldquo;lock-order violation in comprehensive cppu_detail_getUnoType&rdquo;<br />
<br />
=== Definite False Positives ===<br />
<br />
Open as of <code>DEV300_m99</code>:<br />
<br />
* {{issue|116872}} &ldquo;drawinglayer: BPixelRasterToBitmapEx causes false valgrind positive in rtl_crc32&rdquo;<br />
<br />
* On <code>unxlngx6</code>, executing <code>DEV300_m100</code> <code>sfx2/qa/complex</code>, a 14 byte <code>com.sun.star.util.DateTime</code> struct (consisting of seven <code>unsigned short</code> members) is filled with two 64 bit writes.<br />
<pre><br />
Invalid write of size 8<br />
at 0x1558BBAC: x86_64::fill_struct(_typelib_TypeDescriptionReference*, unsigned long const*, double const*, void*) (in /opt/openoffice.org/ure/lib/libgcc3_uno.so)<br />
by 0x15591965: callVirtualMethod(void*, unsigned int, void*, _typelib_TypeDescriptionReference*, bool, unsigned long*, unsigned int, unsigned long*, unsigned int, double*, unsigned int) (in /opt/openoffice.org/ure/lib/libgcc3_uno.so)<br />
by 0x1559240D: cpp_call(bridges::cpp_uno::shared::UnoInterfaceProxy*, bridges::cpp_uno::shared::VtableSlot, _typelib_TypeDescriptionReference*, int, _typelib_MethodParameter*, void*, void**, _uno_Any**) (in /opt/openoffice.org/ure/lib/libgcc3_uno.so)<br />
by 0x15592B8A: bridges::cpp_uno::shared::unoInterfaceProxyDispatch(_uno_Interface*, _typelib_TypeDescription const*, void*, void**, _uno_Any**) (in /opt/openoffice.org/ure/lib/libgcc3_uno.so)<br />
by 0x1A15C688: binaryurp::IncomingRequest::execute_throw(binaryurp::BinaryAny*, std::vector<binaryurp::BinaryAny, std::allocator<binaryurp::BinaryAny> >*) const (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A15CC45: binaryurp::IncomingRequest::execute() const (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A16B09A: request (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x70057CA: cppu_threadpool::JobQueue::enter(long, unsigned char) (in /opt/openoffice.org/ure/lib/libuno_cppu.so.3)<br />
by 0x70062C2: cppu_threadpool::ORequestThread::run() (in /opt/openoffice.org/ure/lib/libuno_cppu.so.3)<br />
by 0x70065F2: cppu_requestThreadWorker (in /opt/openoffice.org/ure/lib/libuno_cppu.so.3)<br />
by 0x4E5F72E: osl_thread_start_Impl (in /opt/openoffice.org/ure/lib/libuno_sal.so.3)<br />
by 0x67679C9: start_thread (pthread_create.c:300)<br />
Address 0xeb32480 is 16 bytes inside a block of size 22 alloc'd<br />
at 0x4C274A8: malloc (vg_replace_malloc.c:236)<br />
by 0x4E9A7CC: rtl_allocateMemory (in /opt/openoffice.org/ure/lib/libuno_sal.so.3)<br />
by 0x4013EE: allocate(unsigned long, (anonymous namespace)::AllocatorTraits const&) (in /opt/openoffice.org3/program/soffice.bin)<br />
by 0x4014C5: operator new(unsigned long) (in /opt/openoffice.org3/program/soffice.bin)<br />
by 0x1A15E77E: __gnu_cxx::new_allocator<char>::allocate(unsigned long, void const*) (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A15E7A6: std::_Vector_base<char, std::allocator<char> >::_M_allocate(unsigned long) (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A15E7D8: std::_Vector_base<char, std::allocator<char> >::_Vector_base(unsigned long, std::allocator<char> const&) (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A15F686: std::vector<char, std::allocator<char> >::vector(unsigned long, char const&, std::allocator<char> const&) (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A15C57A: binaryurp::IncomingRequest::execute_throw(binaryurp::BinaryAny*, std::vector<binaryurp::BinaryAny, std::allocator<binaryurp::BinaryAny> >*) const (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A15CC45: binaryurp::IncomingRequest::execute() const (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A16B09A: request (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x70057CA: cppu_threadpool::JobQueue::enter(long, unsigned char) (in /opt/openoffice.org/ure/lib/libuno_cppu.so.3)<br />
</pre><br />
<br />
* On <code>unxlngx6</code>, executing <code>DEV300_m100</code> <code>sfx2/qa/complex</code> triggers the below report, which appears to be a false positive caused by what appears to be an error in valgrind, see [https://bugs.kde.org/show_bug.cgi?id=266990 &ldquo;setns instruction causes false positive&rdquo;].<br />
<pre><br />
Conditional jump or move depends on uninitialised value(s)<br />
at 0x22694A93: SwLayAction::_FormatCntnt(SwCntntFrm const*, SwPageFrm const*) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x226982DD: SwLayAction::_FormatFlyCntnt(SwFlyFrm const*) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x226A0349: SwObjectFormatter::_FormatObj(SwAnchoredObject&) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x226A14CB: SwObjectFormatterTxtFrm::DoFormatObj(SwAnchoredObject&, bool) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x226A01C2: SwObjectFormatter::_FormatObjsAtFrm(SwTxtFrm*) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x226A115B: SwObjectFormatterTxtFrm::DoFormatObjs() (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x2269FF52: SwObjectFormatter::FormatObjsAtFrm(SwFrm&, SwPageFrm const&, SwLayAction*) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x2269501E: SwLayAction::FormatCntnt(SwPageFrm const*) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x22696E9B: SwLayAction::InternalAction() (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x226975A7: SwLayAction::Action() (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x22885D50: ViewShell::ImplEndAction(unsigned char) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x225155A2: ViewShell::EndAction(unsigned char) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
</pre><br />
<br />
=== Potentially False Positives ===<br />
<br />
<pre><br />
Conditional jump or move depends on uninitialised value(s)<br />
at 0x9440A18: XcursorImageHash (in /usr/lib/libXcursor.so.1.0.2)<br />
by 0x9440ED7: XcursorNoticePutBitmap (in /usr/lib/libXcursor.so.1.0.2)<br />
by 0x42F5EF8: _XNoticePutBitmap (in /usr/lib/libX11.so.6.3.0)<br />
by 0x430D3A7: XPutImage (in /usr/lib/libX11.so.6.3.0)<br />
by 0x938107E: ImplSalDDB::ImplSalDDB(_XImage*, unsigned long, int, SalTwoRect const&) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x9382E77: X11SalBitmap::ImplGetDDB(unsigned long, int, long, SalTwoRect const&) const (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x9382F52: X11SalBitmap::ImplDraw(unsigned long, int, long, SalTwoRect const&, _XGC* const&) const (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x937DC2A: X11SalGraphics::drawMaskedBitmap(SalTwoRect const*, SalBitmap const&, SalBitmap const&) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x937DF70: X11SalGraphics::drawBitmap(SalTwoRect const*, SalBitmap const&, SalBitmap const&) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x5BAE9FB: SalGraphics::DrawBitmap(SalTwoRect const*, SalBitmap const&, SalBitmap const&, OutputDevice const*) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclli.so)<br />
by 0x5B92D9C: OutputDevice::ImplDrawBitmapEx(Point const&, Size const&, Point const&, Size const&, BitmapEx const&, unsigned long) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclli.so)<br />
by 0x5B9320D: OutputDevice::DrawBitmapEx(Point const&, Size const&, BitmapEx const&) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclli.so)<br />
</pre><br />
might be a false positive, [http://code.google.com/p/microblog-purple/source/browse/branches/0.3/valgrind-suppressions?r=353#27] specifies a suppression block for the head of that stack,<br />
<pre><br />
{<br />
X oddness 3<br />
Memcheck:Cond<br />
fun:XcursorImageHash<br />
fun:XcursorNoticePutBitmap<br />
fun:_XNoticePutBitmap<br />
fun:XPutImage<br />
}<br />
</pre><br />
<br />
== more information ==<br />
<br />
There's also some Writer document about Valgrind: http://tools.openoffice.org/debugging/usingvalgrind.sxw<br />
<br />
TODO: move (!) its content here, not just copy but also remove there, so we don't end up with a fork.<br />
<br />
TODO: '''Run recent version''' <br/><br />
Someone should run the latest version o OO.o, as Valgrind 3.3.0 re-introduces Hellgrind which helps e.g. to hunt down deadlocks. See [http://www.valgrind.org/docs/manual/dist.news.html] for more.<br />
<br />
== Callgrind Profiling How-To ==<br />
<br />
There's a [[Callgrind| Callgrind How-To]].<br />
<br />
<br />
[[Category:Developer Tools]]</div>Sbhttps://wiki.openoffice.org/wiki/ValgrindValgrind2011-02-28T10:51:34Z<p>Sb: /* Definite Errors */</p>
<hr />
<div>'''[http://valgrind.org/ Valgrind]''' is an instrumentation framework for dynamic analysis tools. It can be used to detect memory management and threading bugs and profile programs. It runs on Linux x86 and AMD64, PPC32 and PPC64 are fairly complete.<br />
<br />
== disabling the custom allocator ==<br />
<br />
If you use ooo-build; export OOO_FORCE_SYSALLOC=1 before running, (this is built into [[linkoo]]'s ooenv script).<br />
<br />
If you use a Vanilla build, and your shell is setup for building ooo, use the following wrapper script around valgrind:<br />
<pre><br />
#!/bin/sh<br />
<br />
# instrument soffice with a malloc-based memory allocator.<br />
# Requires libsalalloc_malloc.so to be in the LD_LIBRARY_PATH.<br />
# Forwards all command line arguments to valgrind.<br />
<br />
export LD_PRELOAD=libsalalloc_malloc.so<br />
valgrind $@ <br />
</pre><br />
<br />
which preloads a small interceptor lib, which redirects all allocator calls to malloc.<br />
<br />
== disabling glib's custom allocator ==<br />
<br />
If you want to also track down problems with glib allocated objects, e.g. resource leaks in gconfbe then you need to disable glib's custom allocation as well, e.g. <br />
<br />
<pre><br />
G_SLICE=always-malloc valgrind ...<br />
</pre><br />
<br />
== Errors Found ==<br />
<br />
=== Definite Errors ===<br />
<br />
Open as of <code>DEV300_m99</code>:<br />
<br />
* {{issue|114718}} &ldquo;forms/qa/unoapi: crash in remote async release call&rdquo;<br />
* {{issue|116785}} &ldquo;framework::[Module]ImageManager kept alive by ring ref&rdquo;<br />
* {{issue|116786}} &ldquo;framework::ToolBarLayoutManger::m_p{AddonOptions,GlobalSettings} leak&rdquo;<br />
* {{issue|116850}} &ldquo;SvLBox::OnCurrentEntryChanged: Conditional jump or move depends on uninitialised value(s)&rdquo;<br />
* {{issue|116885}} &ldquo;utl::TextSearch::CachedTextSearch::~CachedTextSearch called too late&rdquo;<br />
* {{issue|116891}} &ldquo;framework::AddonMenuManager::BuildMenu leaks MenuConfiguration::Attributes&rdquo;<br />
* {{issue|116910}} &ldquo;desktop::Acceptor leaks Thread_Impl&rdquo;<br />
* {{issue|116915}} &ldquo;osl_getSystemPathFromFileURL leaks rtl_uStrings&rdquo;<br />
* {{issue|116981}} &ldquo;rtl/source/bootstrap.cxx does not clean up memory&rdquo;<br />
* {{issue|117082}} &ldquo;editengine: static maTypeSequence instances destroyed too late&rdquo;<br />
* {{issue|117083}} &ldquo;document window leaks framework::WindowCommandDispatch instance&rdquo;<br />
* {{issue|117084}} &ldquo;Desktop::Main leaks Lockfile instance&rdquo;<br />
* {{issue|117119}} &ldquo;lock-order violation in comprehensive cppu_detail_getUnoType&rdquo;<br />
<br />
=== Definite False Positives ===<br />
<br />
Open as of <code>DEV300_m99</code>:<br />
<br />
* {{issue|116872}} &ldquo;drawinglayer: BPixelRasterToBitmapEx causes false valgrind positive in rtl_crc32&rdquo;<br />
<br />
* On <code>unxlngx6</code>, executing <code>DEV300_m100</code> <code>sfx2/qa/complex</code>, a 14 byte <code>com.sun.star.util.DateTime</code> struct (consisting of seven <code>unsigned short</code> members) is filled with two 64 bit writes.<br />
<pre><br />
Invalid write of size 8<br />
at 0x1558BBAC: x86_64::fill_struct(_typelib_TypeDescriptionReference*, unsigned long const*, double const*, void*) (in /opt/openoffice.org/ure/lib/libgcc3_uno.so)<br />
by 0x15591965: callVirtualMethod(void*, unsigned int, void*, _typelib_TypeDescriptionReference*, bool, unsigned long*, unsigned int, unsigned long*, unsigned int, double*, unsigned int) (in /opt/openoffice.org/ure/lib/libgcc3_uno.so)<br />
by 0x1559240D: cpp_call(bridges::cpp_uno::shared::UnoInterfaceProxy*, bridges::cpp_uno::shared::VtableSlot, _typelib_TypeDescriptionReference*, int, _typelib_MethodParameter*, void*, void**, _uno_Any**) (in /opt/openoffice.org/ure/lib/libgcc3_uno.so)<br />
by 0x15592B8A: bridges::cpp_uno::shared::unoInterfaceProxyDispatch(_uno_Interface*, _typelib_TypeDescription const*, void*, void**, _uno_Any**) (in /opt/openoffice.org/ure/lib/libgcc3_uno.so)<br />
by 0x1A15C688: binaryurp::IncomingRequest::execute_throw(binaryurp::BinaryAny*, std::vector<binaryurp::BinaryAny, std::allocator<binaryurp::BinaryAny> >*) const (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A15CC45: binaryurp::IncomingRequest::execute() const (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A16B09A: request (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x70057CA: cppu_threadpool::JobQueue::enter(long, unsigned char) (in /opt/openoffice.org/ure/lib/libuno_cppu.so.3)<br />
by 0x70062C2: cppu_threadpool::ORequestThread::run() (in /opt/openoffice.org/ure/lib/libuno_cppu.so.3)<br />
by 0x70065F2: cppu_requestThreadWorker (in /opt/openoffice.org/ure/lib/libuno_cppu.so.3)<br />
by 0x4E5F72E: osl_thread_start_Impl (in /opt/openoffice.org/ure/lib/libuno_sal.so.3)<br />
by 0x67679C9: start_thread (pthread_create.c:300)<br />
Address 0xeb32480 is 16 bytes inside a block of size 22 alloc'd<br />
at 0x4C274A8: malloc (vg_replace_malloc.c:236)<br />
by 0x4E9A7CC: rtl_allocateMemory (in /opt/openoffice.org/ure/lib/libuno_sal.so.3)<br />
by 0x4013EE: allocate(unsigned long, (anonymous namespace)::AllocatorTraits const&) (in /opt/openoffice.org3/program/soffice.bin)<br />
by 0x4014C5: operator new(unsigned long) (in /opt/openoffice.org3/program/soffice.bin)<br />
by 0x1A15E77E: __gnu_cxx::new_allocator<char>::allocate(unsigned long, void const*) (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A15E7A6: std::_Vector_base<char, std::allocator<char> >::_M_allocate(unsigned long) (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A15E7D8: std::_Vector_base<char, std::allocator<char> >::_Vector_base(unsigned long, std::allocator<char> const&) (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A15F686: std::vector<char, std::allocator<char> >::vector(unsigned long, char const&, std::allocator<char> const&) (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A15C57A: binaryurp::IncomingRequest::execute_throw(binaryurp::BinaryAny*, std::vector<binaryurp::BinaryAny, std::allocator<binaryurp::BinaryAny> >*) const (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A15CC45: binaryurp::IncomingRequest::execute() const (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A16B09A: request (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x70057CA: cppu_threadpool::JobQueue::enter(long, unsigned char) (in /opt/openoffice.org/ure/lib/libuno_cppu.so.3)<br />
</pre><br />
<br />
* On <code>unxlngx6</code>, executing <code>DEV300_m100</code> <code>sfx2/qa/complex</code> triggers the below report, which appears to be a false positive caused by what appears to be an error in valgrind, see [https://bugs.kde.org/show_bug.cgi?id=266990 &ldquo;setns instruction causes false positive&rdquo;].<br />
<pre><br />
Conditional jump or move depends on uninitialised value(s)<br />
at 0x22694A93: SwLayAction::_FormatCntnt(SwCntntFrm const*, SwPageFrm const*) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x226982DD: SwLayAction::_FormatFlyCntnt(SwFlyFrm const*) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x226A0349: SwObjectFormatter::_FormatObj(SwAnchoredObject&) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x226A14CB: SwObjectFormatterTxtFrm::DoFormatObj(SwAnchoredObject&, bool) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x226A01C2: SwObjectFormatter::_FormatObjsAtFrm(SwTxtFrm*) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x226A115B: SwObjectFormatterTxtFrm::DoFormatObjs() (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x2269FF52: SwObjectFormatter::FormatObjsAtFrm(SwFrm&, SwPageFrm const&, SwLayAction*) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x2269501E: SwLayAction::FormatCntnt(SwPageFrm const*) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x22696E9B: SwLayAction::InternalAction() (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x226975A7: SwLayAction::Action() (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x22885D50: ViewShell::ImplEndAction(unsigned char) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x225155A2: ViewShell::EndAction(unsigned char) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
</pre><br />
<br />
=== Potentially False Positives ===<br />
<br />
<pre><br />
Conditional jump or move depends on uninitialised value(s)<br />
at 0x9440A18: XcursorImageHash (in /usr/lib/libXcursor.so.1.0.2)<br />
by 0x9440ED7: XcursorNoticePutBitmap (in /usr/lib/libXcursor.so.1.0.2)<br />
by 0x42F5EF8: _XNoticePutBitmap (in /usr/lib/libX11.so.6.3.0)<br />
by 0x430D3A7: XPutImage (in /usr/lib/libX11.so.6.3.0)<br />
by 0x938107E: ImplSalDDB::ImplSalDDB(_XImage*, unsigned long, int, SalTwoRect const&) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x9382E77: X11SalBitmap::ImplGetDDB(unsigned long, int, long, SalTwoRect const&) const (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x9382F52: X11SalBitmap::ImplDraw(unsigned long, int, long, SalTwoRect const&, _XGC* const&) const (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x937DC2A: X11SalGraphics::drawMaskedBitmap(SalTwoRect const*, SalBitmap const&, SalBitmap const&) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x937DF70: X11SalGraphics::drawBitmap(SalTwoRect const*, SalBitmap const&, SalBitmap const&) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x5BAE9FB: SalGraphics::DrawBitmap(SalTwoRect const*, SalBitmap const&, SalBitmap const&, OutputDevice const*) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclli.so)<br />
by 0x5B92D9C: OutputDevice::ImplDrawBitmapEx(Point const&, Size const&, Point const&, Size const&, BitmapEx const&, unsigned long) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclli.so)<br />
by 0x5B9320D: OutputDevice::DrawBitmapEx(Point const&, Size const&, BitmapEx const&) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclli.so)<br />
</pre><br />
might be a false positive, [http://code.google.com/p/microblog-purple/source/browse/branches/0.3/valgrind-suppressions?r=353#27] specifies a suppression block for the head of that stack,<br />
<pre><br />
{<br />
X oddness 3<br />
Memcheck:Cond<br />
fun:XcursorImageHash<br />
fun:XcursorNoticePutBitmap<br />
fun:_XNoticePutBitmap<br />
fun:XPutImage<br />
}<br />
</pre><br />
<br />
== more information ==<br />
<br />
There's also some Writer document about Valgrind: http://tools.openoffice.org/debugging/usingvalgrind.sxw<br />
<br />
TODO: move (!) its content here, not just copy but also remove there, so we don't end up with a fork.<br />
<br />
TODO: '''Run recent version''' <br/><br />
Someone should run the latest version o OO.o, as Valgrind 3.3.0 re-introduces Hellgrind which helps e.g. to hunt down deadlocks. See [http://www.valgrind.org/docs/manual/dist.news.html] for more.<br />
<br />
== Callgrind Profiling How-To ==<br />
<br />
There's a [[Callgrind| Callgrind How-To]].<br />
<br />
<br />
[[Category:Developer Tools]]</div>Sbhttps://wiki.openoffice.org/wiki/ValgrindValgrind2011-02-25T15:59:12Z<p>Sb: /* Definite Errors */</p>
<hr />
<div>'''[http://valgrind.org/ Valgrind]''' is an instrumentation framework for dynamic analysis tools. It can be used to detect memory management and threading bugs and profile programs. It runs on Linux x86 and AMD64, PPC32 and PPC64 are fairly complete.<br />
<br />
== disabling the custom allocator ==<br />
<br />
If you use ooo-build; export OOO_FORCE_SYSALLOC=1 before running, (this is built into [[linkoo]]'s ooenv script).<br />
<br />
If you use a Vanilla build, and your shell is setup for building ooo, use the following wrapper script around valgrind:<br />
<pre><br />
#!/bin/sh<br />
<br />
# instrument soffice with a malloc-based memory allocator.<br />
# Requires libsalalloc_malloc.so to be in the LD_LIBRARY_PATH.<br />
# Forwards all command line arguments to valgrind.<br />
<br />
export LD_PRELOAD=libsalalloc_malloc.so<br />
valgrind $@ <br />
</pre><br />
<br />
which preloads a small interceptor lib, which redirects all allocator calls to malloc.<br />
<br />
== disabling glib's custom allocator ==<br />
<br />
If you want to also track down problems with glib allocated objects, e.g. resource leaks in gconfbe then you need to disable glib's custom allocation as well, e.g. <br />
<br />
<pre><br />
G_SLICE=always-malloc valgrind ...<br />
</pre><br />
<br />
== Errors Found ==<br />
<br />
=== Definite Errors ===<br />
<br />
Open as of <code>DEV300_m99</code>:<br />
<br />
* {{issue|114718}} &ldquo;forms/qa/unoapi: crash in remote async release call&rdquo;<br />
* {{issue|116785}} &ldquo;framework::[Module]ImageManager kept alive by ring ref&rdquo;<br />
* {{issue|116786}} &ldquo;framework::ToolBarLayoutManger::m_p{AddonOptions,GlobalSettings} leak&rdquo;<br />
* {{issue|116850}} &ldquo;SvLBox::OnCurrentEntryChanged: Conditional jump or move depends on uninitialised value(s)&rdquo;<br />
* {{issue|116885}} &ldquo;utl::TextSearch::CachedTextSearch::~CachedTextSearch called too late&rdquo;<br />
* {{issue|116891}} &ldquo;framework::AddonMenuManager::BuildMenu leaks MenuConfiguration::Attributes&rdquo;<br />
* {{issue|116910}} &ldquo;desktop::Acceptor leaks Thread_Impl&rdquo;<br />
* {{issue|116915}} &ldquo;osl_getSystemPathFromFileURL leaks rtl_uStrings&rdquo;<br />
* {{issue|116981}} &ldquo;rtl/source/bootstrap.cxx does not clean up memory&rdquo;<br />
* {{issue|117082}} &ldquo;editengine: static maTypeSequence instances destroyed too late&rdquo;<br />
* {{issue|117083}} &ldquo;document window leaks framework::WindowCommandDispatch instance&rdquo;<br />
* {{issue|117084}} &ldquo;Desktop::Main leaks Lockfile instance&rdquo;<br />
<br />
=== Definite False Positives ===<br />
<br />
Open as of <code>DEV300_m99</code>:<br />
<br />
* {{issue|116872}} &ldquo;drawinglayer: BPixelRasterToBitmapEx causes false valgrind positive in rtl_crc32&rdquo;<br />
<br />
* On <code>unxlngx6</code>, executing <code>DEV300_m100</code> <code>sfx2/qa/complex</code>, a 14 byte <code>com.sun.star.util.DateTime</code> struct (consisting of seven <code>unsigned short</code> members) is filled with two 64 bit writes.<br />
<pre><br />
Invalid write of size 8<br />
at 0x1558BBAC: x86_64::fill_struct(_typelib_TypeDescriptionReference*, unsigned long const*, double const*, void*) (in /opt/openoffice.org/ure/lib/libgcc3_uno.so)<br />
by 0x15591965: callVirtualMethod(void*, unsigned int, void*, _typelib_TypeDescriptionReference*, bool, unsigned long*, unsigned int, unsigned long*, unsigned int, double*, unsigned int) (in /opt/openoffice.org/ure/lib/libgcc3_uno.so)<br />
by 0x1559240D: cpp_call(bridges::cpp_uno::shared::UnoInterfaceProxy*, bridges::cpp_uno::shared::VtableSlot, _typelib_TypeDescriptionReference*, int, _typelib_MethodParameter*, void*, void**, _uno_Any**) (in /opt/openoffice.org/ure/lib/libgcc3_uno.so)<br />
by 0x15592B8A: bridges::cpp_uno::shared::unoInterfaceProxyDispatch(_uno_Interface*, _typelib_TypeDescription const*, void*, void**, _uno_Any**) (in /opt/openoffice.org/ure/lib/libgcc3_uno.so)<br />
by 0x1A15C688: binaryurp::IncomingRequest::execute_throw(binaryurp::BinaryAny*, std::vector<binaryurp::BinaryAny, std::allocator<binaryurp::BinaryAny> >*) const (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A15CC45: binaryurp::IncomingRequest::execute() const (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A16B09A: request (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x70057CA: cppu_threadpool::JobQueue::enter(long, unsigned char) (in /opt/openoffice.org/ure/lib/libuno_cppu.so.3)<br />
by 0x70062C2: cppu_threadpool::ORequestThread::run() (in /opt/openoffice.org/ure/lib/libuno_cppu.so.3)<br />
by 0x70065F2: cppu_requestThreadWorker (in /opt/openoffice.org/ure/lib/libuno_cppu.so.3)<br />
by 0x4E5F72E: osl_thread_start_Impl (in /opt/openoffice.org/ure/lib/libuno_sal.so.3)<br />
by 0x67679C9: start_thread (pthread_create.c:300)<br />
Address 0xeb32480 is 16 bytes inside a block of size 22 alloc'd<br />
at 0x4C274A8: malloc (vg_replace_malloc.c:236)<br />
by 0x4E9A7CC: rtl_allocateMemory (in /opt/openoffice.org/ure/lib/libuno_sal.so.3)<br />
by 0x4013EE: allocate(unsigned long, (anonymous namespace)::AllocatorTraits const&) (in /opt/openoffice.org3/program/soffice.bin)<br />
by 0x4014C5: operator new(unsigned long) (in /opt/openoffice.org3/program/soffice.bin)<br />
by 0x1A15E77E: __gnu_cxx::new_allocator<char>::allocate(unsigned long, void const*) (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A15E7A6: std::_Vector_base<char, std::allocator<char> >::_M_allocate(unsigned long) (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A15E7D8: std::_Vector_base<char, std::allocator<char> >::_Vector_base(unsigned long, std::allocator<char> const&) (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A15F686: std::vector<char, std::allocator<char> >::vector(unsigned long, char const&, std::allocator<char> const&) (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A15C57A: binaryurp::IncomingRequest::execute_throw(binaryurp::BinaryAny*, std::vector<binaryurp::BinaryAny, std::allocator<binaryurp::BinaryAny> >*) const (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A15CC45: binaryurp::IncomingRequest::execute() const (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A16B09A: request (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x70057CA: cppu_threadpool::JobQueue::enter(long, unsigned char) (in /opt/openoffice.org/ure/lib/libuno_cppu.so.3)<br />
</pre><br />
<br />
* On <code>unxlngx6</code>, executing <code>DEV300_m100</code> <code>sfx2/qa/complex</code> triggers the below report, which appears to be a false positive caused by what appears to be an error in valgrind, see [https://bugs.kde.org/show_bug.cgi?id=266990 &ldquo;setns instruction causes false positive&rdquo;].<br />
<pre><br />
Conditional jump or move depends on uninitialised value(s)<br />
at 0x22694A93: SwLayAction::_FormatCntnt(SwCntntFrm const*, SwPageFrm const*) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x226982DD: SwLayAction::_FormatFlyCntnt(SwFlyFrm const*) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x226A0349: SwObjectFormatter::_FormatObj(SwAnchoredObject&) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x226A14CB: SwObjectFormatterTxtFrm::DoFormatObj(SwAnchoredObject&, bool) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x226A01C2: SwObjectFormatter::_FormatObjsAtFrm(SwTxtFrm*) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x226A115B: SwObjectFormatterTxtFrm::DoFormatObjs() (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x2269FF52: SwObjectFormatter::FormatObjsAtFrm(SwFrm&, SwPageFrm const&, SwLayAction*) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x2269501E: SwLayAction::FormatCntnt(SwPageFrm const*) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x22696E9B: SwLayAction::InternalAction() (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x226975A7: SwLayAction::Action() (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x22885D50: ViewShell::ImplEndAction(unsigned char) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x225155A2: ViewShell::EndAction(unsigned char) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
</pre><br />
<br />
=== Potentially False Positives ===<br />
<br />
<pre><br />
Conditional jump or move depends on uninitialised value(s)<br />
at 0x9440A18: XcursorImageHash (in /usr/lib/libXcursor.so.1.0.2)<br />
by 0x9440ED7: XcursorNoticePutBitmap (in /usr/lib/libXcursor.so.1.0.2)<br />
by 0x42F5EF8: _XNoticePutBitmap (in /usr/lib/libX11.so.6.3.0)<br />
by 0x430D3A7: XPutImage (in /usr/lib/libX11.so.6.3.0)<br />
by 0x938107E: ImplSalDDB::ImplSalDDB(_XImage*, unsigned long, int, SalTwoRect const&) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x9382E77: X11SalBitmap::ImplGetDDB(unsigned long, int, long, SalTwoRect const&) const (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x9382F52: X11SalBitmap::ImplDraw(unsigned long, int, long, SalTwoRect const&, _XGC* const&) const (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x937DC2A: X11SalGraphics::drawMaskedBitmap(SalTwoRect const*, SalBitmap const&, SalBitmap const&) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x937DF70: X11SalGraphics::drawBitmap(SalTwoRect const*, SalBitmap const&, SalBitmap const&) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x5BAE9FB: SalGraphics::DrawBitmap(SalTwoRect const*, SalBitmap const&, SalBitmap const&, OutputDevice const*) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclli.so)<br />
by 0x5B92D9C: OutputDevice::ImplDrawBitmapEx(Point const&, Size const&, Point const&, Size const&, BitmapEx const&, unsigned long) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclli.so)<br />
by 0x5B9320D: OutputDevice::DrawBitmapEx(Point const&, Size const&, BitmapEx const&) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclli.so)<br />
</pre><br />
might be a false positive, [http://code.google.com/p/microblog-purple/source/browse/branches/0.3/valgrind-suppressions?r=353#27] specifies a suppression block for the head of that stack,<br />
<pre><br />
{<br />
X oddness 3<br />
Memcheck:Cond<br />
fun:XcursorImageHash<br />
fun:XcursorNoticePutBitmap<br />
fun:_XNoticePutBitmap<br />
fun:XPutImage<br />
}<br />
</pre><br />
<br />
== more information ==<br />
<br />
There's also some Writer document about Valgrind: http://tools.openoffice.org/debugging/usingvalgrind.sxw<br />
<br />
TODO: move (!) its content here, not just copy but also remove there, so we don't end up with a fork.<br />
<br />
TODO: '''Run recent version''' <br/><br />
Someone should run the latest version o OO.o, as Valgrind 3.3.0 re-introduces Hellgrind which helps e.g. to hunt down deadlocks. See [http://www.valgrind.org/docs/manual/dist.news.html] for more.<br />
<br />
== Callgrind Profiling How-To ==<br />
<br />
There's a [[Callgrind| Callgrind How-To]].<br />
<br />
<br />
[[Category:Developer Tools]]</div>Sbhttps://wiki.openoffice.org/wiki/ValgrindValgrind2011-02-23T16:16:22Z<p>Sb: /* Definite False Positives */</p>
<hr />
<div>'''[http://valgrind.org/ Valgrind]''' is an instrumentation framework for dynamic analysis tools. It can be used to detect memory management and threading bugs and profile programs. It runs on Linux x86 and AMD64, PPC32 and PPC64 are fairly complete.<br />
<br />
== disabling the custom allocator ==<br />
<br />
If you use ooo-build; export OOO_FORCE_SYSALLOC=1 before running, (this is built into [[linkoo]]'s ooenv script).<br />
<br />
If you use a Vanilla build, and your shell is setup for building ooo, use the following wrapper script around valgrind:<br />
<pre><br />
#!/bin/sh<br />
<br />
# instrument soffice with a malloc-based memory allocator.<br />
# Requires libsalalloc_malloc.so to be in the LD_LIBRARY_PATH.<br />
# Forwards all command line arguments to valgrind.<br />
<br />
export LD_PRELOAD=libsalalloc_malloc.so<br />
valgrind $@ <br />
</pre><br />
<br />
which preloads a small interceptor lib, which redirects all allocator calls to malloc.<br />
<br />
== disabling glib's custom allocator ==<br />
<br />
If you want to also track down problems with glib allocated objects, e.g. resource leaks in gconfbe then you need to disable glib's custom allocation as well, e.g. <br />
<br />
<pre><br />
G_SLICE=always-malloc valgrind ...<br />
</pre><br />
<br />
== Errors Found ==<br />
<br />
=== Definite Errors ===<br />
<br />
Open as of <code>DEV300_m99</code>:<br />
<br />
* {{issue|114718}} &ldquo;forms/qa/unoapi: crash in remote async release call&rdquo;<br />
* {{issue|116785}} &ldquo;framework::[Module]ImageManager kept alive by ring ref&rdquo;<br />
* {{issue|116786}} &ldquo;framework::ToolBarLayoutManger::m_p{AddonOptions,GlobalSettings} leak&rdquo;<br />
* {{issue|116850}} &ldquo;SvLBox::OnCurrentEntryChanged: Conditional jump or move depends on uninitialised value(s)&rdquo;<br />
* {{issue|116885}} &ldquo;utl::TextSearch::CachedTextSearch::~CachedTextSearch called too late&rdquo;<br />
* {{issue|116891}} &ldquo;framework::AddonMenuManager::BuildMenu leaks MenuConfiguration::Attributes&rdquo;<br />
* {{issue|116910}} &ldquo;desktop::Acceptor leaks Thread_Impl&rdquo;<br />
* {{issue|116915}} &ldquo;osl_getSystemPathFromFileURL leaks rtl_uStrings&rdquo;<br />
* {{issue|116981}} &ldquo;rtl/source/bootstrap.cxx does not clean up memory&rdquo;<br />
<br />
=== Definite False Positives ===<br />
<br />
Open as of <code>DEV300_m99</code>:<br />
<br />
* {{issue|116872}} &ldquo;drawinglayer: BPixelRasterToBitmapEx causes false valgrind positive in rtl_crc32&rdquo;<br />
<br />
* On <code>unxlngx6</code>, executing <code>DEV300_m100</code> <code>sfx2/qa/complex</code>, a 14 byte <code>com.sun.star.util.DateTime</code> struct (consisting of seven <code>unsigned short</code> members) is filled with two 64 bit writes.<br />
<pre><br />
Invalid write of size 8<br />
at 0x1558BBAC: x86_64::fill_struct(_typelib_TypeDescriptionReference*, unsigned long const*, double const*, void*) (in /opt/openoffice.org/ure/lib/libgcc3_uno.so)<br />
by 0x15591965: callVirtualMethod(void*, unsigned int, void*, _typelib_TypeDescriptionReference*, bool, unsigned long*, unsigned int, unsigned long*, unsigned int, double*, unsigned int) (in /opt/openoffice.org/ure/lib/libgcc3_uno.so)<br />
by 0x1559240D: cpp_call(bridges::cpp_uno::shared::UnoInterfaceProxy*, bridges::cpp_uno::shared::VtableSlot, _typelib_TypeDescriptionReference*, int, _typelib_MethodParameter*, void*, void**, _uno_Any**) (in /opt/openoffice.org/ure/lib/libgcc3_uno.so)<br />
by 0x15592B8A: bridges::cpp_uno::shared::unoInterfaceProxyDispatch(_uno_Interface*, _typelib_TypeDescription const*, void*, void**, _uno_Any**) (in /opt/openoffice.org/ure/lib/libgcc3_uno.so)<br />
by 0x1A15C688: binaryurp::IncomingRequest::execute_throw(binaryurp::BinaryAny*, std::vector<binaryurp::BinaryAny, std::allocator<binaryurp::BinaryAny> >*) const (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A15CC45: binaryurp::IncomingRequest::execute() const (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A16B09A: request (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x70057CA: cppu_threadpool::JobQueue::enter(long, unsigned char) (in /opt/openoffice.org/ure/lib/libuno_cppu.so.3)<br />
by 0x70062C2: cppu_threadpool::ORequestThread::run() (in /opt/openoffice.org/ure/lib/libuno_cppu.so.3)<br />
by 0x70065F2: cppu_requestThreadWorker (in /opt/openoffice.org/ure/lib/libuno_cppu.so.3)<br />
by 0x4E5F72E: osl_thread_start_Impl (in /opt/openoffice.org/ure/lib/libuno_sal.so.3)<br />
by 0x67679C9: start_thread (pthread_create.c:300)<br />
Address 0xeb32480 is 16 bytes inside a block of size 22 alloc'd<br />
at 0x4C274A8: malloc (vg_replace_malloc.c:236)<br />
by 0x4E9A7CC: rtl_allocateMemory (in /opt/openoffice.org/ure/lib/libuno_sal.so.3)<br />
by 0x4013EE: allocate(unsigned long, (anonymous namespace)::AllocatorTraits const&) (in /opt/openoffice.org3/program/soffice.bin)<br />
by 0x4014C5: operator new(unsigned long) (in /opt/openoffice.org3/program/soffice.bin)<br />
by 0x1A15E77E: __gnu_cxx::new_allocator<char>::allocate(unsigned long, void const*) (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A15E7A6: std::_Vector_base<char, std::allocator<char> >::_M_allocate(unsigned long) (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A15E7D8: std::_Vector_base<char, std::allocator<char> >::_Vector_base(unsigned long, std::allocator<char> const&) (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A15F686: std::vector<char, std::allocator<char> >::vector(unsigned long, char const&, std::allocator<char> const&) (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A15C57A: binaryurp::IncomingRequest::execute_throw(binaryurp::BinaryAny*, std::vector<binaryurp::BinaryAny, std::allocator<binaryurp::BinaryAny> >*) const (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A15CC45: binaryurp::IncomingRequest::execute() const (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A16B09A: request (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x70057CA: cppu_threadpool::JobQueue::enter(long, unsigned char) (in /opt/openoffice.org/ure/lib/libuno_cppu.so.3)<br />
</pre><br />
<br />
* On <code>unxlngx6</code>, executing <code>DEV300_m100</code> <code>sfx2/qa/complex</code> triggers the below report, which appears to be a false positive caused by what appears to be an error in valgrind, see [https://bugs.kde.org/show_bug.cgi?id=266990 &ldquo;setns instruction causes false positive&rdquo;].<br />
<pre><br />
Conditional jump or move depends on uninitialised value(s)<br />
at 0x22694A93: SwLayAction::_FormatCntnt(SwCntntFrm const*, SwPageFrm const*) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x226982DD: SwLayAction::_FormatFlyCntnt(SwFlyFrm const*) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x226A0349: SwObjectFormatter::_FormatObj(SwAnchoredObject&) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x226A14CB: SwObjectFormatterTxtFrm::DoFormatObj(SwAnchoredObject&, bool) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x226A01C2: SwObjectFormatter::_FormatObjsAtFrm(SwTxtFrm*) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x226A115B: SwObjectFormatterTxtFrm::DoFormatObjs() (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x2269FF52: SwObjectFormatter::FormatObjsAtFrm(SwFrm&, SwPageFrm const&, SwLayAction*) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x2269501E: SwLayAction::FormatCntnt(SwPageFrm const*) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x22696E9B: SwLayAction::InternalAction() (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x226975A7: SwLayAction::Action() (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x22885D50: ViewShell::ImplEndAction(unsigned char) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
by 0x225155A2: ViewShell::EndAction(unsigned char) (in /opt/openoffice.org/basis3.4/program/libswlx.so)<br />
</pre><br />
<br />
=== Potentially False Positives ===<br />
<br />
<pre><br />
Conditional jump or move depends on uninitialised value(s)<br />
at 0x9440A18: XcursorImageHash (in /usr/lib/libXcursor.so.1.0.2)<br />
by 0x9440ED7: XcursorNoticePutBitmap (in /usr/lib/libXcursor.so.1.0.2)<br />
by 0x42F5EF8: _XNoticePutBitmap (in /usr/lib/libX11.so.6.3.0)<br />
by 0x430D3A7: XPutImage (in /usr/lib/libX11.so.6.3.0)<br />
by 0x938107E: ImplSalDDB::ImplSalDDB(_XImage*, unsigned long, int, SalTwoRect const&) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x9382E77: X11SalBitmap::ImplGetDDB(unsigned long, int, long, SalTwoRect const&) const (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x9382F52: X11SalBitmap::ImplDraw(unsigned long, int, long, SalTwoRect const&, _XGC* const&) const (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x937DC2A: X11SalGraphics::drawMaskedBitmap(SalTwoRect const*, SalBitmap const&, SalBitmap const&) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x937DF70: X11SalGraphics::drawBitmap(SalTwoRect const*, SalBitmap const&, SalBitmap const&) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x5BAE9FB: SalGraphics::DrawBitmap(SalTwoRect const*, SalBitmap const&, SalBitmap const&, OutputDevice const*) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclli.so)<br />
by 0x5B92D9C: OutputDevice::ImplDrawBitmapEx(Point const&, Size const&, Point const&, Size const&, BitmapEx const&, unsigned long) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclli.so)<br />
by 0x5B9320D: OutputDevice::DrawBitmapEx(Point const&, Size const&, BitmapEx const&) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclli.so)<br />
</pre><br />
might be a false positive, [http://code.google.com/p/microblog-purple/source/browse/branches/0.3/valgrind-suppressions?r=353#27] specifies a suppression block for the head of that stack,<br />
<pre><br />
{<br />
X oddness 3<br />
Memcheck:Cond<br />
fun:XcursorImageHash<br />
fun:XcursorNoticePutBitmap<br />
fun:_XNoticePutBitmap<br />
fun:XPutImage<br />
}<br />
</pre><br />
<br />
== more information ==<br />
<br />
There's also some Writer document about Valgrind: http://tools.openoffice.org/debugging/usingvalgrind.sxw<br />
<br />
TODO: move (!) its content here, not just copy but also remove there, so we don't end up with a fork.<br />
<br />
TODO: '''Run recent version''' <br/><br />
Someone should run the latest version o OO.o, as Valgrind 3.3.0 re-introduces Hellgrind which helps e.g. to hunt down deadlocks. See [http://www.valgrind.org/docs/manual/dist.news.html] for more.<br />
<br />
== Callgrind Profiling How-To ==<br />
<br />
There's a [[Callgrind| Callgrind How-To]].<br />
<br />
<br />
[[Category:Developer Tools]]</div>Sbhttps://wiki.openoffice.org/wiki/ValgrindValgrind2011-02-22T08:49:22Z<p>Sb: /* Definite False Positives */</p>
<hr />
<div>'''[http://valgrind.org/ Valgrind]''' is an instrumentation framework for dynamic analysis tools. It can be used to detect memory management and threading bugs and profile programs. It runs on Linux x86 and AMD64, PPC32 and PPC64 are fairly complete.<br />
<br />
== disabling the custom allocator ==<br />
<br />
If you use ooo-build; export OOO_FORCE_SYSALLOC=1 before running, (this is built into [[linkoo]]'s ooenv script).<br />
<br />
If you use a Vanilla build, and your shell is setup for building ooo, use the following wrapper script around valgrind:<br />
<pre><br />
#!/bin/sh<br />
<br />
# instrument soffice with a malloc-based memory allocator.<br />
# Requires libsalalloc_malloc.so to be in the LD_LIBRARY_PATH.<br />
# Forwards all command line arguments to valgrind.<br />
<br />
export LD_PRELOAD=libsalalloc_malloc.so<br />
valgrind $@ <br />
</pre><br />
<br />
which preloads a small interceptor lib, which redirects all allocator calls to malloc.<br />
<br />
== disabling glib's custom allocator ==<br />
<br />
If you want to also track down problems with glib allocated objects, e.g. resource leaks in gconfbe then you need to disable glib's custom allocation as well, e.g. <br />
<br />
<pre><br />
G_SLICE=always-malloc valgrind ...<br />
</pre><br />
<br />
== Errors Found ==<br />
<br />
=== Definite Errors ===<br />
<br />
Open as of <code>DEV300_m99</code>:<br />
<br />
* {{issue|114718}} &ldquo;forms/qa/unoapi: crash in remote async release call&rdquo;<br />
* {{issue|116785}} &ldquo;framework::[Module]ImageManager kept alive by ring ref&rdquo;<br />
* {{issue|116786}} &ldquo;framework::ToolBarLayoutManger::m_p{AddonOptions,GlobalSettings} leak&rdquo;<br />
* {{issue|116850}} &ldquo;SvLBox::OnCurrentEntryChanged: Conditional jump or move depends on uninitialised value(s)&rdquo;<br />
* {{issue|116885}} &ldquo;utl::TextSearch::CachedTextSearch::~CachedTextSearch called too late&rdquo;<br />
* {{issue|116891}} &ldquo;framework::AddonMenuManager::BuildMenu leaks MenuConfiguration::Attributes&rdquo;<br />
* {{issue|116910}} &ldquo;desktop::Acceptor leaks Thread_Impl&rdquo;<br />
* {{issue|116915}} &ldquo;osl_getSystemPathFromFileURL leaks rtl_uStrings&rdquo;<br />
* {{issue|116981}} &ldquo;rtl/source/bootstrap.cxx does not clean up memory&rdquo;<br />
<br />
=== Definite False Positives ===<br />
<br />
Open as of <code>DEV300_m99</code>:<br />
<br />
* {{issue|116872}} &ldquo;drawinglayer: BPixelRasterToBitmapEx causes false valgrind positive in rtl_crc32&rdquo;<br />
<br />
* On <code>unxlngx6</code>, executing <code>DEV300_m100</code> <code>sfx2/qa/complex</code>, a 14 byte <code>com.sun.star.util.DateTime</code> struct (consisting of seven <code>unsigned short</code> members) is filled with two 64 bit writes.<br />
<pre><br />
Invalid write of size 8<br />
at 0x1558BBAC: x86_64::fill_struct(_typelib_TypeDescriptionReference*, unsigned long const*, double const*, void*) (in /opt/openoffice.org/ure/lib/libgcc3_uno.so)<br />
by 0x15591965: callVirtualMethod(void*, unsigned int, void*, _typelib_TypeDescriptionReference*, bool, unsigned long*, unsigned int, unsigned long*, unsigned int, double*, unsigned int) (in /opt/openoffice.org/ure/lib/libgcc3_uno.so)<br />
by 0x1559240D: cpp_call(bridges::cpp_uno::shared::UnoInterfaceProxy*, bridges::cpp_uno::shared::VtableSlot, _typelib_TypeDescriptionReference*, int, _typelib_MethodParameter*, void*, void**, _uno_Any**) (in /opt/openoffice.org/ure/lib/libgcc3_uno.so)<br />
by 0x15592B8A: bridges::cpp_uno::shared::unoInterfaceProxyDispatch(_uno_Interface*, _typelib_TypeDescription const*, void*, void**, _uno_Any**) (in /opt/openoffice.org/ure/lib/libgcc3_uno.so)<br />
by 0x1A15C688: binaryurp::IncomingRequest::execute_throw(binaryurp::BinaryAny*, std::vector<binaryurp::BinaryAny, std::allocator<binaryurp::BinaryAny> >*) const (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A15CC45: binaryurp::IncomingRequest::execute() const (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A16B09A: request (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x70057CA: cppu_threadpool::JobQueue::enter(long, unsigned char) (in /opt/openoffice.org/ure/lib/libuno_cppu.so.3)<br />
by 0x70062C2: cppu_threadpool::ORequestThread::run() (in /opt/openoffice.org/ure/lib/libuno_cppu.so.3)<br />
by 0x70065F2: cppu_requestThreadWorker (in /opt/openoffice.org/ure/lib/libuno_cppu.so.3)<br />
by 0x4E5F72E: osl_thread_start_Impl (in /opt/openoffice.org/ure/lib/libuno_sal.so.3)<br />
by 0x67679C9: start_thread (pthread_create.c:300)<br />
Address 0xeb32480 is 16 bytes inside a block of size 22 alloc'd<br />
at 0x4C274A8: malloc (vg_replace_malloc.c:236)<br />
by 0x4E9A7CC: rtl_allocateMemory (in /opt/openoffice.org/ure/lib/libuno_sal.so.3)<br />
by 0x4013EE: allocate(unsigned long, (anonymous namespace)::AllocatorTraits const&) (in /opt/openoffice.org3/program/soffice.bin)<br />
by 0x4014C5: operator new(unsigned long) (in /opt/openoffice.org3/program/soffice.bin)<br />
by 0x1A15E77E: __gnu_cxx::new_allocator<char>::allocate(unsigned long, void const*) (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A15E7A6: std::_Vector_base<char, std::allocator<char> >::_M_allocate(unsigned long) (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A15E7D8: std::_Vector_base<char, std::allocator<char> >::_Vector_base(unsigned long, std::allocator<char> const&) (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A15F686: std::vector<char, std::allocator<char> >::vector(unsigned long, char const&, std::allocator<char> const&) (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A15C57A: binaryurp::IncomingRequest::execute_throw(binaryurp::BinaryAny*, std::vector<binaryurp::BinaryAny, std::allocator<binaryurp::BinaryAny> >*) const (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A15CC45: binaryurp::IncomingRequest::execute() const (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x1A16B09A: request (in /opt/openoffice.org/ure/lib/binaryurp.uno.so)<br />
by 0x70057CA: cppu_threadpool::JobQueue::enter(long, unsigned char) (in /opt/openoffice.org/ure/lib/libuno_cppu.so.3)<br />
</pre><br />
<br />
=== Potentially False Positives ===<br />
<br />
<pre><br />
Conditional jump or move depends on uninitialised value(s)<br />
at 0x9440A18: XcursorImageHash (in /usr/lib/libXcursor.so.1.0.2)<br />
by 0x9440ED7: XcursorNoticePutBitmap (in /usr/lib/libXcursor.so.1.0.2)<br />
by 0x42F5EF8: _XNoticePutBitmap (in /usr/lib/libX11.so.6.3.0)<br />
by 0x430D3A7: XPutImage (in /usr/lib/libX11.so.6.3.0)<br />
by 0x938107E: ImplSalDDB::ImplSalDDB(_XImage*, unsigned long, int, SalTwoRect const&) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x9382E77: X11SalBitmap::ImplGetDDB(unsigned long, int, long, SalTwoRect const&) const (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x9382F52: X11SalBitmap::ImplDraw(unsigned long, int, long, SalTwoRect const&, _XGC* const&) const (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x937DC2A: X11SalGraphics::drawMaskedBitmap(SalTwoRect const*, SalBitmap const&, SalBitmap const&) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x937DF70: X11SalGraphics::drawBitmap(SalTwoRect const*, SalBitmap const&, SalBitmap const&) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x5BAE9FB: SalGraphics::DrawBitmap(SalTwoRect const*, SalBitmap const&, SalBitmap const&, OutputDevice const*) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclli.so)<br />
by 0x5B92D9C: OutputDevice::ImplDrawBitmapEx(Point const&, Size const&, Point const&, Size const&, BitmapEx const&, unsigned long) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclli.so)<br />
by 0x5B9320D: OutputDevice::DrawBitmapEx(Point const&, Size const&, BitmapEx const&) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclli.so)<br />
</pre><br />
might be a false positive, [http://code.google.com/p/microblog-purple/source/browse/branches/0.3/valgrind-suppressions?r=353#27] specifies a suppression block for the head of that stack,<br />
<pre><br />
{<br />
X oddness 3<br />
Memcheck:Cond<br />
fun:XcursorImageHash<br />
fun:XcursorNoticePutBitmap<br />
fun:_XNoticePutBitmap<br />
fun:XPutImage<br />
}<br />
</pre><br />
<br />
== more information ==<br />
<br />
There's also some Writer document about Valgrind: http://tools.openoffice.org/debugging/usingvalgrind.sxw<br />
<br />
TODO: move (!) its content here, not just copy but also remove there, so we don't end up with a fork.<br />
<br />
TODO: '''Run recent version''' <br/><br />
Someone should run the latest version o OO.o, as Valgrind 3.3.0 re-introduces Hellgrind which helps e.g. to hunt down deadlocks. See [http://www.valgrind.org/docs/manual/dist.news.html] for more.<br />
<br />
== Callgrind Profiling How-To ==<br />
<br />
There's a [[Callgrind| Callgrind How-To]].<br />
<br />
<br />
[[Category:Developer Tools]]</div>Sbhttps://wiki.openoffice.org/wiki/ValgrindValgrind2011-02-16T10:03:45Z<p>Sb: /* Definite Errors */</p>
<hr />
<div>'''[http://valgrind.org/ Valgrind]''' is an instrumentation framework for dynamic analysis tools. It can be used to detect memory management and threading bugs and profile programs. It runs on Linux x86 and AMD64, PPC32 and PPC64 are fairly complete.<br />
<br />
== disabling the custom allocator ==<br />
<br />
If you use ooo-build; export OOO_FORCE_SYSALLOC=1 before running, (this is built into [[linkoo]]'s ooenv script).<br />
<br />
If you use a Vanilla build, and your shell is setup for building ooo, use the following wrapper script around valgrind:<br />
<pre><br />
#!/bin/sh<br />
<br />
# instrument soffice with a malloc-based memory allocator.<br />
# Requires libsalalloc_malloc.so to be in the LD_LIBRARY_PATH.<br />
# Forwards all command line arguments to valgrind.<br />
<br />
export LD_PRELOAD=libsalalloc_malloc.so<br />
valgrind $@ <br />
</pre><br />
<br />
which preloads a small interceptor lib, which redirects all allocator calls to malloc.<br />
<br />
== disabling glib's custom allocator ==<br />
<br />
If you want to also track down problems with glib allocated objects, e.g. resource leaks in gconfbe then you need to disable glib's custom allocation as well, e.g. <br />
<br />
<pre><br />
G_SLICE=always-malloc valgrind ...<br />
</pre><br />
<br />
== Errors Found ==<br />
<br />
=== Definite Errors ===<br />
<br />
Open as of <code>DEV300_m99</code>:<br />
<br />
* {{issue|114718}} &ldquo;forms/qa/unoapi: crash in remote async release call&rdquo;<br />
* {{issue|116785}} &ldquo;framework::[Module]ImageManager kept alive by ring ref&rdquo;<br />
* {{issue|116786}} &ldquo;framework::ToolBarLayoutManger::m_p{AddonOptions,GlobalSettings} leak&rdquo;<br />
* {{issue|116850}} &ldquo;SvLBox::OnCurrentEntryChanged: Conditional jump or move depends on uninitialised value(s)&rdquo;<br />
* {{issue|116885}} &ldquo;utl::TextSearch::CachedTextSearch::~CachedTextSearch called too late&rdquo;<br />
* {{issue|116891}} &ldquo;framework::AddonMenuManager::BuildMenu leaks MenuConfiguration::Attributes&rdquo;<br />
* {{issue|116910}} &ldquo;desktop::Acceptor leaks Thread_Impl&rdquo;<br />
* {{issue|116915}} &ldquo;osl_getSystemPathFromFileURL leaks rtl_uStrings&rdquo;<br />
* {{issue|116981}} &ldquo;rtl/source/bootstrap.cxx does not clean up memory&rdquo;<br />
<br />
=== Definite False Positives ===<br />
<br />
Open as of <code>DEV300_m99</code>:<br />
<br />
* {{issue|116872}} &ldquo;drawinglayer: BPixelRasterToBitmapEx causes false valgrind positive in rtl_crc32&rdquo;<br />
<br />
=== Potentially False Positives ===<br />
<br />
<pre><br />
Conditional jump or move depends on uninitialised value(s)<br />
at 0x9440A18: XcursorImageHash (in /usr/lib/libXcursor.so.1.0.2)<br />
by 0x9440ED7: XcursorNoticePutBitmap (in /usr/lib/libXcursor.so.1.0.2)<br />
by 0x42F5EF8: _XNoticePutBitmap (in /usr/lib/libX11.so.6.3.0)<br />
by 0x430D3A7: XPutImage (in /usr/lib/libX11.so.6.3.0)<br />
by 0x938107E: ImplSalDDB::ImplSalDDB(_XImage*, unsigned long, int, SalTwoRect const&) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x9382E77: X11SalBitmap::ImplGetDDB(unsigned long, int, long, SalTwoRect const&) const (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x9382F52: X11SalBitmap::ImplDraw(unsigned long, int, long, SalTwoRect const&, _XGC* const&) const (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x937DC2A: X11SalGraphics::drawMaskedBitmap(SalTwoRect const*, SalBitmap const&, SalBitmap const&) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x937DF70: X11SalGraphics::drawBitmap(SalTwoRect const*, SalBitmap const&, SalBitmap const&) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x5BAE9FB: SalGraphics::DrawBitmap(SalTwoRect const*, SalBitmap const&, SalBitmap const&, OutputDevice const*) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclli.so)<br />
by 0x5B92D9C: OutputDevice::ImplDrawBitmapEx(Point const&, Size const&, Point const&, Size const&, BitmapEx const&, unsigned long) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclli.so)<br />
by 0x5B9320D: OutputDevice::DrawBitmapEx(Point const&, Size const&, BitmapEx const&) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclli.so)<br />
</pre><br />
might be a false positive, [http://code.google.com/p/microblog-purple/source/browse/branches/0.3/valgrind-suppressions?r=353#27] specifies a suppression block for the head of that stack,<br />
<pre><br />
{<br />
X oddness 3<br />
Memcheck:Cond<br />
fun:XcursorImageHash<br />
fun:XcursorNoticePutBitmap<br />
fun:_XNoticePutBitmap<br />
fun:XPutImage<br />
}<br />
</pre><br />
<br />
== more information ==<br />
<br />
There's also some Writer document about Valgrind: http://tools.openoffice.org/debugging/usingvalgrind.sxw<br />
<br />
TODO: move (!) its content here, not just copy but also remove there, so we don't end up with a fork.<br />
<br />
TODO: '''Run recent version''' <br/><br />
Someone should run the latest version o OO.o, as Valgrind 3.3.0 re-introduces Hellgrind which helps e.g. to hunt down deadlocks. See [http://www.valgrind.org/docs/manual/dist.news.html] for more.<br />
<br />
== Callgrind Profiling How-To ==<br />
<br />
There's a [[Callgrind| Callgrind How-To]].<br />
<br />
<br />
[[Category:Developer Tools]]</div>Sbhttps://wiki.openoffice.org/wiki/Talk:OOoRelease34Talk:OOoRelease342011-02-16T09:35:02Z<p>Sb: Created page with 'Confused. Both "February, 14th 2011" and "March, 7th 2011" are "Branch Off" date. Also, should "no more feature cws will be integrated until that date" (i.e., March 7) read "no…'</p>
<hr />
<div>Confused. Both "February, 14th 2011" and "March, 7th 2011" are "Branch Off" date. Also, should "no more feature cws will be integrated until that date" (i.e., March 7) read "no more feature cws will be integrated after that date" instead? [[User:Sb|Sb]] 09:35, 16 February 2011 (UTC)</div>Sbhttps://wiki.openoffice.org/wiki/ValgrindValgrind2011-02-10T16:18:16Z<p>Sb: /* Definite Errors */</p>
<hr />
<div>'''[http://valgrind.org/ Valgrind]''' is an instrumentation framework for dynamic analysis tools. It can be used to detect memory management and threading bugs and profile programs. It runs on Linux x86 and AMD64, PPC32 and PPC64 are fairly complete.<br />
<br />
== disabling the custom allocator ==<br />
<br />
If you use ooo-build; export OOO_FORCE_SYSALLOC=1 before running, (this is built into [[linkoo]]'s ooenv script).<br />
<br />
If you use a Vanilla build, and your shell is setup for building ooo, use the following wrapper script around valgrind:<br />
<pre><br />
#!/bin/sh<br />
<br />
# instrument soffice with a malloc-based memory allocator.<br />
# Requires libsalalloc_malloc.so to be in the LD_LIBRARY_PATH.<br />
# Forwards all command line arguments to valgrind.<br />
<br />
export LD_PRELOAD=libsalalloc_malloc.so<br />
valgrind $@ <br />
</pre><br />
<br />
which preloads a small interceptor lib, which redirects all allocator calls to malloc.<br />
<br />
== disabling glib's custom allocator ==<br />
<br />
If you want to also track down problems with glib allocated objects, e.g. resource leaks in gconfbe then you need to disable glib's custom allocation as well, e.g. <br />
<br />
<pre><br />
G_SLICE=always-malloc valgrind ...<br />
</pre><br />
<br />
== Errors Found ==<br />
<br />
=== Definite Errors ===<br />
<br />
Open as of <code>DEV300_m99</code>:<br />
<br />
* {{issue|114718}} &ldquo;forms/qa/unoapi: crash in remote async release call&rdquo;<br />
* {{issue|116785}} &ldquo;framework::[Module]ImageManager kept alive by ring ref&rdquo;<br />
* {{issue|116786}} &ldquo;framework::ToolBarLayoutManger::m_p{AddonOptions,GlobalSettings} leak&rdquo;<br />
* {{issue|116850}} &ldquo;SvLBox::OnCurrentEntryChanged: Conditional jump or move depends on uninitialised value(s)&rdquo;<br />
* {{issue|116885}} &ldquo;utl::TextSearch::CachedTextSearch::~CachedTextSearch called too late&rdquo;<br />
* {{issue|116891}} &ldquo;framework::AddonMenuManager::BuildMenu leaks MenuConfiguration::Attributes&rdquo;<br />
* {{issue|116910}} &ldquo;desktop::Acceptor leaks Thread_Impl&rdquo;<br />
* {{issue|116915}} &ldquo;osl_getSystemPathFromFileURL leaks rtl_uStrings&rdquo;<br />
<br />
=== Definite False Positives ===<br />
<br />
Open as of <code>DEV300_m99</code>:<br />
<br />
* {{issue|116872}} &ldquo;drawinglayer: BPixelRasterToBitmapEx causes false valgrind positive in rtl_crc32&rdquo;<br />
<br />
=== Potentially False Positives ===<br />
<br />
<pre><br />
Conditional jump or move depends on uninitialised value(s)<br />
at 0x9440A18: XcursorImageHash (in /usr/lib/libXcursor.so.1.0.2)<br />
by 0x9440ED7: XcursorNoticePutBitmap (in /usr/lib/libXcursor.so.1.0.2)<br />
by 0x42F5EF8: _XNoticePutBitmap (in /usr/lib/libX11.so.6.3.0)<br />
by 0x430D3A7: XPutImage (in /usr/lib/libX11.so.6.3.0)<br />
by 0x938107E: ImplSalDDB::ImplSalDDB(_XImage*, unsigned long, int, SalTwoRect const&) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x9382E77: X11SalBitmap::ImplGetDDB(unsigned long, int, long, SalTwoRect const&) const (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x9382F52: X11SalBitmap::ImplDraw(unsigned long, int, long, SalTwoRect const&, _XGC* const&) const (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x937DC2A: X11SalGraphics::drawMaskedBitmap(SalTwoRect const*, SalBitmap const&, SalBitmap const&) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x937DF70: X11SalGraphics::drawBitmap(SalTwoRect const*, SalBitmap const&, SalBitmap const&) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x5BAE9FB: SalGraphics::DrawBitmap(SalTwoRect const*, SalBitmap const&, SalBitmap const&, OutputDevice const*) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclli.so)<br />
by 0x5B92D9C: OutputDevice::ImplDrawBitmapEx(Point const&, Size const&, Point const&, Size const&, BitmapEx const&, unsigned long) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclli.so)<br />
by 0x5B9320D: OutputDevice::DrawBitmapEx(Point const&, Size const&, BitmapEx const&) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclli.so)<br />
</pre><br />
might be a false positive, [http://code.google.com/p/microblog-purple/source/browse/branches/0.3/valgrind-suppressions?r=353#27] specifies a suppression block for the head of that stack,<br />
<pre><br />
{<br />
X oddness 3<br />
Memcheck:Cond<br />
fun:XcursorImageHash<br />
fun:XcursorNoticePutBitmap<br />
fun:_XNoticePutBitmap<br />
fun:XPutImage<br />
}<br />
</pre><br />
<br />
== more information ==<br />
<br />
There's also some Writer document about Valgrind: http://tools.openoffice.org/debugging/usingvalgrind.sxw<br />
<br />
TODO: move (!) its content here, not just copy but also remove there, so we don't end up with a fork.<br />
<br />
TODO: '''Run recent version''' <br/><br />
Someone should run the latest version o OO.o, as Valgrind 3.3.0 re-introduces Hellgrind which helps e.g. to hunt down deadlocks. See [http://www.valgrind.org/docs/manual/dist.news.html] for more.<br />
<br />
== Callgrind Profiling How-To ==<br />
<br />
There's a [[Callgrind| Callgrind How-To]].<br />
<br />
<br />
[[Category:Developer Tools]]</div>Sbhttps://wiki.openoffice.org/wiki/ValgrindValgrind2011-02-10T14:28:40Z<p>Sb: /* Definite Errors */</p>
<hr />
<div>'''[http://valgrind.org/ Valgrind]''' is an instrumentation framework for dynamic analysis tools. It can be used to detect memory management and threading bugs and profile programs. It runs on Linux x86 and AMD64, PPC32 and PPC64 are fairly complete.<br />
<br />
== disabling the custom allocator ==<br />
<br />
If you use ooo-build; export OOO_FORCE_SYSALLOC=1 before running, (this is built into [[linkoo]]'s ooenv script).<br />
<br />
If you use a Vanilla build, and your shell is setup for building ooo, use the following wrapper script around valgrind:<br />
<pre><br />
#!/bin/sh<br />
<br />
# instrument soffice with a malloc-based memory allocator.<br />
# Requires libsalalloc_malloc.so to be in the LD_LIBRARY_PATH.<br />
# Forwards all command line arguments to valgrind.<br />
<br />
export LD_PRELOAD=libsalalloc_malloc.so<br />
valgrind $@ <br />
</pre><br />
<br />
which preloads a small interceptor lib, which redirects all allocator calls to malloc.<br />
<br />
== disabling glib's custom allocator ==<br />
<br />
If you want to also track down problems with glib allocated objects, e.g. resource leaks in gconfbe then you need to disable glib's custom allocation as well, e.g. <br />
<br />
<pre><br />
G_SLICE=always-malloc valgrind ...<br />
</pre><br />
<br />
== Errors Found ==<br />
<br />
=== Definite Errors ===<br />
<br />
Open as of <code>DEV300_m99</code>:<br />
<br />
* {{issue|114718}} &ldquo;forms/qa/unoapi: crash in remote async release call&rdquo;<br />
* {{issue|116785}} &ldquo;framework::[Module]ImageManager kept alive by ring ref&rdquo;<br />
* {{issue|116786}} &ldquo;framework::ToolBarLayoutManger::m_p{AddonOptions,GlobalSettings} leak&rdquo;<br />
* {{issue|116850}} &ldquo;SvLBox::OnCurrentEntryChanged: Conditional jump or move depends on uninitialised value(s)&rdquo;<br />
* {{issue|116885}} &ldquo;utl::TextSearch::CachedTextSearch::~CachedTextSearch called too late&rdquo;<br />
* {{issue|116891}} &ldquo;framework::AddonMenuManager::BuildMenu leaks MenuConfiguration::Attributes&rdquo;<br />
* {{issue|116910}} &ldquo;desktop::Acceptor leaks Thread_Impl&rdquo;<br />
<br />
=== Definite False Positives ===<br />
<br />
Open as of <code>DEV300_m99</code>:<br />
<br />
* {{issue|116872}} &ldquo;drawinglayer: BPixelRasterToBitmapEx causes false valgrind positive in rtl_crc32&rdquo;<br />
<br />
=== Potentially False Positives ===<br />
<br />
<pre><br />
Conditional jump or move depends on uninitialised value(s)<br />
at 0x9440A18: XcursorImageHash (in /usr/lib/libXcursor.so.1.0.2)<br />
by 0x9440ED7: XcursorNoticePutBitmap (in /usr/lib/libXcursor.so.1.0.2)<br />
by 0x42F5EF8: _XNoticePutBitmap (in /usr/lib/libX11.so.6.3.0)<br />
by 0x430D3A7: XPutImage (in /usr/lib/libX11.so.6.3.0)<br />
by 0x938107E: ImplSalDDB::ImplSalDDB(_XImage*, unsigned long, int, SalTwoRect const&) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x9382E77: X11SalBitmap::ImplGetDDB(unsigned long, int, long, SalTwoRect const&) const (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x9382F52: X11SalBitmap::ImplDraw(unsigned long, int, long, SalTwoRect const&, _XGC* const&) const (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x937DC2A: X11SalGraphics::drawMaskedBitmap(SalTwoRect const*, SalBitmap const&, SalBitmap const&) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x937DF70: X11SalGraphics::drawBitmap(SalTwoRect const*, SalBitmap const&, SalBitmap const&) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x5BAE9FB: SalGraphics::DrawBitmap(SalTwoRect const*, SalBitmap const&, SalBitmap const&, OutputDevice const*) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclli.so)<br />
by 0x5B92D9C: OutputDevice::ImplDrawBitmapEx(Point const&, Size const&, Point const&, Size const&, BitmapEx const&, unsigned long) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclli.so)<br />
by 0x5B9320D: OutputDevice::DrawBitmapEx(Point const&, Size const&, BitmapEx const&) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclli.so)<br />
</pre><br />
might be a false positive, [http://code.google.com/p/microblog-purple/source/browse/branches/0.3/valgrind-suppressions?r=353#27] specifies a suppression block for the head of that stack,<br />
<pre><br />
{<br />
X oddness 3<br />
Memcheck:Cond<br />
fun:XcursorImageHash<br />
fun:XcursorNoticePutBitmap<br />
fun:_XNoticePutBitmap<br />
fun:XPutImage<br />
}<br />
</pre><br />
<br />
== more information ==<br />
<br />
There's also some Writer document about Valgrind: http://tools.openoffice.org/debugging/usingvalgrind.sxw<br />
<br />
TODO: move (!) its content here, not just copy but also remove there, so we don't end up with a fork.<br />
<br />
TODO: '''Run recent version''' <br/><br />
Someone should run the latest version o OO.o, as Valgrind 3.3.0 re-introduces Hellgrind which helps e.g. to hunt down deadlocks. See [http://www.valgrind.org/docs/manual/dist.news.html] for more.<br />
<br />
== Callgrind Profiling How-To ==<br />
<br />
There's a [[Callgrind| Callgrind How-To]].<br />
<br />
<br />
[[Category:Developer Tools]]</div>Sbhttps://wiki.openoffice.org/wiki/ValgrindValgrind2011-02-09T14:47:31Z<p>Sb: uo</p>
<hr />
<div>'''[http://valgrind.org/ Valgrind]''' is an instrumentation framework for dynamic analysis tools. It can be used to detect memory management and threading bugs and profile programs. It runs on Linux x86 and AMD64, PPC32 and PPC64 are fairly complete.<br />
<br />
== disabling the custom allocator ==<br />
<br />
If you use ooo-build; export OOO_FORCE_SYSALLOC=1 before running, (this is built into [[linkoo]]'s ooenv script).<br />
<br />
If you use a Vanilla build, and your shell is setup for building ooo, use the following wrapper script around valgrind:<br />
<pre><br />
#!/bin/sh<br />
<br />
# instrument soffice with a malloc-based memory allocator.<br />
# Requires libsalalloc_malloc.so to be in the LD_LIBRARY_PATH.<br />
# Forwards all command line arguments to valgrind.<br />
<br />
export LD_PRELOAD=libsalalloc_malloc.so<br />
valgrind $@ <br />
</pre><br />
<br />
which preloads a small interceptor lib, which redirects all allocator calls to malloc.<br />
<br />
== disabling glib's custom allocator ==<br />
<br />
If you want to also track down problems with glib allocated objects, e.g. resource leaks in gconfbe then you need to disable glib's custom allocation as well, e.g. <br />
<br />
<pre><br />
G_SLICE=always-malloc valgrind ...<br />
</pre><br />
<br />
== Errors Found ==<br />
<br />
=== Definite Errors ===<br />
<br />
Open as of <code>DEV300_m99</code>:<br />
<br />
* {{issue|114718}} &ldquo;forms/qa/unoapi: crash in remote async release call&rdquo;<br />
* {{issue|116785}} &ldquo;framework::[Module]ImageManager kept alive by ring ref&rdquo;<br />
* {{issue|116786}} &ldquo;framework::ToolBarLayoutManger::m_p{AddonOptions,GlobalSettings} leak&rdquo;<br />
* {{issue|116850}} &ldquo;SvLBox::OnCurrentEntryChanged: Conditional jump or move depends on uninitialised value(s)&rdquo;<br />
* {{issue|116885}} &ldquo;utl::TextSearch::CachedTextSearch::~CachedTextSearch called too late&rdquo;<br />
* {{issue|116891}} &ldquo;framework::AddonMenuManager::BuildMenu leaks MenuConfiguration::Attributes&rdquo;<br />
<br />
=== Definite False Positives ===<br />
<br />
Open as of <code>DEV300_m99</code>:<br />
<br />
* {{issue|116872}} &ldquo;drawinglayer: BPixelRasterToBitmapEx causes false valgrind positive in rtl_crc32&rdquo;<br />
<br />
=== Potentially False Positives ===<br />
<br />
<pre><br />
Conditional jump or move depends on uninitialised value(s)<br />
at 0x9440A18: XcursorImageHash (in /usr/lib/libXcursor.so.1.0.2)<br />
by 0x9440ED7: XcursorNoticePutBitmap (in /usr/lib/libXcursor.so.1.0.2)<br />
by 0x42F5EF8: _XNoticePutBitmap (in /usr/lib/libX11.so.6.3.0)<br />
by 0x430D3A7: XPutImage (in /usr/lib/libX11.so.6.3.0)<br />
by 0x938107E: ImplSalDDB::ImplSalDDB(_XImage*, unsigned long, int, SalTwoRect const&) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x9382E77: X11SalBitmap::ImplGetDDB(unsigned long, int, long, SalTwoRect const&) const (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x9382F52: X11SalBitmap::ImplDraw(unsigned long, int, long, SalTwoRect const&, _XGC* const&) const (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x937DC2A: X11SalGraphics::drawMaskedBitmap(SalTwoRect const*, SalBitmap const&, SalBitmap const&) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x937DF70: X11SalGraphics::drawBitmap(SalTwoRect const*, SalBitmap const&, SalBitmap const&) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x5BAE9FB: SalGraphics::DrawBitmap(SalTwoRect const*, SalBitmap const&, SalBitmap const&, OutputDevice const*) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclli.so)<br />
by 0x5B92D9C: OutputDevice::ImplDrawBitmapEx(Point const&, Size const&, Point const&, Size const&, BitmapEx const&, unsigned long) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclli.so)<br />
by 0x5B9320D: OutputDevice::DrawBitmapEx(Point const&, Size const&, BitmapEx const&) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclli.so)<br />
</pre><br />
might be a false positive, [http://code.google.com/p/microblog-purple/source/browse/branches/0.3/valgrind-suppressions?r=353#27] specifies a suppression block for the head of that stack,<br />
<pre><br />
{<br />
X oddness 3<br />
Memcheck:Cond<br />
fun:XcursorImageHash<br />
fun:XcursorNoticePutBitmap<br />
fun:_XNoticePutBitmap<br />
fun:XPutImage<br />
}<br />
</pre><br />
<br />
== more information ==<br />
<br />
There's also some Writer document about Valgrind: http://tools.openoffice.org/debugging/usingvalgrind.sxw<br />
<br />
TODO: move (!) its content here, not just copy but also remove there, so we don't end up with a fork.<br />
<br />
TODO: '''Run recent version''' <br/><br />
Someone should run the latest version o OO.o, as Valgrind 3.3.0 re-introduces Hellgrind which helps e.g. to hunt down deadlocks. See [http://www.valgrind.org/docs/manual/dist.news.html] for more.<br />
<br />
== Callgrind Profiling How-To ==<br />
<br />
There's a [[Callgrind| Callgrind How-To]].<br />
<br />
<br />
[[Category:Developer Tools]]</div>Sbhttps://wiki.openoffice.org/wiki/ValgrindValgrind2011-02-09T10:49:25Z<p>Sb: /* Definite Errors */</p>
<hr />
<div>'''[http://valgrind.org/ Valgrind]''' is an instrumentation framework for dynamic analysis tools. It can be used to detect memory management and threading bugs and profile programs. It runs on Linux x86 and AMD64, PPC32 and PPC64 are fairly complete.<br />
<br />
== disabling the custom allocator ==<br />
<br />
If you use ooo-build; export OOO_FORCE_SYSALLOC=1 before running, (this is built into [[linkoo]]'s ooenv script).<br />
<br />
If you use a Vanilla build, and your shell is setup for building ooo, use the following wrapper script around valgrind:<br />
<pre><br />
#!/bin/sh<br />
<br />
# instrument soffice with a malloc-based memory allocator.<br />
# Requires libsalalloc_malloc.so to be in the LD_LIBRARY_PATH.<br />
# Forwards all command line arguments to valgrind.<br />
<br />
export LD_PRELOAD=libsalalloc_malloc.so<br />
valgrind $@ <br />
</pre><br />
<br />
which preloads a small interceptor lib, which redirects all allocator calls to malloc.<br />
<br />
== disabling glib's custom allocator ==<br />
<br />
If you want to also track down problems with glib allocated objects, e.g. resource leaks in gconfbe then you need to disable glib's custom allocation as well, e.g. <br />
<br />
<pre><br />
G_SLICE=always-malloc valgrind ...<br />
</pre><br />
<br />
== Errors Found ==<br />
<br />
=== Definite Errors ===<br />
<br />
Open as of <code>DEV300_m99</code>:<br />
<br />
* {{issue|114718}} &ldquo;forms/qa/unoapi: crash in remote async release call&rdquo;<br />
* {{issue|116785}} &ldquo;framework::[Module]ImageManager kept alive by ring ref&rdquo;<br />
* {{issue|116786}} &ldquo;framework::ToolBarLayoutManger::m_p{AddonOptions,GlobalSettings} leak&rdquo;<br />
* {{issue|116850}} &ldquo;SvLBox::OnCurrentEntryChanged: Conditional jump or move depends on uninitialised value(s)&rdquo;<br />
* {{issue|116885}} &ldquo;utl::TextSearch::CachedTextSearch::~CachedTextSearch called too late&rdquo;<br />
<br />
=== Definite False Positives ===<br />
<br />
Open as of <code>DEV300_m99</code>:<br />
<br />
* {{issue|116872}} &ldquo;drawinglayer: BPixelRasterToBitmapEx causes false valgrind positive in rtl_crc32&rdquo;<br />
<br />
=== Potentially False Positives ===<br />
<br />
<pre><br />
Conditional jump or move depends on uninitialised value(s)<br />
at 0x9440A18: XcursorImageHash (in /usr/lib/libXcursor.so.1.0.2)<br />
by 0x9440ED7: XcursorNoticePutBitmap (in /usr/lib/libXcursor.so.1.0.2)<br />
by 0x42F5EF8: _XNoticePutBitmap (in /usr/lib/libX11.so.6.3.0)<br />
by 0x430D3A7: XPutImage (in /usr/lib/libX11.so.6.3.0)<br />
by 0x938107E: ImplSalDDB::ImplSalDDB(_XImage*, unsigned long, int, SalTwoRect const&) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x9382E77: X11SalBitmap::ImplGetDDB(unsigned long, int, long, SalTwoRect const&) const (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x9382F52: X11SalBitmap::ImplDraw(unsigned long, int, long, SalTwoRect const&, _XGC* const&) const (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x937DC2A: X11SalGraphics::drawMaskedBitmap(SalTwoRect const*, SalBitmap const&, SalBitmap const&) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x937DF70: X11SalGraphics::drawBitmap(SalTwoRect const*, SalBitmap const&, SalBitmap const&) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x5BAE9FB: SalGraphics::DrawBitmap(SalTwoRect const*, SalBitmap const&, SalBitmap const&, OutputDevice const*) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclli.so)<br />
by 0x5B92D9C: OutputDevice::ImplDrawBitmapEx(Point const&, Size const&, Point const&, Size const&, BitmapEx const&, unsigned long) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclli.so)<br />
by 0x5B9320D: OutputDevice::DrawBitmapEx(Point const&, Size const&, BitmapEx const&) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclli.so)<br />
</pre><br />
might be a false positive, [http://code.google.com/p/microblog-purple/source/browse/branches/0.3/valgrind-suppressions?r=353#27] specifies a suppression block for the head of that stack,<br />
<pre><br />
{<br />
X oddness 3<br />
Memcheck:Cond<br />
fun:XcursorImageHash<br />
fun:XcursorNoticePutBitmap<br />
fun:_XNoticePutBitmap<br />
fun:XPutImage<br />
}<br />
</pre><br />
<br />
== more information ==<br />
<br />
There's also some Writer document about Valgrind: http://tools.openoffice.org/debugging/usingvalgrind.sxw<br />
<br />
TODO: move (!) its content here, not just copy but also remove there, so we don't end up with a fork.<br />
<br />
TODO: '''Run recent version''' <br/><br />
Someone should run the latest version o OO.o, as Valgrind 3.3.0 re-introduces Hellgrind which helps e.g. to hunt down deadlocks. See [http://www.valgrind.org/docs/manual/dist.news.html] for more.<br />
<br />
== Callgrind Profiling How-To ==<br />
<br />
There's a [[Callgrind| Callgrind How-To]].<br />
<br />
<br />
[[Category:Developer Tools]]</div>Sbhttps://wiki.openoffice.org/wiki/ValgrindValgrind2011-02-08T12:06:55Z<p>Sb: /* Errors Found */</p>
<hr />
<div>'''[http://valgrind.org/ Valgrind]''' is an instrumentation framework for dynamic analysis tools. It can be used to detect memory management and threading bugs and profile programs. It runs on Linux x86 and AMD64, PPC32 and PPC64 are fairly complete.<br />
<br />
== disabling the custom allocator ==<br />
<br />
If you use ooo-build; export OOO_FORCE_SYSALLOC=1 before running, (this is built into [[linkoo]]'s ooenv script).<br />
<br />
If you use a Vanilla build, and your shell is setup for building ooo, use the following wrapper script around valgrind:<br />
<pre><br />
#!/bin/sh<br />
<br />
# instrument soffice with a malloc-based memory allocator.<br />
# Requires libsalalloc_malloc.so to be in the LD_LIBRARY_PATH.<br />
# Forwards all command line arguments to valgrind.<br />
<br />
export LD_PRELOAD=libsalalloc_malloc.so<br />
valgrind $@ <br />
</pre><br />
<br />
which preloads a small interceptor lib, which redirects all allocator calls to malloc.<br />
<br />
== disabling glib's custom allocator ==<br />
<br />
If you want to also track down problems with glib allocated objects, e.g. resource leaks in gconfbe then you need to disable glib's custom allocation as well, e.g. <br />
<br />
<pre><br />
G_SLICE=always-malloc valgrind ...<br />
</pre><br />
<br />
== Errors Found ==<br />
<br />
=== Definite Errors ===<br />
<br />
Open as of <code>DEV300_m99</code>:<br />
<br />
* {{issue|114718}} &ldquo;forms/qa/unoapi: crash in remote async release call&rdquo;<br />
* {{issue|116785}} &ldquo;framework::[Module]ImageManager kept alive by ring ref&rdquo;<br />
* {{issue|116786}} &ldquo;framework::ToolBarLayoutManger::m_p{AddonOptions,GlobalSettings} leak&rdquo;<br />
* {{issue|116850}} &ldquo;SvLBox::OnCurrentEntryChanged: Conditional jump or move depends on uninitialised value(s)&rdquo;<br />
<br />
=== Definite False Positives ===<br />
<br />
Open as of <code>DEV300_m99</code>:<br />
<br />
* {{issue|116872}} &ldquo;drawinglayer: BPixelRasterToBitmapEx causes false valgrind positive in rtl_crc32&rdquo;<br />
<br />
=== Potentially False Positives ===<br />
<br />
<pre><br />
Conditional jump or move depends on uninitialised value(s)<br />
at 0x9440A18: XcursorImageHash (in /usr/lib/libXcursor.so.1.0.2)<br />
by 0x9440ED7: XcursorNoticePutBitmap (in /usr/lib/libXcursor.so.1.0.2)<br />
by 0x42F5EF8: _XNoticePutBitmap (in /usr/lib/libX11.so.6.3.0)<br />
by 0x430D3A7: XPutImage (in /usr/lib/libX11.so.6.3.0)<br />
by 0x938107E: ImplSalDDB::ImplSalDDB(_XImage*, unsigned long, int, SalTwoRect const&) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x9382E77: X11SalBitmap::ImplGetDDB(unsigned long, int, long, SalTwoRect const&) const (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x9382F52: X11SalBitmap::ImplDraw(unsigned long, int, long, SalTwoRect const&, _XGC* const&) const (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x937DC2A: X11SalGraphics::drawMaskedBitmap(SalTwoRect const*, SalBitmap const&, SalBitmap const&) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x937DF70: X11SalGraphics::drawBitmap(SalTwoRect const*, SalBitmap const&, SalBitmap const&) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x5BAE9FB: SalGraphics::DrawBitmap(SalTwoRect const*, SalBitmap const&, SalBitmap const&, OutputDevice const*) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclli.so)<br />
by 0x5B92D9C: OutputDevice::ImplDrawBitmapEx(Point const&, Size const&, Point const&, Size const&, BitmapEx const&, unsigned long) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclli.so)<br />
by 0x5B9320D: OutputDevice::DrawBitmapEx(Point const&, Size const&, BitmapEx const&) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclli.so)<br />
</pre><br />
might be a false positive, [http://code.google.com/p/microblog-purple/source/browse/branches/0.3/valgrind-suppressions?r=353#27] specifies a suppression block for the head of that stack,<br />
<pre><br />
{<br />
X oddness 3<br />
Memcheck:Cond<br />
fun:XcursorImageHash<br />
fun:XcursorNoticePutBitmap<br />
fun:_XNoticePutBitmap<br />
fun:XPutImage<br />
}<br />
</pre><br />
<br />
== more information ==<br />
<br />
There's also some Writer document about Valgrind: http://tools.openoffice.org/debugging/usingvalgrind.sxw<br />
<br />
TODO: move (!) its content here, not just copy but also remove there, so we don't end up with a fork.<br />
<br />
TODO: '''Run recent version''' <br/><br />
Someone should run the latest version o OO.o, as Valgrind 3.3.0 re-introduces Hellgrind which helps e.g. to hunt down deadlocks. See [http://www.valgrind.org/docs/manual/dist.news.html] for more.<br />
<br />
== Callgrind Profiling How-To ==<br />
<br />
There's a [[Callgrind| Callgrind How-To]].<br />
<br />
<br />
[[Category:Developer Tools]]</div>Sbhttps://wiki.openoffice.org/wiki/ValgrindValgrind2011-02-07T13:26:04Z<p>Sb: </p>
<hr />
<div>'''[http://valgrind.org/ Valgrind]''' is an instrumentation framework for dynamic analysis tools. It can be used to detect memory management and threading bugs and profile programs. It runs on Linux x86 and AMD64, PPC32 and PPC64 are fairly complete.<br />
<br />
== disabling the custom allocator ==<br />
<br />
If you use ooo-build; export OOO_FORCE_SYSALLOC=1 before running, (this is built into [[linkoo]]'s ooenv script).<br />
<br />
If you use a Vanilla build, and your shell is setup for building ooo, use the following wrapper script around valgrind:<br />
<pre><br />
#!/bin/sh<br />
<br />
# instrument soffice with a malloc-based memory allocator.<br />
# Requires libsalalloc_malloc.so to be in the LD_LIBRARY_PATH.<br />
# Forwards all command line arguments to valgrind.<br />
<br />
export LD_PRELOAD=libsalalloc_malloc.so<br />
valgrind $@ <br />
</pre><br />
<br />
which preloads a small interceptor lib, which redirects all allocator calls to malloc.<br />
<br />
== disabling glib's custom allocator ==<br />
<br />
If you want to also track down problems with glib allocated objects, e.g. resource leaks in gconfbe then you need to disable glib's custom allocation as well, e.g. <br />
<br />
<pre><br />
G_SLICE=always-malloc valgrind ...<br />
</pre><br />
<br />
== Errors Found ==<br />
<br />
=== Definite Errors ===<br />
<br />
Open as of <code>DEV300_m99</code>:<br />
<br />
* {{issue|114718}} &ldquo;forms/qa/unoapi: crash in remote async release call&rdquo;<br />
* {{issue|116785}} &ldquo;framework::[Module]ImageManager kept alive by ring ref&rdquo;<br />
* {{issue|116786}} &ldquo;framework::ToolBarLayoutManger::m_p{AddonOptions,GlobalSettings} leak&rdquo;<br />
* {{issue|116850}} &ldquo;SvLBox::OnCurrentEntryChanged: Conditional jump or move depends on uninitialised value(s)&rdquo;<br />
<br />
=== Potentially False Positives ===<br />
<br />
<pre><br />
Conditional jump or move depends on uninitialised value(s)<br />
at 0x9440A18: XcursorImageHash (in /usr/lib/libXcursor.so.1.0.2)<br />
by 0x9440ED7: XcursorNoticePutBitmap (in /usr/lib/libXcursor.so.1.0.2)<br />
by 0x42F5EF8: _XNoticePutBitmap (in /usr/lib/libX11.so.6.3.0)<br />
by 0x430D3A7: XPutImage (in /usr/lib/libX11.so.6.3.0)<br />
by 0x938107E: ImplSalDDB::ImplSalDDB(_XImage*, unsigned long, int, SalTwoRect const&) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x9382E77: X11SalBitmap::ImplGetDDB(unsigned long, int, long, SalTwoRect const&) const (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x9382F52: X11SalBitmap::ImplDraw(unsigned long, int, long, SalTwoRect const&, _XGC* const&) const (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x937DC2A: X11SalGraphics::drawMaskedBitmap(SalTwoRect const*, SalBitmap const&, SalBitmap const&) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x937DF70: X11SalGraphics::drawBitmap(SalTwoRect const*, SalBitmap const&, SalBitmap const&) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclplug_genli.so)<br />
by 0x5BAE9FB: SalGraphics::DrawBitmap(SalTwoRect const*, SalBitmap const&, SalBitmap const&, OutputDevice const*) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclli.so)<br />
by 0x5B92D9C: OutputDevice::ImplDrawBitmapEx(Point const&, Size const&, Point const&, Size const&, BitmapEx const&, unsigned long) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclli.so)<br />
by 0x5B9320D: OutputDevice::DrawBitmapEx(Point const&, Size const&, BitmapEx const&) (in /cws/sb138_m98/DEV300/unxlngi6/installation/opt/openoffice.org/basis3.4/program/libvclli.so)<br />
</pre><br />
might be a false positive, [http://code.google.com/p/microblog-purple/source/browse/branches/0.3/valgrind-suppressions?r=353#27] specifies a suppression block for the head of that stack,<br />
<pre><br />
{<br />
X oddness 3<br />
Memcheck:Cond<br />
fun:XcursorImageHash<br />
fun:XcursorNoticePutBitmap<br />
fun:_XNoticePutBitmap<br />
fun:XPutImage<br />
}<br />
</pre><br />
<br />
== more information ==<br />
<br />
There's also some Writer document about Valgrind: http://tools.openoffice.org/debugging/usingvalgrind.sxw<br />
<br />
TODO: move (!) its content here, not just copy but also remove there, so we don't end up with a fork.<br />
<br />
TODO: '''Run recent version''' <br/><br />
Someone should run the latest version o OO.o, as Valgrind 3.3.0 re-introduces Hellgrind which helps e.g. to hunt down deadlocks. See [http://www.valgrind.org/docs/manual/dist.news.html] for more.<br />
<br />
== Callgrind Profiling How-To ==<br />
<br />
There's a [[Callgrind| Callgrind How-To]].<br />
<br />
<br />
[[Category:Developer Tools]]</div>Sbhttps://wiki.openoffice.org/wiki/Test_CleanupTest Cleanup2011-02-03T14:45:02Z<p>Sb: /* unoapi Tests */</p>
<hr />
<div>= Test Cleanup Project =<br />
<br />
The demand for automated (unit) testing should be obvious. See the [http://www.openoffice.org/servlets/ReadMsg?list=dev&msgNo=26189 mission statement mail] and [[Media:JustTestingPresentation.odp|slides]] from a [http://fosdem.org/2010/schedule/events/ooo_testing FOSDEM'10 talk] and an [http://www.ooocon.org/index.php/ooocon/2010/paper/view/188 OOoCon&nbsp;2010 presentation] for more information and further links.<br />
<br />
For examples of how to write xUnit based tests in the OOo code base, see [http://hg.services.openoffice.org/DEV300/file/87f4911ea629/basegfx/test <code>basegfx/test/</code>], [http://hg.services.openoffice.org/DEV300/file/87f4911ea629/sal/qa/ByteSequence <code>sal/qa/ByteSequence/</code>], and [http://hg.services.openoffice.org/DEV300/file/87f4911ea629/smoketestoo_native <code>smoketest_native/</code>]. However, the hard part should not be how to write test code, anyway, but how to write ''testable'' code; see [http://misko.hevery.com/2008/11/04/clean-code-talks-unit-testing/ The Clean Code Talks&mdash;Unit Testing].<br />
<br />
When testing C++ code that merely uses UNO types (no services), but uses them in a way that requires UNO to be bootstrapped so that the relevant type information is available (e.g., putting instances of complex UNO types into <code>com::sun::star::uno::Any</code>), one approach is as follows: In the <code>makefile.mk</code>, instead of <code>.INCLUDE: _cppunit.mk</code> use<br />
<source lang="make"><br />
.IF "$(OS)" == "WNT"<br />
my_file = file:///<br />
.ELSE<br />
my_file = file://<br />
.END<br />
<br />
ALLTAR : test<br />
<br />
test .PHONY : $(SHL1TARGETN)<br />
$(CPPUNITTESTER) $(SHL1TARGETN) \<br />
-env:UNO_TYPES=$(my_file)$(SOLARBINDIR)/types.rdb<br />
</source><br />
and in the test code once call <code>cppu::defaultBootstrap_InitialComponentContext()</code>.<br />
<br />
== User Interface ==<br />
<br />
=== CppUnit ===<br />
<br />
For tests in C++, plain CppUnit (at least version 1.12.1) is available. (OOo bundles CppUnit 1.12.1 as an external module; alternatively, you can configure <code>--with-system-cppunit</code>.)<br />
<br />
Implement the test code as a dynamic library, following CppUnit conventions (i.e., using [http://cppunit.sourceforge.net/doc/lastest/group___creating_test_suite.html#ga0 <code>CPPUNIT_TEST_SUITE_REGISTRATION</code>] and [http://cppunit.sourceforge.net/doc/lastest/_test_plug_in_8h.html#a2 <code>CPPUNIT_PLUGIN_IMPLEMENT</code>] macros). The following settings are needed in the <code>makefile.mk</code>:<br />
* <code>ENABLE_EXCEPTIONS = TRUE</code><br />
* <code>CFLAGSCXX += $(CPPUNIT_CFLAGS)</code><br />
* <code>SHL<var>n</var>RPATH = NONE</code><br />
* <code>SHL<var>n</var>STDLIBS += $(CPPUNITLIB)</code><br />
* <code>SHL<var>n</var>VERSIONMAP = <var>version.map</var></code>, where that file must contain the following (see [[#CppUnit_1.12.1|details]] below for improving this):<br />
UDK_3_0_0 {<br />
global:<br />
cppunitTestPlugIn;<br />
local:<br />
*;<br />
};<br />
<br />
To run tests, <code>sal/cppunittester</code> delivers a <code>cppunittester</code> executable that has some advantages over the plain CppUnit <code>DllPlugInTester</code>:<br />
* It uses <code>SAL_IMPLEMENT_MAIN</code> to properly set up the per-process settings required by URE. Test code as well as tested code based on URE will expect this and would fail in a process that is not set up in this way.<br />
* Getting CppUnit to build as an external module within the Windows OOo build is a non-trivial task. The less parts of it that need to be built, the better.<br />
<br />
Something like the following in <code>makefile.mk</code> will execute the tests:<br />
ALLTAR : test<br />
test .PHONY : $(SHL1TARGETN)<br />
$(CPPUNITTESTER) $(SHL1TARGETN)<br />
<br />
<code>$(CPPUNITTESTER)</code> internally uses <code>$(AUGMENT_LIBRARY_PATH_LOCAL)</code> to favor library instances in the local output tree over ones in solver. Alternatively to the above, <code>.INCLUDE: _cppunit.mk</code> calls <code>$(CPPUNITTESTER)</code> on each of <code>$(SHL1TARGETN)</code>, &hellip;, <code>$(SHL10TARGETN)</code> that is defined.<br />
<br />
=== JUnit ===<br />
<br />
For tests in Java, plain JUnit (at least version 4) is available. (OOo requires JUnit as a prerequisite, see [http://junit.org/ junit.org] for downloads; you can configure <code>--with-junit=<var>&hellip;</var></code> if it is not automatically found; alternatively, you can configure <code>--without-junit</code>, disabling JUnit-based tests.)<br />
<br />
=== <code>subsequenttests</code> ===<br />
<br />
Some tests have build and/or run time dependencies on modules further up in the hierarchy, or modules that the rest of the module in question does not have dependencies on (and which are thus not listed in the module's <code>build.lst</code>). The extreme case are tests that need a complete OOo installation as their test environment.<br />
<br />
For such tests, the whole <code>makefile.mk</code> should be wrapped in:<br />
.IF "$(OOO_SUBSEQUENT_TESTS)" == ""<br />
nothing .PHONY :<br />
.ELSE<br />
...<br />
.END<br />
(and the directory included in the module's <code>build.lst</code>).<br />
<br />
The idea is to do a complete OOo build first (<code>cd smoketestoo_native && build --all</code>) and then build and execute those tests either selectively or wholesale.<br />
<br />
Selectively building a specific such test directory can be done with <code>cd <var>&hellip;</var> && OOO_SUBSEQUENT_TESTS=TRUE dmake</code>.<br />
<br />
To build and execute ''all'' these test directories, the tool <code>subsequenttests</code> (in <code>solenv/bin</code>) exists. It scans the <code>build.lst</code> files of all modules for <code>makefile.mk</code>s that mention <code>OOO_SUBSEQUENT_TESTS</code> and simply executes <code>dmake</code> in all those directories, with <code>OOO_SUBSEQUENT_TESTS</code> set. It supports a <code>-P<var>n</var></code> switch to build <var>n</var> directories in parallel.<br />
<br />
=== Helpers ===<br />
<br />
A new module <code>test</code> shall collect reusable code snippets for C++ and Java tests.<br />
<br />
For now, it concentrates on letting a test connect to an OOo instance via remote UNO: A C++ test class can hold a <code>test::OfficeConnection</code> as class member and, in its CppUnit <code>setUp</code> and <code>tearDown</code> functions, call <code>OfficeConnection::setUp</code> and <code>OfficeConnection::tearDown</code>, respectively. Tests obtain access to the OOo instance via <code>OfficeConnection::getFactory</code>. Similarly, a Java test class can use an <code>org.openoffice.test.OfficeConnection</code> instance, offering the same functionality as its C++ counterpart.<br />
<br />
For this to work, three additional steps are necessary:<br />
* First, in <code>instsetoo_native</code>, building an installation set for the <code>openoffice</code> product in the default language (<code>en-US</code>) in any package format now takes care to always also build an archive package format (<code>tar.gz</code> resp. <code>zip</code>) of that product.<br />
* Second, building <code>smoketestoo_native</code> permanently installs that archive into the solver. (Except on Windows, where problems with resulting long pathnames prevent this; there, as a workaround, each test individually unzips the archive to some local temporary directory.) <br />
* Third, a test that requires an OOo instance includes <code>installationtest.mk</code> in its <code>makefile.mk</code>. That file makes sure to call the CppUnit and JUnit test runners with the information necessary for the helper classes to start the correct OOo instance with a fresh <code>UserInstallation</code> and set up an URP pipe connection. The information is tunneled into the test runner executables as UNO bootstrap parameters.<br />
<br />
For debugging purposes, which OOo instance the tests use can manually be overridden, see [http://www.openoffice.org/servlets/ReadMsg?list=interface-announce&msgNo=1285 &ldquo;OOO_TEST_SOFFICE: allow override of tested soffice process&rdquo;].<br />
<br />
=== <code>unoapi</code> Tests ===<br />
<br />
The <code>unoapi</code> tests are redesigned to use the new test framework. They are plain JUnit tests and use the mechanisms described above to connect to running OOo instances. However, due to the large amount of logic encoded in <code>qadevOOo</code>, those JUnit tests for now are only thin wrappers around <code>org.openoffice.Runner.run</code>. This is intended to change over time.<br />
<br />
The <code>cwscheckapi</code> tool to run the <code>unoapi</code> tests has been subsumed by <code>subsequenttests</code>. The latter always runs all tests, while the former had mechanisms to run only tests for modules that had been changed by a CWS. The hope is that the parallel mode of <code>subsequenttests</code> makes it fast enough so that running all tests all of the times becomes feasible.<br />
<br />
Unfortunately, running the <code>unoapi</code> tests is still not stable enough to give useful results. Therefore, running <code>subsequenttests</code> has been disabled in the build bots for now. Making the tests sufficiently stable is ongoing work.<br />
<br />
== Details ==<br />
<br />
Working on {{CWS|sb118}}, {{CWS|sb120}}.<br />
<br />
=== CppUnit 1.12.1 ===<br />
<br />
* Replace existing <code>cppunit</code> and <code>testshl2</code> combo with latest CppUnit 1.12.1.<br />
* OOo <code>configure --with-system-cppunit</code> (for now only if also <code>--with-system-stl</code>!); minimal required version for now arbitrarily 1.12.1.<br />
* '''TODO:''' Upstream <code>PATCH_FILES</code> (<code>windows.patch</code>?!?).<br />
* '''TODO:''' <code>RPATH</code> in generated libraries and executables.<br />
* '''TODO:''' Improve <code>CPPUNIT_PLUGIN_EXPORT</code> and get rid of version maps (GCC exception problems?).<br />
* '''TODO:''' <code>cppunit/makefile.mk</code> <code>MY_LIBS = -lm</code> Solaris hack.<br />
* '''TODO:''' In general OOo build environment, no longer set <code>CFLAGS</code> etc. as environment variables; have package-specific <code>OOO_<var>package</var>_CFLAGS</code> etc. and combine those into <code>CFLAGS</code> etc. where necessary (see <code>OOO_STLPORT_CXXFLAGS</code> etc. in <code>cppunit/makefile.mk</code>).<br />
* '''TODO:''' Why use <code>cppunittester</code> instead of <code>DllPlugInTester</code>? (Remove building/delivering <code>DllPlugInTester</code>.)<br />
* '''TODO:''' Make <code>operator &lt;&lt;(std::basic_ostream &amp;, rtl::OUString const &amp;)</code> from <code>test/oustringstreaminserter.hxx</code> generally available?<br />
* '''TODO:''' Make STLport <code>num_put</code> symbols available on platforms other than Linux (see <code>solenv/bin/addsym.awk</code>), too, so that <code>CPPUNIT_ASSERT_EQUAL</code> actually outputs numeric values.<br />
<br />
=== <code>testshl2</code> ===<br />
<br />
* <code>solenv/inc_cppunit.mk</code>/<code>cppunit.mk</code>: [http://hg.services.openoffice.org/cws/sb118/rev/cf13421c3774 &ldquo;adapted <code>cppunit.mk</code> to <code>cppunittester</code> and no longer require &lsquo;<code>dmake test</code>&rsquo; to run tests&rdquo;].<br />
* '''TODO:''' <code>DEV300_m68</code> introduced <code>TESTSHL2LIB</code> (which I removed again) and uses it in many <code>qa</code> makefiles (that I need to touch someday, anyway).<br />
<br />
=== Unit Tests ===<br />
<br />
* <code>OOO_SUBSEQUENT_TESTS</code> (<code>build.lst</code> lists local dependencies of those directories, so that modifying a module and then calling &ldquo;<code>OOO_SUBSEQUENT_TESTS=x build</code>&rdquo; rebuilds the module and executes the tests).<br />
* '''TODO:''' If Build Environment&nbsp;2.0 would build directly to solver (instead of local output tree/deliver), that would simplify tests that currently need to take care to test local libraries instead of solver ones (see, for example, <code>OOO_TEST_PREFIX</code> in the <code>services.rdb</code> of <code>stoc/test/uriproc/makefile.mk</code>).<br />
{{Documentation/Note|Build Environment&nbsp;2.0 will not build directly to solver, but will make a module depend on the targets in the solver, and these are depending on the targets in the workdir (aka the old "local output tree"). Thus on an usual build in a module building and delivering are not two steps anymore. If tests depend on the target in the solver (which they will do automatically in most use cases, as linking against a library automatically creates a dependency on the library in the solver), they can be sure that the target is up to date in the solver '''and''' in the workdir.<br />
<br />
--[[User:B michaelsen|B michaelsen]] 06:32, 27 August 2010 (UTC)}}<br />
* '''TODO:''' Constructs like &ldquo;<code>-env:UNO_<var>&hellip;</var>=$(my_file)<var>&hellip;</var></code>&rdquo; would fail for problematic characters (spaces!) in paths.<br />
<br />
=== Smoke Test ===<br />
<br />
* Redesign <code>smoketestoo_native</code> to use CppUnit and pre-installed OOo.<br />
* [http://hg.services.openoffice.org/cws/sb118/rev/160b248247a0 &ldquo;changed <code>tools/debug</code> to never fall back from writing to shell to writing to file, and read <code>DBGSV_INIT</code> from <code>rtl::Bootstrap</code>; the latter causes problems if <code>tools/debug</code> is called from static code executing before <code>SAL_MAIN</code> has called <code>osl_setCommandArgs</code> &rarr; removed statics from code and added assertions to <code>osl/process</code>; various improvements to <code>smoketests.cxx</code> (incl. passing an appropriate <code>dbgsv.ini</code> for non-pro builds)&rdquo;] followed by [http://hg.services.openoffice.org/cws/sb118/rev/dbbacb9d2fd3 &ldquo;reverted parts of HG <code>-c&nbsp;160b248247a0</code> again: the &lsquo;static code executing before <code>SAL_MAIN</code>&rsquo; problem was too severe; instead, globally set <code>DBGSV_INIT</code> build env var to new <code>solenv/bin/dbgsv.ini</code>&rdquo;]; see also {{issue|109142}} &ldquo;Let assertions abort&rdquo;.<br />
* '''TODO:''' For <code>smoketestoo_native/makefile.mk</code> &ldquo;<code><nowiki>-env:arg-env=$(OOO_LIBRARY_PATH_VAR)"$${{$(OOO_LIBRARY_PATH_VAR)+=$$$(OOO_LIBRARY_PATH_VAR)}}"</nowiki></code>&rdquo; mechanism: <code>osl_executeProcess</code> <code>ustrEnvironments</code> members without &ldquo;<code>=</code>&rdquo;: all platforms; documentation; documentation of <code>osl_executeProcess_WithRedicrectedIO</code>.<br />
* '''TODO:''' <code>-headless</code>? (appears to still display windows on Windows and Mac OS&nbsp;X, however, see {{issue|109052}})<br />
* '''TODO:''' {{issue|113341}} &ldquo;-nofirststartwizard should disable update check&rdquo;<br />
<br />
=== Pre-Installed OOo ===<br />
<br />
* For Sun Hamburg Release Engineering, take MWS archive installation sets from &ldquo;S:&rdquo; instead of solver: [http://hg.services.openoffice.org/cws/sb118/rev/d5dbea724063 &ldquo;take installation set from <code>SHIPDRIVE</code> if appropriate&rdquo;].<br />
* '''TODO:''' <code>PKGFORMAT=installed</code> instead of <code>archive</code>?<br />
<br />
=== <code>unoapi</code> Tests ===<br />
<br />
* Known issues, open (not yet addressed at all; disabled for now on net-yet-integrated CWS; or fixed on not-yet-integrated CWS):<br />
** {{issue|116120}} &ldquo;vcl: TabControl::ImplGetTabRect negative height leads to X_CreatePixmap BadAlloc&rdquo;<br />
** {{issue|116125}} &ldquo;qadevOOo/qa/complex/junitskeleton failure&rdquo;<br />
** {{issue|116156}} &ldquo;toolkit/qa/unoapi crash in SwAccessibleMap::RemoveContext&rdquo;<br />
** {{issue|116192}} &ldquo;[sw] fixed text fields sometimes get updated&rdquo;<br />
** {{issue|116550}} &ldquo;toolkit/qa/unoapi crashes OOo in ~SwAccessibleParagraph vs. SwXTextDocument::close&rdquo;<br />
** {{issue|116583}} &ldquo;comphelper/qa/complex/comphelper failure&rdquo;<br />
** {{issue|116730}} &ldquo;vcl: crash with multiple threads in Window::ImplGrabFocus&rdquo;<br />
** {{issue|116733}} &ldquo;sw: crash in ~SwDrawContact (forms/qa/unoapi)&rdquo;<br />
** {{issue|116784}} &ldquo;[sfx2] CheckGlobalEventBroadcaster_writer1 fails&rdquo;<br />
* Known issues, disabled for now:<br />
** {{issue|109517}} &ldquo;sc/qa/unoapi fails for ScAnnotationObj etc.&rdquo;<br />
** {{issue|109518}} &ldquo;sd/qa/unoapi crash in SfxViewShell::GetController&rdquo;<br />
** {{issue|109643}} &ldquo;toolkit/qa/unoapi tests fail when losing focus&rdquo;<br />
** {{issue|109728}} &ldquo;~ScAutoFormatObj uses cleared ScGlobal&rdquo;<br />
** {{issue|109917}} &ldquo;fragile unoapi test using OnUnfocus event&rdquo;<br />
** {{issue|109939}} &ldquo;toolkit: inconsistent UnoControl locking schemes&rdquo;<br />
** {{issue|110862}} &ldquo;sc/qa/unoapi fails for sc.ScDataPilotTableObj::com::sun::star::sheet::XDataPilotTable::refresh()&rdquo;<br />
** {{issue|110988}} &ldquo;svtools/qa/unoapi fails for svtools.AccessibleBrowseBox etc.&rdquo;<br />
** {{issue|111006}} &ldquo;toolkit: deadlock between UnoControls&rdquo;<br />
** {{issue|111032}} &ldquo;sc/qa/unoapi sc.ScAccessibleCell::com::sun::star::accessibility::XAccessibleText getCharacterBounds() failure&rdquo;<br />
** {{issue|111042}} &ldquo;sd/qa/unoapi sd::DrawController::dispose crash&rdquo;<br />
** {{issue|111043}} &ldquo;sd/qa/unoapi sd::DrawController_OutlineView NullPointerException&rdquo;<br />
** {{issue|111102}} &ldquo;chart2: ChartModelHelper::findDiagram returns null&rdquo;<br />
** {{issue|111111}} &ldquo;xmloff.Impress.XMLImporter::com::sun::star::document::XImporter&rdquo;<br />
** {{issue|111113}} &ldquo;toolkit.AccessibleStatusBarItem unoapi failure&rdquo;<br />
** {{issue|111148}} &ldquo;forms/qa/unoapi forms.OImageControlModel::com::sun::star::beans::XMultiPropertySet deadlock&rdquo;<br />
** {{issue|111169}} &ldquo;svx.AccessiblePageShape unoapi failure&rdquo;<br />
** {{issue|111170}} &ldquo;sun/i18n/qa/unoapi "creating a drawdoc" failure&rdquo;<br />
** {{issue|111178}} &ldquo;sw/qa/unoapi SwView::SelectShell crash&rdquo;<br />
** {{issue|111180}} &ldquo;framework/qa/unoapi fwk.Desktop::com::sun::star::frame::XComponentLoader::loadComponentFromURL() failure&rdquo;<br />
** {{issue|111182}} &ldquo;Desktop::terminate -> ~DropTarget -> _objc_error crash&rdquo;<br />
** {{issue|111184}} &ldquo;sal/qa/osl/pipe uses fixed pipe names&rdquo;<br />
** {{issue|111186}} &ldquo;sw/qa/unoapi sw.PageStyle::com::sun::star::beans::XPropertySet::setPropertyValue() failure&rdquo;<br />
** {{issue|111190}} &ldquo;sw/qa/unoapi sw.SwXShape failure&rdquo;<br />
** {{issue|111194}} &ldquo;sw/qa/unoapi sw.XMLExporter crash&rdquo;<br />
** {{issue|111195}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleScrollBar::com::sun::star::accessibility::XAccessibleValue::setCurrentValue() failure&rdquo;<br />
** {{issue|111197}} &ldquo;sw/qa/unoapi sw.SwAccessibleDocumentPageView failure&rdquo;<br />
** {{issue|111199}} &ldquo;sd/qa/unoapi sd.AccessibleOutlineView failure&rdquo;<br />
** {{issue|111200}} &ldquo;xmloff/qa/unoapi xmloff.Draw.XMLMetaImporter failure&rdquo;<br />
** {{issue|111216}} &ldquo;svx/qa/unoapi accessibility deadlock&rdquo;<br />
** {{issue|111218}} &ldquo;sw/qa/unoapi sw.SwAccessibleParagraphView::com::sun::star::accessibility::XAccessibleEventBroadcaster::removeEventListener() failure&rdquo;<br />
** {{issue|111220}} &ldquo;sw/qa/unoapi sw.XMLContentExporter::com::sun::star::document::XFilter::cancel() failure&rdquo;<br />
** {{issue|111224}} &ldquo;xmloff/qa/unoapi xmloff.Impress.XMLContentExporter crash&rdquo;<br />
** {{issue|111225}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleStatusBar failure&rdquo;<br />
** {{issue|111252}} &ldquo;svx/qa/unoapi svx.AccessibleOLEShape deadlock&rdquo;<br />
** {{issue|111273}} &ldquo;sw/qa/unoapi sw.SwXTextEmbeddedObject::com::sun::star::document::XEmbeddedObjectSupplier::getEmbeddedObject() crash&rdquo;<br />
** {{issue|111278}} &ldquo;svx/qa/unoapi svx.AccessibleEditableTextPara failure&rdquo;<br />
** {{issue|111283}} &ldquo;sfx2/qa/unoapi sfx.StandaloneDocumentInfo failure&rdquo;<br />
** {{issue|111285}} &ldquo;forms/qa/unoapi forms.OButtonModel failure&rdquo;<br />
** {{issue|111287}} &ldquo;xmloff/qa/unoapi XMLSettingsIm-/Exporter crash&rdquo;<br />
** {{issue|111329}} &ldquo;sd/qa/unoapi SdXCustomPresentationAccess::getElementNames/ImpEditEngine::OnlineSpellHdl hang&rdquo;<br />
** {{issue|111332}} &ldquo;sw/qa/unoapi sw.XMLStylesExporter::com::sun::star::document::XFilter crash&rdquo;<br />
** {{issue|111333}} &ldquo;forms/qa/unoapi forms.OImageControlControl::com::sun::star::awt::XControl deadlock&rdquo;<br />
** {{issue|112743}} &ldquo;starmath/qa/unoapi sm.XMLSettingsExporter failure&rdquo;<br />
** {{issue|112746}} &ldquo;framework/qa/unoapi fwk.ModuleManager failure (X11 BadWindow)&rdquo;<br />
** {{issue|112751}} &ldquo;testgraphical/qa/graphical failure&rdquo;<br />
** {{issue|112778}} &ldquo;xmloff/qa/unoapi xmloff.Draw.XMLContentExporter failure&rdquo;<br />
** {{issue|113020}} &ldquo;sw/qa/unoapi sw.SwXTextGraphicObject::com::sun::star::beans::XPropertySet failure&rdquo;<br />
** {{issue|113103}} &ldquo;chart2: deadlock between DiagramHelper and Diagram&rdquo;<br />
** {{issue|113136}} &ldquo;sw/qa/unoapi sw.SwAccessibleParagraphView::com::sun::star::accessibility::XAccessibleEditableText failure&rdquo;<br />
** {{issue|113142}} &ldquo;sw/qa/unoapi SwAccessibleContext::RemoveFrmFromAccessibleMap crash&rdquo;<br />
** {{issue|113161}} &ldquo;sd/qa/unoapi sd.SdLayer::com::sun::star::drawing::Layer::IsVisible failure&rdquo;<br />
** {{issue|113201}} &ldquo;forms/qa/unoapi forms.OEditModel::com::sun::star::form::validation::XValidatableFormComponent failure&rdquo;<br />
** {{issue|113245}} &ldquo;framework/qa/unoapi fwl.TypeDetection failure&rdquo;<br />
** {{issue|113306}} &ldquo;sfx2/qa/unoapi sfx.DocumentTemplates failure&rdquo;<br />
** {{issue|113386}} &ldquo;sd/qa/unoapi sd.AccessibleDrawDocumentView::com::sun::star::accessibility::XAccessibleComponent::containsPoint() failure&rdquo;<br />
** {{issue|113489}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleMenu{,Bar,Separator} failures&rdquo;<br />
** {{issue|114205}} &ldquo;sw/qa/unoapi sw.SwAccessibleParagraphView::com::sun::star::accessibility::XAccessibleText::copyText() failed&rdquo;<br />
** {{issue|114209}} &ldquo;forms/qa/unoapi forms.OGridControlModel::com::sun::star::view::XSelectionSupplier crash&rdquo;<br />
** {{issue|114211}} &ldquo;xmloff/qa/unoapi xmloff.Draw.XMLStylesImporter::com::sun::star::lang::XInitialization crash&rdquo;<br />
** {{issue|114213}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleMenu::com::sun::star::accessibility::XAccessibleSelection failure&rdquo;<br />
** {{issue|114636}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleScrollBar::com::sun::star::accessibility::XAccessibleAction failure&rdquo;<br />
** {{issue|114637}} &ldquo;sw/qa/unoapi sw.SwAccessibleFootnoteView(?) crash&rdquo;<br />
** {{issue|114642}} &ldquo;svx/qa/unoapi svx: svx.SvxUnoTextContent::com::sun::star::style::CharacterProperties crash&rdquo;<br />
** {{issue|114669}} &ldquo;forms/qa/unoapi forms.OListBoxControl crash&rdquo;<br />
** {{issue|114889}} &ldquo;sw/qa/unoapi sw.SwXTextViewCursor::com::sun::star::view::XScreenCursor&rdquo;<br />
* Missing tests:<br />
** {{issue|109564}} &ldquo;qadevOOo/tests/java/ifc/awt/_XSystemChildFactory.java&rdquo;<br />
* Sporadic failures:<br />
** {{issue|111217}} &ldquo;BasicManager::SetGlobalUNOConstant crash during shutdown&rdquo;<br />
** {{issue|111246}} &ldquo;svx::FontHeightToolBoxControl::statusChanged crash (memory corruption)&rdquo;<br />
** {{issue|111271}} &ldquo;Mac OS X: crash during shutdown, __tcf_2 on stack&rdquo;<br />
** {{issue|111400}} &ldquo;Extension Manager does not join spawned uno process (-> smoketestoo_native fails)&rdquo;<br />
** {{issue|112070}} &ldquo;UNO API tests must not use random&rdquo;<br />
** {{issue|113158}} &ldquo;crash with two threads in framework::ToolBarManager dtor&rdquo;<br />
** {{issue|113197}} &ldquo;sw/qa/unoapi sw.SwXTextRange hangs&rdquo;<br />
** {{issue|113367}} &ldquo;sysdtrans deadlock during shutdown&rdquo;<br />
** {{issue|113464}} &ldquo;stoc_smgr::ORegistryServiceManager::dispose crash during shutdown&rdquo;<br />
** {{issue|114207}} &ldquo;framework::ModuleUIConfigurationManager::dispose crash during shutdown&rdquo;<br />
** {{issue|114675}} &ldquo;binary URP bridge race on shut down, crash&rdquo;<br />
** {{issue|114718}} &ldquo;forms/qa/unoapi: crash in remote async release call&rdquo;<br />
** {{issue|116131}} &ldquo;vcl: message unregisterDraggingDestinationHandler: sent to freed object&rdquo;<br />
<br />
[[Category:Effort]][[Category:Test]]</div>Sbhttps://wiki.openoffice.org/wiki/Test_CleanupTest Cleanup2011-01-31T16:12:41Z<p>Sb: /* unoapi Tests */</p>
<hr />
<div>= Test Cleanup Project =<br />
<br />
The demand for automated (unit) testing should be obvious. See the [http://www.openoffice.org/servlets/ReadMsg?list=dev&msgNo=26189 mission statement mail] and [[Media:JustTestingPresentation.odp|slides]] from a [http://fosdem.org/2010/schedule/events/ooo_testing FOSDEM'10 talk] and an [http://www.ooocon.org/index.php/ooocon/2010/paper/view/188 OOoCon&nbsp;2010 presentation] for more information and further links.<br />
<br />
For examples of how to write xUnit based tests in the OOo code base, see [http://hg.services.openoffice.org/DEV300/file/87f4911ea629/basegfx/test <code>basegfx/test/</code>], [http://hg.services.openoffice.org/DEV300/file/87f4911ea629/sal/qa/ByteSequence <code>sal/qa/ByteSequence/</code>], and [http://hg.services.openoffice.org/DEV300/file/87f4911ea629/smoketestoo_native <code>smoketest_native/</code>]. However, the hard part should not be how to write test code, anyway, but how to write ''testable'' code; see [http://misko.hevery.com/2008/11/04/clean-code-talks-unit-testing/ The Clean Code Talks&mdash;Unit Testing].<br />
<br />
When testing C++ code that merely uses UNO types (no services), but uses them in a way that requires UNO to be bootstrapped so that the relevant type information is available (e.g., putting instances of complex UNO types into <code>com::sun::star::uno::Any</code>), one approach is as follows: In the <code>makefile.mk</code>, instead of <code>.INCLUDE: _cppunit.mk</code> use<br />
<source lang="make"><br />
.IF "$(OS)" == "WNT"<br />
my_file = file:///<br />
.ELSE<br />
my_file = file://<br />
.END<br />
<br />
ALLTAR : test<br />
<br />
test .PHONY : $(SHL1TARGETN)<br />
$(CPPUNITTESTER) $(SHL1TARGETN) \<br />
-env:UNO_TYPES=$(my_file)$(SOLARBINDIR)/types.rdb<br />
</source><br />
and in the test code once call <code>cppu::defaultBootstrap_InitialComponentContext()</code>.<br />
<br />
== User Interface ==<br />
<br />
=== CppUnit ===<br />
<br />
For tests in C++, plain CppUnit (at least version 1.12.1) is available. (OOo bundles CppUnit 1.12.1 as an external module; alternatively, you can configure <code>--with-system-cppunit</code>.)<br />
<br />
Implement the test code as a dynamic library, following CppUnit conventions (i.e., using [http://cppunit.sourceforge.net/doc/lastest/group___creating_test_suite.html#ga0 <code>CPPUNIT_TEST_SUITE_REGISTRATION</code>] and [http://cppunit.sourceforge.net/doc/lastest/_test_plug_in_8h.html#a2 <code>CPPUNIT_PLUGIN_IMPLEMENT</code>] macros). The following settings are needed in the <code>makefile.mk</code>:<br />
* <code>ENABLE_EXCEPTIONS = TRUE</code><br />
* <code>CFLAGSCXX += $(CPPUNIT_CFLAGS)</code><br />
* <code>SHL<var>n</var>RPATH = NONE</code><br />
* <code>SHL<var>n</var>STDLIBS += $(CPPUNITLIB)</code><br />
* <code>SHL<var>n</var>VERSIONMAP = <var>version.map</var></code>, where that file must contain the following (see [[#CppUnit_1.12.1|details]] below for improving this):<br />
UDK_3_0_0 {<br />
global:<br />
cppunitTestPlugIn;<br />
local:<br />
*;<br />
};<br />
<br />
To run tests, <code>sal/cppunittester</code> delivers a <code>cppunittester</code> executable that has some advantages over the plain CppUnit <code>DllPlugInTester</code>:<br />
* It uses <code>SAL_IMPLEMENT_MAIN</code> to properly set up the per-process settings required by URE. Test code as well as tested code based on URE will expect this and would fail in a process that is not set up in this way.<br />
* Getting CppUnit to build as an external module within the Windows OOo build is a non-trivial task. The less parts of it that need to be built, the better.<br />
<br />
Something like the following in <code>makefile.mk</code> will execute the tests:<br />
ALLTAR : test<br />
test .PHONY : $(SHL1TARGETN)<br />
$(CPPUNITTESTER) $(SHL1TARGETN)<br />
<br />
<code>$(CPPUNITTESTER)</code> internally uses <code>$(AUGMENT_LIBRARY_PATH_LOCAL)</code> to favor library instances in the local output tree over ones in solver. Alternatively to the above, <code>.INCLUDE: _cppunit.mk</code> calls <code>$(CPPUNITTESTER)</code> on each of <code>$(SHL1TARGETN)</code>, &hellip;, <code>$(SHL10TARGETN)</code> that is defined.<br />
<br />
=== JUnit ===<br />
<br />
For tests in Java, plain JUnit (at least version 4) is available. (OOo requires JUnit as a prerequisite, see [http://junit.org/ junit.org] for downloads; you can configure <code>--with-junit=<var>&hellip;</var></code> if it is not automatically found; alternatively, you can configure <code>--without-junit</code>, disabling JUnit-based tests.)<br />
<br />
=== <code>subsequenttests</code> ===<br />
<br />
Some tests have build and/or run time dependencies on modules further up in the hierarchy, or modules that the rest of the module in question does not have dependencies on (and which are thus not listed in the module's <code>build.lst</code>). The extreme case are tests that need a complete OOo installation as their test environment.<br />
<br />
For such tests, the whole <code>makefile.mk</code> should be wrapped in:<br />
.IF "$(OOO_SUBSEQUENT_TESTS)" == ""<br />
nothing .PHONY :<br />
.ELSE<br />
...<br />
.END<br />
(and the directory included in the module's <code>build.lst</code>).<br />
<br />
The idea is to do a complete OOo build first (<code>cd smoketestoo_native && build --all</code>) and then build and execute those tests either selectively or wholesale.<br />
<br />
Selectively building a specific such test directory can be done with <code>cd <var>&hellip;</var> && OOO_SUBSEQUENT_TESTS=TRUE dmake</code>.<br />
<br />
To build and execute ''all'' these test directories, the tool <code>subsequenttests</code> (in <code>solenv/bin</code>) exists. It scans the <code>build.lst</code> files of all modules for <code>makefile.mk</code>s that mention <code>OOO_SUBSEQUENT_TESTS</code> and simply executes <code>dmake</code> in all those directories, with <code>OOO_SUBSEQUENT_TESTS</code> set. It supports a <code>-P<var>n</var></code> switch to build <var>n</var> directories in parallel.<br />
<br />
=== Helpers ===<br />
<br />
A new module <code>test</code> shall collect reusable code snippets for C++ and Java tests.<br />
<br />
For now, it concentrates on letting a test connect to an OOo instance via remote UNO: A C++ test class can hold a <code>test::OfficeConnection</code> as class member and, in its CppUnit <code>setUp</code> and <code>tearDown</code> functions, call <code>OfficeConnection::setUp</code> and <code>OfficeConnection::tearDown</code>, respectively. Tests obtain access to the OOo instance via <code>OfficeConnection::getFactory</code>. Similarly, a Java test class can use an <code>org.openoffice.test.OfficeConnection</code> instance, offering the same functionality as its C++ counterpart.<br />
<br />
For this to work, three additional steps are necessary:<br />
* First, in <code>instsetoo_native</code>, building an installation set for the <code>openoffice</code> product in the default language (<code>en-US</code>) in any package format now takes care to always also build an archive package format (<code>tar.gz</code> resp. <code>zip</code>) of that product.<br />
* Second, building <code>smoketestoo_native</code> permanently installs that archive into the solver. (Except on Windows, where problems with resulting long pathnames prevent this; there, as a workaround, each test individually unzips the archive to some local temporary directory.) <br />
* Third, a test that requires an OOo instance includes <code>installationtest.mk</code> in its <code>makefile.mk</code>. That file makes sure to call the CppUnit and JUnit test runners with the information necessary for the helper classes to start the correct OOo instance with a fresh <code>UserInstallation</code> and set up an URP pipe connection. The information is tunneled into the test runner executables as UNO bootstrap parameters.<br />
<br />
For debugging purposes, which OOo instance the tests use can manually be overridden, see [http://www.openoffice.org/servlets/ReadMsg?list=interface-announce&msgNo=1285 &ldquo;OOO_TEST_SOFFICE: allow override of tested soffice process&rdquo;].<br />
<br />
=== <code>unoapi</code> Tests ===<br />
<br />
The <code>unoapi</code> tests are redesigned to use the new test framework. They are plain JUnit tests and use the mechanisms described above to connect to running OOo instances. However, due to the large amount of logic encoded in <code>qadevOOo</code>, those JUnit tests for now are only thin wrappers around <code>org.openoffice.Runner.run</code>. This is intended to change over time.<br />
<br />
The <code>cwscheckapi</code> tool to run the <code>unoapi</code> tests has been subsumed by <code>subsequenttests</code>. The latter always runs all tests, while the former had mechanisms to run only tests for modules that had been changed by a CWS. The hope is that the parallel mode of <code>subsequenttests</code> makes it fast enough so that running all tests all of the times becomes feasible.<br />
<br />
Unfortunately, running the <code>unoapi</code> tests is still not stable enough to give useful results. Therefore, running <code>subsequenttests</code> has been disabled in the build bots for now. Making the tests sufficiently stable is ongoing work.<br />
<br />
== Details ==<br />
<br />
Working on {{CWS|sb118}}, {{CWS|sb120}}.<br />
<br />
=== CppUnit 1.12.1 ===<br />
<br />
* Replace existing <code>cppunit</code> and <code>testshl2</code> combo with latest CppUnit 1.12.1.<br />
* OOo <code>configure --with-system-cppunit</code> (for now only if also <code>--with-system-stl</code>!); minimal required version for now arbitrarily 1.12.1.<br />
* '''TODO:''' Upstream <code>PATCH_FILES</code> (<code>windows.patch</code>?!?).<br />
* '''TODO:''' <code>RPATH</code> in generated libraries and executables.<br />
* '''TODO:''' Improve <code>CPPUNIT_PLUGIN_EXPORT</code> and get rid of version maps (GCC exception problems?).<br />
* '''TODO:''' <code>cppunit/makefile.mk</code> <code>MY_LIBS = -lm</code> Solaris hack.<br />
* '''TODO:''' In general OOo build environment, no longer set <code>CFLAGS</code> etc. as environment variables; have package-specific <code>OOO_<var>package</var>_CFLAGS</code> etc. and combine those into <code>CFLAGS</code> etc. where necessary (see <code>OOO_STLPORT_CXXFLAGS</code> etc. in <code>cppunit/makefile.mk</code>).<br />
* '''TODO:''' Why use <code>cppunittester</code> instead of <code>DllPlugInTester</code>? (Remove building/delivering <code>DllPlugInTester</code>.)<br />
* '''TODO:''' Make <code>operator &lt;&lt;(std::basic_ostream &amp;, rtl::OUString const &amp;)</code> from <code>test/oustringstreaminserter.hxx</code> generally available?<br />
* '''TODO:''' Make STLport <code>num_put</code> symbols available on platforms other than Linux (see <code>solenv/bin/addsym.awk</code>), too, so that <code>CPPUNIT_ASSERT_EQUAL</code> actually outputs numeric values.<br />
<br />
=== <code>testshl2</code> ===<br />
<br />
* <code>solenv/inc_cppunit.mk</code>/<code>cppunit.mk</code>: [http://hg.services.openoffice.org/cws/sb118/rev/cf13421c3774 &ldquo;adapted <code>cppunit.mk</code> to <code>cppunittester</code> and no longer require &lsquo;<code>dmake test</code>&rsquo; to run tests&rdquo;].<br />
* '''TODO:''' <code>DEV300_m68</code> introduced <code>TESTSHL2LIB</code> (which I removed again) and uses it in many <code>qa</code> makefiles (that I need to touch someday, anyway).<br />
<br />
=== Unit Tests ===<br />
<br />
* <code>OOO_SUBSEQUENT_TESTS</code> (<code>build.lst</code> lists local dependencies of those directories, so that modifying a module and then calling &ldquo;<code>OOO_SUBSEQUENT_TESTS=x build</code>&rdquo; rebuilds the module and executes the tests).<br />
* '''TODO:''' If Build Environment&nbsp;2.0 would build directly to solver (instead of local output tree/deliver), that would simplify tests that currently need to take care to test local libraries instead of solver ones (see, for example, <code>OOO_TEST_PREFIX</code> in the <code>services.rdb</code> of <code>stoc/test/uriproc/makefile.mk</code>).<br />
{{Documentation/Note|Build Environment&nbsp;2.0 will not build directly to solver, but will make a module depend on the targets in the solver, and these are depending on the targets in the workdir (aka the old "local output tree"). Thus on an usual build in a module building and delivering are not two steps anymore. If tests depend on the target in the solver (which they will do automatically in most use cases, as linking against a library automatically creates a dependency on the library in the solver), they can be sure that the target is up to date in the solver '''and''' in the workdir.<br />
<br />
--[[User:B michaelsen|B michaelsen]] 06:32, 27 August 2010 (UTC)}}<br />
* '''TODO:''' Constructs like &ldquo;<code>-env:UNO_<var>&hellip;</var>=$(my_file)<var>&hellip;</var></code>&rdquo; would fail for problematic characters (spaces!) in paths.<br />
<br />
=== Smoke Test ===<br />
<br />
* Redesign <code>smoketestoo_native</code> to use CppUnit and pre-installed OOo.<br />
* [http://hg.services.openoffice.org/cws/sb118/rev/160b248247a0 &ldquo;changed <code>tools/debug</code> to never fall back from writing to shell to writing to file, and read <code>DBGSV_INIT</code> from <code>rtl::Bootstrap</code>; the latter causes problems if <code>tools/debug</code> is called from static code executing before <code>SAL_MAIN</code> has called <code>osl_setCommandArgs</code> &rarr; removed statics from code and added assertions to <code>osl/process</code>; various improvements to <code>smoketests.cxx</code> (incl. passing an appropriate <code>dbgsv.ini</code> for non-pro builds)&rdquo;] followed by [http://hg.services.openoffice.org/cws/sb118/rev/dbbacb9d2fd3 &ldquo;reverted parts of HG <code>-c&nbsp;160b248247a0</code> again: the &lsquo;static code executing before <code>SAL_MAIN</code>&rsquo; problem was too severe; instead, globally set <code>DBGSV_INIT</code> build env var to new <code>solenv/bin/dbgsv.ini</code>&rdquo;]; see also {{issue|109142}} &ldquo;Let assertions abort&rdquo;.<br />
* '''TODO:''' For <code>smoketestoo_native/makefile.mk</code> &ldquo;<code><nowiki>-env:arg-env=$(OOO_LIBRARY_PATH_VAR)"$${{$(OOO_LIBRARY_PATH_VAR)+=$$$(OOO_LIBRARY_PATH_VAR)}}"</nowiki></code>&rdquo; mechanism: <code>osl_executeProcess</code> <code>ustrEnvironments</code> members without &ldquo;<code>=</code>&rdquo;: all platforms; documentation; documentation of <code>osl_executeProcess_WithRedicrectedIO</code>.<br />
* '''TODO:''' <code>-headless</code>? (appears to still display windows on Windows and Mac OS&nbsp;X, however, see {{issue|109052}})<br />
* '''TODO:''' {{issue|113341}} &ldquo;-nofirststartwizard should disable update check&rdquo;<br />
<br />
=== Pre-Installed OOo ===<br />
<br />
* For Sun Hamburg Release Engineering, take MWS archive installation sets from &ldquo;S:&rdquo; instead of solver: [http://hg.services.openoffice.org/cws/sb118/rev/d5dbea724063 &ldquo;take installation set from <code>SHIPDRIVE</code> if appropriate&rdquo;].<br />
* '''TODO:''' <code>PKGFORMAT=installed</code> instead of <code>archive</code>?<br />
<br />
=== <code>unoapi</code> Tests ===<br />
<br />
* Known issues, open (not yet addressed at all; disabled for now on net-yet-integrated CWS; or fixed on not-yet-integrated CWS):<br />
** {{issue|116120}} &ldquo;vcl: TabControl::ImplGetTabRect negative height leads to X_CreatePixmap BadAlloc&rdquo;<br />
** {{issue|116125}} &ldquo;qadevOOo/qa/complex/junitskeleton failure&rdquo;<br />
** {{issue|116156}} &ldquo;toolkit/qa/unoapi crash in SwAccessibleMap::RemoveContext&rdquo;<br />
** {{issue|116192}} &ldquo;[sw] fixed text fields sometimes get updated&rdquo;<br />
** {{issue|116550}} &ldquo;toolkit/qa/unoapi crashes OOo in ~SwAccessibleParagraph vs. SwXTextDocument::close&rdquo;<br />
** {{issue|116583}} &ldquo;comphelper/qa/complex/comphelper failure&rdquo;<br />
** {{issue|116730}} &ldquo;vcl: crash with multiple threads in Window::ImplGrabFocus&rdquo;<br />
** {{issue|116733}} &ldquo;sw: crash in ~SwDrawContact (forms/qa/unoapi)&rdquo;<br />
* Known issues, disabled for now:<br />
** {{issue|109517}} &ldquo;sc/qa/unoapi fails for ScAnnotationObj etc.&rdquo;<br />
** {{issue|109518}} &ldquo;sd/qa/unoapi crash in SfxViewShell::GetController&rdquo;<br />
** {{issue|109643}} &ldquo;toolkit/qa/unoapi tests fail when losing focus&rdquo;<br />
** {{issue|109728}} &ldquo;~ScAutoFormatObj uses cleared ScGlobal&rdquo;<br />
** {{issue|109917}} &ldquo;fragile unoapi test using OnUnfocus event&rdquo;<br />
** {{issue|109939}} &ldquo;toolkit: inconsistent UnoControl locking schemes&rdquo;<br />
** {{issue|110862}} &ldquo;sc/qa/unoapi fails for sc.ScDataPilotTableObj::com::sun::star::sheet::XDataPilotTable::refresh()&rdquo;<br />
** {{issue|110988}} &ldquo;svtools/qa/unoapi fails for svtools.AccessibleBrowseBox etc.&rdquo;<br />
** {{issue|111006}} &ldquo;toolkit: deadlock between UnoControls&rdquo;<br />
** {{issue|111032}} &ldquo;sc/qa/unoapi sc.ScAccessibleCell::com::sun::star::accessibility::XAccessibleText getCharacterBounds() failure&rdquo;<br />
** {{issue|111042}} &ldquo;sd/qa/unoapi sd::DrawController::dispose crash&rdquo;<br />
** {{issue|111043}} &ldquo;sd/qa/unoapi sd::DrawController_OutlineView NullPointerException&rdquo;<br />
** {{issue|111102}} &ldquo;chart2: ChartModelHelper::findDiagram returns null&rdquo;<br />
** {{issue|111111}} &ldquo;xmloff.Impress.XMLImporter::com::sun::star::document::XImporter&rdquo;<br />
** {{issue|111113}} &ldquo;toolkit.AccessibleStatusBarItem unoapi failure&rdquo;<br />
** {{issue|111148}} &ldquo;forms/qa/unoapi forms.OImageControlModel::com::sun::star::beans::XMultiPropertySet deadlock&rdquo;<br />
** {{issue|111169}} &ldquo;svx.AccessiblePageShape unoapi failure&rdquo;<br />
** {{issue|111170}} &ldquo;sun/i18n/qa/unoapi "creating a drawdoc" failure&rdquo;<br />
** {{issue|111178}} &ldquo;sw/qa/unoapi SwView::SelectShell crash&rdquo;<br />
** {{issue|111180}} &ldquo;framework/qa/unoapi fwk.Desktop::com::sun::star::frame::XComponentLoader::loadComponentFromURL() failure&rdquo;<br />
** {{issue|111182}} &ldquo;Desktop::terminate -> ~DropTarget -> _objc_error crash&rdquo;<br />
** {{issue|111184}} &ldquo;sal/qa/osl/pipe uses fixed pipe names&rdquo;<br />
** {{issue|111186}} &ldquo;sw/qa/unoapi sw.PageStyle::com::sun::star::beans::XPropertySet::setPropertyValue() failure&rdquo;<br />
** {{issue|111190}} &ldquo;sw/qa/unoapi sw.SwXShape failure&rdquo;<br />
** {{issue|111194}} &ldquo;sw/qa/unoapi sw.XMLExporter crash&rdquo;<br />
** {{issue|111195}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleScrollBar::com::sun::star::accessibility::XAccessibleValue::setCurrentValue() failure&rdquo;<br />
** {{issue|111197}} &ldquo;sw/qa/unoapi sw.SwAccessibleDocumentPageView failure&rdquo;<br />
** {{issue|111199}} &ldquo;sd/qa/unoapi sd.AccessibleOutlineView failure&rdquo;<br />
** {{issue|111200}} &ldquo;xmloff/qa/unoapi xmloff.Draw.XMLMetaImporter failure&rdquo;<br />
** {{issue|111216}} &ldquo;svx/qa/unoapi accessibility deadlock&rdquo;<br />
** {{issue|111218}} &ldquo;sw/qa/unoapi sw.SwAccessibleParagraphView::com::sun::star::accessibility::XAccessibleEventBroadcaster::removeEventListener() failure&rdquo;<br />
** {{issue|111220}} &ldquo;sw/qa/unoapi sw.XMLContentExporter::com::sun::star::document::XFilter::cancel() failure&rdquo;<br />
** {{issue|111224}} &ldquo;xmloff/qa/unoapi xmloff.Impress.XMLContentExporter crash&rdquo;<br />
** {{issue|111225}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleStatusBar failure&rdquo;<br />
** {{issue|111252}} &ldquo;svx/qa/unoapi svx.AccessibleOLEShape deadlock&rdquo;<br />
** {{issue|111273}} &ldquo;sw/qa/unoapi sw.SwXTextEmbeddedObject::com::sun::star::document::XEmbeddedObjectSupplier::getEmbeddedObject() crash&rdquo;<br />
** {{issue|111278}} &ldquo;svx/qa/unoapi svx.AccessibleEditableTextPara failure&rdquo;<br />
** {{issue|111283}} &ldquo;sfx2/qa/unoapi sfx.StandaloneDocumentInfo failure&rdquo;<br />
** {{issue|111285}} &ldquo;forms/qa/unoapi forms.OButtonModel failure&rdquo;<br />
** {{issue|111287}} &ldquo;xmloff/qa/unoapi XMLSettingsIm-/Exporter crash&rdquo;<br />
** {{issue|111329}} &ldquo;sd/qa/unoapi SdXCustomPresentationAccess::getElementNames/ImpEditEngine::OnlineSpellHdl hang&rdquo;<br />
** {{issue|111332}} &ldquo;sw/qa/unoapi sw.XMLStylesExporter::com::sun::star::document::XFilter crash&rdquo;<br />
** {{issue|111333}} &ldquo;forms/qa/unoapi forms.OImageControlControl::com::sun::star::awt::XControl deadlock&rdquo;<br />
** {{issue|112743}} &ldquo;starmath/qa/unoapi sm.XMLSettingsExporter failure&rdquo;<br />
** {{issue|112746}} &ldquo;framework/qa/unoapi fwk.ModuleManager failure (X11 BadWindow)&rdquo;<br />
** {{issue|112751}} &ldquo;testgraphical/qa/graphical failure&rdquo;<br />
** {{issue|112778}} &ldquo;xmloff/qa/unoapi xmloff.Draw.XMLContentExporter failure&rdquo;<br />
** {{issue|113020}} &ldquo;sw/qa/unoapi sw.SwXTextGraphicObject::com::sun::star::beans::XPropertySet failure&rdquo;<br />
** {{issue|113103}} &ldquo;chart2: deadlock between DiagramHelper and Diagram&rdquo;<br />
** {{issue|113136}} &ldquo;sw/qa/unoapi sw.SwAccessibleParagraphView::com::sun::star::accessibility::XAccessibleEditableText failure&rdquo;<br />
** {{issue|113142}} &ldquo;sw/qa/unoapi SwAccessibleContext::RemoveFrmFromAccessibleMap crash&rdquo;<br />
** {{issue|113161}} &ldquo;sd/qa/unoapi sd.SdLayer::com::sun::star::drawing::Layer::IsVisible failure&rdquo;<br />
** {{issue|113201}} &ldquo;forms/qa/unoapi forms.OEditModel::com::sun::star::form::validation::XValidatableFormComponent failure&rdquo;<br />
** {{issue|113245}} &ldquo;framework/qa/unoapi fwl.TypeDetection failure&rdquo;<br />
** {{issue|113306}} &ldquo;sfx2/qa/unoapi sfx.DocumentTemplates failure&rdquo;<br />
** {{issue|113386}} &ldquo;sd/qa/unoapi sd.AccessibleDrawDocumentView::com::sun::star::accessibility::XAccessibleComponent::containsPoint() failure&rdquo;<br />
** {{issue|113489}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleMenu{,Bar,Separator} failures&rdquo;<br />
** {{issue|114205}} &ldquo;sw/qa/unoapi sw.SwAccessibleParagraphView::com::sun::star::accessibility::XAccessibleText::copyText() failed&rdquo;<br />
** {{issue|114209}} &ldquo;forms/qa/unoapi forms.OGridControlModel::com::sun::star::view::XSelectionSupplier crash&rdquo;<br />
** {{issue|114211}} &ldquo;xmloff/qa/unoapi xmloff.Draw.XMLStylesImporter::com::sun::star::lang::XInitialization crash&rdquo;<br />
** {{issue|114213}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleMenu::com::sun::star::accessibility::XAccessibleSelection failure&rdquo;<br />
** {{issue|114636}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleScrollBar::com::sun::star::accessibility::XAccessibleAction failure&rdquo;<br />
** {{issue|114637}} &ldquo;sw/qa/unoapi sw.SwAccessibleFootnoteView(?) crash&rdquo;<br />
** {{issue|114642}} &ldquo;svx/qa/unoapi svx: svx.SvxUnoTextContent::com::sun::star::style::CharacterProperties crash&rdquo;<br />
** {{issue|114669}} &ldquo;forms/qa/unoapi forms.OListBoxControl crash&rdquo;<br />
** {{issue|114889}} &ldquo;sw/qa/unoapi sw.SwXTextViewCursor::com::sun::star::view::XScreenCursor&rdquo;<br />
* Missing tests:<br />
** {{issue|109564}} &ldquo;qadevOOo/tests/java/ifc/awt/_XSystemChildFactory.java&rdquo;<br />
* Sporadic failures:<br />
** {{issue|111217}} &ldquo;BasicManager::SetGlobalUNOConstant crash during shutdown&rdquo;<br />
** {{issue|111246}} &ldquo;svx::FontHeightToolBoxControl::statusChanged crash (memory corruption)&rdquo;<br />
** {{issue|111271}} &ldquo;Mac OS X: crash during shutdown, __tcf_2 on stack&rdquo;<br />
** {{issue|111400}} &ldquo;Extension Manager does not join spawned uno process (-> smoketestoo_native fails)&rdquo;<br />
** {{issue|112070}} &ldquo;UNO API tests must not use random&rdquo;<br />
** {{issue|113158}} &ldquo;crash with two threads in framework::ToolBarManager dtor&rdquo;<br />
** {{issue|113197}} &ldquo;sw/qa/unoapi sw.SwXTextRange hangs&rdquo;<br />
** {{issue|113367}} &ldquo;sysdtrans deadlock during shutdown&rdquo;<br />
** {{issue|113464}} &ldquo;stoc_smgr::ORegistryServiceManager::dispose crash during shutdown&rdquo;<br />
** {{issue|114207}} &ldquo;framework::ModuleUIConfigurationManager::dispose crash during shutdown&rdquo;<br />
** {{issue|114675}} &ldquo;binary URP bridge race on shut down, crash&rdquo;<br />
** {{issue|114718}} &ldquo;forms/qa/unoapi: crash in remote async release call&rdquo;<br />
** {{issue|116131}} &ldquo;vcl: message unregisterDraggingDestinationHandler: sent to freed object&rdquo;<br />
<br />
[[Category:Effort]][[Category:Test]]</div>Sbhttps://wiki.openoffice.org/wiki/Test_CleanupTest Cleanup2011-01-31T15:37:43Z<p>Sb: /* unoapi Tests */</p>
<hr />
<div>= Test Cleanup Project =<br />
<br />
The demand for automated (unit) testing should be obvious. See the [http://www.openoffice.org/servlets/ReadMsg?list=dev&msgNo=26189 mission statement mail] and [[Media:JustTestingPresentation.odp|slides]] from a [http://fosdem.org/2010/schedule/events/ooo_testing FOSDEM'10 talk] and an [http://www.ooocon.org/index.php/ooocon/2010/paper/view/188 OOoCon&nbsp;2010 presentation] for more information and further links.<br />
<br />
For examples of how to write xUnit based tests in the OOo code base, see [http://hg.services.openoffice.org/DEV300/file/87f4911ea629/basegfx/test <code>basegfx/test/</code>], [http://hg.services.openoffice.org/DEV300/file/87f4911ea629/sal/qa/ByteSequence <code>sal/qa/ByteSequence/</code>], and [http://hg.services.openoffice.org/DEV300/file/87f4911ea629/smoketestoo_native <code>smoketest_native/</code>]. However, the hard part should not be how to write test code, anyway, but how to write ''testable'' code; see [http://misko.hevery.com/2008/11/04/clean-code-talks-unit-testing/ The Clean Code Talks&mdash;Unit Testing].<br />
<br />
When testing C++ code that merely uses UNO types (no services), but uses them in a way that requires UNO to be bootstrapped so that the relevant type information is available (e.g., putting instances of complex UNO types into <code>com::sun::star::uno::Any</code>), one approach is as follows: In the <code>makefile.mk</code>, instead of <code>.INCLUDE: _cppunit.mk</code> use<br />
<source lang="make"><br />
.IF "$(OS)" == "WNT"<br />
my_file = file:///<br />
.ELSE<br />
my_file = file://<br />
.END<br />
<br />
ALLTAR : test<br />
<br />
test .PHONY : $(SHL1TARGETN)<br />
$(CPPUNITTESTER) $(SHL1TARGETN) \<br />
-env:UNO_TYPES=$(my_file)$(SOLARBINDIR)/types.rdb<br />
</source><br />
and in the test code once call <code>cppu::defaultBootstrap_InitialComponentContext()</code>.<br />
<br />
== User Interface ==<br />
<br />
=== CppUnit ===<br />
<br />
For tests in C++, plain CppUnit (at least version 1.12.1) is available. (OOo bundles CppUnit 1.12.1 as an external module; alternatively, you can configure <code>--with-system-cppunit</code>.)<br />
<br />
Implement the test code as a dynamic library, following CppUnit conventions (i.e., using [http://cppunit.sourceforge.net/doc/lastest/group___creating_test_suite.html#ga0 <code>CPPUNIT_TEST_SUITE_REGISTRATION</code>] and [http://cppunit.sourceforge.net/doc/lastest/_test_plug_in_8h.html#a2 <code>CPPUNIT_PLUGIN_IMPLEMENT</code>] macros). The following settings are needed in the <code>makefile.mk</code>:<br />
* <code>ENABLE_EXCEPTIONS = TRUE</code><br />
* <code>CFLAGSCXX += $(CPPUNIT_CFLAGS)</code><br />
* <code>SHL<var>n</var>RPATH = NONE</code><br />
* <code>SHL<var>n</var>STDLIBS += $(CPPUNITLIB)</code><br />
* <code>SHL<var>n</var>VERSIONMAP = <var>version.map</var></code>, where that file must contain the following (see [[#CppUnit_1.12.1|details]] below for improving this):<br />
UDK_3_0_0 {<br />
global:<br />
cppunitTestPlugIn;<br />
local:<br />
*;<br />
};<br />
<br />
To run tests, <code>sal/cppunittester</code> delivers a <code>cppunittester</code> executable that has some advantages over the plain CppUnit <code>DllPlugInTester</code>:<br />
* It uses <code>SAL_IMPLEMENT_MAIN</code> to properly set up the per-process settings required by URE. Test code as well as tested code based on URE will expect this and would fail in a process that is not set up in this way.<br />
* Getting CppUnit to build as an external module within the Windows OOo build is a non-trivial task. The less parts of it that need to be built, the better.<br />
<br />
Something like the following in <code>makefile.mk</code> will execute the tests:<br />
ALLTAR : test<br />
test .PHONY : $(SHL1TARGETN)<br />
$(CPPUNITTESTER) $(SHL1TARGETN)<br />
<br />
<code>$(CPPUNITTESTER)</code> internally uses <code>$(AUGMENT_LIBRARY_PATH_LOCAL)</code> to favor library instances in the local output tree over ones in solver. Alternatively to the above, <code>.INCLUDE: _cppunit.mk</code> calls <code>$(CPPUNITTESTER)</code> on each of <code>$(SHL1TARGETN)</code>, &hellip;, <code>$(SHL10TARGETN)</code> that is defined.<br />
<br />
=== JUnit ===<br />
<br />
For tests in Java, plain JUnit (at least version 4) is available. (OOo requires JUnit as a prerequisite, see [http://junit.org/ junit.org] for downloads; you can configure <code>--with-junit=<var>&hellip;</var></code> if it is not automatically found; alternatively, you can configure <code>--without-junit</code>, disabling JUnit-based tests.)<br />
<br />
=== <code>subsequenttests</code> ===<br />
<br />
Some tests have build and/or run time dependencies on modules further up in the hierarchy, or modules that the rest of the module in question does not have dependencies on (and which are thus not listed in the module's <code>build.lst</code>). The extreme case are tests that need a complete OOo installation as their test environment.<br />
<br />
For such tests, the whole <code>makefile.mk</code> should be wrapped in:<br />
.IF "$(OOO_SUBSEQUENT_TESTS)" == ""<br />
nothing .PHONY :<br />
.ELSE<br />
...<br />
.END<br />
(and the directory included in the module's <code>build.lst</code>).<br />
<br />
The idea is to do a complete OOo build first (<code>cd smoketestoo_native && build --all</code>) and then build and execute those tests either selectively or wholesale.<br />
<br />
Selectively building a specific such test directory can be done with <code>cd <var>&hellip;</var> && OOO_SUBSEQUENT_TESTS=TRUE dmake</code>.<br />
<br />
To build and execute ''all'' these test directories, the tool <code>subsequenttests</code> (in <code>solenv/bin</code>) exists. It scans the <code>build.lst</code> files of all modules for <code>makefile.mk</code>s that mention <code>OOO_SUBSEQUENT_TESTS</code> and simply executes <code>dmake</code> in all those directories, with <code>OOO_SUBSEQUENT_TESTS</code> set. It supports a <code>-P<var>n</var></code> switch to build <var>n</var> directories in parallel.<br />
<br />
=== Helpers ===<br />
<br />
A new module <code>test</code> shall collect reusable code snippets for C++ and Java tests.<br />
<br />
For now, it concentrates on letting a test connect to an OOo instance via remote UNO: A C++ test class can hold a <code>test::OfficeConnection</code> as class member and, in its CppUnit <code>setUp</code> and <code>tearDown</code> functions, call <code>OfficeConnection::setUp</code> and <code>OfficeConnection::tearDown</code>, respectively. Tests obtain access to the OOo instance via <code>OfficeConnection::getFactory</code>. Similarly, a Java test class can use an <code>org.openoffice.test.OfficeConnection</code> instance, offering the same functionality as its C++ counterpart.<br />
<br />
For this to work, three additional steps are necessary:<br />
* First, in <code>instsetoo_native</code>, building an installation set for the <code>openoffice</code> product in the default language (<code>en-US</code>) in any package format now takes care to always also build an archive package format (<code>tar.gz</code> resp. <code>zip</code>) of that product.<br />
* Second, building <code>smoketestoo_native</code> permanently installs that archive into the solver. (Except on Windows, where problems with resulting long pathnames prevent this; there, as a workaround, each test individually unzips the archive to some local temporary directory.) <br />
* Third, a test that requires an OOo instance includes <code>installationtest.mk</code> in its <code>makefile.mk</code>. That file makes sure to call the CppUnit and JUnit test runners with the information necessary for the helper classes to start the correct OOo instance with a fresh <code>UserInstallation</code> and set up an URP pipe connection. The information is tunneled into the test runner executables as UNO bootstrap parameters.<br />
<br />
For debugging purposes, which OOo instance the tests use can manually be overridden, see [http://www.openoffice.org/servlets/ReadMsg?list=interface-announce&msgNo=1285 &ldquo;OOO_TEST_SOFFICE: allow override of tested soffice process&rdquo;].<br />
<br />
=== <code>unoapi</code> Tests ===<br />
<br />
The <code>unoapi</code> tests are redesigned to use the new test framework. They are plain JUnit tests and use the mechanisms described above to connect to running OOo instances. However, due to the large amount of logic encoded in <code>qadevOOo</code>, those JUnit tests for now are only thin wrappers around <code>org.openoffice.Runner.run</code>. This is intended to change over time.<br />
<br />
The <code>cwscheckapi</code> tool to run the <code>unoapi</code> tests has been subsumed by <code>subsequenttests</code>. The latter always runs all tests, while the former had mechanisms to run only tests for modules that had been changed by a CWS. The hope is that the parallel mode of <code>subsequenttests</code> makes it fast enough so that running all tests all of the times becomes feasible.<br />
<br />
Unfortunately, running the <code>unoapi</code> tests is still not stable enough to give useful results. Therefore, running <code>subsequenttests</code> has been disabled in the build bots for now. Making the tests sufficiently stable is ongoing work.<br />
<br />
== Details ==<br />
<br />
Working on {{CWS|sb118}}, {{CWS|sb120}}.<br />
<br />
=== CppUnit 1.12.1 ===<br />
<br />
* Replace existing <code>cppunit</code> and <code>testshl2</code> combo with latest CppUnit 1.12.1.<br />
* OOo <code>configure --with-system-cppunit</code> (for now only if also <code>--with-system-stl</code>!); minimal required version for now arbitrarily 1.12.1.<br />
* '''TODO:''' Upstream <code>PATCH_FILES</code> (<code>windows.patch</code>?!?).<br />
* '''TODO:''' <code>RPATH</code> in generated libraries and executables.<br />
* '''TODO:''' Improve <code>CPPUNIT_PLUGIN_EXPORT</code> and get rid of version maps (GCC exception problems?).<br />
* '''TODO:''' <code>cppunit/makefile.mk</code> <code>MY_LIBS = -lm</code> Solaris hack.<br />
* '''TODO:''' In general OOo build environment, no longer set <code>CFLAGS</code> etc. as environment variables; have package-specific <code>OOO_<var>package</var>_CFLAGS</code> etc. and combine those into <code>CFLAGS</code> etc. where necessary (see <code>OOO_STLPORT_CXXFLAGS</code> etc. in <code>cppunit/makefile.mk</code>).<br />
* '''TODO:''' Why use <code>cppunittester</code> instead of <code>DllPlugInTester</code>? (Remove building/delivering <code>DllPlugInTester</code>.)<br />
* '''TODO:''' Make <code>operator &lt;&lt;(std::basic_ostream &amp;, rtl::OUString const &amp;)</code> from <code>test/oustringstreaminserter.hxx</code> generally available?<br />
* '''TODO:''' Make STLport <code>num_put</code> symbols available on platforms other than Linux (see <code>solenv/bin/addsym.awk</code>), too, so that <code>CPPUNIT_ASSERT_EQUAL</code> actually outputs numeric values.<br />
<br />
=== <code>testshl2</code> ===<br />
<br />
* <code>solenv/inc_cppunit.mk</code>/<code>cppunit.mk</code>: [http://hg.services.openoffice.org/cws/sb118/rev/cf13421c3774 &ldquo;adapted <code>cppunit.mk</code> to <code>cppunittester</code> and no longer require &lsquo;<code>dmake test</code>&rsquo; to run tests&rdquo;].<br />
* '''TODO:''' <code>DEV300_m68</code> introduced <code>TESTSHL2LIB</code> (which I removed again) and uses it in many <code>qa</code> makefiles (that I need to touch someday, anyway).<br />
<br />
=== Unit Tests ===<br />
<br />
* <code>OOO_SUBSEQUENT_TESTS</code> (<code>build.lst</code> lists local dependencies of those directories, so that modifying a module and then calling &ldquo;<code>OOO_SUBSEQUENT_TESTS=x build</code>&rdquo; rebuilds the module and executes the tests).<br />
* '''TODO:''' If Build Environment&nbsp;2.0 would build directly to solver (instead of local output tree/deliver), that would simplify tests that currently need to take care to test local libraries instead of solver ones (see, for example, <code>OOO_TEST_PREFIX</code> in the <code>services.rdb</code> of <code>stoc/test/uriproc/makefile.mk</code>).<br />
{{Documentation/Note|Build Environment&nbsp;2.0 will not build directly to solver, but will make a module depend on the targets in the solver, and these are depending on the targets in the workdir (aka the old "local output tree"). Thus on an usual build in a module building and delivering are not two steps anymore. If tests depend on the target in the solver (which they will do automatically in most use cases, as linking against a library automatically creates a dependency on the library in the solver), they can be sure that the target is up to date in the solver '''and''' in the workdir.<br />
<br />
--[[User:B michaelsen|B michaelsen]] 06:32, 27 August 2010 (UTC)}}<br />
* '''TODO:''' Constructs like &ldquo;<code>-env:UNO_<var>&hellip;</var>=$(my_file)<var>&hellip;</var></code>&rdquo; would fail for problematic characters (spaces!) in paths.<br />
<br />
=== Smoke Test ===<br />
<br />
* Redesign <code>smoketestoo_native</code> to use CppUnit and pre-installed OOo.<br />
* [http://hg.services.openoffice.org/cws/sb118/rev/160b248247a0 &ldquo;changed <code>tools/debug</code> to never fall back from writing to shell to writing to file, and read <code>DBGSV_INIT</code> from <code>rtl::Bootstrap</code>; the latter causes problems if <code>tools/debug</code> is called from static code executing before <code>SAL_MAIN</code> has called <code>osl_setCommandArgs</code> &rarr; removed statics from code and added assertions to <code>osl/process</code>; various improvements to <code>smoketests.cxx</code> (incl. passing an appropriate <code>dbgsv.ini</code> for non-pro builds)&rdquo;] followed by [http://hg.services.openoffice.org/cws/sb118/rev/dbbacb9d2fd3 &ldquo;reverted parts of HG <code>-c&nbsp;160b248247a0</code> again: the &lsquo;static code executing before <code>SAL_MAIN</code>&rsquo; problem was too severe; instead, globally set <code>DBGSV_INIT</code> build env var to new <code>solenv/bin/dbgsv.ini</code>&rdquo;]; see also {{issue|109142}} &ldquo;Let assertions abort&rdquo;.<br />
* '''TODO:''' For <code>smoketestoo_native/makefile.mk</code> &ldquo;<code><nowiki>-env:arg-env=$(OOO_LIBRARY_PATH_VAR)"$${{$(OOO_LIBRARY_PATH_VAR)+=$$$(OOO_LIBRARY_PATH_VAR)}}"</nowiki></code>&rdquo; mechanism: <code>osl_executeProcess</code> <code>ustrEnvironments</code> members without &ldquo;<code>=</code>&rdquo;: all platforms; documentation; documentation of <code>osl_executeProcess_WithRedicrectedIO</code>.<br />
* '''TODO:''' <code>-headless</code>? (appears to still display windows on Windows and Mac OS&nbsp;X, however, see {{issue|109052}})<br />
* '''TODO:''' {{issue|113341}} &ldquo;-nofirststartwizard should disable update check&rdquo;<br />
<br />
=== Pre-Installed OOo ===<br />
<br />
* For Sun Hamburg Release Engineering, take MWS archive installation sets from &ldquo;S:&rdquo; instead of solver: [http://hg.services.openoffice.org/cws/sb118/rev/d5dbea724063 &ldquo;take installation set from <code>SHIPDRIVE</code> if appropriate&rdquo;].<br />
* '''TODO:''' <code>PKGFORMAT=installed</code> instead of <code>archive</code>?<br />
<br />
=== <code>unoapi</code> Tests ===<br />
<br />
* Known issues, open (not yet addressed at all; disabled for now on net-yet-integrated CWS; or fixed on not-yet-integrated CWS):<br />
** {{issue|116120}} &ldquo;vcl: TabControl::ImplGetTabRect negative height leads to X_CreatePixmap BadAlloc&rdquo;<br />
** {{issue|116125}} &ldquo;qadevOOo/qa/complex/junitskeleton failure&rdquo;<br />
** {{issue|116156}} &ldquo;toolkit/qa/unoapi crash in SwAccessibleMap::RemoveContext&rdquo;<br />
** {{issue|116192}} &ldquo;[sw] fixed text fields sometimes get updated&rdquo;<br />
** {{issue|116550}} &ldquo;toolkit/qa/unoapi crashes OOo in ~SwAccessibleParagraph vs. SwXTextDocument::close&rdquo;<br />
** {{issue|116583}} &ldquo;comphelper/qa/complex/comphelper failure&rdquo;<br />
** {{issue|116730}} &ldquo;vcl: crash with multiple threads in Window::ImplGrabFocus&rdquo;<br />
* Known issues, disabled for now:<br />
** {{issue|109517}} &ldquo;sc/qa/unoapi fails for ScAnnotationObj etc.&rdquo;<br />
** {{issue|109518}} &ldquo;sd/qa/unoapi crash in SfxViewShell::GetController&rdquo;<br />
** {{issue|109643}} &ldquo;toolkit/qa/unoapi tests fail when losing focus&rdquo;<br />
** {{issue|109728}} &ldquo;~ScAutoFormatObj uses cleared ScGlobal&rdquo;<br />
** {{issue|109917}} &ldquo;fragile unoapi test using OnUnfocus event&rdquo;<br />
** {{issue|109939}} &ldquo;toolkit: inconsistent UnoControl locking schemes&rdquo;<br />
** {{issue|110862}} &ldquo;sc/qa/unoapi fails for sc.ScDataPilotTableObj::com::sun::star::sheet::XDataPilotTable::refresh()&rdquo;<br />
** {{issue|110988}} &ldquo;svtools/qa/unoapi fails for svtools.AccessibleBrowseBox etc.&rdquo;<br />
** {{issue|111006}} &ldquo;toolkit: deadlock between UnoControls&rdquo;<br />
** {{issue|111032}} &ldquo;sc/qa/unoapi sc.ScAccessibleCell::com::sun::star::accessibility::XAccessibleText getCharacterBounds() failure&rdquo;<br />
** {{issue|111042}} &ldquo;sd/qa/unoapi sd::DrawController::dispose crash&rdquo;<br />
** {{issue|111043}} &ldquo;sd/qa/unoapi sd::DrawController_OutlineView NullPointerException&rdquo;<br />
** {{issue|111102}} &ldquo;chart2: ChartModelHelper::findDiagram returns null&rdquo;<br />
** {{issue|111111}} &ldquo;xmloff.Impress.XMLImporter::com::sun::star::document::XImporter&rdquo;<br />
** {{issue|111113}} &ldquo;toolkit.AccessibleStatusBarItem unoapi failure&rdquo;<br />
** {{issue|111148}} &ldquo;forms/qa/unoapi forms.OImageControlModel::com::sun::star::beans::XMultiPropertySet deadlock&rdquo;<br />
** {{issue|111169}} &ldquo;svx.AccessiblePageShape unoapi failure&rdquo;<br />
** {{issue|111170}} &ldquo;sun/i18n/qa/unoapi "creating a drawdoc" failure&rdquo;<br />
** {{issue|111178}} &ldquo;sw/qa/unoapi SwView::SelectShell crash&rdquo;<br />
** {{issue|111180}} &ldquo;framework/qa/unoapi fwk.Desktop::com::sun::star::frame::XComponentLoader::loadComponentFromURL() failure&rdquo;<br />
** {{issue|111182}} &ldquo;Desktop::terminate -> ~DropTarget -> _objc_error crash&rdquo;<br />
** {{issue|111184}} &ldquo;sal/qa/osl/pipe uses fixed pipe names&rdquo;<br />
** {{issue|111186}} &ldquo;sw/qa/unoapi sw.PageStyle::com::sun::star::beans::XPropertySet::setPropertyValue() failure&rdquo;<br />
** {{issue|111190}} &ldquo;sw/qa/unoapi sw.SwXShape failure&rdquo;<br />
** {{issue|111194}} &ldquo;sw/qa/unoapi sw.XMLExporter crash&rdquo;<br />
** {{issue|111195}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleScrollBar::com::sun::star::accessibility::XAccessibleValue::setCurrentValue() failure&rdquo;<br />
** {{issue|111197}} &ldquo;sw/qa/unoapi sw.SwAccessibleDocumentPageView failure&rdquo;<br />
** {{issue|111199}} &ldquo;sd/qa/unoapi sd.AccessibleOutlineView failure&rdquo;<br />
** {{issue|111200}} &ldquo;xmloff/qa/unoapi xmloff.Draw.XMLMetaImporter failure&rdquo;<br />
** {{issue|111216}} &ldquo;svx/qa/unoapi accessibility deadlock&rdquo;<br />
** {{issue|111218}} &ldquo;sw/qa/unoapi sw.SwAccessibleParagraphView::com::sun::star::accessibility::XAccessibleEventBroadcaster::removeEventListener() failure&rdquo;<br />
** {{issue|111220}} &ldquo;sw/qa/unoapi sw.XMLContentExporter::com::sun::star::document::XFilter::cancel() failure&rdquo;<br />
** {{issue|111224}} &ldquo;xmloff/qa/unoapi xmloff.Impress.XMLContentExporter crash&rdquo;<br />
** {{issue|111225}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleStatusBar failure&rdquo;<br />
** {{issue|111252}} &ldquo;svx/qa/unoapi svx.AccessibleOLEShape deadlock&rdquo;<br />
** {{issue|111273}} &ldquo;sw/qa/unoapi sw.SwXTextEmbeddedObject::com::sun::star::document::XEmbeddedObjectSupplier::getEmbeddedObject() crash&rdquo;<br />
** {{issue|111278}} &ldquo;svx/qa/unoapi svx.AccessibleEditableTextPara failure&rdquo;<br />
** {{issue|111283}} &ldquo;sfx2/qa/unoapi sfx.StandaloneDocumentInfo failure&rdquo;<br />
** {{issue|111285}} &ldquo;forms/qa/unoapi forms.OButtonModel failure&rdquo;<br />
** {{issue|111287}} &ldquo;xmloff/qa/unoapi XMLSettingsIm-/Exporter crash&rdquo;<br />
** {{issue|111329}} &ldquo;sd/qa/unoapi SdXCustomPresentationAccess::getElementNames/ImpEditEngine::OnlineSpellHdl hang&rdquo;<br />
** {{issue|111332}} &ldquo;sw/qa/unoapi sw.XMLStylesExporter::com::sun::star::document::XFilter crash&rdquo;<br />
** {{issue|111333}} &ldquo;forms/qa/unoapi forms.OImageControlControl::com::sun::star::awt::XControl deadlock&rdquo;<br />
** {{issue|112743}} &ldquo;starmath/qa/unoapi sm.XMLSettingsExporter failure&rdquo;<br />
** {{issue|112746}} &ldquo;framework/qa/unoapi fwk.ModuleManager failure (X11 BadWindow)&rdquo;<br />
** {{issue|112751}} &ldquo;testgraphical/qa/graphical failure&rdquo;<br />
** {{issue|112778}} &ldquo;xmloff/qa/unoapi xmloff.Draw.XMLContentExporter failure&rdquo;<br />
** {{issue|113020}} &ldquo;sw/qa/unoapi sw.SwXTextGraphicObject::com::sun::star::beans::XPropertySet failure&rdquo;<br />
** {{issue|113103}} &ldquo;chart2: deadlock between DiagramHelper and Diagram&rdquo;<br />
** {{issue|113136}} &ldquo;sw/qa/unoapi sw.SwAccessibleParagraphView::com::sun::star::accessibility::XAccessibleEditableText failure&rdquo;<br />
** {{issue|113142}} &ldquo;sw/qa/unoapi SwAccessibleContext::RemoveFrmFromAccessibleMap crash&rdquo;<br />
** {{issue|113161}} &ldquo;sd/qa/unoapi sd.SdLayer::com::sun::star::drawing::Layer::IsVisible failure&rdquo;<br />
** {{issue|113201}} &ldquo;forms/qa/unoapi forms.OEditModel::com::sun::star::form::validation::XValidatableFormComponent failure&rdquo;<br />
** {{issue|113245}} &ldquo;framework/qa/unoapi fwl.TypeDetection failure&rdquo;<br />
** {{issue|113306}} &ldquo;sfx2/qa/unoapi sfx.DocumentTemplates failure&rdquo;<br />
** {{issue|113386}} &ldquo;sd/qa/unoapi sd.AccessibleDrawDocumentView::com::sun::star::accessibility::XAccessibleComponent::containsPoint() failure&rdquo;<br />
** {{issue|113489}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleMenu{,Bar,Separator} failures&rdquo;<br />
** {{issue|114205}} &ldquo;sw/qa/unoapi sw.SwAccessibleParagraphView::com::sun::star::accessibility::XAccessibleText::copyText() failed&rdquo;<br />
** {{issue|114209}} &ldquo;forms/qa/unoapi forms.OGridControlModel::com::sun::star::view::XSelectionSupplier crash&rdquo;<br />
** {{issue|114211}} &ldquo;xmloff/qa/unoapi xmloff.Draw.XMLStylesImporter::com::sun::star::lang::XInitialization crash&rdquo;<br />
** {{issue|114213}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleMenu::com::sun::star::accessibility::XAccessibleSelection failure&rdquo;<br />
** {{issue|114636}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleScrollBar::com::sun::star::accessibility::XAccessibleAction failure&rdquo;<br />
** {{issue|114637}} &ldquo;sw/qa/unoapi sw.SwAccessibleFootnoteView(?) crash&rdquo;<br />
** {{issue|114642}} &ldquo;svx/qa/unoapi svx: svx.SvxUnoTextContent::com::sun::star::style::CharacterProperties crash&rdquo;<br />
** {{issue|114669}} &ldquo;forms/qa/unoapi forms.OListBoxControl crash&rdquo;<br />
** {{issue|114889}} &ldquo;sw/qa/unoapi sw.SwXTextViewCursor::com::sun::star::view::XScreenCursor&rdquo;<br />
* Missing tests:<br />
** {{issue|109564}} &ldquo;qadevOOo/tests/java/ifc/awt/_XSystemChildFactory.java&rdquo;<br />
* Sporadic failures:<br />
** {{issue|111217}} &ldquo;BasicManager::SetGlobalUNOConstant crash during shutdown&rdquo;<br />
** {{issue|111246}} &ldquo;svx::FontHeightToolBoxControl::statusChanged crash (memory corruption)&rdquo;<br />
** {{issue|111271}} &ldquo;Mac OS X: crash during shutdown, __tcf_2 on stack&rdquo;<br />
** {{issue|111400}} &ldquo;Extension Manager does not join spawned uno process (-> smoketestoo_native fails)&rdquo;<br />
** {{issue|112070}} &ldquo;UNO API tests must not use random&rdquo;<br />
** {{issue|113158}} &ldquo;crash with two threads in framework::ToolBarManager dtor&rdquo;<br />
** {{issue|113197}} &ldquo;sw/qa/unoapi sw.SwXTextRange hangs&rdquo;<br />
** {{issue|113367}} &ldquo;sysdtrans deadlock during shutdown&rdquo;<br />
** {{issue|113464}} &ldquo;stoc_smgr::ORegistryServiceManager::dispose crash during shutdown&rdquo;<br />
** {{issue|114207}} &ldquo;framework::ModuleUIConfigurationManager::dispose crash during shutdown&rdquo;<br />
** {{issue|114675}} &ldquo;binary URP bridge race on shut down, crash&rdquo;<br />
** {{issue|114718}} &ldquo;forms/qa/unoapi: crash in remote async release call&rdquo;<br />
** {{issue|116131}} &ldquo;vcl: message unregisterDraggingDestinationHandler: sent to freed object&rdquo;<br />
<br />
[[Category:Effort]][[Category:Test]]</div>Sbhttps://wiki.openoffice.org/wiki/Test_CleanupTest Cleanup2011-01-24T10:53:16Z<p>Sb: /* unoapi Tests */</p>
<hr />
<div>= Test Cleanup Project =<br />
<br />
The demand for automated (unit) testing should be obvious. See the [http://www.openoffice.org/servlets/ReadMsg?list=dev&msgNo=26189 mission statement mail] and [[Media:JustTestingPresentation.odp|slides]] from a [http://fosdem.org/2010/schedule/events/ooo_testing FOSDEM'10 talk] and an [http://www.ooocon.org/index.php/ooocon/2010/paper/view/188 OOoCon&nbsp;2010 presentation] for more information and further links.<br />
<br />
For examples of how to write xUnit based tests in the OOo code base, see [http://hg.services.openoffice.org/DEV300/file/87f4911ea629/basegfx/test <code>basegfx/test/</code>], [http://hg.services.openoffice.org/DEV300/file/87f4911ea629/sal/qa/ByteSequence <code>sal/qa/ByteSequence/</code>], and [http://hg.services.openoffice.org/DEV300/file/87f4911ea629/smoketestoo_native <code>smoketest_native/</code>]. However, the hard part should not be how to write test code, anyway, but how to write ''testable'' code; see [http://misko.hevery.com/2008/11/04/clean-code-talks-unit-testing/ The Clean Code Talks&mdash;Unit Testing].<br />
<br />
When testing C++ code that merely uses UNO types (no services), but uses them in a way that requires UNO to be bootstrapped so that the relevant type information is available (e.g., putting instances of complex UNO types into <code>com::sun::star::uno::Any</code>), one approach is as follows: In the <code>makefile.mk</code>, instead of <code>.INCLUDE: _cppunit.mk</code> use<br />
<source lang="make"><br />
.IF "$(OS)" == "WNT"<br />
my_file = file:///<br />
.ELSE<br />
my_file = file://<br />
.END<br />
<br />
ALLTAR : test<br />
<br />
test .PHONY : $(SHL1TARGETN)<br />
$(CPPUNITTESTER) $(SHL1TARGETN) \<br />
-env:UNO_TYPES=$(my_file)$(SOLARBINDIR)/types.rdb<br />
</source><br />
and in the test code once call <code>cppu::defaultBootstrap_InitialComponentContext()</code>.<br />
<br />
== User Interface ==<br />
<br />
=== CppUnit ===<br />
<br />
For tests in C++, plain CppUnit (at least version 1.12.1) is available. (OOo bundles CppUnit 1.12.1 as an external module; alternatively, you can configure <code>--with-system-cppunit</code>.)<br />
<br />
Implement the test code as a dynamic library, following CppUnit conventions (i.e., using [http://cppunit.sourceforge.net/doc/lastest/group___creating_test_suite.html#ga0 <code>CPPUNIT_TEST_SUITE_REGISTRATION</code>] and [http://cppunit.sourceforge.net/doc/lastest/_test_plug_in_8h.html#a2 <code>CPPUNIT_PLUGIN_IMPLEMENT</code>] macros). The following settings are needed in the <code>makefile.mk</code>:<br />
* <code>ENABLE_EXCEPTIONS = TRUE</code><br />
* <code>CFLAGSCXX += $(CPPUNIT_CFLAGS)</code><br />
* <code>SHL<var>n</var>RPATH = NONE</code><br />
* <code>SHL<var>n</var>STDLIBS += $(CPPUNITLIB)</code><br />
* <code>SHL<var>n</var>VERSIONMAP = <var>version.map</var></code>, where that file must contain the following (see [[#CppUnit_1.12.1|details]] below for improving this):<br />
UDK_3_0_0 {<br />
global:<br />
cppunitTestPlugIn;<br />
local:<br />
*;<br />
};<br />
<br />
To run tests, <code>sal/cppunittester</code> delivers a <code>cppunittester</code> executable that has some advantages over the plain CppUnit <code>DllPlugInTester</code>:<br />
* It uses <code>SAL_IMPLEMENT_MAIN</code> to properly set up the per-process settings required by URE. Test code as well as tested code based on URE will expect this and would fail in a process that is not set up in this way.<br />
* Getting CppUnit to build as an external module within the Windows OOo build is a non-trivial task. The less parts of it that need to be built, the better.<br />
<br />
Something like the following in <code>makefile.mk</code> will execute the tests:<br />
ALLTAR : test<br />
test .PHONY : $(SHL1TARGETN)<br />
$(CPPUNITTESTER) $(SHL1TARGETN)<br />
<br />
<code>$(CPPUNITTESTER)</code> internally uses <code>$(AUGMENT_LIBRARY_PATH_LOCAL)</code> to favor library instances in the local output tree over ones in solver. Alternatively to the above, <code>.INCLUDE: _cppunit.mk</code> calls <code>$(CPPUNITTESTER)</code> on each of <code>$(SHL1TARGETN)</code>, &hellip;, <code>$(SHL10TARGETN)</code> that is defined.<br />
<br />
=== JUnit ===<br />
<br />
For tests in Java, plain JUnit (at least version 4) is available. (OOo requires JUnit as a prerequisite, see [http://junit.org/ junit.org] for downloads; you can configure <code>--with-junit=<var>&hellip;</var></code> if it is not automatically found; alternatively, you can configure <code>--without-junit</code>, disabling JUnit-based tests.)<br />
<br />
=== <code>subsequenttests</code> ===<br />
<br />
Some tests have build and/or run time dependencies on modules further up in the hierarchy, or modules that the rest of the module in question does not have dependencies on (and which are thus not listed in the module's <code>build.lst</code>). The extreme case are tests that need a complete OOo installation as their test environment.<br />
<br />
For such tests, the whole <code>makefile.mk</code> should be wrapped in:<br />
.IF "$(OOO_SUBSEQUENT_TESTS)" == ""<br />
nothing .PHONY :<br />
.ELSE<br />
...<br />
.END<br />
(and the directory included in the module's <code>build.lst</code>).<br />
<br />
The idea is to do a complete OOo build first (<code>cd smoketestoo_native && build --all</code>) and then build and execute those tests either selectively or wholesale.<br />
<br />
Selectively building a specific such test directory can be done with <code>cd <var>&hellip;</var> && OOO_SUBSEQUENT_TESTS=TRUE dmake</code>.<br />
<br />
To build and execute ''all'' these test directories, the tool <code>subsequenttests</code> (in <code>solenv/bin</code>) exists. It scans the <code>build.lst</code> files of all modules for <code>makefile.mk</code>s that mention <code>OOO_SUBSEQUENT_TESTS</code> and simply executes <code>dmake</code> in all those directories, with <code>OOO_SUBSEQUENT_TESTS</code> set. It supports a <code>-P<var>n</var></code> switch to build <var>n</var> directories in parallel.<br />
<br />
=== Helpers ===<br />
<br />
A new module <code>test</code> shall collect reusable code snippets for C++ and Java tests.<br />
<br />
For now, it concentrates on letting a test connect to an OOo instance via remote UNO: A C++ test class can hold a <code>test::OfficeConnection</code> as class member and, in its CppUnit <code>setUp</code> and <code>tearDown</code> functions, call <code>OfficeConnection::setUp</code> and <code>OfficeConnection::tearDown</code>, respectively. Tests obtain access to the OOo instance via <code>OfficeConnection::getFactory</code>. Similarly, a Java test class can use an <code>org.openoffice.test.OfficeConnection</code> instance, offering the same functionality as its C++ counterpart.<br />
<br />
For this to work, three additional steps are necessary:<br />
* First, in <code>instsetoo_native</code>, building an installation set for the <code>openoffice</code> product in the default language (<code>en-US</code>) in any package format now takes care to always also build an archive package format (<code>tar.gz</code> resp. <code>zip</code>) of that product.<br />
* Second, building <code>smoketestoo_native</code> permanently installs that archive into the solver. (Except on Windows, where problems with resulting long pathnames prevent this; there, as a workaround, each test individually unzips the archive to some local temporary directory.) <br />
* Third, a test that requires an OOo instance includes <code>installationtest.mk</code> in its <code>makefile.mk</code>. That file makes sure to call the CppUnit and JUnit test runners with the information necessary for the helper classes to start the correct OOo instance with a fresh <code>UserInstallation</code> and set up an URP pipe connection. The information is tunneled into the test runner executables as UNO bootstrap parameters.<br />
<br />
For debugging purposes, which OOo instance the tests use can manually be overridden, see [http://www.openoffice.org/servlets/ReadMsg?list=interface-announce&msgNo=1285 &ldquo;OOO_TEST_SOFFICE: allow override of tested soffice process&rdquo;].<br />
<br />
=== <code>unoapi</code> Tests ===<br />
<br />
The <code>unoapi</code> tests are redesigned to use the new test framework. They are plain JUnit tests and use the mechanisms described above to connect to running OOo instances. However, due to the large amount of logic encoded in <code>qadevOOo</code>, those JUnit tests for now are only thin wrappers around <code>org.openoffice.Runner.run</code>. This is intended to change over time.<br />
<br />
The <code>cwscheckapi</code> tool to run the <code>unoapi</code> tests has been subsumed by <code>subsequenttests</code>. The latter always runs all tests, while the former had mechanisms to run only tests for modules that had been changed by a CWS. The hope is that the parallel mode of <code>subsequenttests</code> makes it fast enough so that running all tests all of the times becomes feasible.<br />
<br />
Unfortunately, running the <code>unoapi</code> tests is still not stable enough to give useful results. Therefore, running <code>subsequenttests</code> has been disabled in the build bots for now. Making the tests sufficiently stable is ongoing work.<br />
<br />
== Details ==<br />
<br />
Working on {{CWS|sb118}}, {{CWS|sb120}}.<br />
<br />
=== CppUnit 1.12.1 ===<br />
<br />
* Replace existing <code>cppunit</code> and <code>testshl2</code> combo with latest CppUnit 1.12.1.<br />
* OOo <code>configure --with-system-cppunit</code> (for now only if also <code>--with-system-stl</code>!); minimal required version for now arbitrarily 1.12.1.<br />
* '''TODO:''' Upstream <code>PATCH_FILES</code> (<code>windows.patch</code>?!?).<br />
* '''TODO:''' <code>RPATH</code> in generated libraries and executables.<br />
* '''TODO:''' Improve <code>CPPUNIT_PLUGIN_EXPORT</code> and get rid of version maps (GCC exception problems?).<br />
* '''TODO:''' <code>cppunit/makefile.mk</code> <code>MY_LIBS = -lm</code> Solaris hack.<br />
* '''TODO:''' In general OOo build environment, no longer set <code>CFLAGS</code> etc. as environment variables; have package-specific <code>OOO_<var>package</var>_CFLAGS</code> etc. and combine those into <code>CFLAGS</code> etc. where necessary (see <code>OOO_STLPORT_CXXFLAGS</code> etc. in <code>cppunit/makefile.mk</code>).<br />
* '''TODO:''' Why use <code>cppunittester</code> instead of <code>DllPlugInTester</code>? (Remove building/delivering <code>DllPlugInTester</code>.)<br />
* '''TODO:''' Make <code>operator &lt;&lt;(std::basic_ostream &amp;, rtl::OUString const &amp;)</code> from <code>test/oustringstreaminserter.hxx</code> generally available?<br />
* '''TODO:''' Make STLport <code>num_put</code> symbols available on platforms other than Linux (see <code>solenv/bin/addsym.awk</code>), too, so that <code>CPPUNIT_ASSERT_EQUAL</code> actually outputs numeric values.<br />
<br />
=== <code>testshl2</code> ===<br />
<br />
* <code>solenv/inc_cppunit.mk</code>/<code>cppunit.mk</code>: [http://hg.services.openoffice.org/cws/sb118/rev/cf13421c3774 &ldquo;adapted <code>cppunit.mk</code> to <code>cppunittester</code> and no longer require &lsquo;<code>dmake test</code>&rsquo; to run tests&rdquo;].<br />
* '''TODO:''' <code>DEV300_m68</code> introduced <code>TESTSHL2LIB</code> (which I removed again) and uses it in many <code>qa</code> makefiles (that I need to touch someday, anyway).<br />
<br />
=== Unit Tests ===<br />
<br />
* <code>OOO_SUBSEQUENT_TESTS</code> (<code>build.lst</code> lists local dependencies of those directories, so that modifying a module and then calling &ldquo;<code>OOO_SUBSEQUENT_TESTS=x build</code>&rdquo; rebuilds the module and executes the tests).<br />
* '''TODO:''' If Build Environment&nbsp;2.0 would build directly to solver (instead of local output tree/deliver), that would simplify tests that currently need to take care to test local libraries instead of solver ones (see, for example, <code>OOO_TEST_PREFIX</code> in the <code>services.rdb</code> of <code>stoc/test/uriproc/makefile.mk</code>).<br />
{{Documentation/Note|Build Environment&nbsp;2.0 will not build directly to solver, but will make a module depend on the targets in the solver, and these are depending on the targets in the workdir (aka the old "local output tree"). Thus on an usual build in a module building and delivering are not two steps anymore. If tests depend on the target in the solver (which they will do automatically in most use cases, as linking against a library automatically creates a dependency on the library in the solver), they can be sure that the target is up to date in the solver '''and''' in the workdir.<br />
<br />
--[[User:B michaelsen|B michaelsen]] 06:32, 27 August 2010 (UTC)}}<br />
* '''TODO:''' Constructs like &ldquo;<code>-env:UNO_<var>&hellip;</var>=$(my_file)<var>&hellip;</var></code>&rdquo; would fail for problematic characters (spaces!) in paths.<br />
<br />
=== Smoke Test ===<br />
<br />
* Redesign <code>smoketestoo_native</code> to use CppUnit and pre-installed OOo.<br />
* [http://hg.services.openoffice.org/cws/sb118/rev/160b248247a0 &ldquo;changed <code>tools/debug</code> to never fall back from writing to shell to writing to file, and read <code>DBGSV_INIT</code> from <code>rtl::Bootstrap</code>; the latter causes problems if <code>tools/debug</code> is called from static code executing before <code>SAL_MAIN</code> has called <code>osl_setCommandArgs</code> &rarr; removed statics from code and added assertions to <code>osl/process</code>; various improvements to <code>smoketests.cxx</code> (incl. passing an appropriate <code>dbgsv.ini</code> for non-pro builds)&rdquo;] followed by [http://hg.services.openoffice.org/cws/sb118/rev/dbbacb9d2fd3 &ldquo;reverted parts of HG <code>-c&nbsp;160b248247a0</code> again: the &lsquo;static code executing before <code>SAL_MAIN</code>&rsquo; problem was too severe; instead, globally set <code>DBGSV_INIT</code> build env var to new <code>solenv/bin/dbgsv.ini</code>&rdquo;]; see also {{issue|109142}} &ldquo;Let assertions abort&rdquo;.<br />
* '''TODO:''' For <code>smoketestoo_native/makefile.mk</code> &ldquo;<code><nowiki>-env:arg-env=$(OOO_LIBRARY_PATH_VAR)"$${{$(OOO_LIBRARY_PATH_VAR)+=$$$(OOO_LIBRARY_PATH_VAR)}}"</nowiki></code>&rdquo; mechanism: <code>osl_executeProcess</code> <code>ustrEnvironments</code> members without &ldquo;<code>=</code>&rdquo;: all platforms; documentation; documentation of <code>osl_executeProcess_WithRedicrectedIO</code>.<br />
* '''TODO:''' <code>-headless</code>? (appears to still display windows on Windows and Mac OS&nbsp;X, however, see {{issue|109052}})<br />
* '''TODO:''' {{issue|113341}} &ldquo;-nofirststartwizard should disable update check&rdquo;<br />
<br />
=== Pre-Installed OOo ===<br />
<br />
* For Sun Hamburg Release Engineering, take MWS archive installation sets from &ldquo;S:&rdquo; instead of solver: [http://hg.services.openoffice.org/cws/sb118/rev/d5dbea724063 &ldquo;take installation set from <code>SHIPDRIVE</code> if appropriate&rdquo;].<br />
* '''TODO:''' <code>PKGFORMAT=installed</code> instead of <code>archive</code>?<br />
<br />
=== <code>unoapi</code> Tests ===<br />
<br />
* Known issues, open (not yet addressed at all; disabled for now on net-yet-integrated CWS; or fixed on not-yet-integrated CWS):<br />
** {{issue|116120}} &ldquo;vcl: TabControl::ImplGetTabRect negative height leads to X_CreatePixmap BadAlloc&rdquo;<br />
** {{issue|116125}} &ldquo;qadevOOo/qa/complex/junitskeleton failure&rdquo;<br />
** {{issue|116156}} &ldquo;toolkit/qa/unoapi crash in SwAccessibleMap::RemoveContext&rdquo;<br />
** {{issue|116192}} &ldquo;[sw] fixed text fields sometimes get updated&rdquo;<br />
** {{issue|116550}} &ldquo;toolkit/qa/unoapi crashes OOo in ~SwAccessibleParagraph vs. SwXTextDocument::close&rdquo;<br />
** {{issue|116583}} &ldquo;comphelper/qa/complex/comphelper failure&rdquo;<br />
* Known issues, disabled for now:<br />
** {{issue|109517}} &ldquo;sc/qa/unoapi fails for ScAnnotationObj etc.&rdquo;<br />
** {{issue|109518}} &ldquo;sd/qa/unoapi crash in SfxViewShell::GetController&rdquo;<br />
** {{issue|109643}} &ldquo;toolkit/qa/unoapi tests fail when losing focus&rdquo;<br />
** {{issue|109728}} &ldquo;~ScAutoFormatObj uses cleared ScGlobal&rdquo;<br />
** {{issue|109917}} &ldquo;fragile unoapi test using OnUnfocus event&rdquo;<br />
** {{issue|109939}} &ldquo;toolkit: inconsistent UnoControl locking schemes&rdquo;<br />
** {{issue|110862}} &ldquo;sc/qa/unoapi fails for sc.ScDataPilotTableObj::com::sun::star::sheet::XDataPilotTable::refresh()&rdquo;<br />
** {{issue|110988}} &ldquo;svtools/qa/unoapi fails for svtools.AccessibleBrowseBox etc.&rdquo;<br />
** {{issue|111006}} &ldquo;toolkit: deadlock between UnoControls&rdquo;<br />
** {{issue|111032}} &ldquo;sc/qa/unoapi sc.ScAccessibleCell::com::sun::star::accessibility::XAccessibleText getCharacterBounds() failure&rdquo;<br />
** {{issue|111042}} &ldquo;sd/qa/unoapi sd::DrawController::dispose crash&rdquo;<br />
** {{issue|111043}} &ldquo;sd/qa/unoapi sd::DrawController_OutlineView NullPointerException&rdquo;<br />
** {{issue|111102}} &ldquo;chart2: ChartModelHelper::findDiagram returns null&rdquo;<br />
** {{issue|111111}} &ldquo;xmloff.Impress.XMLImporter::com::sun::star::document::XImporter&rdquo;<br />
** {{issue|111113}} &ldquo;toolkit.AccessibleStatusBarItem unoapi failure&rdquo;<br />
** {{issue|111148}} &ldquo;forms/qa/unoapi forms.OImageControlModel::com::sun::star::beans::XMultiPropertySet deadlock&rdquo;<br />
** {{issue|111169}} &ldquo;svx.AccessiblePageShape unoapi failure&rdquo;<br />
** {{issue|111170}} &ldquo;sun/i18n/qa/unoapi "creating a drawdoc" failure&rdquo;<br />
** {{issue|111178}} &ldquo;sw/qa/unoapi SwView::SelectShell crash&rdquo;<br />
** {{issue|111180}} &ldquo;framework/qa/unoapi fwk.Desktop::com::sun::star::frame::XComponentLoader::loadComponentFromURL() failure&rdquo;<br />
** {{issue|111182}} &ldquo;Desktop::terminate -> ~DropTarget -> _objc_error crash&rdquo;<br />
** {{issue|111184}} &ldquo;sal/qa/osl/pipe uses fixed pipe names&rdquo;<br />
** {{issue|111186}} &ldquo;sw/qa/unoapi sw.PageStyle::com::sun::star::beans::XPropertySet::setPropertyValue() failure&rdquo;<br />
** {{issue|111190}} &ldquo;sw/qa/unoapi sw.SwXShape failure&rdquo;<br />
** {{issue|111194}} &ldquo;sw/qa/unoapi sw.XMLExporter crash&rdquo;<br />
** {{issue|111195}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleScrollBar::com::sun::star::accessibility::XAccessibleValue::setCurrentValue() failure&rdquo;<br />
** {{issue|111197}} &ldquo;sw/qa/unoapi sw.SwAccessibleDocumentPageView failure&rdquo;<br />
** {{issue|111199}} &ldquo;sd/qa/unoapi sd.AccessibleOutlineView failure&rdquo;<br />
** {{issue|111200}} &ldquo;xmloff/qa/unoapi xmloff.Draw.XMLMetaImporter failure&rdquo;<br />
** {{issue|111216}} &ldquo;svx/qa/unoapi accessibility deadlock&rdquo;<br />
** {{issue|111218}} &ldquo;sw/qa/unoapi sw.SwAccessibleParagraphView::com::sun::star::accessibility::XAccessibleEventBroadcaster::removeEventListener() failure&rdquo;<br />
** {{issue|111220}} &ldquo;sw/qa/unoapi sw.XMLContentExporter::com::sun::star::document::XFilter::cancel() failure&rdquo;<br />
** {{issue|111224}} &ldquo;xmloff/qa/unoapi xmloff.Impress.XMLContentExporter crash&rdquo;<br />
** {{issue|111225}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleStatusBar failure&rdquo;<br />
** {{issue|111252}} &ldquo;svx/qa/unoapi svx.AccessibleOLEShape deadlock&rdquo;<br />
** {{issue|111273}} &ldquo;sw/qa/unoapi sw.SwXTextEmbeddedObject::com::sun::star::document::XEmbeddedObjectSupplier::getEmbeddedObject() crash&rdquo;<br />
** {{issue|111278}} &ldquo;svx/qa/unoapi svx.AccessibleEditableTextPara failure&rdquo;<br />
** {{issue|111283}} &ldquo;sfx2/qa/unoapi sfx.StandaloneDocumentInfo failure&rdquo;<br />
** {{issue|111285}} &ldquo;forms/qa/unoapi forms.OButtonModel failure&rdquo;<br />
** {{issue|111287}} &ldquo;xmloff/qa/unoapi XMLSettingsIm-/Exporter crash&rdquo;<br />
** {{issue|111329}} &ldquo;sd/qa/unoapi SdXCustomPresentationAccess::getElementNames/ImpEditEngine::OnlineSpellHdl hang&rdquo;<br />
** {{issue|111332}} &ldquo;sw/qa/unoapi sw.XMLStylesExporter::com::sun::star::document::XFilter crash&rdquo;<br />
** {{issue|111333}} &ldquo;forms/qa/unoapi forms.OImageControlControl::com::sun::star::awt::XControl deadlock&rdquo;<br />
** {{issue|112743}} &ldquo;starmath/qa/unoapi sm.XMLSettingsExporter failure&rdquo;<br />
** {{issue|112746}} &ldquo;framework/qa/unoapi fwk.ModuleManager failure (X11 BadWindow)&rdquo;<br />
** {{issue|112751}} &ldquo;testgraphical/qa/graphical failure&rdquo;<br />
** {{issue|112778}} &ldquo;xmloff/qa/unoapi xmloff.Draw.XMLContentExporter failure&rdquo;<br />
** {{issue|113020}} &ldquo;sw/qa/unoapi sw.SwXTextGraphicObject::com::sun::star::beans::XPropertySet failure&rdquo;<br />
** {{issue|113103}} &ldquo;chart2: deadlock between DiagramHelper and Diagram&rdquo;<br />
** {{issue|113136}} &ldquo;sw/qa/unoapi sw.SwAccessibleParagraphView::com::sun::star::accessibility::XAccessibleEditableText failure&rdquo;<br />
** {{issue|113142}} &ldquo;sw/qa/unoapi SwAccessibleContext::RemoveFrmFromAccessibleMap crash&rdquo;<br />
** {{issue|113161}} &ldquo;sd/qa/unoapi sd.SdLayer::com::sun::star::drawing::Layer::IsVisible failure&rdquo;<br />
** {{issue|113201}} &ldquo;forms/qa/unoapi forms.OEditModel::com::sun::star::form::validation::XValidatableFormComponent failure&rdquo;<br />
** {{issue|113245}} &ldquo;framework/qa/unoapi fwl.TypeDetection failure&rdquo;<br />
** {{issue|113306}} &ldquo;sfx2/qa/unoapi sfx.DocumentTemplates failure&rdquo;<br />
** {{issue|113386}} &ldquo;sd/qa/unoapi sd.AccessibleDrawDocumentView::com::sun::star::accessibility::XAccessibleComponent::containsPoint() failure&rdquo;<br />
** {{issue|113489}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleMenu{,Bar,Separator} failures&rdquo;<br />
** {{issue|114205}} &ldquo;sw/qa/unoapi sw.SwAccessibleParagraphView::com::sun::star::accessibility::XAccessibleText::copyText() failed&rdquo;<br />
** {{issue|114209}} &ldquo;forms/qa/unoapi forms.OGridControlModel::com::sun::star::view::XSelectionSupplier crash&rdquo;<br />
** {{issue|114211}} &ldquo;xmloff/qa/unoapi xmloff.Draw.XMLStylesImporter::com::sun::star::lang::XInitialization crash&rdquo;<br />
** {{issue|114213}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleMenu::com::sun::star::accessibility::XAccessibleSelection failure&rdquo;<br />
** {{issue|114636}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleScrollBar::com::sun::star::accessibility::XAccessibleAction failure&rdquo;<br />
** {{issue|114637}} &ldquo;sw/qa/unoapi sw.SwAccessibleFootnoteView(?) crash&rdquo;<br />
** {{issue|114642}} &ldquo;svx/qa/unoapi svx: svx.SvxUnoTextContent::com::sun::star::style::CharacterProperties crash&rdquo;<br />
** {{issue|114669}} &ldquo;forms/qa/unoapi forms.OListBoxControl crash&rdquo;<br />
** {{issue|114889}} &ldquo;sw/qa/unoapi sw.SwXTextViewCursor::com::sun::star::view::XScreenCursor&rdquo;<br />
* Missing tests:<br />
** {{issue|109564}} &ldquo;qadevOOo/tests/java/ifc/awt/_XSystemChildFactory.java&rdquo;<br />
* Sporadic failures:<br />
** {{issue|111217}} &ldquo;BasicManager::SetGlobalUNOConstant crash during shutdown&rdquo;<br />
** {{issue|111246}} &ldquo;svx::FontHeightToolBoxControl::statusChanged crash (memory corruption)&rdquo;<br />
** {{issue|111271}} &ldquo;Mac OS X: crash during shutdown, __tcf_2 on stack&rdquo;<br />
** {{issue|111400}} &ldquo;Extension Manager does not join spawned uno process (-> smoketestoo_native fails)&rdquo;<br />
** {{issue|112070}} &ldquo;UNO API tests must not use random&rdquo;<br />
** {{issue|113158}} &ldquo;crash with two threads in framework::ToolBarManager dtor&rdquo;<br />
** {{issue|113197}} &ldquo;sw/qa/unoapi sw.SwXTextRange hangs&rdquo;<br />
** {{issue|113367}} &ldquo;sysdtrans deadlock during shutdown&rdquo;<br />
** {{issue|113464}} &ldquo;stoc_smgr::ORegistryServiceManager::dispose crash during shutdown&rdquo;<br />
** {{issue|114207}} &ldquo;framework::ModuleUIConfigurationManager::dispose crash during shutdown&rdquo;<br />
** {{issue|114675}} &ldquo;binary URP bridge race on shut down, crash&rdquo;<br />
** {{issue|114718}} &ldquo;forms/qa/unoapi: crash in remote async release call&rdquo;<br />
** {{issue|116131}} &ldquo;vcl: message unregisterDraggingDestinationHandler: sent to freed object&rdquo;<br />
<br />
[[Category:Effort]][[Category:Test]]</div>Sbhttps://wiki.openoffice.org/wiki/Test_CleanupTest Cleanup2011-01-21T14:33:50Z<p>Sb: /* unoapi Tests */</p>
<hr />
<div>= Test Cleanup Project =<br />
<br />
The demand for automated (unit) testing should be obvious. See the [http://www.openoffice.org/servlets/ReadMsg?list=dev&msgNo=26189 mission statement mail] and [[Media:JustTestingPresentation.odp|slides]] from a [http://fosdem.org/2010/schedule/events/ooo_testing FOSDEM'10 talk] and an [http://www.ooocon.org/index.php/ooocon/2010/paper/view/188 OOoCon&nbsp;2010 presentation] for more information and further links.<br />
<br />
For examples of how to write xUnit based tests in the OOo code base, see [http://hg.services.openoffice.org/DEV300/file/87f4911ea629/basegfx/test <code>basegfx/test/</code>], [http://hg.services.openoffice.org/DEV300/file/87f4911ea629/sal/qa/ByteSequence <code>sal/qa/ByteSequence/</code>], and [http://hg.services.openoffice.org/DEV300/file/87f4911ea629/smoketestoo_native <code>smoketest_native/</code>]. However, the hard part should not be how to write test code, anyway, but how to write ''testable'' code; see [http://misko.hevery.com/2008/11/04/clean-code-talks-unit-testing/ The Clean Code Talks&mdash;Unit Testing].<br />
<br />
When testing C++ code that merely uses UNO types (no services), but uses them in a way that requires UNO to be bootstrapped so that the relevant type information is available (e.g., putting instances of complex UNO types into <code>com::sun::star::uno::Any</code>), one approach is as follows: In the <code>makefile.mk</code>, instead of <code>.INCLUDE: _cppunit.mk</code> use<br />
<source lang="make"><br />
.IF "$(OS)" == "WNT"<br />
my_file = file:///<br />
.ELSE<br />
my_file = file://<br />
.END<br />
<br />
ALLTAR : test<br />
<br />
test .PHONY : $(SHL1TARGETN)<br />
$(CPPUNITTESTER) $(SHL1TARGETN) \<br />
-env:UNO_TYPES=$(my_file)$(SOLARBINDIR)/types.rdb<br />
</source><br />
and in the test code once call <code>cppu::defaultBootstrap_InitialComponentContext()</code>.<br />
<br />
== User Interface ==<br />
<br />
=== CppUnit ===<br />
<br />
For tests in C++, plain CppUnit (at least version 1.12.1) is available. (OOo bundles CppUnit 1.12.1 as an external module; alternatively, you can configure <code>--with-system-cppunit</code>.)<br />
<br />
Implement the test code as a dynamic library, following CppUnit conventions (i.e., using [http://cppunit.sourceforge.net/doc/lastest/group___creating_test_suite.html#ga0 <code>CPPUNIT_TEST_SUITE_REGISTRATION</code>] and [http://cppunit.sourceforge.net/doc/lastest/_test_plug_in_8h.html#a2 <code>CPPUNIT_PLUGIN_IMPLEMENT</code>] macros). The following settings are needed in the <code>makefile.mk</code>:<br />
* <code>ENABLE_EXCEPTIONS = TRUE</code><br />
* <code>CFLAGSCXX += $(CPPUNIT_CFLAGS)</code><br />
* <code>SHL<var>n</var>RPATH = NONE</code><br />
* <code>SHL<var>n</var>STDLIBS += $(CPPUNITLIB)</code><br />
* <code>SHL<var>n</var>VERSIONMAP = <var>version.map</var></code>, where that file must contain the following (see [[#CppUnit_1.12.1|details]] below for improving this):<br />
UDK_3_0_0 {<br />
global:<br />
cppunitTestPlugIn;<br />
local:<br />
*;<br />
};<br />
<br />
To run tests, <code>sal/cppunittester</code> delivers a <code>cppunittester</code> executable that has some advantages over the plain CppUnit <code>DllPlugInTester</code>:<br />
* It uses <code>SAL_IMPLEMENT_MAIN</code> to properly set up the per-process settings required by URE. Test code as well as tested code based on URE will expect this and would fail in a process that is not set up in this way.<br />
* Getting CppUnit to build as an external module within the Windows OOo build is a non-trivial task. The less parts of it that need to be built, the better.<br />
<br />
Something like the following in <code>makefile.mk</code> will execute the tests:<br />
ALLTAR : test<br />
test .PHONY : $(SHL1TARGETN)<br />
$(CPPUNITTESTER) $(SHL1TARGETN)<br />
<br />
<code>$(CPPUNITTESTER)</code> internally uses <code>$(AUGMENT_LIBRARY_PATH_LOCAL)</code> to favor library instances in the local output tree over ones in solver. Alternatively to the above, <code>.INCLUDE: _cppunit.mk</code> calls <code>$(CPPUNITTESTER)</code> on each of <code>$(SHL1TARGETN)</code>, &hellip;, <code>$(SHL10TARGETN)</code> that is defined.<br />
<br />
=== JUnit ===<br />
<br />
For tests in Java, plain JUnit (at least version 4) is available. (OOo requires JUnit as a prerequisite, see [http://junit.org/ junit.org] for downloads; you can configure <code>--with-junit=<var>&hellip;</var></code> if it is not automatically found; alternatively, you can configure <code>--without-junit</code>, disabling JUnit-based tests.)<br />
<br />
=== <code>subsequenttests</code> ===<br />
<br />
Some tests have build and/or run time dependencies on modules further up in the hierarchy, or modules that the rest of the module in question does not have dependencies on (and which are thus not listed in the module's <code>build.lst</code>). The extreme case are tests that need a complete OOo installation as their test environment.<br />
<br />
For such tests, the whole <code>makefile.mk</code> should be wrapped in:<br />
.IF "$(OOO_SUBSEQUENT_TESTS)" == ""<br />
nothing .PHONY :<br />
.ELSE<br />
...<br />
.END<br />
(and the directory included in the module's <code>build.lst</code>).<br />
<br />
The idea is to do a complete OOo build first (<code>cd smoketestoo_native && build --all</code>) and then build and execute those tests either selectively or wholesale.<br />
<br />
Selectively building a specific such test directory can be done with <code>cd <var>&hellip;</var> && OOO_SUBSEQUENT_TESTS=TRUE dmake</code>.<br />
<br />
To build and execute ''all'' these test directories, the tool <code>subsequenttests</code> (in <code>solenv/bin</code>) exists. It scans the <code>build.lst</code> files of all modules for <code>makefile.mk</code>s that mention <code>OOO_SUBSEQUENT_TESTS</code> and simply executes <code>dmake</code> in all those directories, with <code>OOO_SUBSEQUENT_TESTS</code> set. It supports a <code>-P<var>n</var></code> switch to build <var>n</var> directories in parallel.<br />
<br />
=== Helpers ===<br />
<br />
A new module <code>test</code> shall collect reusable code snippets for C++ and Java tests.<br />
<br />
For now, it concentrates on letting a test connect to an OOo instance via remote UNO: A C++ test class can hold a <code>test::OfficeConnection</code> as class member and, in its CppUnit <code>setUp</code> and <code>tearDown</code> functions, call <code>OfficeConnection::setUp</code> and <code>OfficeConnection::tearDown</code>, respectively. Tests obtain access to the OOo instance via <code>OfficeConnection::getFactory</code>. Similarly, a Java test class can use an <code>org.openoffice.test.OfficeConnection</code> instance, offering the same functionality as its C++ counterpart.<br />
<br />
For this to work, three additional steps are necessary:<br />
* First, in <code>instsetoo_native</code>, building an installation set for the <code>openoffice</code> product in the default language (<code>en-US</code>) in any package format now takes care to always also build an archive package format (<code>tar.gz</code> resp. <code>zip</code>) of that product.<br />
* Second, building <code>smoketestoo_native</code> permanently installs that archive into the solver. (Except on Windows, where problems with resulting long pathnames prevent this; there, as a workaround, each test individually unzips the archive to some local temporary directory.) <br />
* Third, a test that requires an OOo instance includes <code>installationtest.mk</code> in its <code>makefile.mk</code>. That file makes sure to call the CppUnit and JUnit test runners with the information necessary for the helper classes to start the correct OOo instance with a fresh <code>UserInstallation</code> and set up an URP pipe connection. The information is tunneled into the test runner executables as UNO bootstrap parameters.<br />
<br />
For debugging purposes, which OOo instance the tests use can manually be overridden, see [http://www.openoffice.org/servlets/ReadMsg?list=interface-announce&msgNo=1285 &ldquo;OOO_TEST_SOFFICE: allow override of tested soffice process&rdquo;].<br />
<br />
=== <code>unoapi</code> Tests ===<br />
<br />
The <code>unoapi</code> tests are redesigned to use the new test framework. They are plain JUnit tests and use the mechanisms described above to connect to running OOo instances. However, due to the large amount of logic encoded in <code>qadevOOo</code>, those JUnit tests for now are only thin wrappers around <code>org.openoffice.Runner.run</code>. This is intended to change over time.<br />
<br />
The <code>cwscheckapi</code> tool to run the <code>unoapi</code> tests has been subsumed by <code>subsequenttests</code>. The latter always runs all tests, while the former had mechanisms to run only tests for modules that had been changed by a CWS. The hope is that the parallel mode of <code>subsequenttests</code> makes it fast enough so that running all tests all of the times becomes feasible.<br />
<br />
Unfortunately, running the <code>unoapi</code> tests is still not stable enough to give useful results. Therefore, running <code>subsequenttests</code> has been disabled in the build bots for now. Making the tests sufficiently stable is ongoing work.<br />
<br />
== Details ==<br />
<br />
Working on {{CWS|sb118}}, {{CWS|sb120}}.<br />
<br />
=== CppUnit 1.12.1 ===<br />
<br />
* Replace existing <code>cppunit</code> and <code>testshl2</code> combo with latest CppUnit 1.12.1.<br />
* OOo <code>configure --with-system-cppunit</code> (for now only if also <code>--with-system-stl</code>!); minimal required version for now arbitrarily 1.12.1.<br />
* '''TODO:''' Upstream <code>PATCH_FILES</code> (<code>windows.patch</code>?!?).<br />
* '''TODO:''' <code>RPATH</code> in generated libraries and executables.<br />
* '''TODO:''' Improve <code>CPPUNIT_PLUGIN_EXPORT</code> and get rid of version maps (GCC exception problems?).<br />
* '''TODO:''' <code>cppunit/makefile.mk</code> <code>MY_LIBS = -lm</code> Solaris hack.<br />
* '''TODO:''' In general OOo build environment, no longer set <code>CFLAGS</code> etc. as environment variables; have package-specific <code>OOO_<var>package</var>_CFLAGS</code> etc. and combine those into <code>CFLAGS</code> etc. where necessary (see <code>OOO_STLPORT_CXXFLAGS</code> etc. in <code>cppunit/makefile.mk</code>).<br />
* '''TODO:''' Why use <code>cppunittester</code> instead of <code>DllPlugInTester</code>? (Remove building/delivering <code>DllPlugInTester</code>.)<br />
* '''TODO:''' Make <code>operator &lt;&lt;(std::basic_ostream &amp;, rtl::OUString const &amp;)</code> from <code>test/oustringstreaminserter.hxx</code> generally available?<br />
* '''TODO:''' Make STLport <code>num_put</code> symbols available on platforms other than Linux (see <code>solenv/bin/addsym.awk</code>), too, so that <code>CPPUNIT_ASSERT_EQUAL</code> actually outputs numeric values.<br />
<br />
=== <code>testshl2</code> ===<br />
<br />
* <code>solenv/inc_cppunit.mk</code>/<code>cppunit.mk</code>: [http://hg.services.openoffice.org/cws/sb118/rev/cf13421c3774 &ldquo;adapted <code>cppunit.mk</code> to <code>cppunittester</code> and no longer require &lsquo;<code>dmake test</code>&rsquo; to run tests&rdquo;].<br />
* '''TODO:''' <code>DEV300_m68</code> introduced <code>TESTSHL2LIB</code> (which I removed again) and uses it in many <code>qa</code> makefiles (that I need to touch someday, anyway).<br />
<br />
=== Unit Tests ===<br />
<br />
* <code>OOO_SUBSEQUENT_TESTS</code> (<code>build.lst</code> lists local dependencies of those directories, so that modifying a module and then calling &ldquo;<code>OOO_SUBSEQUENT_TESTS=x build</code>&rdquo; rebuilds the module and executes the tests).<br />
* '''TODO:''' If Build Environment&nbsp;2.0 would build directly to solver (instead of local output tree/deliver), that would simplify tests that currently need to take care to test local libraries instead of solver ones (see, for example, <code>OOO_TEST_PREFIX</code> in the <code>services.rdb</code> of <code>stoc/test/uriproc/makefile.mk</code>).<br />
{{Documentation/Note|Build Environment&nbsp;2.0 will not build directly to solver, but will make a module depend on the targets in the solver, and these are depending on the targets in the workdir (aka the old "local output tree"). Thus on an usual build in a module building and delivering are not two steps anymore. If tests depend on the target in the solver (which they will do automatically in most use cases, as linking against a library automatically creates a dependency on the library in the solver), they can be sure that the target is up to date in the solver '''and''' in the workdir.<br />
<br />
--[[User:B michaelsen|B michaelsen]] 06:32, 27 August 2010 (UTC)}}<br />
* '''TODO:''' Constructs like &ldquo;<code>-env:UNO_<var>&hellip;</var>=$(my_file)<var>&hellip;</var></code>&rdquo; would fail for problematic characters (spaces!) in paths.<br />
<br />
=== Smoke Test ===<br />
<br />
* Redesign <code>smoketestoo_native</code> to use CppUnit and pre-installed OOo.<br />
* [http://hg.services.openoffice.org/cws/sb118/rev/160b248247a0 &ldquo;changed <code>tools/debug</code> to never fall back from writing to shell to writing to file, and read <code>DBGSV_INIT</code> from <code>rtl::Bootstrap</code>; the latter causes problems if <code>tools/debug</code> is called from static code executing before <code>SAL_MAIN</code> has called <code>osl_setCommandArgs</code> &rarr; removed statics from code and added assertions to <code>osl/process</code>; various improvements to <code>smoketests.cxx</code> (incl. passing an appropriate <code>dbgsv.ini</code> for non-pro builds)&rdquo;] followed by [http://hg.services.openoffice.org/cws/sb118/rev/dbbacb9d2fd3 &ldquo;reverted parts of HG <code>-c&nbsp;160b248247a0</code> again: the &lsquo;static code executing before <code>SAL_MAIN</code>&rsquo; problem was too severe; instead, globally set <code>DBGSV_INIT</code> build env var to new <code>solenv/bin/dbgsv.ini</code>&rdquo;]; see also {{issue|109142}} &ldquo;Let assertions abort&rdquo;.<br />
* '''TODO:''' For <code>smoketestoo_native/makefile.mk</code> &ldquo;<code><nowiki>-env:arg-env=$(OOO_LIBRARY_PATH_VAR)"$${{$(OOO_LIBRARY_PATH_VAR)+=$$$(OOO_LIBRARY_PATH_VAR)}}"</nowiki></code>&rdquo; mechanism: <code>osl_executeProcess</code> <code>ustrEnvironments</code> members without &ldquo;<code>=</code>&rdquo;: all platforms; documentation; documentation of <code>osl_executeProcess_WithRedicrectedIO</code>.<br />
* '''TODO:''' <code>-headless</code>? (appears to still display windows on Windows and Mac OS&nbsp;X, however, see {{issue|109052}})<br />
* '''TODO:''' {{issue|113341}} &ldquo;-nofirststartwizard should disable update check&rdquo;<br />
<br />
=== Pre-Installed OOo ===<br />
<br />
* For Sun Hamburg Release Engineering, take MWS archive installation sets from &ldquo;S:&rdquo; instead of solver: [http://hg.services.openoffice.org/cws/sb118/rev/d5dbea724063 &ldquo;take installation set from <code>SHIPDRIVE</code> if appropriate&rdquo;].<br />
* '''TODO:''' <code>PKGFORMAT=installed</code> instead of <code>archive</code>?<br />
<br />
=== <code>unoapi</code> Tests ===<br />
<br />
* Known issues, open (not yet addressed at all; disabled for now on net-yet-integrated CWS; or fixed on not-yet-integrated CWS):<br />
** {{issue|116120}} &ldquo;vcl: TabControl::ImplGetTabRect negative height leads to X_CreatePixmap BadAlloc&rdquo;<br />
** {{issue|116125}} &ldquo;qadevOOo/qa/complex/junitskeleton failure&rdquo;<br />
** {{issue|116156}} &ldquo;toolkit/qa/unoapi crash in SwAccessibleMap::RemoveContext&rdquo;<br />
** {{issue|116192}} &ldquo;[sw] fixed text fields sometimes get updated&rdquo;<br />
** {{issue|116550}} &ldquo;toolkit/qa/unoapi crashes OOo in ~SwAccessibleParagraph vs. SwXTextDocument::close&rdquo;<br />
* Known issues, disabled for now:<br />
** {{issue|109517}} &ldquo;sc/qa/unoapi fails for ScAnnotationObj etc.&rdquo;<br />
** {{issue|109518}} &ldquo;sd/qa/unoapi crash in SfxViewShell::GetController&rdquo;<br />
** {{issue|109643}} &ldquo;toolkit/qa/unoapi tests fail when losing focus&rdquo;<br />
** {{issue|109728}} &ldquo;~ScAutoFormatObj uses cleared ScGlobal&rdquo;<br />
** {{issue|109917}} &ldquo;fragile unoapi test using OnUnfocus event&rdquo;<br />
** {{issue|109939}} &ldquo;toolkit: inconsistent UnoControl locking schemes&rdquo;<br />
** {{issue|110862}} &ldquo;sc/qa/unoapi fails for sc.ScDataPilotTableObj::com::sun::star::sheet::XDataPilotTable::refresh()&rdquo;<br />
** {{issue|110988}} &ldquo;svtools/qa/unoapi fails for svtools.AccessibleBrowseBox etc.&rdquo;<br />
** {{issue|111006}} &ldquo;toolkit: deadlock between UnoControls&rdquo;<br />
** {{issue|111032}} &ldquo;sc/qa/unoapi sc.ScAccessibleCell::com::sun::star::accessibility::XAccessibleText getCharacterBounds() failure&rdquo;<br />
** {{issue|111042}} &ldquo;sd/qa/unoapi sd::DrawController::dispose crash&rdquo;<br />
** {{issue|111043}} &ldquo;sd/qa/unoapi sd::DrawController_OutlineView NullPointerException&rdquo;<br />
** {{issue|111102}} &ldquo;chart2: ChartModelHelper::findDiagram returns null&rdquo;<br />
** {{issue|111111}} &ldquo;xmloff.Impress.XMLImporter::com::sun::star::document::XImporter&rdquo;<br />
** {{issue|111113}} &ldquo;toolkit.AccessibleStatusBarItem unoapi failure&rdquo;<br />
** {{issue|111148}} &ldquo;forms/qa/unoapi forms.OImageControlModel::com::sun::star::beans::XMultiPropertySet deadlock&rdquo;<br />
** {{issue|111169}} &ldquo;svx.AccessiblePageShape unoapi failure&rdquo;<br />
** {{issue|111170}} &ldquo;sun/i18n/qa/unoapi "creating a drawdoc" failure&rdquo;<br />
** {{issue|111178}} &ldquo;sw/qa/unoapi SwView::SelectShell crash&rdquo;<br />
** {{issue|111180}} &ldquo;framework/qa/unoapi fwk.Desktop::com::sun::star::frame::XComponentLoader::loadComponentFromURL() failure&rdquo;<br />
** {{issue|111182}} &ldquo;Desktop::terminate -> ~DropTarget -> _objc_error crash&rdquo;<br />
** {{issue|111184}} &ldquo;sal/qa/osl/pipe uses fixed pipe names&rdquo;<br />
** {{issue|111186}} &ldquo;sw/qa/unoapi sw.PageStyle::com::sun::star::beans::XPropertySet::setPropertyValue() failure&rdquo;<br />
** {{issue|111190}} &ldquo;sw/qa/unoapi sw.SwXShape failure&rdquo;<br />
** {{issue|111194}} &ldquo;sw/qa/unoapi sw.XMLExporter crash&rdquo;<br />
** {{issue|111195}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleScrollBar::com::sun::star::accessibility::XAccessibleValue::setCurrentValue() failure&rdquo;<br />
** {{issue|111197}} &ldquo;sw/qa/unoapi sw.SwAccessibleDocumentPageView failure&rdquo;<br />
** {{issue|111199}} &ldquo;sd/qa/unoapi sd.AccessibleOutlineView failure&rdquo;<br />
** {{issue|111200}} &ldquo;xmloff/qa/unoapi xmloff.Draw.XMLMetaImporter failure&rdquo;<br />
** {{issue|111216}} &ldquo;svx/qa/unoapi accessibility deadlock&rdquo;<br />
** {{issue|111218}} &ldquo;sw/qa/unoapi sw.SwAccessibleParagraphView::com::sun::star::accessibility::XAccessibleEventBroadcaster::removeEventListener() failure&rdquo;<br />
** {{issue|111220}} &ldquo;sw/qa/unoapi sw.XMLContentExporter::com::sun::star::document::XFilter::cancel() failure&rdquo;<br />
** {{issue|111224}} &ldquo;xmloff/qa/unoapi xmloff.Impress.XMLContentExporter crash&rdquo;<br />
** {{issue|111225}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleStatusBar failure&rdquo;<br />
** {{issue|111252}} &ldquo;svx/qa/unoapi svx.AccessibleOLEShape deadlock&rdquo;<br />
** {{issue|111273}} &ldquo;sw/qa/unoapi sw.SwXTextEmbeddedObject::com::sun::star::document::XEmbeddedObjectSupplier::getEmbeddedObject() crash&rdquo;<br />
** {{issue|111278}} &ldquo;svx/qa/unoapi svx.AccessibleEditableTextPara failure&rdquo;<br />
** {{issue|111283}} &ldquo;sfx2/qa/unoapi sfx.StandaloneDocumentInfo failure&rdquo;<br />
** {{issue|111285}} &ldquo;forms/qa/unoapi forms.OButtonModel failure&rdquo;<br />
** {{issue|111287}} &ldquo;xmloff/qa/unoapi XMLSettingsIm-/Exporter crash&rdquo;<br />
** {{issue|111329}} &ldquo;sd/qa/unoapi SdXCustomPresentationAccess::getElementNames/ImpEditEngine::OnlineSpellHdl hang&rdquo;<br />
** {{issue|111332}} &ldquo;sw/qa/unoapi sw.XMLStylesExporter::com::sun::star::document::XFilter crash&rdquo;<br />
** {{issue|111333}} &ldquo;forms/qa/unoapi forms.OImageControlControl::com::sun::star::awt::XControl deadlock&rdquo;<br />
** {{issue|112743}} &ldquo;starmath/qa/unoapi sm.XMLSettingsExporter failure&rdquo;<br />
** {{issue|112746}} &ldquo;framework/qa/unoapi fwk.ModuleManager failure (X11 BadWindow)&rdquo;<br />
** {{issue|112751}} &ldquo;testgraphical/qa/graphical failure&rdquo;<br />
** {{issue|112778}} &ldquo;xmloff/qa/unoapi xmloff.Draw.XMLContentExporter failure&rdquo;<br />
** {{issue|113020}} &ldquo;sw/qa/unoapi sw.SwXTextGraphicObject::com::sun::star::beans::XPropertySet failure&rdquo;<br />
** {{issue|113103}} &ldquo;chart2: deadlock between DiagramHelper and Diagram&rdquo;<br />
** {{issue|113136}} &ldquo;sw/qa/unoapi sw.SwAccessibleParagraphView::com::sun::star::accessibility::XAccessibleEditableText failure&rdquo;<br />
** {{issue|113142}} &ldquo;sw/qa/unoapi SwAccessibleContext::RemoveFrmFromAccessibleMap crash&rdquo;<br />
** {{issue|113161}} &ldquo;sd/qa/unoapi sd.SdLayer::com::sun::star::drawing::Layer::IsVisible failure&rdquo;<br />
** {{issue|113201}} &ldquo;forms/qa/unoapi forms.OEditModel::com::sun::star::form::validation::XValidatableFormComponent failure&rdquo;<br />
** {{issue|113245}} &ldquo;framework/qa/unoapi fwl.TypeDetection failure&rdquo;<br />
** {{issue|113306}} &ldquo;sfx2/qa/unoapi sfx.DocumentTemplates failure&rdquo;<br />
** {{issue|113386}} &ldquo;sd/qa/unoapi sd.AccessibleDrawDocumentView::com::sun::star::accessibility::XAccessibleComponent::containsPoint() failure&rdquo;<br />
** {{issue|113489}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleMenu{,Bar,Separator} failures&rdquo;<br />
** {{issue|114205}} &ldquo;sw/qa/unoapi sw.SwAccessibleParagraphView::com::sun::star::accessibility::XAccessibleText::copyText() failed&rdquo;<br />
** {{issue|114209}} &ldquo;forms/qa/unoapi forms.OGridControlModel::com::sun::star::view::XSelectionSupplier crash&rdquo;<br />
** {{issue|114211}} &ldquo;xmloff/qa/unoapi xmloff.Draw.XMLStylesImporter::com::sun::star::lang::XInitialization crash&rdquo;<br />
** {{issue|114213}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleMenu::com::sun::star::accessibility::XAccessibleSelection failure&rdquo;<br />
** {{issue|114636}} &ldquo;toolkit/qa/unoapi toolkit.AccessibleScrollBar::com::sun::star::accessibility::XAccessibleAction failure&rdquo;<br />
** {{issue|114637}} &ldquo;sw/qa/unoapi sw.SwAccessibleFootnoteView(?) crash&rdquo;<br />
** {{issue|114642}} &ldquo;svx/qa/unoapi svx: svx.SvxUnoTextContent::com::sun::star::style::CharacterProperties crash&rdquo;<br />
** {{issue|114669}} &ldquo;forms/qa/unoapi forms.OListBoxControl crash&rdquo;<br />
** {{issue|114889}} &ldquo;sw/qa/unoapi sw.SwXTextViewCursor::com::sun::star::view::XScreenCursor&rdquo;<br />
* Missing tests:<br />
** {{issue|109564}} &ldquo;qadevOOo/tests/java/ifc/awt/_XSystemChildFactory.java&rdquo;<br />
* Sporadic failures:<br />
** {{issue|111217}} &ldquo;BasicManager::SetGlobalUNOConstant crash during shutdown&rdquo;<br />
** {{issue|111246}} &ldquo;svx::FontHeightToolBoxControl::statusChanged crash (memory corruption)&rdquo;<br />
** {{issue|111271}} &ldquo;Mac OS X: crash during shutdown, __tcf_2 on stack&rdquo;<br />
** {{issue|111400}} &ldquo;Extension Manager does not join spawned uno process (-> smoketestoo_native fails)&rdquo;<br />
** {{issue|112070}} &ldquo;UNO API tests must not use random&rdquo;<br />
** {{issue|113158}} &ldquo;crash with two threads in framework::ToolBarManager dtor&rdquo;<br />
** {{issue|113197}} &ldquo;sw/qa/unoapi sw.SwXTextRange hangs&rdquo;<br />
** {{issue|113367}} &ldquo;sysdtrans deadlock during shutdown&rdquo;<br />
** {{issue|113464}} &ldquo;stoc_smgr::ORegistryServiceManager::dispose crash during shutdown&rdquo;<br />
** {{issue|114207}} &ldquo;framework::ModuleUIConfigurationManager::dispose crash during shutdown&rdquo;<br />
** {{issue|114675}} &ldquo;binary URP bridge race on shut down, crash&rdquo;<br />
** {{issue|114718}} &ldquo;forms/qa/unoapi: crash in remote async release call&rdquo;<br />
** {{issue|116131}} &ldquo;vcl: message unregisterDraggingDestinationHandler: sent to freed object&rdquo;<br />
<br />
[[Category:Effort]][[Category:Test]]</div>Sbhttps://wiki.openoffice.org/wiki/Uno/Remote/Specifications/Uno_Remote_ProtocolUno/Remote/Specifications/Uno Remote Protocol2011-01-20T10:46:53Z<p>Sb: Protocol Property Messages clarification</p>
<hr />
<div>''RPC is a convenient but flawed accident of history'' &mdash;[http://www.qconlondon.com/dl/qcon-london-2009/slides/SteveVinoski_RPCAndItsOffspringConvenientYetFundamentallyFlawed.pdf Steve Vinoski]<br />
<br />
= Abstract =<br />
<br />
This document specifies the UNO Remote Protocol version 1.0 (URP). This protocol is used to transmit UNO calls across process boundaries (comparable to IIOP in CORBA).<br />
<br />
This protocol was primarily designed to minimize the amount of transferred data for a series of one-way calls. The protocol does not make any assumptions about how the data is transferred.<br />
<br />
= Basic Data Representation =<br />
<br />
Data is transferred as sequences of 8-bit bytes. Data is neither aligned nor padded. Multi-byte entities are transferred in network byte order (most significant byte first). Entities like &ldquo;a 32-bit signed integer&rdquo; or &ldquo;a 16-bit unsigned integer&rdquo; are represented in the obvious way.<br />
<br />
There is one special kind of entity that appears at various places in this specification: A ''compressed number,'' which denotes a 32-bit unsigned integer, is represented as either one byte or five bytes. If the first byte equals <code>0xFF</code>, the following four bytes represent an integer in the range [0 &hellip; 2<sup>32</sup>&nbsp;&minus;&nbsp;1]. If the first (and only) byte is less than <code>0xFF</code>, it represents an integer in the range [0 &hellip; 254]. Integers in the range [0 &hellip; 254] can thus be represented as either one byte or five bytes; both forms are valid, but the shorter form is preferred.<br />
<br />
= Blocks and Messages =<br />
<br />
The largest transferred unit is a ''block.'' It consists of a fixed-size block header, followed by one or more messages:<br />
{| border="1"<br />
|-<br />
| Block header:<br/>&ensp;size<br/>&ensp;message count<br />
|-<br />
| Message 1<br />
|-<br />
| &ensp;&hellip;<br />
|-<br />
| Message <var>k</var><br />
|}<br />
<br />
A message may either be a request or a reply. It consists of a header and a body.<br />
<br />
== Block Header ==<br />
<br />
The ''block header'' consists of two 32-bit unsigned integers. The first integer specifies the size of the block in bytes, not counting the eight bytes of the block header. The second integer specifies the number of messages within the block.<br />
<br />
The given size must match the actual size exactly (that is, there must not be any excess bytes after the last message in the block). The message count must not be zero.<br />
<br />
= Messages =<br />
<br />
== Caching Concept ==<br />
<br />
To minimize the amount of transferred data, URP uses caching. This means that URP is optimized for repetitive calls on the same or recently used UNO interfaces.<br />
<br />
The following three different kinds of entities are cached:<br />
* Object identifiers (OIDs)<br />
* Thread identifiers (TIDs)<br />
* Types<br />
The caching used is the same for each of the three different kinds; below, it<br />
is explained for OIDs only, but TIDs and types are no different.<br />
<br />
There are two different caching mechanisms, a first-level cache and a<br />
second-level cache.<br />
<br />
=== First-Level Cache ===<br />
<br />
For each of the two directions of an URP bridge, there is a ''last OID item'' (actually, there are individual last OID, last TID, and last type items). The two items for the different directions are completely independent of one another. The contents of a last OID item is affected exclusively by the sending side, as detailed below. (Both sides of an URP bridge will have a private copy of a last OID item, where these two copies will always be in sync. But that can be considered an implementation detail.)<br />
<br />
Initially, the last OID item is empty.<br />
<br />
The header of a request message specifies the OID of the object on which to make a call (correspondingly, it also specifies the TID of the thread from which to make the call, and the interface type on which to make the call). The header contains a flag that specifies whether to use the contents of the last OID item (in which case the last OID item must not be empty), or whether the header contains a new OID (which is then stored in the last OID item, overwriting any old contents).<br />
<br />
=== Second-Level Cache ===<br />
<br />
For each of the two directions of an URP bridge, there is a ''cache table'' (actually, there are three individual cache tables for OIDs, TIDs, and types). The two cache tables for the different directions are completely independent of one another. The contents of a cache table is affected exclusively by the sending side, as detailed below. (Both sides of an URP bridge will have a private copy of a cache table, where these two copies will always be in sync. But that can be considered an implementation detail.)<br />
<br />
Initially, each cache table is empty.<br />
<br />
The caching mechanism uses ''cache indices,'' 16-bit unsigned integers. The cache table size is <var>K</var> =&nbsp;256. ''(Historically, the cache table size was intended to be dynamically changeable, hence the use of 16-bit qunatities.)'' An OID can be transferred in either of two ways:<br />
* As an OID together with a cache index. The OID is entered into the cache table at the given index. The cache index must be in the range [0 &hellip; <var>K</var>&nbsp;&minus;&nbsp;1]. (If the cache table already contains an entry for the given index, the old entry is overwritten.) As a special case, if the cache index equals <code>0xFFFF</code>, the OID is not entered into the cache table.<br />
* As only a cache index. The cache index must be in the range [0 &hellip; <var>K</var>&nbsp;&minus;&nbsp;1], and the cache table must contain an entry for that index. The transferred OID is the cache table entry at the given index.<br />
<br />
== Objects ==<br />
<br />
=== Object Life Cycle ===<br />
<br />
See [http://udk.openoffice.org/common/man/lifecycle.html ''UNO Object Life Cycle Model''] for an explanation of the object life cycle concept and related terms. An URP bridge has to ensure that an object that has been transferred over the bridge can reliably be detected as ''done,'' once the object has transitioned to<br />
that state. The following describes the current mechanism to achieve this, but<br />
'''note that it is broken''' (see below).<br />
<br />
In the following, the notion of an object&nbsp;<var>o</var> together with an interface type&nbsp;<var>t</var> implemented by&nbsp;<var>o</var> is used, written as the tuple &lang;<var>o</var>,&nbsp;<var>t</var>&rang;. Each side of an URP bridge maintains a ''reference count'' (a non-negative integer) for each tuple &lang;<var>o</var>,&nbsp;<var>t</var>&rang; that it has sent over the bridge (either as the target of a method call in a request message, or as the value of an interface type among the data of a request or reply message). Also, at any point in time, each side of an URP bridge considers a given tuple &lang;<var>o</var>,&nbsp;<var>t</var>&rang; as either ''bridged in'' or not. A tuple &lang;<var>o</var>,&nbsp;<var>t</var>&rang; is considered bridged in at one side of a bridge if and only if the corresponding reference count is positive at the other side of the bridge.<br />
<br />
A tuple &lang;<var>o</var>,&nbsp;<var>t</var>&rang; can only be used as the target of a method call in a request message while it is bridged in at the sending side.<br />
<br />
Each reference count starts out at zero. When sending the tuple &lang;<var>o</var>,&nbsp;<var>t</var>&rang; (as the value of an interface type among the data of a request or reply message), the sending side increments its reference count for &lang;<var>o</var>,&nbsp;<var>t</var>&rang;, unless it considers as bridged in any tuple &lang;<var>o</var>,&nbsp;<var>t</var>&prime;&rang;, where <var>t</var>&prime; is a subtype of&nbsp;<var>t</var> (including <var>t</var> itself). If the same tuple appears multiple times in the data of a message, the corresponding reference count is incremented multiple times.<br />
<br />
For every tuple &lang;<var>o</var>,&nbsp;<var>t</var>&rang; that is bridged in at one side of an URP bridge, that side has to eventually send a <code>release</code> message for &lang;<var>o</var>,&nbsp;<var>t</var>&rang; to the other side. Each <code>release</code> message causes the receiving side to decrement its corresponding reference count by one. It is an error to send a <code>release</code> message for a tuple while it is not bridged in at the sending side.<br />
<br />
When a tuple &lang;<var>o</var>,&nbsp;<var>t</var>&rang; becomes no longer bridged in at one side of an URP bridge, that side may no longer use that tuple (in particular, send it as the value of an interface type among the data of a message), unless it still has another reference of type&nbsp;<var>t</var> to&nbsp;<var>o</var>. An object&nbsp;<var>o</var> cannot become ''done'' as long as any side of any URP bridge has a positive reference count for any tuple &lang;<var>o</var>,&nbsp;<var>t</var>&rang;, with arbitrary&nbsp;<var>t</var>.<br />
<br />
The optimization rule (to not increment the reference count for &lang;<var>o</var>,&nbsp;<var>t</var>&rang; when &lang;<var>o</var>,&nbsp;<var>t</var>&rang; itself or some subtype tuple &lang;<var>o</var>,&nbsp;<var>t</var>&prime;&rang; is considered as bridged in) is broken, as it leads to race conditions: Suppose there are three environments, <var>A</var>, <var>B</var>, and&nbsp;<var>C</var>; each two environments are connected via an URP bridge. Environment&nbsp;<var>A</var> has a local UNO object&nbsp;<var>o</var>, and it has sent <var>o</var> to both <var>B</var> and&nbsp;<var>C</var>. Both <var>B</var> and&nbsp;<var>C</var><br />
have a proxy for&nbsp;<var>o</var> (each of the two proxies forwarding to environment&nbsp;<var>A</var>). Once this setup is established, we only consider the bridge between <var>B</var> and&nbsp;<var>C</var>. Also, we can ignore any interface types (just assume <var>o</var> only implements <code>com.sun.star.uno.XInterface</code>).<br />
<br />
For the bridge between <var>B</var> and&nbsp;<var>C</var>, initially both <var>B</var> and&nbsp;<var>C</var> have a reference count of&nbsp;0 for the object&nbsp;<var>o</var>, and neither of them considers <var>o</var> to be bridged in.<br />
<br />
Assume <var>B</var> sends object&nbsp;<var>o</var> to&nbsp;<var>C</var>. Lets call this <var>Send</var><sub>1</sub>. The optimization rule does notapply: <var>B</var> increments its reference count for&nbsp;<var>o</var> to&nbsp;1 as soon as it sends the message <var>Send</var><sub>1</sub> at time&nbsp;<var>t</var><sub>1</sub>, and <var>C</var> considers <var>o</var> to be bridged in as soon as it receives the message at time <var>t</var><sub>2</sub> &gt; <var>t</var><sub>1</sub>. (When <var>C</var> does no longer need the&nbsp;<var>o</var> offered by&nbsp;<var>B</var>, it will send back a <code>release</code> message to&nbsp;<var>B</var>, which will in turn drop its reference count for&nbsp;<var>o</var> back to&nbsp;0.)<br />
<br />
Assume <var>C</var> sends object&nbsp;<var>o</var> to&nbsp;<var>B</var> (lets call this <var>Send</var><sub>2</sub>) at about the same time as <var>Send</var><sub>1</sub> happens. <var>C</var> sends the message <var>Send</var><sub>2</sub> at time&nbsp;<var>t</var><sub>3</sub>. There are two cases to consider:<br />
# If <var>t</var><sub>3</sub> &lt; <var>t</var><sub>2</sub> (<var>Send</var><sub>1</sub> has not yet reached&nbsp;<var>C</var>), the optimization rule will not apply, and <var>C</var> increments its reference count for&nbsp;<var>o</var> to&nbsp;1.<br />
# If <var>t</var><sub>3</sub> &gt; <var>t</var><sub>2</sub> (<var>Send</var><sub>1</sub> has already reached&nbsp;<var>C</var>, and <var>C</var> considers <var>o</var> to be bridged in), the optimization rule does apply, and <var>C</var> does not increment its reference count for&nbsp;<var>o</var> (which stays at&nbsp;0).<br />
<br />
But when <var>B</var> receives <var>Send</var><sub>2</sub>, it cannot tell which of the two cases occurred. Thus, <var>B</var> does not know whether to send back a <code>release</code> message to&nbsp;<var>C</var>.<br />
<br />
'''[TODO: This needs to be fixed.]'''<br />
<br />
=== Object Identifiers ===<br />
<br />
Each UNO object is assigned a globally unique object identifier (OID), which is a non-empty ASCII string. How OIDs are assigned to UNO objects, and how it is ensured that they are globally unique is outside the scope of this document.<br />
<br />
Within URP, OIDs are used for four purposes:<br />
* To identify the object that is the target of a method call in a request message.<br />
* To identify an object for which a reference to that object is the value of an interface type among the data of a request or reply message.<br />
* As initial object identifiers in <code>queryInterface</code> messages to request initial objects, see [[#The queryInterface Message|The <code>queryInterface</code> Message.]]<br />
* The special OID <code>UrpProtocolProperties</code> is used to identify certain special messages; see [[#Protocol Property Messages|Protocol Property Messages.]]<br />
<br />
== Threads ==<br />
<br />
See [http://udk.openoffice.org/common/man/execution.html ''UNO Execution Model''] for a general description of threads in UNO, and for related terminology. Each UNO thread is assigned a globally unique thread identifier (TID), which is a non-empty byte sequence. How TIDs are assigned to UNO threads, and how it is ensured that they are globally unique is outside the scope of this document. (Note that global uniqueness is only required for the TIDs of active threads&mdash;an active thread may have the same TID as a done thread, i.e., TIDs may be recycled.)<br />
<br />
Generally, URP represents normal UNO interface method invocations as synchronous calls, and one-way UNO interface method invocations as asynchronous calls. This can be overridden with a <code>MUSTREPLY</code> flag: On the one hand, one-way UNO interface method invocations can be forced to use synchronous instead of asynchronous calls; doing so is in accordance with the specification of the UNO execution model. On the other hand, normal UNO interface method invocations can be forced to use asynchronous instead of synchronous calls (with a <code>MUSTREPLY</code> flag set to&nbsp;0); doing so violates the specification of the UNO execution model, and should thus be avoided.<br />
<br />
To satisfy the requirements of the UNO execution model, each side of an URP bridge implementation must adhere to certain rules:<br />
* When sending a synchronous request message with the TID of a UNO thread&nbsp;<var>h</var>, the sending side will not execute any computation steps in thread&nbsp;<var>h</var> (especially, it will not send any further request or reply messages with the given TID), until it receives back the corresponding reply message.<br />
* When sending an asynchronous request message with the TID of a UNO thread&nbsp;<var>h</var>, the sending side simply continues to execute computation steps in thread&nbsp;<var>h</var>. It does not wait for any reply message.<br />
* For each TID, the receiving side maintains a queue of pending request messages received with that TID. Upon receiving a synchronous or asynchronous request messages with a given TID, the receiving side enqueues it at the end of the corresponding queue.<br />
* Whenever a synchronous request message becomes the first entry in a queue for a given TID (of some UNO thread&nbsp;<var>h</var>), the receiving side starts to sequentially execute the computation steps corresponding to the requested UNO interface method, in thread&nbsp;<var>h</var>. It uses the TID of thread&nbsp;<var>h</var> for all request messages sent while executing these computation steps. When it is finished with the computation steps, it sends back a reply message (with the given TID), and the synchronous request message is removed from the head of the queue.<br />
* Whenever an asynchronous request message becomes the first entry in a queue for a given TID (of some UNO thread&nbsp;<var>h</var>), the receiving side starts to sequentially execute the computation steps corresponding to the requested UNO interface method, in a new (previously immaterial) thread&nbsp;<var>h</var>&prime;. It uses the TID of thread&nbsp;<var>h</var>&prime; for all request messages sent while executing these computation steps. When it is finished with the computation steps, thread&nbsp;<var>h</var>&prime; transitions from active to done, and the asynchronous request message is removed from the head of the queue.<br />
<br />
In language bindings that map (conceptual) UNO threads to &ldquo;real&rdquo; process threads, it may be useful to share this mapping across all URP bridges within one process (even across different language bindings): Assume that a synchronous request message with a given TID is sent out over some bridge. The process thread corresponding to the given TID will be blocked until a corresponding reply message is received back over that bridge. Further assume that within this time span a synchronous request message with the same TID is received over some other bridge. It is desirable, then, that this message is executed in the blocked process thread (temporarily unblocking it), so that it can share critical resources (e.g., mutices, thread local storage) with the blocked method execution.<br />
<br />
== Function IDs ==<br />
<br />
The ''function ID'' corresponding to a given interface type member function is defined to be the function index the member function maps to (see [http://udk.openoffice.org/common/man/typesystem.html ''UNO Type System'']). It is an error for a function index that is used as a function ID to be outside the range [0 &hellip; 2<sup>16</sup>&nbsp;&minus;&nbsp;1].<br />
<br />
== Special Messages ==<br />
<br />
Apart from normal messages (that represent calls of methods on UNO objects), there are various kinds of special messages.<br />
<br />
=== The <code>queryInterface</code> Message ===<br />
<br />
This message is used to query a UNO object&nbsp;<var>o</var> for a supported interface type&nbsp;<var>t</var>. It is a request message corresponding to a UNO IDL interface method of the form <code>any queryInterface([in] type)</code>. It uses function ID&nbsp;0 (which is otherwise reserved). The passed in type must be an interface type. The corresponding reply message contains a value &lang;<var>t</var>&prime;,&nbsp;<var>v</var>&prime;&rang; of type <code>ANY</code>. If <var>o</var> does implement the requested type&nbsp;<var>t</var>, <var>t</var>&prime; must equal <var>t</var>, and <var>v</var> must be a non-null reference of type&nbsp;<var>t</var> to&nbsp;<var>o</var>. Otherwise, <var>t</var>&prime; must be <code>VOID</code>.<br />
<br />
There is a special sort of <code>queryInterface</code> messages that request ''initial objects.'' Bridges often face a bootstrapping problem, in that neither side of a bridge knows the OID of an object available at the other side, and neither side can send meaningful request messages. To solve this problem, each side of a bridge can define a well-known set of ''initial object identifiers,'' which can be used by the other side of the bridge to obtain references to those initial objects. This is done with special <code>queryInterface</code> messages, where the target OID is the initial object identifier (instead of a real OID), and the requested interface type is <code>com.sun.star.uno.XInterface</code>. The method call interface type of the request message itself must also be <code>com.sun.star.uno.XInterface</code>. Using an initial object identifier instead of an OID is only valid in such a special <code>queryInterface</code> call; the corresponding reply message will return an <code>ANY</code> containing an object reference with the real OID of the requested initial object (or it will return a <code>VOID</code> <code>ANY</code>). How to distinguish a normal <code>queryInterface</code> message (with a real OID) from such a special <code>queryInterface</code> message (with an initial object identifier instead of an OID) is left unspecified.<br />
<br />
''It is unfortunate that initial object identifiers and OIDs share a single name space.''<br />
<br />
=== The <code>release</code> Message ===<br />
<br />
This message is used to control reference counts associated with objects, see [[#Object Life Cycle|Object Life Cycle]]. It is a request message corresponding to a UNO IDL interface method of the form <code>[oneway] void release()</code>. It uses function ID&nbsp;2 (which is otherwise reserved). (Even though this is a one-way method, a <code>MUSTREPLY</code> flag may require a corresponding reply message, just as with any other one-way method.)<br />
<br />
=== Protocol Property Messages ===<br />
<br />
Properties may be used to customize bridge-internal settings for application-dependent requirements (see [[#Protocol Properties|Protocol Properties]]). Properties can be accessed by sending special request messages containing the special OID <code>UrpProtocolProperties</code> and the interface type <code>com.sun.star.bridge.XProtocolProperties</code>.<br />
<br />
This implies that the OID <code>UrpProtocolProperties</code> is reserved by URP (but only as a real OID, not necessarily as an initial object identifier). The interface type <code>com.sun.star.bridge.XProtocolProperties</code> is only used as a&mdash;meaningless&mdash;tag here; whether or not there is a type of that name (be it an interface type or any other kind of type) is irrelevant.<br />
<br />
''It is unfortunate that the special OID <code>UrpProtocolProperties</code> shares a single name space with normal OIDs, and that these special messages use the interface type <code>com.sun.star.bridge.XProtocolProperties</code> as a tag.''<br />
<br />
Exchanging <code>requestChange</code> and <code>commitChange</code> messages must adhere to a special protocol. For this protocol, each side of the bridge is in one of a number of states at any point in time: <var>initial</var>, <var>requested</var>(<var>n</var>), <var>reply&minus;1</var>, <var>reply0</var>, <var>reply1</var>, <var>commit</var>, <var>committed</var>, or <var>wait</var>. Initially, each side of the bridge is in state <var>initial</var>. Each side of the bridge transitions as follows:<br />
* In state <var>initial</var>, it can send a <code>requestChange</code> request with a given random number&nbsp;<var>n</var>, and transition to state <var>requested</var>(<var>n</var>).<br />
* In state <var>initial</var>, it can receive a <code>requestChange</code> request. It must send back a corresponding reply with return value&nbsp;1, and transition to state <var>wait</var>.<br />
* In state <var>requested</var>(<var>n</var>), it can receive a reply corresponding to its <code>requestChange</code> request, with return value&nbsp;1. It must transition to state <var>commit</var>.<br />
* In state <var>requested</var>(<var>n</var>), it can receive a <code>requestChange</code> request with a random number&nbsp;<var>n</var>&prime;. It must behave as follows:<br />
** If <var>n</var> &lt; <var>n</var>&prime;, it sends back a reply with return value&nbsp;1, and transitions to state <var>reply0</var>.<br />
** If <var>n</var> = <var>n</var>&prime;, it sends back a reply with return value&nbsp;&minus;1, and transitions to state <var>reply&minus;1</var>.<br />
** If <var>n</var> &gt; <var>n</var>&prime;, it sends back a reply with return value&nbsp;0, and transitions to state <var>reply1</var>.<br />
* In state <var>reply&minus;1</var>, it will receive a reply corresponding to its <code>requestChange</code> request, with return value&nbsp;&minus;1. It must transition to state <var>initial</var>.<br />
* In state <var>reply0</var>, it will receive a reply corresponding to its <code>requestChange</code> request, with return value&nbsp;0. It must transition to state <var>wait</var>.<br />
* In state <var>reply1</var>, it will receive a reply corresponding to its <code>requestChange</code> request, with return value&nbsp;1. It must transition to state <var>commit</var>.<br />
* In state <var>commit</var>, it must send a <code>commitChange</code> request, and transition to state <var>committed</var>.<br />
* In state <var>committed</var>, it will receive a reply corresponding to its <code>commitChange</code> request. It must transition to state <var>initial</var>.<br />
* After sending the <code>commitChange</code> request in state <var>commit</var>, this side of the bridge must not send any messages, until it has received the corresponding reply in state <var>committed</var>. (This implies that the sent <code>commitChange</code> request must be the last message in a block.)<br />
* In state <var>wait</var>, it will receive a <code>commitChange</code> request. It must send back a corresponding reply, and transition to state <var>initial</var>.<br />
<br />
Any behaviour of one side of a bridge that does not conform to this protocol is an error. What other messages, besides <code>requestChange</code> and <code>commitChange</code> requests and replies, are sent at what times is not controlled by this protocol (except for the limitation to not send any messages while a <code>commitChange</code> is in transit).<br />
<br />
''This protocol can lead to livelock if both sides of a bridge continuously send <code>requestChange</code> messages with identical random numbers.''<br />
<br />
==== The <code>requestChange</code> Message ====<br />
<br />
This message is used to initiate a change of protocol properties. It is a request message corresponding to a UNO IDL interface method of the form<br />
{| align="center"<br />
|-<br />
| <code>long requestChange([in] long randomNumber);</code><br />
|}<br />
The function ID to use for this message is&nbsp;4.<br />
<br />
The parameter <code>randomNumber</code> is used in case both sides of the bridge send a <code>requestChange</code> message at the same time. The general idea is that the side that supplies the larger number is allowed to proceed with a <code>commitChange</code> message.<br />
<br />
The corresponding reply message contains a <code>LONG</code>. Possible values are 1, 0, and&nbsp;&minus;1; it is an error if any other value is returned. The general idea is that 1 indicates that the receiver can proceed and send a <code>commitChange</code> message, 0 indicates that the other side supplied a larger random number, and &minus;1 indicates that both sides supplied the same random number.<br />
<br />
==== The <code>commitChange</code> Message ====<br />
<br />
This message is used to commit changes of protocol properties. It is a request message corresponding to a UNO IDL interface method of the form<br />
{| align="center"<br />
|-<br />
| <code>void commitChange([in] sequence&lt; [http://api.openoffice.org/docs/common/ref/com/sun/star/bridge/ProtocolProperty.html com::sun::star::bridge::ProtocolProperty] &gt; newValues)<br/>&emsp;raises ([http://api.openoffice.org/docs/common/ref/com/sun/star/bridge/InvalidProtocolChangeException.html com::sun::star::bridge::InvalidProtocolChangeException]);</code><br />
|}<br />
The function ID to use for this message is&nbsp;5.<br />
<br />
The sequence <code>newValues</code> may only contain defined properties, and only those properties that are contained in <code>newValues</code> will be changed. The corresponding reply message will signal an <code>InvalidProtocolChangeException</code> if the other side of the bridge fails to change at least one of the properties, for whatever reason. In that case, no properties are changed at all. To try to change properties again, a new <code>requestChange</code> message must be send.<br />
<br />
On either side of the bridge, the new property values take effect immediately after the (successful) reply to <code>commitChange</code> has been sent or received, respectively. Thus, the reply message itself must still be sent using the old property values.<br />
<br />
== Message Headers ==<br />
<br />
Each message starts with one or two flag bytes. The most significant bit of the first flag byte specifies whether the message has a long or a short header:<br />
{| border="1"<br />
|+ First byte of any message header<br />
|-<br />
! Bit name<br />
! Value<br />
! Description<br />
|-<br />
| rowspan="2" | 7 <code>LONGHEADER</code><br />
| align="center" | 1<br />
| The first byte contains flags with further information about the message.<br />
|-<br />
| align="center" | 0<br />
| The message is a short request message with default flags.<br />
|-<br />
| &ensp;&hellip;<br />
| colspan="2" | &ensp;&hellip;<br />
|}<br />
<br />
For a long message header, the second most significant bit of the first flag byte specifies whether the message is a request or a reply:<br />
{| border="1"<br />
|+ First byte of long message header<br />
|-<br />
! Bit name<br />
! Value<br />
! Description<br />
|-<br />
| 7 <code>LONGHEADER</code><br />
| align="center" | 1<br />
|<br />
|-<br />
| rowspan="2" | 6 <code>REQUEST</code><br />
| align="center" | 1<br />
| The message is a request.<br />
|-<br />
| align="center" | 0<br />
| The message is a reply.<br />
|-<br />
| &ensp;&hellip;<br />
| colspan="2" | &ensp;&hellip;<br />
|}<br />
<br />
A short request message encodes the function ID in the flag bytes (a short request message can only be used if the function ID is in the range [0 &hellip; 2<sup>14</sup>&nbsp;&minus;&nbsp;1]; otherwise, a regular request message must be used). It implicitly uses the first-level caching mechanism for types, OIDs, and TIDs. Its header consists of the one or two flag bytes only:<br />
{| border="1"<br />
|+ First byte of short (request) message header<br />
|-<br />
! Bit name<br />
! Value<br />
! Description<br />
|-<br />
| 7 <code>LONGHEADER</code><br />
| align="center" | 0<br />
|<br />
|-<br />
| rowspan="2" | 6 <code>FUNCTIONID14</code><br />
| align="center" | 1<br />
| The message header consists of two flag bytes. The lower order 6&nbsp;bits of the first byte contain the higher order bits of the function ID, and the 8&nbsp;bits of the second byte contain the lower order bits of the function ID.<br />
|-<br />
| align="center" | 0<br />
| The message header consists of only one flag byte. The lower order 6&nbsp;bits of the byte contain the function ID.<br />
|-<br />
| &ensp;&hellip;<br />
| colspan="2" | &ensp;&hellip;<br />
|}<br />
<br />
== Request Messages ==<br />
<br />
A request message represents the call of a method&nbsp;<var>m</var> of an interface type&nbsp;<var>t</var> at an object&nbsp;<var>o</var> (with a given OID); the call is made from some UNO thread&nbsp;<var>h</var> (with a given TID). The method&nbsp;<var>m</var> has a fixed sequence of parameters &lang;<var>x</var><sub>1</sub>&nbsp;<var>t</var><sub>1</sub>, &hellip;, <var>x</var><sub><var>k</var></sub>&nbsp;<var>t</var><sub><var>k</var></sub>&rang;, <var>k</var> &ge; 0, where each <var>x</var><sub><var>i</var></sub> designates the parameter as either ''in, out,'' or ''in-out,'' and each <var>t</var><sub><var>i</var></sub> is a non-void, non-exception type. If the method&nbsp;<var>m</var> is not defined as a one-way method (or if a <code>MUSTREPLY</code> flag requires a reply nonetheless), the request message will be followed by a reply message with the same TID, sent in the opposite direction.<br />
<br />
{| border="1"<br />
|+ First byte of (long) request message header<br />
|-<br />
! Bit name<br />
! Value<br />
! Description<br />
|-<br />
| 7 <code>LONGHEADER</code><br />
| align="center" | 1<br />
|<br />
|-<br />
| 6 <code>REQUEST</code><br />
| align="center" | 1<br />
|<br />
|-<br />
| rowspan="2" | 5 <code>NEWTYPE</code><br />
| align="center" | 1<br />
| The interface type&nbsp;<var>t</var> of the method call is given explicitly, as part of the message header.<br />
|-<br />
| align="center" | 0<br />
| The interface type&nbsp;<var>t</var> of the method call is given implicitly, using the first-level caching mechanism for types.<br />
|-<br />
| rowspan="2" | 4 <code>NEWOID</code><br />
| align="center" | 1<br />
| The OID of the method call is given explicitly, as part of the message header.<br />
|-<br />
| align="center" | 0<br />
| The OID of the method call is given implicitly, using the first-level caching mechanism for OIDs.<br />
|-<br />
| rowspan="2" | 3 <code>NEWTID</code><br />
| align="center" | 1<br />
| The TID of the method call is given explicitly, as part of the message header.<br />
|-<br />
| align="center" | 0<br />
| The TID of the method call is given implicitly, using the first-level caching mechanism for TIDs.<br />
|-<br />
| rowspan="2" | 2 <code>FUNCTIONID16</code><br />
| align="center" | 1<br />
| The function ID is represented as a 16-bit unsigned integer.<br />
|-<br />
| align="center" | 0<br />
| The function ID is represented as an 8-bit unsigned integer.<br />
|-<br />
| 1 reserved<br />
| align="center" | 0<br />
| When sending, this bit must be set to&nbsp;0; when receiving, the value of this bit should be ignored.<br />
|-<br />
| rowspan="2" | 0 <code>MOREFLAGS</code><br />
| align="center" | 1<br />
| This byte is followed by a second flag byte.<br />
|-<br />
| align="center" | 0<br />
| This byte is the only flag byte.<br />
|}<br />
<br />
If a second flag byte follows, it specifies whether or not a reply is sent back (flag <code>MUSTREPLY</code>), and whether the call is executed synchronously or asynchronously (flag <code>SYNCHRONOUS</code>), overriding any one-way definition of the method&nbsp;<var>m</var>. If no second flag byte follows, the settings of the flags <code>MUSTREPLY</code> and <code>SYNCHRONOUS</code> is specified by the definition of&nbsp;<var>m</var>: if <var>m</var> is defined as a one-way method, both <code>MUSTREPLY</code> and <code>SYNCHRONOUS</code> are implicitly set to&nbsp;0; if <var>m</var> is defined as a normal (not one-way) method, both <code>MUSTREPLY</code> and <code>SYNCHRONOUS</code> are implicitly set to&nbsp;1. It is an error if <code>MUSTREPLY</code> and <code>SYNCHRONOUS</code> are not set either both to&nbsp;0 or both to&nbsp;1.<br />
<br />
''It seems to be a historic mistake that there are two redundant bits, <code>MUSTREPLY</code> and <code>SYNCHRONOUS</code>, that must always have the same value.''<br />
<br />
{| border="1"<br />
|+ Possible second byte of (long) request message header<br />
|-<br />
! Bit name<br />
! Value<br />
! Description<br />
|-<br />
| rowspan="2" | 7 <code>MUSTREPLY</code><br />
| align="center" | 1<br />
| A reply must be sent back.<br />
|-<br />
| align="center" | 0<br />
| No reply must be sent back. (For a method that would originally be synchronous, setting this bit to&nbsp;1 means that information about the return value, the output values of out and in-out parameters, and thrown exceptions is effectively lost.)<br />
|-<br />
| rowspan="2" | 6 <code>SYNCHRONOUS</code><br />
| align="center" | 1<br />
| Execute the call synchronously.<br />
|-<br />
| align="center" | 0<br />
| Execute the call asynchronously.<br />
|-<br />
| 0&ndash;5 reserved<br />
| align="center"| 0<br />
| When sending, these bits must be set to&nbsp;0; when receiving, the values of these bits should be ignored.<br />
|}<br />
<br />
The flag bytes are followed by the function ID, either a 16-bit or an 8-bit unsigned integer.<br />
<br />
If the <code>NEWTYPE</code> flag is set, then the interface type&nbsp;<var>t</var> follows, represented as a value of type <code>TYPE</code>.<br />
<br />
If the <code>NEWOID</code> flag is set, then the OID follows. For its representation, the second-level caching mechanism for OIDs is used. An OID&nbsp;<var>d</var> is a non-empty ASCII string, and hence also a non-empty Unicode string. The OID is represented as the representation of a Unicode string&nbsp;<var>d</var>&prime; of type <code>STRING</code>, followed by a cache index. If <var>d</var>&prime; is the empty string, the OID is taken from the OID cache table. Otherwise, <var>d</var> = <var>d</var>&prime; is the OID. Conversely, it is an error if the Unicode string&nbsp;<var>d</var>&prime; is not also an ASCII string that is a valid OID. (This also implies that no valid OID may be the empty ASCII string.)<br />
<br />
If the <code>NEWTID</code> flag is set, then the TID follows. For its representation, the second-level caching mechanism for TIDs is used. A TID&nbsp;<var>d</var>, which is a non-empty byte sequence, is represented as the representation of a sequence&nbsp;<var>d</var>&prime; of component type <code>BYTE</code>, followed by a cache index. If <var>d</var>&prime; is the empty sequence, the TID is taken from the TID cache table. Otherwise, <var>d</var> = <var>d</var>&prime; is the TID.<br />
<br />
The message header is finished then. The message body contains the input values of any in and in-out parameters from &lang;<var>x</var><sub>1</sub>&nbsp;<var>t</var><sub>1</sub>, &hellip;, <var>x</var><sub><var>k</var></sub>&nbsp;<var>t</var><sub><var>k</var></sub>&rang;, in that order. Each relevant value&nbsp;<var>v</var><sub><var>i</var></sub> is represented as a value of type&nbsp;<var>t</var><sub><var>i</var></sub>, for 1 &le; <var>i</var> &le; <var>k</var>.<br />
<br />
== Reply Messages ==<br />
<br />
Each reply message corresponds to a request message. It represents the data (return value and output values of any out and in-out parameters, or any thrown exception) returned from the call represented by the corresponding request message. Apart from the fixed sequence of parameters &lang;<var>x</var><sub>1</sub>&nbsp;<var>t</var><sub>1</sub>, &hellip;, <var>x</var><sub><var>k</var></sub>&nbsp;<var>t</var><sub><var>k</var></sub>&rang;, <var>k</var> &ge; 0, the method&nbsp;<var>m</var> has a return value type&nbsp;<var>t</var><sub>0</sub> (which must be a non-exception type), and a set of exception specifications {<var>e</var><sub>1</sub>, &hellip;, <var>e</var><sub><var>l</var></sub>}, <var>l</var> &ge; 0 (where each <var>e</var><sub><var>i</var></sub> must be an exception type).<br />
<br />
A reply message header has only one flag byte:<br />
{| border="1"<br />
|+ First byte of reply message header<br />
|-<br />
! Bit name<br />
! Value<br />
! Description<br />
|-<br />
| 7 <code>LONGHEADER</code><br />
| align="center" | 1<br />
|<br />
|-<br />
| 6 <code>REQUEST</code><br />
| align="center" | 0<br />
|<br />
|-<br />
| rowspan="2" | 5 <code>EXCEPTION</code><br />
| align="center" | 1<br />
| The call terminated abnormally, by throwing an exception.<br />
|-<br />
| align="center" | 0<br />
| The call terminated normally.<br />
|-<br />
| 4 reserved<br />
| align="center" | 0<br />
| When sending, this bit must be set to&nbsp;0; when receiving, the value of this bit should be ignored.<br />
|-<br />
| rowspan="2" | 3 <code>NEWTID</code><br />
| align="center" | 1<br />
| The TID of the method call is given explicitly, as part of the message header.<br />
|-<br />
| align="center" | 0<br />
| The TID of the method call is given implicitly, using the first-level caching mechanism for TIDs.<br />
|-<br />
| 0&ndash;2 reserved<br />
| align="center" | 0<br />
| When sending, these bits must be set to&nbsp;0; when receiving, the values of these bits should be ignored.<br />
|}<br />
<br />
If the <code>NEWTID</code> flag is set, the flag byte is followed by the TID, as described for request messages above. The message header is finished then.<br />
<br />
If the <code>EXCEPTION</code> flag is set, the message body contains the thrown exception, represented as a value &lang;<var>t</var>&prime;,&nbsp;<var>v</var>&prime;&rang; of type <code>ANY</code>. The type&nbsp;<var>t</var>&prime; must be an exception type that matches the set of exception specifications {<var>e</var><sub>1</sub>, &hellip;, <var>e</var><sub><var>l</var></sub>}.<br />
<br />
If the <code>EXCEPTION</code> flag is not set, the message body contains the return value&nbsp;<var>v</var><sub>0</sub>, represented as a value of type&nbsp;<var>t</var><sub>0</sub>, followed by the output values of any out and in-out parameters from &lang;<var>x</var><sub>1</sub>&nbsp;<var>t</var><sub>1</sub>, &hellip;, <var>x</var><sub><var>k</var></sub>&nbsp;<var>t</var><sub><var>k</var></sub>&rang;, in that order. Each relevant value&nbsp;<var>v</var><sub><var>i</var></sub> is represented as a value of type&nbsp;<var>t</var><sub><var>i</var></sub>, for 1 &le; <var>i</var> &le; <var>k</var>.<br />
<br />
== UNO Data Representation ==<br />
<br />
See [http://udk.openoffice.org/common/man/typesystem.html ''UNO Type System''] for a description of the UNO type system and related terms. Assume that <var>v</var> is a value of type&nbsp;<var>t</var>. The following specifies the representation of&nbsp;<var>v</var> of type&nbsp;<var>t</var>&prime;, where <var>t</var>&prime; is determined by context, and will always be the same as&nbsp;<var>t</var>, except for struct, exception, and interface types.<br />
<br />
=== Basic Types ===<br />
<br />
A value of a basic type&nbsp;<var>t</var> is represented as zero or more bytes, in the obvious way (values of type <code>BOOLEAN</code> are represented as numeric values 0 denoting <code>false</code> and 1 denoting <code>true</code>; it is an error to use any other numeric values):<br />
{| border="1"<br />
! Type<br />
! Bytes<br />
|-<br />
| <code>VOID</code><br />
| align="right" | 0<br />
|-<br />
| <code>BOOLEAN</code><br />
| align="right" | 1<br />
|-<br />
| <code>BYTE</code><br />
| align="right" | 1<br />
|-<br />
| <code>SHORT</code><br />
| align="right" | 2<br />
|-<br />
| <code>UNSIGNED SHORT</code><br />
| align="right" | 2<br />
|-<br />
| <code>LONG</code><br />
| align="right" | 4<br />
|-<br />
| <code>UNSIGNED LONG</code><br />
| align="right" | 4<br />
|-<br />
| <code>HYPER</code><br />
| align="right" | 8<br />
|-<br />
| <code>UNSIGNED HYPER</code><br />
| align="right" | 8<br />
|-<br />
| <code>FLOAT</code><br />
| align="right" | 4<br />
|-<br />
| <code>DOUBLE</code><br />
| align="right" | 8<br />
|-<br />
| <code>CHAR</code><br />
| align="right" | 2<br />
|}<br />
<br />
=== <code>STRING</code> ===<br />
<br />
A string is first converted into a sequence of bytes, using UTF-8. Let <var>k</var> &ge; 0 be the length of that sequence. The string is represented as the compressed number&nbsp;<var>k</var>, followed by the UTF-8&ndash;converted bytes. It is an error if <var>k</var> &ge; 2<sup>32</sup>. Conversely, it is an error if the bytes do not form a valid UTF-8 encoding.<br />
<br />
=== <code>TYPE</code> ===<br />
<br />
A type is represented as one or more bytes. The seven lower order bits of the first byte (<var>b</var> <code>&amp;</code> <code>0x7F</code>) specify the type class (see also the enum type <code>com.sun.star.uno.TypeClass</code>):<br />
{| border="1"<br />
! Type<br />
! <var>b</var> <code>&amp;</code> <code>0x7F</code><br />
|-<br />
|-<br />
| <code>VOID</code><br />
| align="right" | 0<br />
|-<br />
| <code>BOOLEAN</code><br />
| align="right" | 2<br />
|-<br />
| <code>BYTE</code><br />
| align="right" | 3<br />
|-<br />
| <code>SHORT</code><br />
| align="right" | 4<br />
|-<br />
| <code>UNSIGNED SHORT</code><br />
| align="right" | 5<br />
|-<br />
| <code>LONG</code><br />
| align="right" | 6<br />
|-<br />
| <code>UNSIGNED LONG</code><br />
| align="right" | 7<br />
|-<br />
| <code>HYPER</code><br />
| align="right" | 8<br />
|-<br />
| <code>UNSIGNED HYPER</code><br />
| align="right" | 9<br />
|-<br />
| <code>FLOAT</code><br />
| align="right" | 10<br />
|-<br />
| <code>DOUBLE</code><br />
| align="right" | 11<br />
|-<br />
| <code>CHAR</code><br />
| align="right" | 1<br />
|-<br />
| <code>STRING</code><br />
| align="right" | 12<br />
|-<br />
| <code>TYPE</code><br />
| align="right" | 13<br />
|-<br />
| <code>ANY</code><br />
| align="right" | 14<br />
|-<br />
| sequence types<br />
| align="right" | 20<br />
|-<br />
| enum types<br />
| align="right" | 15<br />
|-<br />
| struct types<br />
| align="right" | 17<br />
|-<br />
| exception types<br />
| align="right" | 19<br />
|-<br />
| interface types<br />
| align="right" | 22<br />
|}<br />
It is an error if the seven lower order bits have a value not listed above. The higher order bit of the first byte (<var>b</var> <code>&amp;</code> <code>0x80</code>) is a cache flag.<br />
<br />
For a simple type, only the first byte is needed. The cache flag must be set to&nbsp;0.<br />
<br />
For a complex type, the second-level caching mechanism for types is used. The first byte is followed by a cache index. If the cache flag is zero, the type is taken from the type cache table. If the cache flag is one, the name of the type follows, represented as a value of type <code>STRING</code>.<br />
<br />
''The decision to represent complex types by both type class and name leads to some redundancy. For sequence types, for example, a better approach would be to represent a sequence type as the type class byte&nbsp;20 followed by the encoding of the component type.''<br />
<br />
=== <code>ANY</code> ===<br />
<br />
Let <var>v</var> = &lang;<var>t</var><sub>1</sub>,&nbsp;<var>v</var><sub>1</sub>&rang; be a value of type <code>ANY</code>. It is represented as the representation of <var>t</var><sub>1</sub> of type <code>TYPE</code>, followed by the representation of&nbsp;<var>v</var><sub>1</sub> of type&nbsp;<var>t</var><sub>1</sub>.<br />
<br />
=== Sequence Types ===<br />
<br />
Let <var>v</var> = (<var>v</var><sub>1</sub>, &hellip;, <var>v</var><sub><var>k</var></sub>), <var>k</var> &ge; 0, be a value of the sequence type with component type&nbsp;<var>t</var><sub><var>c</var></sub>. It is represented as the compressed number&nbsp;<var>k</var>, followed by the representations of <var>v</var><sub>1</sub>, &hellip;, <var>v</var><sub><var>k</var></sub> of type&nbsp;<var>t</var><sub><var>c</var></sub>, in that order. It is an error if <var>k</var> &ge; 2<sup>32</sup>.<br />
<br />
=== Enum Types ===<br />
<br />
Let <var>v</var> = <var>n</var>, <var>n</var> &isin; [&minus;2<sup>31</sup> &hellip; 2<sup>31</sup>&nbsp;&minus;&nbsp;1], be a value of an enum type. It is represented as the 32-bit signed integer&nbsp;<var>n</var>. Conversely, it is an error if a 32-bit signed integer&nbsp;<var>n</var> shall represent a value of some enum type, and that enum type does not contain a member with numeric value&nbsp;<var>n</var>.<br />
<br />
=== Struct and Exception Types ===<br />
<br />
Let <var>v</var> = &lang;<var>v</var><sub>1</sub>, &hellip;, <var>v</var><sub><var>k</var></sub>&rang; be a value of the struct or exception type <var>t</var> = &lang;<var>t</var><sub>1</sub>, &hellip;, <var>t</var><sub><var>k</var></sub>&rang;, <var>k</var> &ge; 0 (where the <var>t</var><sub><var>i</var></sub> include any members inherited from a possible parent type). Assume that <var>v</var> is to be represented as a value of type&nbsp;<var>t</var>&prime;, where <var>t</var>&prime; = &lang;<var>t</var><sub>1</sub>, &hellip; <var>t</var><sub><var>l</var></sub>&rang;, 0 &le; <var>l</var> &le; <var>k</var>, is a supertype of&nbsp;<var>t</var>. The value&nbsp;<var>v</var> is first converted into a value <var>v</var>&prime; = &lang;<var>v</var><sub>1</sub>, &hellip;, <var>v</var><sub><var>l</var></sub>&rang; of type&nbsp;<var>t</var>&prime;, by slicing it. The value&nbsp;<var>v</var>&prime; is then represented as the combination of the representation of <var>v</var><sub><var>i</var></sub> of type&nbsp;<var>t</var><sub><var>i</var></sub>, for <var>i</var> from 1 to <var>l</var>.<br />
<br />
=== Interface Types ===<br />
<br />
Let <var>v</var> be a reference of interface type&nbsp;<var>t</var>, either the null reference or a reference to a UNO object&nbsp;<var>o</var> with OID&nbsp;<var>d</var>. Assume that <var>v</var> is to be represented as a value of type&nbsp;<var>t</var>&prime;, where <var>t</var>&prime; is a supertype of&nbsp;<var>t</var> (but note that this type&nbsp;<var>t</var>&prime; is irrelevant for the representation of&nbsp;<var>v</var>). If <var>v</var> is the null reference, it is represented as the representation of the empty <code>STRING</code>, followed by the special cache index <code>0xFFFF</code>. Otherwise, it is represented as the representation of the OID&nbsp;<var>d</var>, as described for request messages above.<br />
<br />
= Protocol Properties =<br />
<br />
Properties may be used to customize bridge-internal settings. Special messages are used to change protocol properties (see [[#Protocol Property Messages|Protocol Property Messages]]).<br />
<br />
{| border="1"<br />
|+ The protocol properties defined for URP&nbsp;1.0<br />
! Name<br />
! Type<br />
! Description<br />
|-<br />
| valign="top" | <code>CurrentContext</code><br />
| valign="top" | <code>ANY</code><br />
| valign="top" | Changing this property (to an arbitrary <code>ANY</code> value) enables a mode in which the UNO current context is passed across URP.<br/>An implementation of an URP bridge may fail to change this property (i.e., raise a <code>[http://api.openoffice.org/docs/common/ref/com/sun/star/bridge/InvalidProtocolChangeException.html com::sun::star::bridge::InvalidProtocolChangeException]</code> exception in response to a <code>commitChange</code> message). Each implementation of an URP bridge should try to change this property as soon as the bridge is established. ''(Early bridge implementations failed to pass the current context across the bridge, and that needed to be changed in a compatible way.)''<br/>When the current context mode is enabled, the message body of every request message that is not a special <code>release</code> or protocol property message is prefixed by the UNO current context (in the respective thread) as a value of type <code>[http://api.openoffice.org/docs/common/ref/com/sun/star/uno/XCurrentContext.html com::sun::star::uno::XCurrentContext]</code>. ''(It appears to be a historic mistake that the special <code>queryInterface</code> messages are not also exempted.)''<br />
|}<br />
<br />
[[Category:Spec]]<br />
[[Category:Uno]]<br />
[[Category:Uno:Remote]]<br />
[[Category:Remote]]</div>Sb