summaryrefslogtreecommitdiffstats
path: root/cppu
diff options
context:
space:
mode:
authorDaniel Boelzle <dbo@openoffice.org>2001-10-19 12:04:06 +0000
committerDaniel Boelzle <dbo@openoffice.org>2001-10-19 12:04:06 +0000
commitf8d74955b99b7878a92239057e86cab0a8c42780 (patch)
treea03ebb3a6234d6ff90ff294643dc1ddd6b54cb0f /cppu
parent#93464#replaced wrongly used calloc with rtl_allocateZeroMemory (diff)
downloadcore-f8d74955b99b7878a92239057e86cab0a8c42780.tar.gz
core-f8d74955b99b7878a92239057e86cab0a8c42780.zip
#92951# gcc3 tests, macros
Diffstat (limited to 'cppu')
-rw-r--r--cppu/inc/cppu/macros.hxx8
-rw-r--r--cppu/source/uno/data.cxx16
-rw-r--r--cppu/test/test_di.cxx48
3 files changed, 50 insertions, 22 deletions
diff --git a/cppu/inc/cppu/macros.hxx b/cppu/inc/cppu/macros.hxx
index 4e8ee2bda5be..3db1b004fd70 100644
--- a/cppu/inc/cppu/macros.hxx
+++ b/cppu/inc/cppu/macros.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: macros.hxx,v $
*
- * $Revision: 1.8 $
+ * $Revision: 1.9 $
*
- * last change: $Author: dbo $ $Date: 2001-10-16 11:11:16 $
+ * last change: $Author: dbo $ $Date: 2001-10-19 13:04:06 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -156,9 +156,9 @@
// patching the GNU3 incomatible alignment change for linux intel
#if defined(__GNUC__) && defined(LINUX) && defined(INTEL) && (__GNUC__ == 3)
-#define CPPU_GNU3_ALIGN( base_struct ) __attribute__ ((aligned (__alignof__ (base_struct))))
+#define CPPU_GCC3_ALIGN( base_struct ) __attribute__ ((aligned (__alignof__ (base_struct))))
#else
-#define CPPU_GNU3_ALIGN( base_struct )
+#define CPPU_GCC3_ALIGN( base_struct )
#endif
/**
diff --git a/cppu/source/uno/data.cxx b/cppu/source/uno/data.cxx
index eb0648d9cfa5..384d71c3c56b 100644
--- a/cppu/source/uno/data.cxx
+++ b/cppu/source/uno/data.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: data.cxx,v $
*
- * $Revision: 1.14 $
+ * $Revision: 1.15 $
*
- * last change: $Author: dbo $ $Date: 2001-10-17 13:24:04 $
+ * last change: $Author: dbo $ $Date: 2001-10-19 13:04:06 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -327,7 +327,7 @@ struct C1
};
struct C2 : public C1
{
- sal_Int32 n2 CPPU_GNU3_ALIGN( C1 );
+ sal_Int32 n2 CPPU_GCC3_ALIGN( C1 );
};
struct C3 : public C2
{
@@ -336,7 +336,7 @@ struct C3 : public C2
};
struct C4 : public C3
{
- sal_Int32 n4 CPPU_GNU3_ALIGN( C3 );
+ sal_Int32 n4 CPPU_GCC3_ALIGN( C3 );
double d4;
};
struct C5 : public C4
@@ -346,7 +346,7 @@ struct C5 : public C4
};
struct C6 : public C1
{
- C5 c6 CPPU_GNU3_ALIGN( C1 );
+ C5 c6 CPPU_GCC3_ALIGN( C1 );
sal_Bool b6;
};
@@ -372,7 +372,7 @@ struct M
struct N : public M
{
- sal_Int16 p CPPU_GNU3_ALIGN( M );
+ sal_Int16 p CPPU_GCC3_ALIGN( M );
};
struct N2
{
@@ -414,11 +414,11 @@ struct Char1
};
struct Char2 : public Char1
{
- char c2 CPPU_GNU3_ALIGN( Char1 );
+ char c2 CPPU_GCC3_ALIGN( Char1 );
};
struct Char3 : public Char2
{
- char c3 CPPU_GNU3_ALIGN( Char2 );
+ char c3 CPPU_GCC3_ALIGN( Char2 );
};
struct Char4
{
diff --git a/cppu/test/test_di.cxx b/cppu/test/test_di.cxx
index bb8f011fd728..c73557b50384 100644
--- a/cppu/test/test_di.cxx
+++ b/cppu/test/test_di.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: test_di.cxx,v $
*
- * $Revision: 1.11 $
+ * $Revision: 1.12 $
*
- * last change: $Author: dbo $ $Date: 2001-10-18 12:28:19 $
+ * last change: $Author: dbo $ $Date: 2001-10-19 13:04:06 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -540,6 +540,29 @@ void Test_Impl::setRuntimeException( sal_Int32 _runtimeexception ) throw(::com::
aExc.Context = getInterface();
throw aExc;
}
+
+static void raising1( const Reference< XLanguageBindingTest > & xLBT )
+{
+ test::TestData aRet, aRet2;
+ xLBT->raiseException(
+ aRet.Bool, aRet.Char, aRet.Byte, aRet.Short, aRet.UShort,
+ aRet.Long, aRet.ULong, aRet.Hyper, aRet.UHyper, aRet.Float, aRet.Double,
+ aRet.Enum, aRet.String, aRet.Interface, aRet.Any, aRet.Sequence, aRet2 );
+}
+static void raising2( const Reference< XLanguageBindingTest > & xLBT )
+{
+ try
+ {
+ raising1( xLBT );
+ }
+ catch (RuntimeException &)
+ {
+ }
+ catch (...)
+ {
+ throw;
+ }
+}
//==================================================================================================
sal_Bool raiseException( const Reference< XLanguageBindingTest > & xLBT )
{
@@ -548,13 +571,12 @@ sal_Bool raiseException( const Reference< XLanguageBindingTest > & xLBT )
{
try
{
- test::TestData aRet, aRet2;
try
{
- xLBT->raiseException(
- aRet.Bool, aRet.Char, aRet.Byte, aRet.Short, aRet.UShort,
- aRet.Long, aRet.ULong, aRet.Hyper, aRet.UHyper, aRet.Float, aRet.Double,
- aRet.Enum, aRet.String, aRet.Interface, aRet.Any, aRet.Sequence, aRet2 );
+ raising2( xLBT );
+ }
+ catch (RuntimeException &)
+ {
}
catch (IllegalArgumentException aExc)
{
@@ -578,6 +600,9 @@ sal_Bool raiseException( const Reference< XLanguageBindingTest > & xLBT )
/** it is certain, that the RuntimeException testing will fail, if no */
xLBT->setRuntimeException( 0xcafebabe );
}
+ catch (IllegalArgumentException &)
+ {
+ }
}
catch (Exception & rExc)
{
@@ -608,9 +633,10 @@ static bool perform_test(
if (performTest( xObj, xDummy ))
{
+ ::fprintf( stderr, "> invocation test succeeded!\n" );
if (raiseException( xObj ))
{
- ::fprintf( stderr, "> dynamic invocation test succeeded!\n" );
+ ::fprintf( stderr, "> exception test succeeded!\n" );
return true;
}
else
@@ -618,8 +644,10 @@ static bool perform_test(
::fprintf( stderr, "> exception test failed!\n" );
}
}
-
- ::fprintf( stderr, "> dynamic invocation test failed!\n" );
+ else
+ {
+ ::fprintf( stderr, "> dynamic invocation test failed!\n" );
+ }
return false;
}