summaryrefslogtreecommitdiff
path: root/bridges/test/inter_libs_exc
diff options
context:
space:
mode:
Diffstat (limited to 'bridges/test/inter_libs_exc')
-rw-r--r--bridges/test/inter_libs_exc/inter.cxx69
-rw-r--r--bridges/test/inter_libs_exc/makefile.mk80
-rw-r--r--bridges/test/inter_libs_exc/share.h10
-rw-r--r--bridges/test/inter_libs_exc/starter.cxx68
-rw-r--r--bridges/test/inter_libs_exc/starter.map7
-rw-r--r--bridges/test/inter_libs_exc/thrower.cxx51
-rw-r--r--bridges/test/inter_libs_exc/thrower.map7
7 files changed, 292 insertions, 0 deletions
diff --git a/bridges/test/inter_libs_exc/inter.cxx b/bridges/test/inter_libs_exc/inter.cxx
new file mode 100644
index 000000000000..b3f94e844305
--- /dev/null
+++ b/bridges/test/inter_libs_exc/inter.cxx
@@ -0,0 +1,69 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * 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_bridges.hxx"
+
+#include <stdio.h>
+#include "share.h"
+
+#include <rtl/string.hxx>
+#include <osl/module.hxx>
+
+
+using namespace ::rtl;
+using namespace ::osl;
+using namespace ::com::sun::star;
+using namespace ::com::sun::star::uno;
+
+extern "C" int main( int argc, char const * argv [] )
+{
+#ifdef SAL_W32
+#define SAL_DLLPREFIX ""
+#endif
+ Module mod_starter(
+ OUSTR(SAL_DLLPREFIX"starter"SAL_DLLEXTENSION),
+ SAL_LOADMODULE_LAZY | SAL_LOADMODULE_GLOBAL );
+ Module mod_thrower(
+ OUSTR(SAL_DLLPREFIX"thrower"SAL_DLLEXTENSION),
+ SAL_LOADMODULE_LAZY | SAL_LOADMODULE_GLOBAL );
+
+ typedef t_throws_exc (SAL_CALL * t_get_thrower)();
+ t_get_thrower get_thrower = (t_get_thrower)mod_thrower.getSymbol( OUSTR("get_thrower") );
+ t_throws_exc thrower = (*get_thrower)();
+
+ typedef void (SAL_CALL * t_starter)( t_throws_exc );
+ t_starter start = (t_starter)mod_starter.getSymbol( OUSTR("start") );
+
+ (*start)( thrower );
+
+ return 0;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/bridges/test/inter_libs_exc/makefile.mk b/bridges/test/inter_libs_exc/makefile.mk
new file mode 100644
index 000000000000..7f9ff0512e24
--- /dev/null
+++ b/bridges/test/inter_libs_exc/makefile.mk
@@ -0,0 +1,80 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# 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=bridges
+TARGET=inter
+LIBTARGET=NO
+TARGETTYPE=CUI
+ENABLE_EXCEPTIONS=TRUE
+USE_DEFFILE=TRUE
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : settings.mk
+
+# --- Files --------------------------------------------------------
+
+UNOUCRDEP=$(SOLARBINDIR)$/udkapi.rdb
+UNOUCRRDB=$(SOLARBINDIR)$/udkapi.rdb
+
+# output directory (one dir for each project)
+UNOUCROUT=$(OUT)$/inc$/$(TARGET)
+
+# adding to inludeoath
+INCPRE+=$(UNOUCROUT)
+
+UNOTYPESTYPES := \
+ com.sun.star.lang.IllegalArgumentException \
+ com.sun.star.uno.DeploymentException
+
+SLOFILES=$(SLO)$/starter.obj $(SLO)$/thrower.obj
+
+SHL1TARGET=starter
+SHL1DEF=$(MISC)$/$(SHL1TARGET).def
+SHL1IMPLIB=i$(SHL1TARGET)
+SHL1OBJS=$(SLO)$/starter.obj
+DEF1NAME=$(SHL1TARGET)
+SHL1STDLIBS+= $(CPPULIB) $(SALLIB)
+SHL1VERSIONMAP=$(SHL1TARGET).map
+
+SHL2TARGET=thrower
+SHL2DEF=$(MISC)$/$(SHL2TARGET).def
+SHL2IMPLIB=i$(SHL2TARGET)
+SHL2OBJS=$(SLO)$/thrower.obj
+DEF2NAME=$(SHL2TARGET)
+SHL2STDLIBS+= $(CPPULIB) $(SALLIB)
+SHL2VERSIONMAP=$(SHL2TARGET).map
+
+OBJFILES=$(OBJ)$/inter.obj
+APP1TARGET=inter
+APP1OBJS=$(OBJ)$/inter.obj
+APP1STDLIBS+=\
+ $(SALLIB)
+
+.INCLUDE : target.mk
+
diff --git a/bridges/test/inter_libs_exc/share.h b/bridges/test/inter_libs_exc/share.h
new file mode 100644
index 000000000000..be06619abf76
--- /dev/null
+++ b/bridges/test/inter_libs_exc/share.h
@@ -0,0 +1,10 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+
+#include <com/sun/star/lang/IllegalArgumentException.hpp>
+#include <com/sun/star/uno/DeploymentException.hpp>
+
+#define OUSTR(x) ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(x) )
+
+typedef void (SAL_CALL * t_throws_exc)();
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/bridges/test/inter_libs_exc/starter.cxx b/bridges/test/inter_libs_exc/starter.cxx
new file mode 100644
index 000000000000..23b8d066b2be
--- /dev/null
+++ b/bridges/test/inter_libs_exc/starter.cxx
@@ -0,0 +1,68 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * 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_bridges.hxx"
+
+#include <stdio.h>
+#include "share.h"
+
+
+using namespace ::rtl;
+using namespace ::com::sun::star;
+using namespace ::com::sun::star::uno;
+
+static void some_more( t_throws_exc p )
+{
+ (*p)();
+}
+
+extern "C" void SAL_CALL start( t_throws_exc p )
+{
+ try
+ {
+ some_more( p );
+ }
+ catch (lang::IllegalArgumentException & exc)
+ {
+ OString msg( OUStringToOString( exc.Message, RTL_TEXTENCODING_ASCII_US ) );
+ printf( "starter.cxx: caught IllegalArgumentException: %s\n", msg.getStr() );
+ }
+ catch (Exception & exc)
+ {
+ OString msg( OUStringToOString( exc.Message, RTL_TEXTENCODING_ASCII_US ) );
+ printf( "starter.cxx: caught some UNO exc: %s\n", msg.getStr() );
+ }
+ catch (...)
+ {
+ printf( "starter.cxx: caught something\n" );
+ }
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/bridges/test/inter_libs_exc/starter.map b/bridges/test/inter_libs_exc/starter.map
new file mode 100644
index 000000000000..69bf77c0a34b
--- /dev/null
+++ b/bridges/test/inter_libs_exc/starter.map
@@ -0,0 +1,7 @@
+UDK_3_0_0 {
+ global:
+ start;
+ local:
+ *;
+};
+
diff --git a/bridges/test/inter_libs_exc/thrower.cxx b/bridges/test/inter_libs_exc/thrower.cxx
new file mode 100644
index 000000000000..5289e59d7363
--- /dev/null
+++ b/bridges/test/inter_libs_exc/thrower.cxx
@@ -0,0 +1,51 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * 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_bridges.hxx"
+
+#include "share.h"
+
+
+using namespace ::rtl;
+using namespace ::com::sun::star;
+using namespace ::com::sun::star::uno;
+
+static void SAL_CALL throws_exc()
+{
+ throw lang::IllegalArgumentException(
+ OUSTR("bla"), Reference< XInterface >(), 0 );
+}
+
+extern "C" t_throws_exc SAL_CALL get_thrower()
+{
+ return throws_exc;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/bridges/test/inter_libs_exc/thrower.map b/bridges/test/inter_libs_exc/thrower.map
new file mode 100644
index 000000000000..163d434e0121
--- /dev/null
+++ b/bridges/test/inter_libs_exc/thrower.map
@@ -0,0 +1,7 @@
+UDK_3_0_0 {
+ global:
+ get_thrower;
+ local:
+ *;
+};
+