summaryrefslogtreecommitdiff
path: root/testshl2/workben
diff options
context:
space:
mode:
Diffstat (limited to 'testshl2/workben')
-rw-r--r--testshl2/workben/codegen/README9
-rw-r--r--testshl2/workben/codegen/checkfile7
-rw-r--r--testshl2/workben/codegen/cleanup10
-rw-r--r--testshl2/workben/codegen/makefile.mk49
-rw-r--r--testshl2/workben/codegen/selftest49
-rw-r--r--testshl2/workben/codegen/test.job17
-rw-r--r--testshl2/workben/codegen/w32/checkfile.btm7
-rw-r--r--testshl2/workben/codegen/w32/cleanup.btm9
-rw-r--r--testshl2/workben/codegen/w32/makefile.mk49
-rw-r--r--testshl2/workben/codegen/w32/selftest.btm47
-rw-r--r--testshl2/workben/codegen/w32/test.job17
-rw-r--r--testshl2/workben/dlltest/export.exp1
-rw-r--r--testshl2/workben/dlltest/makefile.mk130
-rw-r--r--testshl2/workben/dlltest/onefunc.cxx54
-rw-r--r--testshl2/workben/dlltest/onefuncstarter.cxx143
-rw-r--r--testshl2/workben/dlltest/registerfunc.h44
-rw-r--r--testshl2/workben/examples/makefile.mk68
-rw-r--r--testshl2/workben/examples/testshl_test.cxx289
-rw-r--r--testshl2/workben/garbage_dump/float.cxx140
-rw-r--r--testshl2/workben/garbage_dump/nippondir.cxx319
-rw-r--r--testshl2/workben/garbage_dump/some_tips.cxx129
-rw-r--r--testshl2/workben/getopt/makefile.mk64
-rw-r--r--testshl2/workben/getopt/test_getopt.cxx143
-rw-r--r--testshl2/workben/makefile.mk130
-rw-r--r--testshl2/workben/runner/unxlngi4.config.file34
-rw-r--r--testshl2/workben/runner/unxsols3.config.file34
-rw-r--r--testshl2/workben/runner/wntmsci9.config.file46
-rw-r--r--testshl2/workben/selftest/README.txt30
-rw-r--r--testshl2/workben/selftest/delivertest.cxx64
-rw-r--r--testshl2/workben/selftest/export.map8
-rw-r--r--testshl2/workben/selftest/makefile.mk91
-rw-r--r--testshl2/workben/selftest/notdeliveredtest.cxx64
-rw-r--r--testshl2/workben/singleton.cxx52
-rw-r--r--testshl2/workben/skeleton/export.map7
-rw-r--r--testshl2/workben/skeleton/makefile.mk55
-rw-r--r--testshl2/workben/skeleton/skeleton.cxx82
-rw-r--r--testshl2/workben/test_autoptr.cxx103
-rw-r--r--testshl2/workben/test_filter.cxx233
-rw-r--r--testshl2/workben/test_member.cxx100
-rw-r--r--testshl2/workben/test_ostringstream.cxx119
-rw-r--r--testshl2/workben/test_preproc.cxx58
-rw-r--r--testshl2/workben/test_printf.cxx63
-rw-r--r--testshl2/workben/test_string.cxx141
-rw-r--r--testshl2/workben/uno/export.exp1
-rwxr-xr-xtestshl2/workben/uno/export.map8
-rw-r--r--testshl2/workben/uno/makefile.mk83
-rw-r--r--testshl2/workben/uno/unotest.cxx117
47 files changed, 3517 insertions, 0 deletions
diff --git a/testshl2/workben/codegen/README b/testshl2/workben/codegen/README
new file mode 100644
index 000000000000..0c24b4a05856
--- /dev/null
+++ b/testshl2/workben/codegen/README
@@ -0,0 +1,9 @@
+This directory contains a simple code generator self test.
+Within UNIX simply start ./selftest
+
+You will get lot of output.
+The code generator creates some files,
+dmake compiles the generated code,
+testshl2 checks the code.
+
+If something goes wrong, you will hopefully get an informal error message.
diff --git a/testshl2/workben/codegen/checkfile b/testshl2/workben/codegen/checkfile
new file mode 100644
index 000000000000..228642da52af
--- /dev/null
+++ b/testshl2/workben/codegen/checkfile
@@ -0,0 +1,7 @@
+#!/bin/csh
+
+if ( -e $1 ) then
+ echo "$1 exist."
+else
+ echo "$1 doesn't exist."
+endif
diff --git a/testshl2/workben/codegen/cleanup b/testshl2/workben/codegen/cleanup
new file mode 100644
index 000000000000..a3fb82312cdf
--- /dev/null
+++ b/testshl2/workben/codegen/cleanup
@@ -0,0 +1,10 @@
+#!/bin/csh
+
+# cleanup
+rm -f *.cxx *.new *.exp
+
+if ( -e makefile.mk_orig ) then
+ rm -f makefile.mk
+ # rename original makefile back
+ mv makefile.mk_orig makefile.mk
+endif
diff --git a/testshl2/workben/codegen/makefile.mk b/testshl2/workben/codegen/makefile.mk
new file mode 100644
index 000000000000..0fdba2d00c13
--- /dev/null
+++ b/testshl2/workben/codegen/makefile.mk
@@ -0,0 +1,49 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2008 by Sun Microsystems, Inc.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.4 $
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+PRJ=..$/..
+
+PRJNAME=testshl2
+TARGET=codegen
+# this is removed at the moment because we need some enhancements
+# TESTDIR=TRUE
+
+ENABLE_EXCEPTIONS=TRUE
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : settings.mk
+
+#------------------------------- All object files -------------------------------
+
+
+# --- Targets ------------------------------------------------------
+
+.INCLUDE : target.mk
diff --git a/testshl2/workben/codegen/selftest b/testshl2/workben/codegen/selftest
new file mode 100644
index 000000000000..cf5e80e513ce
--- /dev/null
+++ b/testshl2/workben/codegen/selftest
@@ -0,0 +1,49 @@
+#!/bin/csh
+
+echo "========== Generate code =========="
+echo
+
+perl ../../source/codegen/codegen.pl test.job
+
+echo
+echo "========== check files =========="
+echo
+
+./checkfile makefile.new
+./checkfile export.exp
+./checkfile skeleton.cxx
+./checkfile nomethod.cxx
+
+echo
+echo "========== backup makefile =========="
+echo
+
+# backup original makefile
+mv makefile.mk makefile.mk_orig
+mv makefile.new makefile.mk
+
+echo
+echo "========== build new sources =========="
+echo
+
+dmake debug=t
+
+echo
+echo "========== call testshl2 =========="
+echo
+
+
+if ( -e ../../${INPATH}/bin/testshl2 ) then
+ ../../${INPATH}/bin/testshl2 -jobonly test.job
+
+ echo
+ ../../${INPATH}/bin/testshl2 ../../${INPATH}/lib/libtest.so
+else
+ echo "testshl2 doesn't exist, test canceled."
+endif
+
+echo
+echo "========== cleanup =========="
+echo
+
+./cleanup
diff --git a/testshl2/workben/codegen/test.job b/testshl2/workben/codegen/test.job
new file mode 100644
index 000000000000..07c47329705b
--- /dev/null
+++ b/testshl2/workben/codegen/test.job
@@ -0,0 +1,17 @@
+# Jobfile
+# this is a job file which contain functions, which should exist
+
+skeleton.bones.bone_001
+skeleton.bones.bone_002
+
+skeleton.bones2.bone_001
+skeleton.bones2.bone_002
+
+nomethod.blah
+illegal
+
+# blah.fasel.suelz
+
+
+# rtl_OUStringBuffer.*
+
diff --git a/testshl2/workben/codegen/w32/checkfile.btm b/testshl2/workben/codegen/w32/checkfile.btm
new file mode 100644
index 000000000000..091ecfbf9faf
--- /dev/null
+++ b/testshl2/workben/codegen/w32/checkfile.btm
@@ -0,0 +1,7 @@
+rem %1 is the filename
+
+iff exist %1 then
+echo Ok: %1 exist.
+else
+echo ERROR: %1 does not exist.
+endiff
diff --git a/testshl2/workben/codegen/w32/cleanup.btm b/testshl2/workben/codegen/w32/cleanup.btm
new file mode 100644
index 000000000000..5073ef887bac
--- /dev/null
+++ b/testshl2/workben/codegen/w32/cleanup.btm
@@ -0,0 +1,9 @@
+rem cleanup
+del *.cxx *.new *.exp
+
+iff exist makefile.mk_orig then
+ del makefile.mk
+ rem rename original makefile back
+ ren makefile.mk_orig makefile.mk
+endiff
+
diff --git a/testshl2/workben/codegen/w32/makefile.mk b/testshl2/workben/codegen/w32/makefile.mk
new file mode 100644
index 000000000000..13f91a3a4bbc
--- /dev/null
+++ b/testshl2/workben/codegen/w32/makefile.mk
@@ -0,0 +1,49 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2008 by Sun Microsystems, Inc.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.3 $
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+PRJ=..$/..$/..
+
+PRJNAME=testshl2
+TARGET=codegen
+# this is removed at the moment because we need some enhancements
+# TESTDIR=TRUE
+
+ENABLE_EXCEPTIONS=TRUE
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : settings.mk
+
+#------------------------------- All object files -------------------------------
+
+
+# --- Targets ------------------------------------------------------
+
+.INCLUDE : target.mk
diff --git a/testshl2/workben/codegen/w32/selftest.btm b/testshl2/workben/codegen/w32/selftest.btm
new file mode 100644
index 000000000000..e181ecc3158b
--- /dev/null
+++ b/testshl2/workben/codegen/w32/selftest.btm
@@ -0,0 +1,47 @@
+
+rem demo
+
+echo "========== Generate code =========="
+echo
+
+perl ..\..\..\source\codegen\codegen.pl test.job
+
+echo
+echo "========== check files =========="
+echo
+
+call checkfile makefile.new
+call checkfile export.exp
+call checkfile skeleton.cxx
+call checkfile nomethod.cxx
+
+echo
+echo "========== backup makefile =========="
+echo
+
+ren makefile.mk makefile.mk_orig
+ren makefile.new makefile.mk
+
+echo
+echo "========== build new sources =========="
+echo
+
+call dmake debug=t
+
+echo
+echo "========== call testshl2 =========="
+echo
+
+iff exist ..\..\..\%INPATH%\bin\testshl2.exe then
+call ..\..\..\%INPATH%\bin\testshl2 -jobonly test.job
+call ..\..\..\%INPATH%\bin\testshl2 ..\..\..\%INPATH%\bin\test.dll
+else
+ echo "testshl2 doesn't exist, test canceled."
+endiff
+
+echo
+echo "========== cleanup =========="
+echo
+
+call cleanup.btm
+
diff --git a/testshl2/workben/codegen/w32/test.job b/testshl2/workben/codegen/w32/test.job
new file mode 100644
index 000000000000..07c47329705b
--- /dev/null
+++ b/testshl2/workben/codegen/w32/test.job
@@ -0,0 +1,17 @@
+# Jobfile
+# this is a job file which contain functions, which should exist
+
+skeleton.bones.bone_001
+skeleton.bones.bone_002
+
+skeleton.bones2.bone_001
+skeleton.bones2.bone_002
+
+nomethod.blah
+illegal
+
+# blah.fasel.suelz
+
+
+# rtl_OUStringBuffer.*
+
diff --git a/testshl2/workben/dlltest/export.exp b/testshl2/workben/dlltest/export.exp
new file mode 100644
index 000000000000..a13529da5876
--- /dev/null
+++ b/testshl2/workben/dlltest/export.exp
@@ -0,0 +1 @@
+registerAllTestFunction
diff --git a/testshl2/workben/dlltest/makefile.mk b/testshl2/workben/dlltest/makefile.mk
new file mode 100644
index 000000000000..88ccfac54b5f
--- /dev/null
+++ b/testshl2/workben/dlltest/makefile.mk
@@ -0,0 +1,130 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2008 by Sun Microsystems, Inc.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.5 $
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+PRJ=..$/..
+PRJINC=
+
+PRJNAME=testshl2
+TARGET=onefunc
+TARGETTYPE=CUI
+
+ENABLE_EXCEPTIONS=TRUE
+#USE_LDUMP2=TRUE
+#LDUMP2=LDUMP3
+
+# --- Settings -----------------------------------------------------
+.INCLUDE : settings.mk
+
+# ------------------------------------------------------------------
+#--------------------------------- Objectfiles ---------------------------------
+OBJFILES=$(OBJ)$/onefuncstarter.obj
+SLOFILES=$(SLO)$/onefunc.obj
+
+# -------------------------------------------------------------------------------
+
+LIB1TARGET= $(LB)$/$(TARGET)_libfile.lib
+LIB1OBJFILES= $(SLOFILES)
+
+.IF "$(GUI)" == "UNX"
+LIB1ARCHIV=$(LB)$/lib$(TARGET)$(DLLPOSTFIX).a
+.ENDIF
+
+# ------------------------------------------------------------------
+SHL2OBJS = $(SLOFILES)
+
+SHL2TARGET= $(TARGET)_DLL
+SHL2STDLIBS+=\
+ $(SALLIB)
+
+SHL2DEPN=
+SHL2IMPLIB= i$(SHL2TARGET)
+SHL2DEF= $(MISC)$/$(SHL2TARGET).def
+
+DEF2NAME =$(SHL2TARGET)
+DEF2EXPORTFILE= export.exp
+
+#----------------------------- prog with *.lib file -----------------------------
+
+APP1TARGET= $(TARGET)starter
+APP1OBJS=$(OBJFILES)
+
+APP1STDLIBS=$(SALLIB)
+
+APP1DEPN= $(APP1OBJS) $(LIB1TARGET)
+APP1LIBS= $(LIB1TARGET)
+
+#-------------------------- executable with LIBARCHIV --------------------------
+
+APP2TARGET= $(TARGET)starter2
+APP2OBJS= $(OBJFILES)
+
+APP2STDLIBS=$(SALLIB)
+.IF "$(GUI)" == "UNX"
+APP2STDLIBS+=$(LB)$/lib$(TARGET)$(DLLPOSTFIX).a
+.ENDIF
+.IF "$(GUI)" == "WNT"
+APP2STDLIBS+=$(LIB1TARGET)
+.ENDIF
+
+APP2DEPN= $(APP1OBJS) $(LIB1TARGET)
+APP2LIBS=
+
+#----------------------- executable with dynamic library -----------------------
+
+APP3TARGET= $(TARGET)starter3
+APP3OBJS= $(OBJFILES)
+
+APP3STDLIBS=$(SALLIB)
+
+.IF "$(GUI)" == "WNT"
+APP3STDLIBS+=i$(SHL2TARGET).lib
+.ENDIF
+.IF "$(GUI)" == "UNX"
+APP3STDLIBS+=-l$(SHL2TARGET)
+.ENDIF
+
+APP3DEPN= $(APP1OBJS) $(LIB1TARGET)
+APP3LIBS=
+# APP3DEF=
+
+#----------------------- executable without any other files -----------------------
+
+APP4TARGET= $(TARGET)starter4
+APP4OBJS= $(OBJFILES)
+
+APP4STDLIBS=$(SALLIB)
+
+APP4DEPN= $(APP1OBJS)
+APP4LIBS=
+# APP3DEF=
+# --- Targets ------------------------------------------------------
+
+.INCLUDE : target.mk
+.INCLUDE : _cppunit.mk
diff --git a/testshl2/workben/dlltest/onefunc.cxx b/testshl2/workben/dlltest/onefunc.cxx
new file mode 100644
index 000000000000..c09963827007
--- /dev/null
+++ b/testshl2/workben/dlltest/onefunc.cxx
@@ -0,0 +1,54 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: onefunc.cxx,v $
+ * $Revision: 1.5 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_testshl2.hxx"
+
+#include <stdio.h>
+#include <sal/types.h>
+#include "registerfunc.h"
+
+extern "C" void SAL_CALL firstfunc()
+{
+ printf("first func called.\n");
+}
+extern "C" void SAL_CALL secondfunc()
+{
+ printf("second func called.\n");
+}
+
+extern "C" void SAL_CALL registerAllTestFunction(FktRegFuncPtr _pFunc)
+{
+ if (_pFunc)
+ {
+ (_pFunc)(&firstfunc, "firstfunc");
+ (_pFunc)(&secondfunc, "secondfunc");
+ }
+}
diff --git a/testshl2/workben/dlltest/onefuncstarter.cxx b/testshl2/workben/dlltest/onefuncstarter.cxx
new file mode 100644
index 000000000000..2331473577d3
--- /dev/null
+++ b/testshl2/workben/dlltest/onefuncstarter.cxx
@@ -0,0 +1,143 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: onefuncstarter.cxx,v $
+ * $Revision: 1.8 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_testshl2.hxx"
+
+#include <vector>
+#include <stdio.h>
+#include "registerfunc.h"
+#include <osl/module.hxx>
+#include <osl/process.h>
+#include <osl/file.hxx>
+
+#include <rtl/string.hxx>
+#include <rtl/ustring.hxx>
+
+typedef std::vector<FktPtr> FunctionList;
+FunctionList m_Functions;
+
+extern "C" bool SAL_CALL registerFunc(FktPtr _pFunc, const char* _sFuncName)
+{
+ printf("Function register call for func(%s) successful.\n", _sFuncName);
+ m_Functions.push_back(_pFunc);
+ // FktPtr pFunc = _pFunc;
+ // if (_pFunc)
+ // {
+ // (_pFunc)();
+ // }
+
+ return true;
+}
+
+void callAll()
+{
+ for(FunctionList::const_iterator it = m_Functions.begin();
+ it != m_Functions.end();
+ ++it)
+ {
+ FktPtr pFunc = *it;
+ if (pFunc)
+ {
+ (pFunc)();
+ }
+ }
+}
+
+// void test_link_at_compiletime()
+// {
+// FktRegFuncPtr pRegisterFunc = &registerFunc;
+// registerAll(pRegisterFunc);
+// callAll();
+// }
+
+
+// -----------------------------------------------------------------------------
+rtl::OUString convertPath( rtl::OString const& sysPth )
+{
+ // PRE: String should contain a filename, relativ or absolut
+ rtl::OUString sysPath( rtl::OUString::createFromAscii( sysPth.getStr() ) );
+ rtl::OUString fURL;
+ if ( sysPth.indexOf("..") == 0 )
+ {
+ // filepath contains '..' so it's a relative path make it absolut.
+ rtl::OUString curDirPth;
+ osl_getProcessWorkingDir( &curDirPth.pData );
+ osl::FileBase::getAbsoluteFileURL( curDirPth, sysPath, fURL );
+ }
+ else
+ {
+ osl::FileBase::getFileURLFromSystemPath( sysPath, fURL );
+ }
+ return fURL;
+}
+// -----------------------------------------------------------------------------
+
+void test_link_at_runtime()
+{
+ ::osl::Module* pModule;
+ pModule = new ::osl::Module();
+ // create and load the module (shared library)
+ // pModule = new ::osl::Module();
+#if (defined WNT) || (defined OS2)
+ pModule->load( convertPath( rtl::OString( "onefunc_DLL.dll" ) ) );
+#endif
+#ifdef UNX
+ pModule->load( convertPath( rtl::OString( "libonefunc_DLL.so" ) ) );
+#endif
+
+ // get entry pointer
+ FktRegAllPtr pFunc = (FktRegAllPtr) pModule->getSymbol( rtl::OUString::createFromAscii( "registerAllTestFunction" ) );
+
+ if (pFunc)
+ {
+ FktRegFuncPtr pRegisterFunc = &registerFunc;
+ pFunc(pRegisterFunc);
+ callAll();
+ }
+
+ delete pModule;
+}
+
+
+
+// ----------------------------------- Main -----------------------------------
+#if (defined UNX) || (defined OS2)
+int main( int argc, char* argv[] )
+#else
+int _cdecl main( int argc, char* argv[] )
+#endif
+{
+ (void) argc;
+ (void) argv;
+// test_link_at_compiletime();
+ test_link_at_runtime();
+ return 0;
+}
diff --git a/testshl2/workben/dlltest/registerfunc.h b/testshl2/workben/dlltest/registerfunc.h
new file mode 100644
index 000000000000..19a3cd99e4ba
--- /dev/null
+++ b/testshl2/workben/dlltest/registerfunc.h
@@ -0,0 +1,44 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: registerfunc.h,v $
+ * $Revision: 1.4 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _register_h
+#define _register_h
+
+#include <sal/types.h>
+
+typedef void (* FktPtr)(void);
+// register the given void* as a function pointer, true, if successful
+extern "C" bool SAL_CALL registerFunc(FktPtr aFunc, const char* aFuncName);
+
+typedef bool (* FktRegFuncPtr)(FktPtr aFunc, const char* aFuncName);
+extern "C" void SAL_CALL registerAllTestFunction(FktRegFuncPtr aFunc);
+
+typedef void (* FktRegAllPtr)(FktRegFuncPtr aFunc);
+#endif
diff --git a/testshl2/workben/examples/makefile.mk b/testshl2/workben/examples/makefile.mk
new file mode 100644
index 000000000000..8ae856d463c2
--- /dev/null
+++ b/testshl2/workben/examples/makefile.mk
@@ -0,0 +1,68 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2008 by Sun Microsystems, Inc.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.4 $
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+PRJ=..$/..
+PRJINC=
+
+PRJNAME=testshl2
+TARGET=demotest
+TARGETTYPE=CUI
+
+ENABLE_EXCEPTIONS=TRUE
+#USE_LDUMP2=TRUE
+#LDUMP2=LDUMP3
+
+# --- Settings -----------------------------------------------------
+.INCLUDE : settings.mk
+
+# ------------------------------------------------------------------
+
+#--------------------------------- Objectfiles ---------------------------------
+SLOFILES=$(SLO)$/testshl_test.obj
+
+# ------------------------------------------------------------------
+SHL2OBJS = $(SLOFILES)
+
+SHL2TARGET= $(TARGET)
+SHL2STDLIBS=\
+ $(SALLIB) \
+ $(SOLARLIBDIR)$/cppunit.lib
+
+SHL2DEPN=
+SHL2IMPLIB= i$(SHL2TARGET)
+SHL2DEF= $(MISC)$/$(SHL2TARGET).def
+
+DEF2NAME =$(SHL2TARGET)
+DEF2EXPORTFILE= export.exp
+
+
+# --- Targets ------------------------------------------------------
+
+.INCLUDE : target.mk
diff --git a/testshl2/workben/examples/testshl_test.cxx b/testshl2/workben/examples/testshl_test.cxx
new file mode 100644
index 000000000000..c667c655958d
--- /dev/null
+++ b/testshl2/workben/examples/testshl_test.cxx
@@ -0,0 +1,289 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: testshl_test.cxx,v $
+ * $Revision: 1.5 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_testshl2.hxx"
+
+#include <stdio.h>
+
+#ifdef WNT
+// #define UNDER_WINDOWS_DEBUGGING
+// Nice feature, to debug under windows, install msdev locally and use DebugBreak() to stop a new process at a point you want.
+#ifdef UNDER_WINDOWS_DEBUGGING
+#include <tools/presys.h>
+#include <windows.h>
+#include <tools/postsys.h>
+
+#define VCL_NEED_BASETSD
+
+#endif /* UNDER_WINDOWS_DEBUGGING */
+#endif /* WNT */
+
+
+#include <vector>
+
+
+#ifndef _SAL_TRES_H_
+#include <rtl/tres.h>
+#endif
+
+#ifndef _TESTSHL_TSTMGR_H_
+#include "tstmgr.h"
+#endif
+
+#ifndef _RTL_STRING_HXX_
+ #include <rtl/string.hxx>
+#endif
+
+#include <osl/time.h>
+
+using namespace std;
+
+
+/**
+ * create bitmap of comandline parameters
+ */
+sal_uInt32 createFlags( vector< sal_Char* > const& cmdln )
+{
+ sal_uInt32 retflags = rtl_tres_Flag_OK;
+
+ vector< sal_Char* >::const_iterator iter = cmdln.begin();
+ while( iter != cmdln.end() )
+ {
+ fprintf( stderr, "%s\n", *iter );
+ if ( *iter[0] == '-' )
+ {
+ rtl::OString item( *iter );
+ if ( item == "-boom" )
+ retflags |= rtl_tres_Flag_BOOM;
+
+ if ( item == "-verbose" )
+ retflags |= rtl_tres_Flag_VERBOSE;
+
+ if ( item == "-skip" )
+ retflags |= rtl_tres_Flag_SKIP;
+
+ if ( item == "-log" )
+ retflags |= rtl_tres_Flag_LOG;
+
+ if ( item == "-his" )
+ retflags |= rtl_tres_Flag_HIS;
+
+ if ( item == "-time" )
+ retflags |= rtl_tres_Flag_TIME;
+
+ if ( item == "-msg" )
+ retflags |= rtl_tres_Flag_MSG;
+
+ if ( item == "-quiet" )
+ retflags |= rtl_tres_Flag_QUIET;
+ }
+ iter++;
+ }
+
+ return retflags;
+}
+
+sal_uInt32 createFlags(int argc, char* argv[])
+{
+ vector< sal_Char* > cmdln;
+ sal_Int32 i;
+
+ /* collect comandline */
+ for ( i = 1; i < argc; i++ )
+ cmdln.push_back( argv[i] );
+
+ return createFlags(cmdln);
+}
+
+// -----------------------------------------------------------------------------
+
+/**
+ * display usage screen
+ */
+
+void usage()
+{
+ fprintf( stdout,
+ "USAGE: testshl shlname scename [-boom][-verbose][-log][-his][-msg]\n" );
+ exit(0);
+}
+
+
+#include <fstream>
+#include <cppunit/TestFixture.h>
+#include <cppunit/TestCaller.h>
+#include <cppunit/TestSuite.h>
+#include <cppunit/TestResult.h>
+#include <cppunit/TestResultCollector.h>
+#include <cppunit/TestAssert.h>
+#include <cppunit/TextTestResult.h>
+
+namespace CppunitTest
+{
+ class AStringTest : public CppUnit::TestCase
+ {
+ rtl::OString *m_pStr;
+ public:
+ AStringTest()
+ :m_pStr(NULL) {}
+
+ void setUp()
+ {
+ m_pStr = new rtl::OString("test1");
+ // throw std::exception("initialization failed.");
+ }
+
+ void tearDown()
+ {
+ delete m_pStr;
+ }
+
+ void testEquality()
+ {
+ CPPUNIT_ASSERT( *m_pStr == "test1" );
+ CPPUNIT_ASSERT( (*m_pStr).equalsIgnoreAsciiCase("Test1") );
+ CPPUNIT_ASSERT( (*m_pStr).equalsIgnoreAsciiCase("Test2") );
+ CPPUNIT_ASSERT( *m_pStr == "test1" );
+ CPPUNIT_ASSERT( *m_pStr == "must also fail" );
+ }
+ void testEquality2()
+ {
+ rtl::OString aStr("test2");
+ CPPUNIT_ASSERT( aStr == "test2" );
+ CPPUNIT_ASSERT_MESSAGE("ein vergleichstest", aStr == "test2");
+ CPPUNIT_ASSERT( aStr == "must also fail" );
+ }
+ void testThrow()
+ {
+ throw std::exception("an own exception!");
+ CPPUNIT_ASSERT( *m_pStr == "test2" );
+ }
+ };
+
+ CppUnit::TestSuite *suite1()
+ {
+ CppUnit::TestSuite *suite = new CppUnit::TestSuite( "AStringTest" );
+
+ // CppUnit::TestSuite suite;
+ // CppUnit::TextTestResult result;
+
+ suite->addTest( new CppUnit::TestCaller<AStringTest>( "throw test", &AStringTest::testThrow ));
+// suite->addTest( new CppUnit::TestCaller<AStringTest>( "test op eq", &AStringTest::testEquality ));
+// suite->addTest( new CppUnit::TestCaller<AStringTest>( "test op eq", &AStringTest::testEquality2 ));
+
+ return suite;
+ }
+
+ // -----------------------------------------------------------------------------
+
+ class ASimpleTest : public CppUnit::TestCase
+ {
+ public:
+ void testEqual()
+ {
+ CPPUNIT_ASSERT( 1 == 1 );
+ }
+ };
+
+ CppUnit::TestSuite *suite2()
+ {
+ CppUnit::TestSuite *suite = new CppUnit::TestSuite( "A simple test" );
+
+ // CppUnit::TestSuite suite;
+ // CppUnit::TextTestResult result;
+
+ suite->addTest( new CppUnit::TestCaller<ASimpleTest>( "1 == 1", &ASimpleTest::testEqual ));
+
+ return suite;
+ }
+
+ // -----------------------------------------------------------------------------
+
+ CppUnit::TestSuite *suite()
+ {
+ CppUnit::TestSuite *suite = new CppUnit::TestSuite( "A simple test" );
+
+ // CppUnit::TestSuite suite;
+ // CppUnit::TextTestResult result;
+
+ suite->addTest( suite1() );
+// suite->addTest( suite2() );
+
+ return suite;
+ }
+}
+
+void cppunitbased_test()
+{
+ {
+ // ofstream out("c:\\temp\\output.txt", ios::out);
+ CppUnit::TextTestResult aResult;
+
+ CppUnit::TestSuite* pSuite = CppunitTest::suite();
+
+ int nTests = pSuite->countTestCases();
+ pSuite->run(&aResult);
+
+ // aResult.print(out);
+ cout << aResult;
+
+ delete pSuite;
+ }
+
+ exit(1);
+}
+
+// ----------------------------------- Main -----------------------------------
+#if (defined UNX) || (defined OS2)
+int main( int argc, char* argv[] )
+#else
+int _cdecl main( int argc, char* argv[] )
+#endif
+{
+ cppunitbased_test();
+
+ tslTestManager hMgr = 0;
+
+ /* show usage screen if too less parameters */
+ if ( argc < 3 )
+ usage();
+
+#ifdef UNDER_WINDOWS_DEBUGGING
+ DebugBreak();
+#endif
+
+ sal_uInt32 nCmdlinebitflags = createFlags( argc, argv );
+
+ hMgr = tsl_TestManager_create( argv, argc, nCmdlinebitflags );
+ tsl_TestManager_run( hMgr );
+ tsl_TestManager_destroy( hMgr );
+ return 0;
+}
diff --git a/testshl2/workben/garbage_dump/float.cxx b/testshl2/workben/garbage_dump/float.cxx
new file mode 100644
index 000000000000..08a36e0cdcd0
--- /dev/null
+++ b/testshl2/workben/garbage_dump/float.cxx
@@ -0,0 +1,140 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: float.cxx,v $
+ * $Revision: 1.4 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_testshl2.hxx"
+#include <stdio.h>
+#include <double>
+#include <math.h> // fabs()
+// #include <sal/types.h>
+
+#define sal_Int16 short
+#define SAL_CALL
+
+// LLA: from kernel.h
+/*
+ * min()/max() macros that also do
+ * strict type-checking.. See the
+ * "unnecessary" pointer comparison.
+ */
+#define MIN(x,y) ({ \
+ const typeof(x) _x = (x); \
+ const typeof(y) _y = (y); \
+ (void) (&_x == &_y); \
+ _x < _y ? _x : _y; })
+
+#define MAX(x,y) ({ \
+ const typeof(x) _x = (x); \
+ const typeof(y) _y = (y); \
+ (void) (&_x == &_y); \
+ _x > _y ? _x : _y; })
+
+//------------------------------------------------------------------------
+// testing the method toDouble()
+//------------------------------------------------------------------------
+template<class T>
+sal_Int16 SAL_CALL test_rtl_OString_checkPrecisionSize()
+{
+ sal_Int16 nSize = sizeof(T);
+ T nCalcValue = 1.0;
+
+ // (i + 1) is the current precision
+ sal_Int16 i = 0;
+ for (i=0;i<50;i++)
+ {
+ nCalcValue *= 10;
+ T nValue = nCalcValue + 0.1;
+ T dSub = nValue - nCalcValue;
+ // ----- 0.11 ---- 0.1 ---- 0.09 -----
+ if (0.11 > dSub && dSub < 0.09)
+ {
+ // due to the fact, that the value is break down we sub 1 from the precision value
+ // but to suppress this, we start at zero, precision is i+1 till here --i;
+ break;
+ }
+ }
+
+ sal_Int16 j= 0;
+ nCalcValue = 1.0;
+ for (j=0;j<50;j++)
+ {
+ nCalcValue /= 10;
+ T nValue = nCalcValue + 1.0;
+ T dSub = nValue - 1.0;
+ // ---- 0.02 ----- 0.01 ---- 0 --- -0.99 ---- -0.98 ----
+ T dSubAbsolut = fabs(dSub);
+ // ---- 0.02 ----- 0.01 ---- 0 (cut)
+ if ( dSub == 0)
+ break;
+ }
+ if (i != j)
+ {
+ // hmmm....
+ // imho i +- 1 == j is a good value
+ int n = i - j;
+ if (n < 0) n = -n;
+ if (n <= 1)
+ {
+ return MIN(i,j);
+ }
+ else
+ {
+ printf("warning: presision differs more than 1");
+ }
+ }
+
+ return i;
+}
+
+void SAL_CALL test_precision( )
+{
+ sal_Int16 nPrecision;
+ nPrecision = test_rtl_OString_checkPrecisionSize<float>();
+ nPrecision = test_rtl_OString_checkPrecisionSize<double>();
+ nPrecision = test_rtl_OString_checkPrecisionSize<long double>();
+ nPrecision = test_rtl_OString_checkPrecisionSize<Double>();
+}
+
+// ----------------------------------- Main -----------------------------------
+#if (defined UNX) || (defined OS2)
+int main( int argc, char* argv[] )
+#else
+int main( int argc, char* argv[] )
+#endif
+{
+ test_precision();
+ return 0;
+}
+
+// The following sets variables for GNU EMACS
+// Local Variables:
+// tab-width:4
+// End:
diff --git a/testshl2/workben/garbage_dump/nippondir.cxx b/testshl2/workben/garbage_dump/nippondir.cxx
new file mode 100644
index 000000000000..24146eec4a45
--- /dev/null
+++ b/testshl2/workben/garbage_dump/nippondir.cxx
@@ -0,0 +1,319 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: nippondir.cxx,v $
+ * $Revision: 1.5 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_testshl2.hxx"
+
+#include <iostream>
+#include<osl/file.hxx>
+
+#include<osl/thread.hxx>
+#include <tools/string.hxx>
+
+// -----------------------------------------------------------------------------
+// ---------------------------------- defines ----------------------------------
+// -----------------------------------------------------------------------------
+#ifndef ASCII
+#define ASCII(x) OUString::createFromAscii(x)
+#endif
+
+using namespace osl;
+using namespace rtl;
+using namespace std;
+
+
+ostream& operator << (ostream& out, rtl::OUString const& aStr)
+{
+ sal_Unicode const* const pStr = aStr.getStr();
+ sal_Unicode const* const pEnd = pStr + aStr.getLength();
+ for (sal_Unicode const* p = pStr; p < pEnd; ++p)
+ if (0 < *p && *p < 127) // ASCII
+ out << char(*p);
+ else
+ out << "[\\u" << hex << *p << "]";
+ return out;
+}
+
+
+inline void operator <<= (::rtl::OUString& _rUnicodeString, const sal_Char* _pAsciiString)
+{
+ _rUnicodeString = ::rtl::OUString::createFromAscii(_pAsciiString);
+}
+
+inline void operator <<= (::rtl::OUString& _rUnicodeString, const ::rtl::OString& _rAsciiString)
+{
+ _rUnicodeString <<= _rAsciiString.getStr();
+}
+
+/*
+inline void operator <<= (Any& _rUnoValue, const sal_Char* _pAsciiString)
+{
+ _rUnoValue <<= ::rtl::OUString::createFromAscii(_pAsciiString);
+}
+
+inline void operator <<= (Any& _rUnoValue, const ::rtl::OString& _rAsciiString)
+{
+ _rUnoValue <<= _rAsciiString.getStr();
+}
+*/
+
+inline void operator <<= (::rtl::OString& _rAsciiString, ::rtl::OUString const& _rUnicodeString )
+{
+ _rAsciiString = rtl::OUStringToOString(_rUnicodeString, RTL_TEXTENCODING_ASCII_US).getStr();
+}
+// -----------------------------------------------------------------------------
+
+namespace FileHelper
+{
+ rtl::OUString createOSLErrorString(FileBase::RC eError)
+ {
+ rtl::OUString aRet;
+ switch(eError)
+ {
+ case osl_File_E_None:
+ break;
+
+ case osl_File_E_PERM:
+ aRet = ASCII("Operation not permitted");
+ break;
+
+ case osl_File_E_NOENT:
+ aRet = ASCII("No such file or directory");
+ break;
+
+ case osl_File_E_SRCH:
+ aRet = ASCII("unknown error: osl_File_E_SRCH");
+ break;
+
+ case osl_File_E_INTR:
+ aRet = ASCII("function call was interrupted");
+ break;
+
+ case osl_File_E_IO:
+ aRet = ASCII("I/O error");
+ break;
+
+ case osl_File_E_NXIO:
+ aRet = ASCII("No such device or address");
+ break;
+
+ case osl_File_E_2BIG:
+ aRet = ASCII("unknown error: osl_File_E_2BIG");
+ break;
+
+ case osl_File_E_NOEXEC:
+ aRet = ASCII("unknown error: osl_File_E_NOEXEC");
+ break;
+
+ case osl_File_E_BADF:
+ aRet = ASCII("Bad file");
+ break;
+
+ case osl_File_E_CHILD:
+ aRet = ASCII("unknown error: osl_File_E_CHILD");
+ break;
+
+ case osl_File_E_AGAIN:
+ aRet = ASCII("Operation would block");
+ break;
+
+ case osl_File_E_NOMEM:
+ aRet = ASCII("not enough memory for allocating structures");
+ break;
+
+ case osl_File_E_ACCES:
+ aRet = ASCII("Permission denied");
+ break;
+
+ case osl_File_E_FAULT:
+ aRet = ASCII("Bad address");
+ break;
+
+ case osl_File_E_BUSY:
+ aRet = ASCII("Text file busy");
+ break;
+
+ case osl_File_E_EXIST:
+ aRet = ASCII("File exists");
+ break;
+
+ case osl_File_E_XDEV:
+ aRet = ASCII("unknown error: osl_File_E_XDEV");
+ break;
+
+ case osl_File_E_NODEV:
+ aRet = ASCII("No such device");
+ break;
+
+ case osl_File_E_NOTDIR:
+ aRet = ASCII("Not a directory");
+ break;
+
+ case osl_File_E_ISDIR:
+ aRet = ASCII("Is a director");
+ break;
+
+ case osl_File_E_INVAL:
+ aRet = ASCII("the format of the parameters was not valid");
+ break;
+
+ case osl_File_E_NFILE:
+ aRet = ASCII("too many open files in the system");
+ break;
+
+ case osl_File_E_MFILE:
+ aRet = ASCII("too many open files used by the process");
+ break;
+
+ case osl_File_E_NOTTY:
+ aRet = ASCII("unknown error: osl_File_E_NOTTY");
+ break;
+
+ case osl_File_E_FBIG:
+ aRet = ASCII("File too large");
+ break;
+
+ case osl_File_E_NOSPC:
+ aRet = ASCII("No space left on device");
+ break;
+
+ case osl_File_E_SPIPE:
+ aRet = ASCII("unknown error: osl_File_E_SPIPE");
+ break;
+
+ case osl_File_E_ROFS:
+ aRet = ASCII("Read-only file system");
+ break;
+
+ case osl_File_E_MLINK:
+ aRet = ASCII("Too many links");
+ break;
+
+ case osl_File_E_PIPE:
+ aRet = ASCII("unknown error: osl_File_E_PIPE");
+ break;
+
+ case osl_File_E_DOM:
+ aRet = ASCII("unknown error: osl_File_E_DOM");
+ break;
+
+ case osl_File_E_RANGE:
+ aRet = ASCII("unknown error: osl_File_E_RANGE");
+ break;
+
+ case osl_File_E_DEADLK:
+ aRet = ASCII("unknown error: osl_File_E_DEADLK");
+ break;
+
+ case osl_File_E_NAMETOOLONG:
+ aRet = ASCII("File name too long");
+ break;
+
+ case osl_File_E_NOLCK:
+ aRet = ASCII("No record locks available");
+ break;
+
+ case osl_File_E_NOSYS:
+ aRet = ASCII("Function not implemente");
+ break;
+
+ case osl_File_E_NOTEMPTY:
+ aRet = ASCII("Directory not empt");
+ break;
+
+ case osl_File_E_LOOP:
+ aRet = ASCII("Too many symbolic links encountered");
+ break;
+
+ case osl_File_E_ILSEQ:
+ aRet = ASCII("unknown error: osl_File_E_ILSEQ");
+ break;
+
+ case osl_File_E_NOLINK:
+ aRet = ASCII("Link has been severed");
+ break;
+
+ case osl_File_E_MULTIHOP:
+ aRet = ASCII("Multihop attempted");
+ break;
+
+ case osl_File_E_USERS:
+ aRet = ASCII("unknown error: osl_File_E_USERS");
+ break;
+
+ case osl_File_E_OVERFLOW:
+ aRet = ASCII("Value too large for defined data type");
+ break;
+
+ /* unmapped error: always last entry in enum! */
+ case osl_File_E_invalidError:
+ aRet = ASCII("unmapped Error");
+ break;
+ }
+ return aRet;
+ }
+} // namespace FileHelper
+
+
+#if (defined UNX) || (defined OS2)
+void main( int argc, char * argv[] )
+#else
+void _cdecl main( int argc, char * argv[] )
+#endif
+{
+
+ OUString aDirectory(OUString::createFromAscii("file:///C:/%E6%96%B0%E3%81%97%E3%81%84%E3%83%95%E3%82%A9%E3%83%AB%E3%83%80"));
+// OUString aDirex(OUString::createFromAscii("file:///C:/%C2%90V%E2%80%9A%C2%B5%E2%80%9A%C2%A2%C6%92t%C6%92H%C6%92%E2%80%B9%C6%92_"));
+
+ osl::FileBase::RC eError = osl::Directory::create(aDirectory);
+ if (eError != osl::FileBase::E_None)
+ {
+ OUString aUStr = FileHelper::createOSLErrorString(eError);
+ OString aStr;
+ aStr <<= aUStr;
+ OSL_ENSURE(false, aStr.getStr());
+ }
+
+// OUString suSystemPath, aTmp;
+// FileBase::RC aRC = FileBase::getSystemPathFromFileURL( aDirectory, suSystemPath );
+//
+// String suSystemPathAsString(suSystemPath);
+// ByteString sSystemPath(suSystemPathAsString, osl_getThreadTextEncoding());
+//
+//
+// ByteString sSystemPathNew = sSystemPath;
+// UniString suSystemPathNew(sSystemPathNew, osl_getThreadTextEncoding());
+// FileBase::RC aRC2 = FileBase::getFileURLFromSystemPath( suSystemPathNew, aTmp );
+
+//
+// aRC = FileBase::getSystemPathFromFileURL( aDirex, aTmp );
+// aRC2 = FileBase::getFileURLFromSystemPath( aTmp, aTmp2 );
+}
+
diff --git a/testshl2/workben/garbage_dump/some_tips.cxx b/testshl2/workben/garbage_dump/some_tips.cxx
new file mode 100644
index 000000000000..b68b83235ebf
--- /dev/null
+++ b/testshl2/workben/garbage_dump/some_tips.cxx
@@ -0,0 +1,129 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: some_tips.cxx,v $
+ * $Revision: 1.4 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_testshl2.hxx"
+#include <cppunit/simpleheader.hxx>
+
+namespace rtl_ByteSequence
+{
+// -----------------------------------------------------------------------
+// call this before any other classes
+// -----------------------------------------------------------------------
+class OSingleton
+{
+public:
+ static OSingleton * GetSingleton();
+ virtual ~OSingleton() {}
+protected :
+ OSingleton()
+ {
+ printf("Do something before.\n");
+ }
+
+ static OSingleton * m_pSingleton;
+};
+
+OSingleton * OSingleton::m_pSingleton = NULL;
+OSingleton * OSingleton::GetSingleton()
+{
+ if(m_pSingleton == NULL )
+ {
+ m_pSingleton = new OSingleton;
+ }
+ return m_pSingleton;
+}
+
+// -----------------------------------------------------------------------------
+
+class before : public CppUnit::TestFixture
+{
+protected:
+ before()
+ {
+ OSingleton::GetSingleton();
+ }
+};
+
+// -----------------------------------------------------------------------------
+
+class GlobalObject
+{
+public:
+ GlobalObject()
+ {
+ // do nothing here
+ }
+ ~GlobalObject()
+ {
+ printf("shutdown");
+ }
+};
+
+GlobalObject theGlobalObject;
+
+// -----------------------------------------------------------------------------
+class assign : public before
+{
+public:
+ // initialise your test code values here.
+ void setUp()
+ {
+ }
+
+ void tearDown()
+ {
+ }
+
+ // insert your test code here.
+ void assign_001()
+ {
+ }
+
+ CPPUNIT_TEST_SUITE(assign);
+ CPPUNIT_TEST(assign_001);
+ CPPUNIT_TEST_SUITE_END();
+}; // class operator=
+
+// -----------------------------------------------------------------------------
+CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_ByteSequence::assign, "rtl_ByteSequence");
+} // namespace ByteSequence
+
+
+// -----------------------------------------------------------------------------
+
+// this macro creates an empty function, which will called by the RegisterAllFunctions()
+// to let the user the possibility to also register some functions by hand.
+void RegisterAdditionalFunctions(FktRegFuncPtr _pFunc)
+{
+ printf("init your work here\n");
+}
+// NOADDITIONAL;
diff --git a/testshl2/workben/getopt/makefile.mk b/testshl2/workben/getopt/makefile.mk
new file mode 100644
index 000000000000..756bc3bc7a94
--- /dev/null
+++ b/testshl2/workben/getopt/makefile.mk
@@ -0,0 +1,64 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2008 by Sun Microsystems, Inc.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.4 $
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+PRJ=..$/..
+PRJINC=
+
+PRJNAME=testshl2
+TARGET=test_getopt
+TARGETTYPE=CUI
+
+ENABLE_EXCEPTIONS=TRUE
+#USE_LDUMP2=TRUE
+#LDUMP2=LDUMP3
+
+# --- Settings -----------------------------------------------------
+.INCLUDE : settings.mk
+
+# ------------------------------------------------------------------
+#--------------------------------- Objectfiles ---------------------------------
+OBJFILES=\
+ $(OBJ)$/getopt.obj \
+ $(OBJ)$/filehelper.obj \
+ $(OBJ)$/test_getopt.obj
+
+#----------------------------- prog with *.lib file -----------------------------
+
+APP1TARGET= $(TARGET)
+APP1OBJS=$(OBJFILES)
+
+APP1STDLIBS=$(SALLIB)
+
+APP1DEPN= $(APP1OBJS)
+APP1LIBS=
+
+# --- Targets ------------------------------------------------------
+
+.INCLUDE : target.mk
diff --git a/testshl2/workben/getopt/test_getopt.cxx b/testshl2/workben/getopt/test_getopt.cxx
new file mode 100644
index 000000000000..381afc240e3e
--- /dev/null
+++ b/testshl2/workben/getopt/test_getopt.cxx
@@ -0,0 +1,143 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: test_getopt.cxx,v $
+ * $Revision: 1.5 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_testshl2.hxx"
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#ifdef SOLARIS
+#include <sys/time.h>
+#endif
+
+#ifdef WNT
+// #define UNDER_WINDOWS_DEBUGGING
+// Nice feature, to debug under windows, install msdev locally and use DebugBreak() to stop a new process at a point you want.
+#ifdef UNDER_WINDOWS_DEBUGGING
+#include <tools/presys.h>
+#include <windows.h>
+#include <tools/postsys.h>
+
+#define VCL_NEED_BASETSD
+
+#endif /* UNDER_WINDOWS_DEBUGGING */
+#endif /* WNT */
+
+#include <iostream>
+#include <vector>
+#include <rtl/string.hxx>
+
+#include "filehelper.hxx"
+#include "getopt.hxx"
+
+// #include <osl/time.h>
+
+using namespace std;
+
+// -----------------------------------------------------------------------------
+
+/**
+ * display usage screen
+ */
+
+void usage()
+{
+ fprintf( stdout,
+ "USAGE: testshl shlname [-boom][-verbose][-log][-his][-msg]\n" );
+ exit(0);
+}
+
+// ----------------------------------- Main -----------------------------------
+#if (defined UNX) || (defined OS2)
+int main( int argc, char* argv[] )
+#else
+int _cdecl main( int argc, char* argv[] )
+#endif
+{
+ (void) argc;
+ static char const* optionSet[] = {
+ "-boom, stop near error position, exception only",
+ "-mode=s, the output mode, emacs, xml, old. Default is -mode old",
+ "-logPath=s, destination path for logging",
+ "-tc=s@, name(s) of testcase(s) to generate",
+ "-h:s, display help or help on option",
+ "-help:s, see -h",
+ NULL
+ };
+
+ GetOpt opt( argv, optionSet );
+
+ // someone indicates that he needs help
+ if ( opt.hasOpt( "-h" ) || opt.hasOpt( "-help" ) )
+ {
+ opt.showUsage();
+ // exit(0);
+ }
+
+ // get path for logging stuff..
+ rtl::OString logPth;
+ // ...if available
+ if ( opt.hasOpt( "-logPth" ))
+ {
+ logPth = opt.getOpt( "-logPth" );
+ }
+
+ rtl::OString param;
+ if ( ! opt.getParams().empty() ) {
+ param = opt.getFirstParam();
+
+ std::cout << "all non '-' Parameter values" << std::endl;
+
+ vector<rtl::OString>& aVec = opt.getParams();
+ for(vector<rtl::OString>::const_iterator it = aVec.begin();
+ it != aVec.end();
+ ++it)
+ {
+ std::cout << (*it).getStr() << std::endl;
+ }
+ }
+
+ if ( opt.hasOpt("-tc"))
+ {
+ std::cout << "Parameter -tc" << std::endl;
+ vector<rtl::OString>& aVec = opt.getOptVec( "-tc" );
+
+ for(vector<rtl::OString>::const_iterator it = aVec.begin();
+ it != aVec.end();
+ ++it)
+ {
+ std::cout << (*it).getStr() << std::endl;
+ }
+ }
+
+ return 0;
+}
+
diff --git a/testshl2/workben/makefile.mk b/testshl2/workben/makefile.mk
new file mode 100644
index 000000000000..c7bffc83b982
--- /dev/null
+++ b/testshl2/workben/makefile.mk
@@ -0,0 +1,130 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2008 by Sun Microsystems, Inc.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.8 $
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+PRJ=..
+PRJINC=
+
+PRJNAME=testshl2
+TARGET=test_autoptr
+TARGETTYPE=CUI
+
+ENABLE_EXCEPTIONS=TRUE
+#USE_LDUMP2=TRUE
+#LDUMP2=LDUMP3
+
+# --- Settings -----------------------------------------------------
+.INCLUDE : settings.mk
+
+# ------------------------------------------------------------------
+#--------------------------------- Objectfiles ---------------------------------
+OBJFILES=\
+ $(OBJ)$/test_autoptr.obj \
+ $(OBJ)$/test_ostringstream.obj
+
+#----------------------------- prog with *.lib file -----------------------------
+
+APP1TARGET= $(TARGET)
+APP1OBJS=$(OBJ)$/test_autoptr.obj
+
+APP1STDLIBS=$(SALLIB)
+
+APP1DEPN= $(APP1OBJS)
+APP1LIBS=
+
+#-------------------------------------------------------------------------------
+
+APP2TARGET= test_ostringstream
+APP2OBJS=$(OBJ)$/test_ostringstream.obj
+
+APP2STDLIBS=$(SALLIB)
+
+APP2DEPN= $(APP1OBJS)
+APP2LIBS=
+#-------------------------------------------------------------------------------
+
+APP3TARGET= test_filter
+APP3OBJS=$(OBJ)$/test_filter.obj
+
+APP3STDLIBS=$(SALLIB)
+
+APP3DEPN= $(APP1OBJS)
+APP3LIBS=
+#-------------------------------------------------------------------------------
+
+# APP4TARGET= test_member
+# APP4OBJS=$(OBJ)$/test_member.obj
+#
+# APP4STDLIBS=$(SALLIB)
+#
+# APP4DEPN=
+ # APP4LIBS=
+
+
+#-------------------------------------------------------------------------------
+
+# APP5TARGET= test_very_long_names
+# APP5OBJS=$(OBJ)$/test_very_long_names.obj
+#
+# APP5STDLIBS=$(SALLIB)
+#
+# APP5DEPN=
+# APP5LIBS=
+
+
+#-------------------------------------------------------------------------------
+
+APP6TARGET= test_string
+APP6OBJS=$(OBJ)$/test_string.obj
+
+APP6STDLIBS=$(SALLIB)
+
+APP6DEPN=
+APP6LIBS=
+#-------------------------------------------------------------------------------
+
+APP7TARGET= test_printf
+APP7OBJS=$(OBJ)$/test_printf.obj
+
+APP7STDLIBS=$(SALLIB)
+
+APP7DEPN=
+APP7LIBS=
+#-------------------------------------------------------------------------------
+
+APP8TARGET= test_preproc
+APP8OBJS=$(OBJ)$/test_preproc.obj
+
+APP8STDLIBS=$(SALLIB)
+
+APP8DEPN=
+APP8LIBS=
+# --- Targets ------------------------------------------------------
+
+.INCLUDE : target.mk
diff --git a/testshl2/workben/runner/unxlngi4.config.file b/testshl2/workben/runner/unxlngi4.config.file
new file mode 100644
index 000000000000..783b56950e20
--- /dev/null
+++ b/testshl2/workben/runner/unxlngi4.config.file
@@ -0,0 +1,34 @@
+# Testshl2Runner
+
+# what is need to start?
+
+PRE1 = setenv SHELL /bin/tcsh
+PRE2 = source ~/staroffice.cshrc
+
+SHELL = /bin/tcsh
+BUILD = udk305
+ENV = unxlngi4
+LOCALENV = /usr/qaapi/projects/solartmp
+BASEDIR = /usr/qaapi/projects
+PROJECTNAME= sal
+INPUT = qa
+OUTPUT = qa
+
+# JOBFILE = $(PROJECTDIR)/$(PROJECTNAME)/$(INPUT)/jobs.txt
+JOBFILE = jobs.txt
+
+TESTTOOL = testshl2
+BATCHFILE = runTestshl.sh
+
+# Hardcoded
+# if ENV == "wnt..."
+# bin
+# if ENV == "unx..."
+# lib
+# PRJLIB = bin
+
+# nothing to do for post
+# POST1 =
+
+
+
diff --git a/testshl2/workben/runner/unxsols3.config.file b/testshl2/workben/runner/unxsols3.config.file
new file mode 100644
index 000000000000..5af1aa49f0c1
--- /dev/null
+++ b/testshl2/workben/runner/unxsols3.config.file
@@ -0,0 +1,34 @@
+# Testshl2Runner
+
+# what is need to start?
+
+PRE1 = setenv SHELL /bin/tcsh
+PRE2 =
+
+SHELL = /bin/tcsh
+BUILD = udk305
+ENV = unxsols3
+LOCALENV = /usr/qaapi/projects/solartemp
+BASEDIR = /usr/qaapi/projects/udk
+PROJECTNAME= sal
+INPUT = qa
+OUTPUT = qa
+
+# JOBFILE = $(PROJECTDIR)/$(PROJECTNAME)/$(INPUT)/jobs.txt
+JOBFILE = jobs.txt
+
+TESTTOOL = testshl2
+BATCHFILE = runTestshl.sh
+
+# Hardcoded
+# if ENV == "wnt..."
+# bin
+# if ENV == "unx..."
+# lib
+# PRJLIB = bin
+
+# nothing to do for post
+# POST1 =
+
+
+
diff --git a/testshl2/workben/runner/wntmsci9.config.file b/testshl2/workben/runner/wntmsci9.config.file
new file mode 100644
index 000000000000..12aefabcd29c
--- /dev/null
+++ b/testshl2/workben/runner/wntmsci9.config.file
@@ -0,0 +1,46 @@
+# Testshl2Runner
+
+# what is need to start?
+
+# path to find setsolar
+PRE1 = set path=r:\\etw;%PATH%
+
+SHELL = c:\\programme\\4nt\\4nt.exe
+BUILD = udk305
+ENV = wntmsci9
+
+# where to find the output directory
+LOCALENV = d:\\local\\305
+
+# the basedirectory to the sources, before a project
+BASEDIR = d:\\local\\305\\UDK305
+
+# name of the project
+PROJECTNAME= sal
+
+# PROJECTDIR is build within the following: $(BASEDIR)/$(PROJECTNAME)
+
+# INPUT is found in $(PROJECTDIR)
+INPUT = qa_work
+
+# OUTPUT is found in $(PROJECTDIR)/$(ENV)
+OUTPUT = qa_work
+
+# JOBFILE is found in $(PROJECTDIR)/$(INPUT)
+JOBFILE = jobs.txt
+
+TESTTOOL = testshl2
+BATCHFILE = runTestshl.btm
+
+# Hardcoded
+# if ENV == "wnt..."
+# bin
+# if ENV == "unx..."
+# lib
+# PRJLIB = bin
+
+# nothing to do for post
+# POST1 =
+
+
+
diff --git a/testshl2/workben/selftest/README.txt b/testshl2/workben/selftest/README.txt
new file mode 100644
index 000000000000..dbf9cce433d7
--- /dev/null
+++ b/testshl2/workben/selftest/README.txt
@@ -0,0 +1,30 @@
+There seems to be some problems with load test libraries from the right path,
+if the libraries are stored also in the solver directory.
+
+To test this:
+Call dmake to build the libraries in this selftest directory.
+Call deliver to copy one test library into the solver tree.
+Call dmake test to simply test the behaviour.
+
+Some more words:
+
+Per default the test libraries should not deliver but if:
+
+- Linux and Windows will use an absolute path to load the test libraries
+ by dlopen().
+- MacOSX will use local path per default to load the test libraries by
+ dlopen();
+
+If there are problems, there exists 2 new parameters like
+-absolutepath
+-localpath
+
+Just call
+'dmake test TESTOPTADD="-absolutepath"' or
+'dmake test TESTOPTADD="-localpath"' from this directory and see which
+behaviour is the right for your environment.
+
+There exist some environment variables to manipulate the default behaviour
+of load libraries. These are
+LD_LIBRARY_PATH
+DYLD_LIBRARY_PATH (Mac OS X)
diff --git a/testshl2/workben/selftest/delivertest.cxx b/testshl2/workben/selftest/delivertest.cxx
new file mode 100644
index 000000000000..1b59c28206e9
--- /dev/null
+++ b/testshl2/workben/selftest/delivertest.cxx
@@ -0,0 +1,64 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: delivertest.cxx,v $
+ * $Revision: 1.2 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_testshl2.hxx"
+#include <cppunit/simpleheader.hxx>
+
+namespace delivertest
+{
+//------------------------------------------------------------------------
+// testing constructors
+//------------------------------------------------------------------------
+
+ class ctor : public CppUnit::TestFixture
+ {
+ public:
+ void ctor_001()
+ {
+ CPPUNIT_ASSERT_MESSAGE("Simple testshl2 self test, You have loaded the delivered library, PER DEFAULT THIS IS ABSOLUTLY WRONG. If you have start this test by 'dmake test' please change the behaviour in 'source/dynamicregister.cxx' in the DynamicLibraryHelper::CTor.", sal_False);
+ }
+
+ CPPUNIT_TEST_SUITE(ctor);
+ CPPUNIT_TEST(ctor_001);
+ CPPUNIT_TEST_SUITE_END();
+ };
+
+ // -----------------------------------------------------------------------------
+ CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(delivertest::ctor, "delivertest");
+} // delivertest
+
+// -----------------------------------------------------------------------------
+
+// this macro creates an empty function, which will called by the RegisterAllFunctions()
+// to let the user the possibility to also register some functions by hand.
+
+NOADDITIONAL;
diff --git a/testshl2/workben/selftest/export.map b/testshl2/workben/selftest/export.map
new file mode 100644
index 000000000000..2718fd9a5cc4
--- /dev/null
+++ b/testshl2/workben/selftest/export.map
@@ -0,0 +1,8 @@
+UDK_3.0 {
+ global:
+ registerAllTestFunction;
+
+ local:
+ *;
+};
+
diff --git a/testshl2/workben/selftest/makefile.mk b/testshl2/workben/selftest/makefile.mk
new file mode 100644
index 000000000000..418a070a3a5d
--- /dev/null
+++ b/testshl2/workben/selftest/makefile.mk
@@ -0,0 +1,91 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2008 by Sun Microsystems, Inc.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.2 $
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+PRJ=..$/..
+
+PRJNAME=sal
+TARGET=selftest_testshl2
+# this is removed at the moment because we need some enhancements
+# TESTDIR=TRUE
+
+ENABLE_EXCEPTIONS=TRUE
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : settings.mk
+
+#------------------------------- All object files -------------------------------
+# do this here, so we get right dependencies
+# SLOFILES= \
+# $(SLO)$/unotest.obj
+
+#----------------------------------- deliver test -----------------------------------
+
+SHL1OBJS= \
+ $(SLO)$/notdeliveredtest.obj
+
+SHL1TARGET= testshl2_deliver_test
+SHL1STDLIBS=\
+ $(SALLIB) \
+ $(CPPUHELPERLIB) \
+ $(COMPHELPERLIB) \
+ $(CPPULIB) \
+ $(CPPUNITLIB)
+
+SHL1IMPLIB= i$(SHL1TARGET)
+
+DEF1NAME =$(SHL1TARGET)
+SHL1VERSIONMAP = export.map
+
+#----------------------------------- deliver test -----------------------------------
+
+SHL2OBJS= \
+ $(SLO)$/delivertest.obj
+
+SHL2TARGET= delivertest
+SHL2STDLIBS=\
+ $(SALLIB) \
+ $(CPPUHELPERLIB) \
+ $(COMPHELPERLIB) \
+ $(CPPULIB) \
+ $(CPPUNITLIB)
+
+SHL2IMPLIB= i$(SHL2TARGET)
+
+DEF2NAME =$(SHL2TARGET)
+SHL2VERSIONMAP = export.map
+
+
+
+# --- Targets ------------------------------------------------------
+
+.INCLUDE : target.mk
+.INCLUDE : _cppunit.mk
+
diff --git a/testshl2/workben/selftest/notdeliveredtest.cxx b/testshl2/workben/selftest/notdeliveredtest.cxx
new file mode 100644
index 000000000000..ec5b06d797b6
--- /dev/null
+++ b/testshl2/workben/selftest/notdeliveredtest.cxx
@@ -0,0 +1,64 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: notdeliveredtest.cxx,v $
+ * $Revision: 1.2 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_testshl2.hxx"
+#include <cppunit/simpleheader.hxx>
+
+namespace delivertest
+{
+//------------------------------------------------------------------------
+// testing constructors
+//------------------------------------------------------------------------
+
+ class ctor : public CppUnit::TestFixture
+ {
+ public:
+ void ctor_001()
+ {
+ CPPUNIT_ASSERT_MESSAGE("Simple testshl2 self test, if you see this error message, the load library test is ok.", sal_False);
+ }
+
+ CPPUNIT_TEST_SUITE(ctor);
+ CPPUNIT_TEST(ctor_001);
+ CPPUNIT_TEST_SUITE_END();
+ };
+
+ // -----------------------------------------------------------------------------
+ CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(delivertest::ctor, "delivertest");
+} // delivertest
+
+// -----------------------------------------------------------------------------
+
+// this macro creates an empty function, which will called by the RegisterAllFunctions()
+// to let the user the possibility to also register some functions by hand.
+
+NOADDITIONAL;
diff --git a/testshl2/workben/singleton.cxx b/testshl2/workben/singleton.cxx
new file mode 100644
index 000000000000..e561da7257a4
--- /dev/null
+++ b/testshl2/workben/singleton.cxx
@@ -0,0 +1,52 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: singleton.cxx,v $
+ * $Revision: 1.3 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_testshl2.hxx"
+class OSingleton
+{
+public:
+ static OSingleton * GetSingleton();
+ virtual ~OSingleton(){}
+protected :
+ OSingleton(){}
+ static OSingleton * m_pSingleton;
+};
+
+OSingleton * OSingleton::m_pSingleton = NULL;
+OSingleton * OSingleton::GetSingleton()
+{
+ if(m_pSingleton == NULL )
+ {
+ m_pSingleton = new OSingleton;
+ }
+ return m_pSingleton;
+}
diff --git a/testshl2/workben/skeleton/export.map b/testshl2/workben/skeleton/export.map
new file mode 100644
index 000000000000..4ca70fa85463
--- /dev/null
+++ b/testshl2/workben/skeleton/export.map
@@ -0,0 +1,7 @@
+UDK_3.0 {
+ global:
+ registerAllTestFunction;
+
+ local:
+ *;
+};
diff --git a/testshl2/workben/skeleton/makefile.mk b/testshl2/workben/skeleton/makefile.mk
new file mode 100644
index 000000000000..6821310ccf29
--- /dev/null
+++ b/testshl2/workben/skeleton/makefile.mk
@@ -0,0 +1,55 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2008 by Sun Microsystems, Inc.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.4 $
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+PRJ := ..$/..
+PRJNAME := testshl2
+
+TARGET := testshl2_workben_skeleton
+
+ENABLE_EXCEPTIONS := TRUE
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE: settings.mk
+
+SHL1TARGET := $(TARGET)
+SHL1OBJS := \
+ $(SLO)$/skeleton.obj
+
+SHL1IMPLIB := i$(SHL1TARGET)
+SHL1STDLIBS := $(CPPUNITLIB) $(SALLIB)
+SHL1VERSIONMAP := export.map
+DEF1NAME := $(SHL1TARGET)
+
+# --- Targets ------------------------------------------------------
+
+.INCLUDE: target.mk
+.INCLUDE : _cppunit.mk
diff --git a/testshl2/workben/skeleton/skeleton.cxx b/testshl2/workben/skeleton/skeleton.cxx
new file mode 100644
index 000000000000..98e633cc86be
--- /dev/null
+++ b/testshl2/workben/skeleton/skeleton.cxx
@@ -0,0 +1,82 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: skeleton.cxx,v $
+ * $Revision: 1.4 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_testshl2.hxx"
+/*
+ * LLA: 20040527
+ */
+#include <cppunit/simpleheader.hxx>
+
+namespace skeleton
+{
+//------------------------------------------------------------------------
+// testing constructors
+//------------------------------------------------------------------------
+
+ class ctor : public CppUnit::TestFixture
+ {
+ public:
+ ctor()
+ {
+ printf("ctor: called\n");
+ }
+
+ void ctor_test()
+ {
+ printf("ctor test: called\n");
+ }
+ void ctor_test2()
+ {
+ printf("ctor test2: called\n");
+ }
+ void ctor_test3()
+ {
+ printf("ctor test3: called\n");
+ }
+
+ CPPUNIT_TEST_SUITE(ctor);
+ CPPUNIT_TEST(ctor_test);
+ CPPUNIT_TEST(ctor_test2);
+ CPPUNIT_TEST(ctor_test3);
+ CPPUNIT_TEST_SUITE_END();
+ };
+
+ // -----------------------------------------------------------------------------
+ CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(skeleton::ctor, "skeleton");
+} // unotest
+
+// -----------------------------------------------------------------------------
+
+// this macro creates an empty function, which will called by the RegisterAllFunctions()
+// to let the user the possibility to also register some functions by hand.
+
+NOADDITIONAL;
diff --git a/testshl2/workben/test_autoptr.cxx b/testshl2/workben/test_autoptr.cxx
new file mode 100644
index 000000000000..1471c6340714
--- /dev/null
+++ b/testshl2/workben/test_autoptr.cxx
@@ -0,0 +1,103 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: test_autoptr.cxx,v $
+ * $Revision: 1.6 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_testshl2.hxx"
+
+#include <stdlib.h>
+#include <memory>
+#include <iostream>
+
+#include <stdio.h>
+
+#include <rtl/string.hxx>
+#include <rtl/ustring.hxx>
+
+class AutoPtrTest
+{
+ int m_nValue;
+
+ // NOCOPY
+ AutoPtrTest(AutoPtrTest const& );
+ AutoPtrTest& operator =(AutoPtrTest const& );
+
+public:
+ AutoPtrTest(int _nValue = 1)
+ :m_nValue(_nValue)
+ {
+ std::cout << "build Value" << std::endl;
+ }
+ ~AutoPtrTest()
+ {
+ std::cout << "release Value" << std::endl;
+ m_nValue = 0;
+ }
+// int operator int() const {return m_nValue;}
+ int getValue() const {return m_nValue;}
+};
+
+std::auto_ptr<AutoPtrTest> getPtr()
+{
+ return std::auto_ptr<AutoPtrTest>(new AutoPtrTest(2));
+}
+
+// auto_ptr get() gibt den Pointer ohne das ownership
+// auto_ptr release()gibt den Pointer und (!) das ownership
+
+void test_autoptr()
+{
+ AutoPtrTest *pValuePtr;
+ std::cout << "start test" << std::endl;
+ {
+ std::auto_ptr<AutoPtrTest> pValue = getPtr();
+ std::cout << "Value with getValue() " << pValue->getValue() << std::endl;
+ // std::cout << "Value operator int() " << *pValue << std::endl;
+ // ownership weiterreichen
+ pValuePtr = pValue.release();
+ }
+ std::cout << "ValuePtr with getValue() " << pValuePtr->getValue() << std::endl;
+
+ // ownership an neuen Pointer uebergeben
+ std::auto_ptr<AutoPtrTest> pValue2(pValuePtr);
+
+ // AutoPtrTest *pStr = getPtr();
+ std::cout << "end test" << std::endl;
+}
+
+// ----------------------------------- Main -----------------------------------
+#if (defined UNX) || (defined OS2)
+int main( int /* argc */ , char* /* argv */ [] )
+#else
+ int _cdecl main( int /* argc*/ , char* /*argv*/ [] )
+#endif
+{
+ test_autoptr();
+ return 0;
+}
diff --git a/testshl2/workben/test_filter.cxx b/testshl2/workben/test_filter.cxx
new file mode 100644
index 000000000000..da8cceb748fe
--- /dev/null
+++ b/testshl2/workben/test_filter.cxx
@@ -0,0 +1,233 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: test_filter.cxx,v $
+ * $Revision: 1.6 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_testshl2.hxx"
+
+#include <vector>
+#include <string>
+#include <iostream>
+#include <rtl/string.hxx>
+
+typedef std::vector<std::string> StringList;
+typedef std::vector<rtl::OString> OStringList;
+
+void split( const rtl::OString& opt,
+ const rtl::OString& _sSeparator,
+ OStringList& optLine )
+{
+ optLine.clear();
+ // const sal_Int32 cSetLen = cSet.getLength();
+ sal_Int32 index = 0;
+ sal_Int32 oldIndex = 0;
+
+ // sal_Int32 i;
+ // sal_Int32 j = 0;
+ while ( opt.getLength() > 0)
+ {
+ // for ( i = 0; i < cSetLen; i++ )
+ // {
+ index = opt.indexOf( _sSeparator, oldIndex);
+ if( index != -1 )
+ {
+ optLine.push_back( opt.copy( oldIndex, index - oldIndex ) );
+ oldIndex = index + _sSeparator.getLength();
+ }
+ // }
+ else // if (index == -1)
+ {
+ optLine.push_back( opt.copy( oldIndex ) );
+ break;
+ }
+ }
+} ///< split
+
+// -----------------------------------------------------------------------------
+
+StringList splitNameAtDot(rtl::OString const& _sName)
+{
+ StringList aList;
+ int nIndex = 0;
+ // int nLastIndex = 0;
+ while ((nIndex = _sName.indexOf(".")) != -1)
+ {
+ rtl::OString nValue;
+ }
+
+ return aList;
+}
+
+// -----------------------------------------------------------------------------
+/*
+bool checkFilter(JobList m_aJobFilter, std::string const& _sNodeName, std::string const& _sName)
+{
+ std::string sFilter = m_aJobFilter.m_aJobList.begin();
+
+ StringList aFilter;
+ aFilter.push_back("rtl_OUString");
+ aFilter.push_back("ctors");
+ aFilter.push_back("*");
+
+ StringList aMyName;
+ aMyName.push_back("rtl_OUString");
+ aMyName.push_back("ctors");
+ aMyName.push_back("ctor_001");
+
+}
+*/
+
+void showList(OStringList const& _sList)
+{
+ for(OStringList::const_iterator it = _sList.begin();
+ it != _sList.end();
+ ++it)
+ {
+ rtl::OString aStr = *it;
+ std::cout << aStr.getStr() << std::endl;
+ }
+}
+
+bool match(OStringList const& _aFilter, OStringList const& _aName)
+{
+ OStringList::const_iterator aFilterIter = _aFilter.begin();
+ OStringList::const_iterator aValueIter = _aName.begin();
+
+ bool bMatch = false;
+
+ while (aFilterIter != _aFilter.end() && aValueIter != _aName.end())
+ {
+ rtl::OString sFilter = *aFilterIter;
+ rtl::OString sName = *aValueIter;
+
+ if (sFilter == sName)
+ {
+ bMatch = true;
+ ++aFilterIter;
+ ++aValueIter;
+ }
+ else if (sFilter == "*")
+ {
+ bMatch = true;
+ break;
+ }
+ else
+ {
+ // Filter does not match
+ bMatch = false;
+ break;
+ }
+ }
+ return bMatch;
+}
+
+// -----------------------------------------------------------------------------
+void test_normal_filter()
+{
+ OStringList aFilter;
+ split("rtl_OUString.ctors.*", ".", aFilter);
+ showList(aFilter);
+
+ OStringList aName;
+ split("rtl_OUString.ctors.ctor_001", ".", aName);
+ showList(aName);
+
+ if (match(aFilter, aName))
+ {
+ std::cout << "Name matches filter." << std::endl;
+ }
+}
+
+void test_normal_filter_other_sep()
+{
+ OStringList aFilter;
+ split("rtl_OUString::ctors::*", "::", aFilter);
+ showList(aFilter);
+
+ OStringList aName;
+ split("rtl_OUString::ctors::ctor_001", "::", aName);
+ showList(aName);
+
+ if (match(aFilter, aName))
+ {
+ std::cout << "Name matches filter." << std::endl;
+ }
+}
+
+void test_no_name()
+{
+ OStringList aFilter;
+ split("rtl_OUString.*", ".", aFilter);
+ showList(aFilter);
+
+ OStringList aName;
+ split("", ".", aName);
+ showList(aName);
+
+ if (match(aFilter, aName))
+ {
+ std::cout << "Name matches filter." << std::endl;
+ }
+}
+
+void test_name_longer_filter()
+{
+ OStringList aFilter;
+ split("rtl_OUString.*", ".", aFilter);
+ showList(aFilter);
+
+ OStringList aName;
+ split("rtl_OUString.ctor.ctor_001", ".", aName);
+ showList(aName);
+
+ if (match(aFilter, aName))
+ {
+ std::cout << "Name matches filter." << std::endl;
+ }
+}
+
+// ----------------------------------- Main -----------------------------------
+#if (defined UNX) || (defined OS2)
+int main( int /* argc */ , char* /* argv */ [] )
+#else
+ int _cdecl main( int /* argc */, char* /* argv */ [] )
+#endif
+{
+ test_normal_filter();
+ test_normal_filter_other_sep();
+ test_no_name();
+ test_name_longer_filter();
+
+ // split("rtl_OUString.*", ".", aFilter);
+ // showList(aFilter);
+
+
+ // test_autoptr();
+ return 0;
+}
diff --git a/testshl2/workben/test_member.cxx b/testshl2/workben/test_member.cxx
new file mode 100644
index 000000000000..6ae812f2862d
--- /dev/null
+++ b/testshl2/workben/test_member.cxx
@@ -0,0 +1,100 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: test_member.cxx,v $
+ * $Revision: 1.4 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_testshl2.hxx"
+#include <iostream>
+#include <string>
+
+using namespace std;
+
+class Aint
+{
+ int n;
+
+public:
+
+ Aint():n(0)
+ {
+ cout << "ctor Aint()" << endl;
+ }
+ Aint(int _n):n(_n)
+ {
+ cout << "ctor Aint(int(" << _n << "))" << endl;
+ }
+ int getA() {return n;}
+ ~Aint()
+ {
+ cout << "dtor Aint()" << endl;
+ }
+
+};
+
+// -----------------------------------------------------------------------------
+
+class B
+{
+ Aint a;
+ Aint b;
+ std::string aStr;
+
+public:
+
+ B()
+ :a(2)
+ {
+ cout << "ctor B()" << endl;
+ }
+ B(int _a)
+ :a(_a)
+ {
+ cout << "ctor B(int)" << endl;
+ }
+
+ void foo()
+ {
+ cout << "a.getA() := " << a.getA() << endl;
+ cout << "b.getA() := " << b.getA() << endl;
+ }
+
+};
+
+
+// ----------------------------------- Main -----------------------------------
+#if (defined UNX) || (defined OS2)
+int main( int argc, char* argv[] )
+#else
+int _cdecl main( int argc, char* argv[] )
+#endif
+{
+ B b(4);
+ b.foo();
+}
diff --git a/testshl2/workben/test_ostringstream.cxx b/testshl2/workben/test_ostringstream.cxx
new file mode 100644
index 000000000000..c8177781bf36
--- /dev/null
+++ b/testshl2/workben/test_ostringstream.cxx
@@ -0,0 +1,119 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: test_ostringstream.cxx,v $
+ * $Revision: 1.6 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_testshl2.hxx"
+
+#include <stdlib.h>
+#include <memory>
+#include <sstream>
+#include <iostream>
+#include <bitset>
+
+#include <sal/types.h>
+
+
+class TestFactoryRegistry
+{
+public:
+ void checkFunc(char* foo);
+ void checkFunc2(char* foo);
+ void checkFunc3(char* foo);
+};
+
+
+void TestFactoryRegistry::checkFunc(char* /* foo */ )
+{
+ static int serialNumber = 1;
+
+ std::ostringstream ost;
+//! could this be the problem?
+ ost << "@Dummy@" << serialNumber++;
+ std::cout << ost.str() << std::endl;
+}
+
+void TestFactoryRegistry::checkFunc2(char* /* foo */)
+{
+ static int serialNumber = 1;
+
+ std::ostringstream ost;
+//! could this be the problem?
+ ost << "@Dummy@" << serialNumber;
+ serialNumber++;
+ std::cout << ost.str() << std::endl;
+}
+
+void TestFactoryRegistry::checkFunc3(char* /* foo */)
+{
+ static int serialNumber = 1;
+
+ int nValue = serialNumber;
+ std::ostringstream ost;
+//! could this be the problem?
+ ost << "@Dummy@" << nValue;
+ serialNumber++;
+ std::cout << ost.str() << std::endl;
+}
+
+static TestFactoryRegistry a;
+static TestFactoryRegistry b;
+static TestFactoryRegistry c;
+
+// ----------------------------------- Main -----------------------------------
+#if (defined UNX) || (defined OS2)
+int main( int /* argc */ , char* /* argv */ [] )
+#else
+ int _cdecl main( int /* argc */, char* /* argv */ [] )
+#endif
+{
+ std::ostringstream ost;
+ // sal_Int32 nValue = 1;
+
+ // ost << "@Dummy@" << nValue;
+ // ost << "dec: " << 15 << std::hex << " hex: " << 15 << std::endl;
+
+ // std::cout << ost.str() << std::endl;
+
+ char* cFoo = NULL;
+
+ a.checkFunc(cFoo);
+ a.checkFunc2(cFoo);
+ a.checkFunc3(cFoo);
+
+ b.checkFunc(cFoo);
+ b.checkFunc2(cFoo);
+ b.checkFunc3(cFoo);
+
+ c.checkFunc(cFoo);
+ c.checkFunc2(cFoo);
+ c.checkFunc3(cFoo);
+
+ return 0;
+}
diff --git a/testshl2/workben/test_preproc.cxx b/testshl2/workben/test_preproc.cxx
new file mode 100644
index 000000000000..e7b993570298
--- /dev/null
+++ b/testshl2/workben/test_preproc.cxx
@@ -0,0 +1,58 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: test_preproc.cxx,v $
+ * $Revision: 1.6 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_testshl2.hxx"
+#include <iostream>
+#include <string>
+#include <rtl/string.hxx>
+
+using namespace std;
+
+#define atest(name) \
+ { \
+ /*if (strlen(#name))*/ { \
+ cout << "String len: " << strlen(#name) << " string: " << #name << endl; \
+ }}
+
+
+// ----------------------------------- Main -----------------------------------
+#if (defined UNX) || (defined OS2)
+int main( int /* argc */, char* /* argv */ [] )
+#else
+ int _cdecl main( int /* argc */, char* /* argv */ [] )
+#endif
+{
+ cout << "test preprocessor: " << endl;
+ atest(fuck);
+ // atest(); compiler error, use "" instead
+ atest("");
+}
diff --git a/testshl2/workben/test_printf.cxx b/testshl2/workben/test_printf.cxx
new file mode 100644
index 000000000000..1b1873e6bfda
--- /dev/null
+++ b/testshl2/workben/test_printf.cxx
@@ -0,0 +1,63 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: test_printf.cxx,v $
+ * $Revision: 1.6 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_testshl2.hxx"
+
+#include <string>
+#include <stdarg.h>
+#include <stdio.h>
+
+void t_print(const char* _pFormatStr, va_list &args)
+{
+ vprintf(_pFormatStr, args);
+}
+
+void t_print(const char* _pFormatStr, ...)
+{
+ va_list args;
+ va_start( args, _pFormatStr );
+ t_print(_pFormatStr, args);
+ va_end( args );
+}
+
+
+// ----------------------------------- Main -----------------------------------
+#if (defined UNX) || (defined OS2)
+int main( int /* argc */ , char* /* argv */ [] )
+#else
+ int _cdecl main( int /* argc */ , char* /* argv */ [] )
+#endif
+{
+ std::string sStr("TestString.");
+ printf("Test %s\n", sStr.c_str() );
+ t_print("Test %s\n", sStr.c_str() );
+ return 0;
+}
diff --git a/testshl2/workben/test_string.cxx b/testshl2/workben/test_string.cxx
new file mode 100644
index 000000000000..e90501372bd7
--- /dev/null
+++ b/testshl2/workben/test_string.cxx
@@ -0,0 +1,141 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: test_string.cxx,v $
+ * $Revision: 1.5 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_testshl2.hxx"
+#include <iostream>
+#include <string>
+#include <rtl/string.hxx>
+
+using namespace std;
+
+const char* g_cSeparatorList = " \t,;:#";
+
+std::string trim(std::string const& _sStringToTrim)
+{
+ rtl::OString sStr(_sStringToTrim.c_str());
+ sStr = sStr.trim();
+ return std::string(sStr.getStr());
+}
+
+bool isInCurrentEnvironment(std::string const& _sString)
+{
+ int nSpace = 0;
+ std::string sSearchString = _sString;
+ bool bEnd = false;
+ // run through the hole given string,
+ std::string sEnv;
+
+ do {
+ nSpace = sSearchString.find_first_of(g_cSeparatorList);
+ if (nSpace < 0)
+ {
+ sEnv = sSearchString;
+ bEnd = true;
+ }
+ else
+ {
+ sEnv = sSearchString.substr(0, nSpace);
+ sSearchString = sSearchString.substr(nSpace + 1);
+ }
+ if (sEnv.length() > 0)
+ {
+ cout << sEnv << endl;
+#ifdef LINUX
+ int nLinux = sEnv.find("unxlng");
+ if (nLinux >= 0)
+ {
+ // found unxlng
+ return true;
+ }
+#endif
+#ifdef SOLARIS
+ int nSolaris = sEnv.find("unxsol");
+ if (nSolaris >= 0)
+ {
+ // found unxsol
+ return true;
+ }
+#endif
+#ifdef WNT
+ int nWindows = sEnv.find("wnt");
+ if (nWindows >= 0)
+ {
+ // found wnt
+ return true;
+ }
+#endif
+ }
+ } while ( !bEnd );
+ return false;
+}
+
+// ----------------------------------- Main -----------------------------------
+#if (defined UNX) || (defined OS2)
+int main( int /* argc */, char* /* argv */ [] )
+#else
+ int _cdecl main( int /* argc */ , char* /* argv */ [] )
+#endif
+{
+ string sLine1 = "osl_Socket.ctor.ctors_001";
+ string sLine = "osl_Socket.ctor.ctors_001 unxlngi5.pro unxsols4.pro wntmsci ";
+
+ int nSpace = sLine.find_first_of(g_cSeparatorList);
+ cout << "Space: " << nSpace << endl;
+ std::string sTest;
+
+ if (nSpace > 0)
+ {
+ sLine = trim(sLine);
+ // check environment
+ sTest = sLine.substr(0, nSpace);
+ std::string sRest = sLine.substr(nSpace + 1);
+ if (isInCurrentEnvironment(sRest))
+ {
+ cout << "new string: " << sTest << endl;
+ }
+ }
+ else
+ {
+ // every environment
+ cout << "new string: " << sLine << endl;
+ }
+
+ // cout << "rest string: " << sRest << endl;
+
+ int nCount = 10;
+ do {
+ cout << nCount << endl;
+ nCount --;
+ }
+ while (nCount >= 0);
+ cout << nCount << endl;
+}
diff --git a/testshl2/workben/uno/export.exp b/testshl2/workben/uno/export.exp
new file mode 100644
index 000000000000..a13529da5876
--- /dev/null
+++ b/testshl2/workben/uno/export.exp
@@ -0,0 +1 @@
+registerAllTestFunction
diff --git a/testshl2/workben/uno/export.map b/testshl2/workben/uno/export.map
new file mode 100755
index 000000000000..2718fd9a5cc4
--- /dev/null
+++ b/testshl2/workben/uno/export.map
@@ -0,0 +1,8 @@
+UDK_3.0 {
+ global:
+ registerAllTestFunction;
+
+ local:
+ *;
+};
+
diff --git a/testshl2/workben/uno/makefile.mk b/testshl2/workben/uno/makefile.mk
new file mode 100644
index 000000000000..7c02beba21bd
--- /dev/null
+++ b/testshl2/workben/uno/makefile.mk
@@ -0,0 +1,83 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2008 by Sun Microsystems, Inc.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.5 $
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+PRJ=..$/..
+
+PRJNAME=sal
+TARGET=qa_uno
+# this is removed at the moment because we need some enhancements
+# TESTDIR=TRUE
+
+ENABLE_EXCEPTIONS=TRUE
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : settings.mk
+
+#------------------------------- All object files -------------------------------
+# do this here, so we get right dependencies
+# SLOFILES= \
+# $(SLO)$/unotest.obj
+
+#----------------------------------- ByteSequence -----------------------------------
+
+SHL1OBJS= \
+ $(SLO)$/unotest.obj
+
+SHL1TARGET= unotest
+SHL1STDLIBS=\
+ $(SALLIB) \
+ $(CPPUHELPERLIB) \
+ $(COMPHELPERLIB) \
+ $(CPPULIB) \
+ $(CPPUNITLIB)
+
+# link $(CPPUNIT) to SHL1STDLIBS instead
+# .IF "$(GUI)" == "WNT"
+# SHL1STDLIBS+= $(SOLARLIBDIR)$/cppunit.lib
+# .ENDIF
+# .IF "$(GUI)" == "UNX"
+# SHL1STDLIBS+=$(SOLARLIBDIR)$/libcppunit$(DLLPOSTFIX).a
+# .ENDIF
+
+SHL1IMPLIB= i$(SHL1TARGET)
+# SHL1DEF= $(MISC)$/$(SHL1TARGET).def
+
+DEF1NAME =$(SHL1TARGET)
+# DEF1EXPORTFILE= export.exp
+SHL1VERSIONMAP = export.map
+
+
+
+# --- Targets ------------------------------------------------------
+
+.INCLUDE : target.mk
+.INCLUDE : _cppunit.mk
+
diff --git a/testshl2/workben/uno/unotest.cxx b/testshl2/workben/uno/unotest.cxx
new file mode 100644
index 000000000000..96f9e7127e60
--- /dev/null
+++ b/testshl2/workben/uno/unotest.cxx
@@ -0,0 +1,117 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: unotest.cxx,v $
+ * $Revision: 1.6 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_testshl2.hxx"
+#include "rtl/bootstrap.hxx"
+#include <comphelper/processfactory.hxx>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <cppunit/simpleheader.hxx>
+#include <cppuhelper/bootstrap.hxx>
+#include <com/sun/star/xml/sax/XParser.hpp>
+
+namespace css = com::sun::star;
+namespace lang = css::lang;
+namespace uno = css::uno;
+namespace sax = css::xml::sax;
+
+
+// StringHelper
+inline void operator <<= (rtl::OString& _rAsciiString, const rtl::OUString& _rUnicodeString)
+{
+ _rAsciiString = rtl::OUStringToOString(_rUnicodeString,RTL_TEXTENCODING_ASCII_US);
+}
+
+
+namespace unotest
+{
+//------------------------------------------------------------------------
+// testing constructors
+//------------------------------------------------------------------------
+
+ class ctor : public CppUnit::TestFixture
+ {
+ public:
+ void ctor_001()
+ {
+ uno::Reference< lang::XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() );
+ if (xFactory.is())
+ {
+ // sample, get a xParser instance
+ uno::Reference< sax::XParser > xParser;
+ xParser = uno::Reference< sax::XParser > (
+ xFactory->createInstance(
+ ::rtl::OUString::createFromAscii("com.sun.star.xml.sax.Parser")), uno::UNO_QUERY);
+
+ CPPUNIT_ASSERT_MESSAGE("can't get sax::Parser", xParser.is());
+ }
+ }
+ void ctor_002()
+ {
+ CPPUNIT_ASSERT_MESSAGE("Simple testshl2 test, MUST fail.", sal_False);
+ }
+
+ CPPUNIT_TEST_SUITE(ctor);
+ CPPUNIT_TEST(ctor_001);
+ CPPUNIT_TEST(ctor_002);
+ CPPUNIT_TEST_SUITE_END();
+ };
+
+ // -----------------------------------------------------------------------------
+ CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(unotest::ctor, "unotest");
+} // unotest
+
+// -----------------------------------------------------------------------------
+
+// this macro creates an empty function, which will called by the RegisterAllFunctions()
+// to let the user the possibility to also register some functions by hand.
+
+
+void RegisterAdditionalFunctions(FktRegFuncPtr _pFunc)
+{
+ (void) _pFunc;
+ uno::Reference<lang::XMultiServiceFactory> xMS;
+
+ try
+ {
+ uno::Reference< uno::XComponentContext > xComponentContext = cppu::defaultBootstrap_InitialComponentContext();
+ xMS.set(xComponentContext->getServiceManager(), uno::UNO_QUERY);
+ comphelper::setProcessServiceFactory(xMS);
+ }
+ catch (::com::sun::star::uno::Exception e )
+ {
+ rtl::OString aError;
+ aError <<= e.Message;
+ printf("Error: %s\n", aError.getStr());
+ }
+}
+// NOADDITIONAL;