LCOV - code coverage report
Current view: top level - usr/local/src/libreoffice/testtools/source/bridgetest - cppobj.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 470 484 97.1 %
Date: 2013-07-09 Functions: 111 114 97.4 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       5             :  * This Source Code Form is subject to the terms of the Mozilla Public
       6             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       7             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       8             :  *
       9             :  * This file incorporates work covered by the following license notice:
      10             :  *
      11             :  *   Licensed to the Apache Software Foundation (ASF) under one or more
      12             :  *   contributor license agreements. See the NOTICE file distributed
      13             :  *   with this work for additional information regarding copyright
      14             :  *   ownership. The ASF licenses this file to you under the Apache
      15             :  *   License, Version 2.0 (the "License"); you may not use this file
      16             :  *   except in compliance with the License. You may obtain a copy of
      17             :  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
      18             :  */
      19             : 
      20             : #include <stdio.h>
      21             : 
      22             : #include "cppu/unotype.hxx"
      23             : #include <osl/diagnose.h>
      24             : #include "osl/diagnose.hxx"
      25             : #include <osl/thread.h>
      26             : #include <osl/mutex.hxx>
      27             : #include <osl/time.h>
      28             : 
      29             : #include <cppuhelper/implbase3.hxx>
      30             : #include <cppuhelper/factory.hxx>
      31             : #include "cppuhelper/exc_hlp.hxx"
      32             : #include "cppuhelper/compbase_ex.hxx"
      33             : #include <com/sun/star/lang/XServiceInfo.hpp>
      34             : #include <com/sun/star/lang/XComponent.hpp>
      35             : #include "com/sun/star/uno/Any.hxx"
      36             : #include "com/sun/star/uno/RuntimeException.hpp"
      37             : #include "com/sun/star/uno/Sequence.hxx"
      38             : 
      39             : #include "test/testtools/bridgetest/Constructors.hpp"
      40             : #include "test/testtools/bridgetest/Constructors2.hpp"
      41             : #include "test/testtools/bridgetest/TestPolyStruct.hpp"
      42             : #include "test/testtools/bridgetest/TestPolyStruct2.hpp"
      43             : #include "test/testtools/bridgetest/XBridgeTest2.hpp"
      44             : #include "test/testtools/bridgetest/XMulti.hpp"
      45             : 
      46             : #include "currentcontextchecker.hxx"
      47             : #include "multi.hxx"
      48             : 
      49             : using namespace osl;
      50             : using namespace cppu;
      51             : using namespace com::sun::star::uno;
      52             : using namespace com::sun::star::lang;
      53             : using namespace com::sun::star::registry;
      54             : using namespace test::testtools::bridgetest;
      55             : 
      56             : 
      57             : #define SERVICENAME     "com.sun.star.test.bridge.CppTestObject"
      58             : #define IMPLNAME        "com.sun.star.comp.bridge.CppTestObject"
      59             : 
      60             : namespace bridge_object
      61             : {
      62             : 
      63             : //--------------------------------------------------------------------------------------------------
      64           1 : inline static Sequence< OUString > getSupportedServiceNames()
      65             : {
      66           1 :     OUString aName( SERVICENAME );
      67           1 :     return Sequence< OUString >( &aName, 1 );
      68             : }
      69             : 
      70             : //==================================================================================================
      71           2 : static void assign( TestElement & rData,
      72             :                     sal_Bool bBool, sal_Unicode cChar, sal_Int8 nByte,
      73             :                     sal_Int16 nShort, sal_uInt16 nUShort,
      74             :                     sal_Int32 nLong, sal_uInt32 nULong,
      75             :                     sal_Int64 nHyper, sal_uInt64 nUHyper,
      76             :                     float fFloat, double fDouble,
      77             :                     TestEnum eEnum, const OUString& rStr,
      78             :                     const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xTest,
      79             :                     const ::com::sun::star::uno::Any& rAny )
      80             : {
      81           2 :     rData.Bool = bBool;
      82           2 :     rData.Char = cChar;
      83           2 :     rData.Byte = nByte;
      84           2 :     rData.Short = nShort;
      85           2 :     rData.UShort = nUShort;
      86           2 :     rData.Long = nLong;
      87           2 :     rData.ULong = nULong;
      88           2 :     rData.Hyper = nHyper;
      89           2 :     rData.UHyper = nUHyper;
      90           2 :     rData.Float = fFloat;
      91           2 :     rData.Double = fDouble;
      92           2 :     rData.Enum = eEnum;
      93           2 :     rData.String = rStr;
      94           2 :     rData.Interface = xTest;
      95           2 :     rData.Any = rAny;
      96           2 : }
      97             : //==================================================================================================
      98           2 : static void assign( TestData & rData,
      99             :                     sal_Bool bBool, sal_Unicode cChar, sal_Int8 nByte,
     100             :                     sal_Int16 nShort, sal_uInt16 nUShort,
     101             :                     sal_Int32 nLong, sal_uInt32 nULong,
     102             :                     sal_Int64 nHyper, sal_uInt64 nUHyper,
     103             :                     float fFloat, double fDouble,
     104             :                     TestEnum eEnum, const OUString& rStr,
     105             :                     const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xTest,
     106             :                     const ::com::sun::star::uno::Any& rAny,
     107             :                     const com::sun::star::uno::Sequence< TestElement >& rSequence )
     108             : {
     109             :     assign( (TestElement &)rData,
     110             :             bBool, cChar, nByte, nShort, nUShort, nLong, nULong, nHyper, nUHyper, fFloat, fDouble,
     111           2 :             eEnum, rStr, xTest, rAny );
     112           2 :     rData.Sequence = rSequence;
     113           2 : }
     114             : 
     115             : //==================================================================================================
     116             : class Test_Impl :
     117             :     public osl::DebugBase<Test_Impl>,
     118             :     public WeakImplHelper3< XBridgeTest2, XServiceInfo , XRecursiveCall >
     119             : {
     120             :     TestData _aData, _aStructData;
     121             :     sal_Int32 m_nLastCallId;
     122             :     bool m_bFirstCall;
     123             :     bool m_bSequenceOfCallTestPassed;
     124             :     Mutex m_mutex;
     125             : 
     126             :     Sequence<sal_Bool> _arBool;
     127             :     Sequence<sal_Unicode> _arChar;
     128             :     Sequence<sal_Int8> _arByte;
     129             :     Sequence<sal_Int16> _arShort;
     130             :     Sequence<sal_uInt16> _arUShort;
     131             :     Sequence<sal_Int32> _arLong;
     132             :     Sequence<sal_uInt32> _arULong;
     133             :     Sequence<sal_Int64> _arHyper;
     134             :     Sequence<sal_uInt64> _arUHyper;
     135             :     Sequence<OUString> _arString;
     136             :     Sequence<float> _arFloat;
     137             :     Sequence<double> _arDouble;
     138             :     Sequence<TestEnum> _arEnum;
     139             :     Sequence<Reference<XInterface> > _arObject;
     140             :     Sequence<Sequence<sal_Int32> > _arLong2;
     141             :     Sequence<Sequence<Sequence<sal_Int32> > > _arLong3;
     142             :     Sequence<Any> _arAny;
     143             :     Sequence<TestElement> _arStruct;
     144             : 
     145             : public:
     146           1 :     Test_Impl() : m_nLastCallId( 0 ),
     147             :                   m_bFirstCall( true ),
     148           1 :                   m_bSequenceOfCallTestPassed( true )
     149           1 :         {}
     150           2 :     virtual ~Test_Impl()
     151           1 :         {
     152             :             OSL_TRACE( "> scalar Test_Impl dtor <" );
     153           2 :         }
     154             : 
     155          41 :     void SAL_CALL acquire() throw ()
     156             :     {
     157          41 :         OWeakObject::acquire();
     158          41 :     }
     159          41 :     void SAL_CALL release() throw ()
     160             :     {
     161          41 :         OWeakObject::release();
     162          41 :      }
     163             : 
     164             :     // XServiceInfo
     165             :     virtual OUString SAL_CALL getImplementationName() throw (RuntimeException);
     166             :     virtual sal_Bool SAL_CALL supportsService( const OUString & rServiceName ) throw (RuntimeException);
     167             :     virtual Sequence< OUString > SAL_CALL getSupportedServiceNames() throw (RuntimeException);
     168             : 
     169             :     // XLBTestBase
     170             :     virtual void SAL_CALL setValues( sal_Bool bBool, sal_Unicode cChar, sal_Int8 nByte,
     171             :                                      sal_Int16 nShort, sal_uInt16 nUShort,
     172             :                                      sal_Int32 nLong, sal_uInt32 nULong,
     173             :                                      sal_Int64 nHyper, sal_uInt64 nUHyper,
     174             :                                      float fFloat, double fDouble,
     175             :                                      TestEnum eEnum, const OUString& rStr,
     176             :                                      const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xTest,
     177             :                                      const ::com::sun::star::uno::Any& rAny,
     178             :                                      const ::com::sun::star::uno::Sequence<TestElement >& rSequence,
     179             :                                      const TestData& rStruct )
     180             :         throw(com::sun::star::uno::RuntimeException);
     181             : 
     182             :     virtual TestData SAL_CALL setValues2( sal_Bool& bBool, sal_Unicode& cChar, sal_Int8& nByte,
     183             :                                                 sal_Int16& nShort, sal_uInt16& nUShort,
     184             :                                                 sal_Int32& nLong, sal_uInt32& nULong,
     185             :                                                 sal_Int64& nHyper, sal_uInt64& nUHyper,
     186             :                                                 float& fFloat, double& fDouble,
     187             :                                                 TestEnum& eEnum, OUString& rStr,
     188             :                                                 ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xTest,
     189             :                                                 ::com::sun::star::uno::Any& rAny,
     190             :                                                 ::com::sun::star::uno::Sequence<TestElement >& rSequence,
     191             :                                                 TestData& rStruct )
     192             :         throw(com::sun::star::uno::RuntimeException);
     193             : 
     194             :     virtual TestData SAL_CALL getValues( sal_Bool& bBool, sal_Unicode& cChar, sal_Int8& nByte,
     195             :                                                sal_Int16& nShort, sal_uInt16& nUShort,
     196             :                                                sal_Int32& nLong, sal_uInt32& nULong,
     197             :                                                sal_Int64& nHyper, sal_uInt64& nUHyper,
     198             :                                                float& fFloat, double& fDouble,
     199             :                                                TestEnum& eEnum, OUString& rStr,
     200             :                                                ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xTest,
     201             :                                                ::com::sun::star::uno::Any& rAny,
     202             :                                                ::com::sun::star::uno::Sequence< TestElement >& rSequence,
     203             :                                                TestData& rStruct )
     204             :         throw(com::sun::star::uno::RuntimeException);
     205             : 
     206           1 :     virtual SmallStruct SAL_CALL echoSmallStruct(const SmallStruct& rStruct) throw(com::sun::star::uno::RuntimeException)
     207           1 :         { return rStruct; }
     208           1 :     virtual MediumStruct SAL_CALL echoMediumStruct(const MediumStruct& rStruct) throw(com::sun::star::uno::RuntimeException)
     209           1 :         { return rStruct; }
     210           1 :     virtual BigStruct SAL_CALL echoBigStruct(const BigStruct& rStruct) throw(com::sun::star::uno::RuntimeException)
     211           1 :         { return rStruct; }
     212           1 :     virtual TwoFloats SAL_CALL echoTwoFloats(const TwoFloats& rStruct) throw(com::sun::star::uno::RuntimeException)
     213           1 :         { return rStruct; }
     214           1 :     virtual FourFloats SAL_CALL echoFourFloats(const FourFloats& rStruct) throw(com::sun::star::uno::RuntimeException)
     215           1 :         { return rStruct; }
     216           1 :     virtual MixedFloatAndInteger SAL_CALL echoMixedFloatAndInteger(const MixedFloatAndInteger& rStruct) throw(com::sun::star::uno::RuntimeException)
     217           1 :         { return rStruct; }
     218           1 :     virtual ThreeByteStruct SAL_CALL echoThreeByteStruct(const ThreeByteStruct& rStruct) throw(com::sun::star::uno::RuntimeException)
     219           1 :         { return rStruct; }
     220           1 :     virtual sal_Int32 SAL_CALL testPPCAlignment( sal_Int64, sal_Int64, sal_Int32, sal_Int64, sal_Int32 i2 ) throw(com::sun::star::uno::RuntimeException)
     221           1 :         { return i2; }
     222           1 :     virtual double SAL_CALL testTenDoubles( double d1, double d2, double d3, double d4, double d5, double d6, double d7, double d8, double d9, double d10 ) throw(com::sun::star::uno::RuntimeException)
     223           1 :         { return d1 + d2 + d3 + d4 + d5 + d6 + d7 + d8 + d9 + d10; }
     224           1 :     virtual sal_Bool SAL_CALL getBool() throw(com::sun::star::uno::RuntimeException)
     225           1 :         { return _aData.Bool; }
     226           1 :     virtual sal_Int8 SAL_CALL getByte() throw(com::sun::star::uno::RuntimeException)
     227           1 :         { return _aData.Byte; }
     228           1 :     virtual sal_Unicode SAL_CALL getChar() throw(com::sun::star::uno::RuntimeException)
     229           1 :         { return _aData.Char; }
     230           1 :     virtual sal_Int16 SAL_CALL getShort() throw(com::sun::star::uno::RuntimeException)
     231           1 :         { return _aData.Short; }
     232           1 :     virtual sal_uInt16 SAL_CALL getUShort() throw(com::sun::star::uno::RuntimeException)
     233           1 :         { return _aData.UShort; }
     234           1 :     virtual sal_Int32 SAL_CALL getLong() throw(com::sun::star::uno::RuntimeException)
     235           1 :         { return _aData.Long; }
     236           1 :     virtual sal_uInt32 SAL_CALL getULong() throw(com::sun::star::uno::RuntimeException)
     237           1 :         { return _aData.ULong; }
     238           1 :     virtual sal_Int64 SAL_CALL getHyper() throw(com::sun::star::uno::RuntimeException)
     239           1 :         { return _aData.Hyper; }
     240           1 :     virtual sal_uInt64 SAL_CALL getUHyper() throw(com::sun::star::uno::RuntimeException)
     241           1 :         { return _aData.UHyper; }
     242           1 :     virtual float SAL_CALL getFloat() throw(com::sun::star::uno::RuntimeException)
     243           1 :         { return _aData.Float; }
     244           1 :     virtual double SAL_CALL getDouble() throw(com::sun::star::uno::RuntimeException)
     245           1 :         { return _aData.Double; }
     246           1 :     virtual TestEnum SAL_CALL getEnum() throw(com::sun::star::uno::RuntimeException)
     247           1 :         { return _aData.Enum; }
     248           1 :     virtual OUString SAL_CALL getString() throw(com::sun::star::uno::RuntimeException)
     249           1 :         { return _aData.String; }
     250           7 :     virtual com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getInterface(  ) throw(com::sun::star::uno::RuntimeException)
     251           7 :         { return _aData.Interface; }
     252           1 :     virtual com::sun::star::uno::Any SAL_CALL getAny() throw(com::sun::star::uno::RuntimeException)
     253           1 :         { return _aData.Any; }
     254           1 :     virtual com::sun::star::uno::Sequence< TestElement > SAL_CALL getSequence() throw(com::sun::star::uno::RuntimeException)
     255           1 :         { return _aData.Sequence; }
     256           1 :     virtual TestData SAL_CALL getStruct() throw(com::sun::star::uno::RuntimeException)
     257           1 :         { return _aStructData; }
     258             : 
     259           1 :     virtual void SAL_CALL setBool( sal_Bool _bool ) throw(::com::sun::star::uno::RuntimeException)
     260           1 :         { _aData.Bool = _bool; }
     261           1 :     virtual void SAL_CALL setByte( sal_Int8 _byte ) throw(::com::sun::star::uno::RuntimeException)
     262           1 :         { _aData.Byte = _byte; }
     263           1 :     virtual void SAL_CALL setChar( sal_Unicode _char ) throw(::com::sun::star::uno::RuntimeException)
     264           1 :         { _aData.Char = _char; }
     265           1 :     virtual void SAL_CALL setShort( sal_Int16 _short ) throw(::com::sun::star::uno::RuntimeException)
     266           1 :         { _aData.Short = _short; }
     267           1 :     virtual void SAL_CALL setUShort( sal_uInt16 _ushort ) throw(::com::sun::star::uno::RuntimeException)
     268           1 :         { _aData.UShort = _ushort; }
     269           1 :     virtual void SAL_CALL setLong( sal_Int32 _long ) throw(::com::sun::star::uno::RuntimeException)
     270           1 :         { _aData.Long = _long; }
     271           1 :     virtual void SAL_CALL setULong( sal_uInt32 _ulong ) throw(::com::sun::star::uno::RuntimeException)
     272           1 :         { _aData.ULong = _ulong; }
     273           1 :     virtual void SAL_CALL setHyper( sal_Int64 _hyper ) throw(::com::sun::star::uno::RuntimeException)
     274           1 :         { _aData.Hyper = _hyper; }
     275           1 :     virtual void SAL_CALL setUHyper( sal_uInt64 _uhyper ) throw(::com::sun::star::uno::RuntimeException)
     276           1 :         { _aData.UHyper = _uhyper; }
     277           1 :     virtual void SAL_CALL setFloat( float _float ) throw(::com::sun::star::uno::RuntimeException)
     278           1 :         { _aData.Float = _float; }
     279           1 :     virtual void SAL_CALL setDouble( double _double ) throw(::com::sun::star::uno::RuntimeException)
     280           1 :         { _aData.Double = _double; }
     281           1 :     virtual void SAL_CALL setEnum( TestEnum _enum ) throw(::com::sun::star::uno::RuntimeException)
     282           1 :         { _aData.Enum = _enum; }
     283           1 :     virtual void SAL_CALL setString( const OUString& _string ) throw(::com::sun::star::uno::RuntimeException)
     284           1 :         { _aData.String = _string; }
     285           1 :     virtual void SAL_CALL setInterface( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _interface ) throw(::com::sun::star::uno::RuntimeException)
     286           1 :         { _aData.Interface = _interface; }
     287           1 :     virtual void SAL_CALL setAny( const ::com::sun::star::uno::Any& _any ) throw(::com::sun::star::uno::RuntimeException)
     288           1 :         { _aData.Any = _any; }
     289           1 :     virtual void SAL_CALL setSequence( const ::com::sun::star::uno::Sequence<TestElement >& _sequence ) throw(::com::sun::star::uno::RuntimeException)
     290           1 :         { _aData.Sequence = _sequence; }
     291           1 :     virtual void SAL_CALL setStruct( const TestData& _struct ) throw(::com::sun::star::uno::RuntimeException)
     292           1 :         { _aStructData = _struct; }
     293             : 
     294           1 :     virtual sal_Int32 SAL_CALL getRaiseAttr1() throw (RuntimeException)
     295           1 :     { throw RuntimeException(); }
     296             : 
     297           1 :     virtual void SAL_CALL setRaiseAttr1(sal_Int32)
     298             :         throw (IllegalArgumentException, RuntimeException)
     299           1 :     { throw IllegalArgumentException(); }
     300             : 
     301           1 :     virtual sal_Int32 SAL_CALL getRaiseAttr2()
     302             :         throw (IllegalArgumentException, RuntimeException)
     303           1 :     { throw IllegalArgumentException(); }
     304             : 
     305           1 :     virtual TestPolyStruct< sal_Bool > SAL_CALL transportPolyBoolean(
     306             :         TestPolyStruct< sal_Bool > const & arg) throw (RuntimeException)
     307           1 :     { return arg; }
     308             : 
     309           1 :     virtual void SAL_CALL transportPolyHyper(TestPolyStruct< sal_Int64 > &)
     310           1 :         throw (RuntimeException) {}
     311             : 
     312           1 :     virtual void SAL_CALL transportPolySequence(
     313             :         TestPolyStruct< Sequence< Any > > const & arg1,
     314             :         TestPolyStruct< Sequence< Any > > & arg2) throw (RuntimeException)
     315           1 :     { arg2 = arg1; }
     316             : 
     317           1 :     virtual TestPolyStruct< sal_Int32 > SAL_CALL getNullPolyLong()
     318             :         throw (RuntimeException)
     319           1 :     { return TestPolyStruct< sal_Int32 >(0); /* work around MS compiler bug */ }
     320             : 
     321           1 :     virtual TestPolyStruct< OUString > SAL_CALL getNullPolyString()
     322             :         throw (RuntimeException)
     323           1 :     { return TestPolyStruct< OUString >(); }
     324             : 
     325           1 :     virtual TestPolyStruct< Type > SAL_CALL getNullPolyType()
     326             :         throw (RuntimeException)
     327           1 :     { return TestPolyStruct< Type >(); }
     328             : 
     329           1 :     virtual TestPolyStruct< Any > SAL_CALL getNullPolyAny()
     330             :         throw (RuntimeException)
     331           1 :     { return TestPolyStruct< Any >(); }
     332             : 
     333             :     virtual TestPolyStruct< Sequence< sal_Bool > > SAL_CALL
     334           1 :     getNullPolySequence() throw (RuntimeException)
     335           1 :     { return TestPolyStruct< Sequence< sal_Bool > >(); }
     336             : 
     337           1 :     virtual TestPolyStruct< TestEnum > SAL_CALL getNullPolyEnum()
     338             :         throw (RuntimeException)
     339             :     { return TestPolyStruct< TestEnum >(
     340           1 :         test::testtools::bridgetest::TestEnum_TEST);
     341             :           /* work around MS compiler bug */ }
     342             : 
     343           1 :     virtual TestPolyStruct< TestBadEnum > SAL_CALL getNullPolyBadEnum()
     344             :         throw (RuntimeException)
     345             :     { return TestPolyStruct< TestBadEnum >(
     346           1 :         test::testtools::bridgetest::TestBadEnum_M);
     347             :           /* explicitly instantiate with default enumerator */ }
     348             : 
     349           1 :     virtual TestPolyStruct< TestStruct > SAL_CALL getNullPolyStruct()
     350             :         throw (RuntimeException)
     351           1 :     { return TestPolyStruct< TestStruct >(); }
     352             : 
     353             :     virtual TestPolyStruct< Reference< XBridgeTestBase > > SAL_CALL
     354           1 :     getNullPolyInterface() throw (RuntimeException)
     355           1 :     { return TestPolyStruct< Reference< XBridgeTestBase > >(); }
     356             : 
     357             :     virtual ::com::sun::star::uno::Any SAL_CALL transportAny(
     358             :         const ::com::sun::star::uno::Any& value )
     359             :         throw(::com::sun::star::uno::RuntimeException);
     360             : 
     361             :     virtual void SAL_CALL call( sal_Int32 nCallId, sal_Int32 nWaitMUSEC )
     362             :         throw(::com::sun::star::uno::RuntimeException);
     363             :     virtual void SAL_CALL callOneway( sal_Int32 nCallId, sal_Int32 nWaitMUSEC )
     364             :         throw(::com::sun::star::uno::RuntimeException);
     365             :     virtual sal_Bool SAL_CALL sequenceOfCallTestPassed(  )
     366             :         throw(::com::sun::star::uno::RuntimeException);
     367             :     virtual void SAL_CALL startRecursiveCall(
     368             :         const ::com::sun::star::uno::Reference< XRecursiveCall >& xCall, sal_Int32 nToCall )
     369             :         throw(::com::sun::star::uno::RuntimeException);
     370             : 
     371             :     virtual Reference< XMulti > SAL_CALL getMulti() throw (RuntimeException);
     372             : 
     373             :     virtual OUString SAL_CALL testMulti(Reference< XMulti > const & multi)
     374             :         throw (RuntimeException);
     375             : 
     376             : public: // XBridgeTest
     377             :     virtual TestData SAL_CALL raiseException( sal_Int16 nArgumentPos, const OUString & rMsg, const Reference< XInterface > & xCOntext )
     378             :         throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
     379             : 
     380             :     virtual void SAL_CALL raiseRuntimeExceptionOneway(
     381             :         const OUString& Message, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& Context )
     382             :         throw(::com::sun::star::uno::RuntimeException);
     383             : 
     384             :     virtual sal_Int32 SAL_CALL getRuntimeException() throw(::com::sun::star::uno::RuntimeException);
     385             :     virtual void SAL_CALL setRuntimeException( sal_Int32 _runtimeexception ) throw(::com::sun::star::uno::RuntimeException);
     386             : 
     387             :     // XBridgeTest2
     388             :     virtual Sequence< sal_Bool > SAL_CALL setSequenceBool(
     389             :         const Sequence< sal_Bool >& aSeq ) throw (RuntimeException);
     390             :     virtual Sequence< sal_Unicode > SAL_CALL setSequenceChar(
     391             :         const Sequence< sal_Unicode >& aSeq ) throw (RuntimeException);
     392             :     virtual Sequence< sal_Int8 > SAL_CALL setSequenceByte(
     393             :         const Sequence< sal_Int8 >& aSeq ) throw (RuntimeException);
     394             :     virtual Sequence< sal_Int16 > SAL_CALL setSequenceShort(
     395             :         const Sequence< sal_Int16 >& aSeq ) throw (RuntimeException);
     396             :     virtual Sequence< sal_uInt16 > SAL_CALL setSequenceUShort(
     397             :         const Sequence< sal_uInt16 >& aSeq ) throw (RuntimeException);
     398             :     virtual Sequence< sal_Int32 > SAL_CALL setSequenceLong(
     399             :         const Sequence< sal_Int32 >& aSeq ) throw (RuntimeException);
     400             :     virtual Sequence< sal_uInt32 > SAL_CALL setSequenceULong(
     401             :         const Sequence< sal_uInt32 >& aSeq ) throw (RuntimeException);
     402             :     virtual Sequence< sal_Int64 > SAL_CALL setSequenceHyper(
     403             :         const Sequence< sal_Int64 >& aSeq ) throw (RuntimeException);
     404             :     virtual Sequence< sal_uInt64 > SAL_CALL setSequenceUHyper(
     405             :         const Sequence< sal_uInt64 >& aSeq ) throw (RuntimeException);
     406             :     virtual Sequence< float > SAL_CALL setSequenceFloat(
     407             :         const Sequence< float >& aSeq ) throw (RuntimeException);
     408             :     virtual Sequence< double > SAL_CALL setSequenceDouble(
     409             :         const Sequence< double >& aSeq ) throw (RuntimeException);
     410             :     virtual Sequence< TestEnum > SAL_CALL setSequenceEnum(
     411             :         const Sequence< TestEnum >& aSeq ) throw (RuntimeException) ;
     412             :     virtual Sequence< OUString > SAL_CALL setSequenceString(
     413             :         const Sequence< OUString >& aString ) throw (RuntimeException);
     414             :     virtual Sequence< Reference< XInterface > > SAL_CALL setSequenceXInterface(
     415             :         const Sequence< Reference< XInterface > >& aSeq )
     416             :         throw (RuntimeException);
     417             :     virtual Sequence<Any > SAL_CALL setSequenceAny(
     418             :         const Sequence<Any >& aSeq ) throw (RuntimeException);
     419             :     virtual Sequence<TestElement > SAL_CALL setSequenceStruct(
     420             :         const Sequence< TestElement >& aSeq ) throw (RuntimeException);
     421             :     virtual Sequence< Sequence< sal_Int32 > > SAL_CALL setDim2(
     422             :         const Sequence<Sequence< sal_Int32 > >& aSeq ) throw (RuntimeException);
     423             :     virtual Sequence< Sequence< Sequence< sal_Int32 > > > SAL_CALL setDim3(
     424             :         const Sequence< Sequence< Sequence< sal_Int32 > > >& aSeq )
     425             :         throw (RuntimeException);
     426             :     virtual void SAL_CALL setSequencesInOut(Sequence< sal_Bool >& aSeqBoolean,
     427             :                                 Sequence< sal_Unicode >& aSeqChar,
     428             :                                 Sequence< sal_Int8 >& aSeqByte,
     429             :                                 Sequence< sal_Int16 >& aSeqShort,
     430             :                                 Sequence< sal_uInt16 >& aSeqUShort,
     431             :                                 Sequence< sal_Int32 >& aSeqLong,
     432             :                                 Sequence< sal_uInt32 >& aSeqULong,
     433             :                                 Sequence< sal_Int64 >& aSeqHyper,
     434             :                                 Sequence< sal_uInt64 >& aSeqUHyper,
     435             :                                 Sequence< float >& aSeqFloat,
     436             :                                 Sequence< double >& aSeqDouble,
     437             :                                 Sequence< TestEnum >& aSeqTestEnum,
     438             :                                 Sequence< OUString >& aSeqString,
     439             :                                 Sequence<Reference<XInterface > >& aSeqXInterface,
     440             :                                 Sequence< Any >& aSeqAny,
     441             :                                 Sequence< Sequence< sal_Int32 > >& aSeqDim2,
     442             :                                 Sequence< Sequence< Sequence< sal_Int32 > > >& aSeqDim3 )
     443             :         throw (RuntimeException);
     444             :     virtual void SAL_CALL setSequencesOut( Sequence< sal_Bool >& aSeqBoolean,
     445             :                              Sequence< sal_Unicode >& aSeqChar,
     446             :                              Sequence< sal_Int8 >& aSeqByte,
     447             :                              Sequence< sal_Int16 >& aSeqShort,
     448             :                              Sequence< sal_uInt16 >& aSeqUShort,
     449             :                              Sequence< sal_Int32 >& aSeqLong,
     450             :                              Sequence< sal_uInt32 >& aSeqULong,
     451             :                              Sequence< sal_Int64 >& aSeqHyper,
     452             :                              Sequence< sal_uInt64 >& aSeqUHyper,
     453             :                              Sequence< float >& aSeqFloat,
     454             :                              Sequence< double >& aSeqDouble,
     455             :                              Sequence< TestEnum >& aSeqEnum,
     456             :                              Sequence< OUString >& aSeqString,
     457             :                              Sequence< Reference< XInterface > >& aSeqXInterface,
     458             :                              Sequence< Any >& aSeqAny,
     459             :                              Sequence< Sequence< sal_Int32 > >& aSeqDim2,
     460             :                              Sequence< Sequence< Sequence< sal_Int32 > > >& aSeqDim3 )
     461             :         throw (RuntimeException);
     462             :     virtual void SAL_CALL testConstructorsService(
     463             :         Reference< XComponentContext > const & context)
     464             :         throw (RuntimeException);
     465             :     virtual Reference< XCurrentContextChecker > SAL_CALL
     466             :     getCurrentContextChecker()
     467             :         throw (RuntimeException);
     468             : 
     469             : public:
     470             :     virtual void SAL_CALL callRecursivly( const ::com::sun::star::uno::Reference< XRecursiveCall >& xCall, sal_Int32 nToCall ) throw(::com::sun::star::uno::RuntimeException);
     471             : };
     472             : 
     473             : //Dummy class for XComponent implementation
     474           6 : class Dummy : public osl::DebugBase<Dummy>,
     475             :               public WeakComponentImplHelperBase
     476             : {
     477             : public:
     478           3 :      Dummy(): WeakComponentImplHelperBase(*Mutex::getGlobalMutex()){}
     479             : 
     480             : };
     481             : //__________________________________________________________________________________________________
     482          16 : Any Test_Impl::transportAny( const Any & value ) throw ( ::com::sun::star::uno::RuntimeException)
     483             : {
     484          16 :     return value;
     485             : }
     486             : 
     487             : //__________________________________________________________________________________________________
     488             : 
     489             : namespace {
     490             : 
     491          55 : void wait(sal_Int32 microSeconds) {
     492             :     OSL_ASSERT(microSeconds >= 0 && microSeconds <= SAL_MAX_INT32 / 1000);
     493             :     TimeValue t = {
     494          55 :         static_cast< sal_uInt32 >(microSeconds / 1000000),
     495          55 :         static_cast< sal_uInt32 >(microSeconds * 1000) };
     496          55 :     osl_waitThread(&t);
     497          55 : }
     498             : 
     499             : }
     500             : 
     501          10 : void Test_Impl::call( sal_Int32 nCallId , sal_Int32 nWaitMUSEC ) throw(::com::sun::star::uno::RuntimeException)
     502             : {
     503          10 :     wait(nWaitMUSEC);
     504          10 :     if( m_bFirstCall )
     505             :     {
     506           1 :         m_bFirstCall = false;
     507             :     }
     508             :     else
     509             :     {
     510           9 :         m_bSequenceOfCallTestPassed = m_bSequenceOfCallTestPassed && (nCallId > m_nLastCallId);
     511             :     }
     512          10 :     m_nLastCallId = nCallId;
     513          10 : }
     514             : 
     515             : //__________________________________________________________________________________________________
     516          45 : void Test_Impl::callOneway( sal_Int32 nCallId , sal_Int32 nWaitMUSEC ) throw (::com::sun::star::uno::RuntimeException)
     517             : {
     518          45 :     wait(nWaitMUSEC);
     519          45 :     m_bSequenceOfCallTestPassed = m_bSequenceOfCallTestPassed && (nCallId > m_nLastCallId);
     520          45 :     m_nLastCallId = nCallId;
     521          45 : }
     522             : 
     523             : //__________________________________________________________________________________________________
     524           1 : sal_Bool Test_Impl::sequenceOfCallTestPassed() throw (::com::sun::star::uno::RuntimeException)
     525             : {
     526           1 :     return m_bSequenceOfCallTestPassed;
     527             : }
     528             : 
     529             : //__________________________________________________________________________________________________
     530           1 : void SAL_CALL Test_Impl::startRecursiveCall(
     531             :     const ::com::sun::star::uno::Reference< XRecursiveCall >& xCall, sal_Int32 nToCall )
     532             :     throw(::com::sun::star::uno::RuntimeException)
     533             : {
     534           1 :     MutexGuard guard( m_mutex );
     535           1 :     if( nToCall )
     536             :     {
     537           1 :         nToCall --;
     538           1 :         xCall->callRecursivly( this , nToCall );
     539           1 :     }
     540           1 : }
     541             : 
     542             : 
     543          25 : void SAL_CALL Test_Impl::callRecursivly(
     544             :     const ::com::sun::star::uno::Reference< XRecursiveCall >& xCall,
     545             :     sal_Int32 nToCall )
     546             :     throw(::com::sun::star::uno::RuntimeException)
     547             : {
     548          25 :     MutexGuard guard( m_mutex );
     549          25 :     if( nToCall )
     550             :     {
     551          24 :         nToCall --;
     552          24 :         xCall->callRecursivly( this , nToCall );
     553          25 :     }
     554          25 : }
     555             : 
     556           1 : Reference< XMulti > Test_Impl::getMulti() throw (RuntimeException) {
     557           1 :     return new testtools::bridgetest::Multi;
     558             : }
     559             : 
     560           1 : OUString Test_Impl::testMulti(Reference< XMulti > const & multi)
     561             :     throw (RuntimeException)
     562             : {
     563           1 :     return testtools::bridgetest::testMulti(multi);
     564             : }
     565             : 
     566             : //__________________________________________________________________________________________________
     567           1 : void Test_Impl::setValues( sal_Bool bBool, sal_Unicode cChar, sal_Int8 nByte,
     568             :                            sal_Int16 nShort, sal_uInt16 nUShort,
     569             :                            sal_Int32 nLong, sal_uInt32 nULong,
     570             :                            sal_Int64 nHyper, sal_uInt64 nUHyper,
     571             :                            float fFloat, double fDouble,
     572             :                            TestEnum eEnum, const OUString& rStr,
     573             :                            const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xTest,
     574             :                            const ::com::sun::star::uno::Any& rAny,
     575             :                            const ::com::sun::star::uno::Sequence<TestElement >& rSequence,
     576             :                            const TestData& rStruct )
     577             :     throw(com::sun::star::uno::RuntimeException)
     578             : {
     579             :     assign( _aData,
     580             :             bBool, cChar, nByte, nShort, nUShort, nLong, nULong, nHyper, nUHyper, fFloat, fDouble,
     581           1 :             eEnum, rStr, xTest, rAny, rSequence );
     582           1 :     _aStructData = rStruct;
     583           1 : }
     584             : //__________________________________________________________________________________________________
     585           1 : TestData Test_Impl::setValues2( sal_Bool& bBool, sal_Unicode& cChar, sal_Int8& nByte,
     586             :                                 sal_Int16& nShort, sal_uInt16& nUShort,
     587             :                                 sal_Int32& nLong, sal_uInt32& nULong,
     588             :                                 sal_Int64& nHyper, sal_uInt64& nUHyper,
     589             :                                 float& fFloat, double& fDouble,
     590             :                                 TestEnum& eEnum, OUString& rStr,
     591             :                                 ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xTest,
     592             :                                 ::com::sun::star::uno::Any& rAny,
     593             :                                 ::com::sun::star::uno::Sequence<TestElement >& rSequence,
     594             :                                 TestData& rStruct )
     595             :     throw(com::sun::star::uno::RuntimeException)
     596             : {
     597             :     assign( _aData,
     598             :             bBool, cChar, nByte, nShort, nUShort, nLong, nULong, nHyper, nUHyper, fFloat, fDouble,
     599           1 :             eEnum, rStr, xTest, rAny, rSequence );
     600           1 :     _aStructData = rStruct;
     601             : 
     602           1 :     TestElement elem = rSequence[ 0 ];
     603           1 :     rSequence[ 0 ] = rSequence[ 1 ];
     604           1 :     rSequence[ 1 ] = elem;
     605             : 
     606           1 :     return _aStructData;
     607             : }
     608             : //__________________________________________________________________________________________________
     609           2 : TestData Test_Impl::getValues( sal_Bool& bBool, sal_Unicode& cChar, sal_Int8& nByte,
     610             :                                sal_Int16& nShort, sal_uInt16& nUShort,
     611             :                                sal_Int32& nLong, sal_uInt32& nULong,
     612             :                                sal_Int64& nHyper, sal_uInt64& nUHyper,
     613             :                                float& fFloat, double& fDouble,
     614             :                                TestEnum& eEnum, OUString& rStr,
     615             :                                ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xTest,
     616             :                                ::com::sun::star::uno::Any& rAny,
     617             :                                ::com::sun::star::uno::Sequence<TestElement >& rSequence,
     618             :                                TestData& rStruct )
     619             :     throw(com::sun::star::uno::RuntimeException)
     620             : {
     621           2 :     bBool = _aData.Bool;
     622           2 :     cChar = _aData.Char;
     623           2 :     nByte = _aData.Byte;
     624           2 :     nShort = _aData.Short;
     625           2 :     nUShort = _aData.UShort;
     626           2 :     nLong = _aData.Long;
     627           2 :     nULong = _aData.ULong;
     628           2 :     nHyper = _aData.Hyper;
     629           2 :     nUHyper = _aData.UHyper;
     630           2 :     fFloat = _aData.Float;
     631           2 :     fDouble = _aData.Double;
     632           2 :     eEnum = _aData.Enum;
     633           2 :     rStr = _aData.String;
     634           2 :     xTest = _aData.Interface;
     635           2 :     rAny = _aData.Any;
     636           2 :     rSequence = _aData.Sequence;
     637           2 :     rStruct = _aStructData;
     638           2 :     return _aStructData;
     639             : }
     640             : //__________________________________________________________________________________________________
     641           1 : TestData Test_Impl::raiseException( sal_Int16 nArgumentPos, const OUString & rMsg, const Reference< XInterface > & xContext )
     642             :     throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException)
     643             : {
     644           1 :     IllegalArgumentException aExc;
     645           1 :     aExc.ArgumentPosition = nArgumentPos;
     646           1 :     aExc.Message          = _aData.String = rMsg;
     647           1 :     aExc.Context          = _aData.Interface = xContext;
     648           1 :     throw aExc;
     649             : }
     650             : 
     651           1 : void Test_Impl::raiseRuntimeExceptionOneway( const OUString & rMsg, const Reference< XInterface > & xContext )
     652             :     throw(::com::sun::star::uno::RuntimeException)
     653             : {
     654           1 :     RuntimeException aExc;
     655           1 :     aExc.Message          = _aData.String = rMsg;
     656           1 :     aExc.Context          = _aData.Interface = xContext;
     657           1 :     throw aExc;
     658             : }
     659             : 
     660           1 : void dothrow2( RuntimeException e )
     661             : {
     662           1 :     throw e;
     663             : }
     664           1 : void dothrow( RuntimeException const & e )
     665             : {
     666             : #if defined _MSC_VER
     667             :     // currently only for MSVC:
     668             :     // just to test whether all bridges fall back to a RuntimeException
     669             :     // in case of a thrown non-UNO exception:
     670             :     try
     671             :     {
     672             :         throw ::std::bad_alloc();
     673             :     }
     674             :     catch (...)
     675             :     {
     676             :         try
     677             :         {
     678             :             Any a( getCaughtException() );
     679             :             RuntimeException exc;
     680             :             OSL_VERIFY( a >>= exc );
     681             :             OSL_TRACE(
     682             :                 OUStringToOString(
     683             :                     exc.Message, RTL_TEXTENCODING_UTF8 ).getStr() );
     684             :         }
     685             :         catch (...) // never throws anything
     686             :         {
     687             :             fprintf( stderr, "\ngetCaughtException() failed!\n" );
     688             :             exit( 1 );
     689             :         }
     690             :     }
     691             : #endif
     692           2 :     dothrow2( e );
     693           0 : }
     694             : //______________________________________________________________________________
     695           1 : sal_Int32 Test_Impl::getRuntimeException()
     696             :     throw (RuntimeException)
     697             : {
     698             :     try
     699             :     {
     700           2 :         dothrow( RuntimeException( _aData.String, _aData.Interface ) );
     701             :     }
     702           1 :     catch (Exception &)
     703             :     {
     704           1 :         Any a( getCaughtException() );
     705           2 :         throwException( a );
     706             :     }
     707           0 :     return 0; // for dummy
     708             : }
     709             : //__________________________________________________________________________________________________
     710           1 : void Test_Impl::setRuntimeException( sal_Int32 ) throw(::com::sun::star::uno::RuntimeException)
     711             : {
     712           1 :     RuntimeException aExc;
     713           1 :     aExc.Message          = _aData.String;
     714           1 :     aExc.Context          = _aData.Interface;
     715           2 :     throwException( makeAny( aExc ) );
     716           0 : }
     717             : 
     718             : // XBridgeTest2 -------------------------------------------------------------
     719           2 : Sequence< sal_Bool > SAL_CALL Test_Impl::setSequenceBool(
     720             :         const Sequence< sal_Bool >& aSeq ) throw (RuntimeException)
     721             : {
     722           2 :     _arBool = aSeq;
     723           2 :     return aSeq;
     724             : }
     725             : 
     726           2 : Sequence< sal_Unicode > SAL_CALL Test_Impl::setSequenceChar(
     727             :         const Sequence< sal_Unicode >& aSeq ) throw (RuntimeException)
     728             : {
     729           2 :     _arChar = aSeq;
     730           2 :     return aSeq;
     731             : }
     732             : 
     733           2 : Sequence< sal_Int8 > SAL_CALL Test_Impl::setSequenceByte(
     734             :         const Sequence< sal_Int8 >& aSeq ) throw (RuntimeException)
     735             : {
     736           2 :     _arByte = aSeq;
     737           2 :     return aSeq;
     738             : }
     739             : 
     740           2 : Sequence< sal_Int16 > SAL_CALL Test_Impl::setSequenceShort(
     741             :         const Sequence< sal_Int16 >& aSeq ) throw (RuntimeException)
     742             : {
     743           2 :     _arShort = aSeq;
     744           2 :     return aSeq;
     745             : }
     746             : 
     747           2 : Sequence< sal_uInt16 > SAL_CALL Test_Impl::setSequenceUShort(
     748             :         const Sequence< sal_uInt16 >& aSeq ) throw (RuntimeException)
     749             : {
     750           2 :     _arUShort = aSeq;
     751           2 :     return aSeq;
     752             : }
     753             : 
     754           2 : Sequence< sal_Int32 > SAL_CALL Test_Impl::setSequenceLong(
     755             :         const Sequence< sal_Int32 >& aSeq ) throw (RuntimeException)
     756             : {
     757           2 :     _arLong = aSeq;
     758           2 :     return aSeq;
     759             : }
     760             : 
     761           2 : Sequence< sal_uInt32 > SAL_CALL Test_Impl::setSequenceULong(
     762             :         const Sequence< sal_uInt32 >& aSeq ) throw (RuntimeException)
     763             : {
     764           2 :     _arULong = aSeq;
     765           2 :     return aSeq;
     766             : }
     767             : 
     768           2 : Sequence< sal_Int64 > SAL_CALL Test_Impl::setSequenceHyper(
     769             :         const Sequence< sal_Int64 >& aSeq ) throw (RuntimeException)
     770             : {
     771           2 :     _arHyper = aSeq;
     772           2 :     return aSeq;
     773             : }
     774             : 
     775           2 : Sequence< sal_uInt64 > SAL_CALL Test_Impl::setSequenceUHyper(
     776             :         const Sequence< sal_uInt64 >& aSeq ) throw (RuntimeException)
     777             : {
     778           2 :     _arUHyper = aSeq;
     779           2 :     return aSeq;
     780             : }
     781             : 
     782           2 : Sequence< float > SAL_CALL Test_Impl::setSequenceFloat(
     783             :         const Sequence< float >& aSeq ) throw (RuntimeException)
     784             : {
     785           2 :     _arFloat = aSeq;
     786           2 :     return aSeq;
     787             : }
     788             : 
     789           2 : Sequence< double > SAL_CALL Test_Impl::setSequenceDouble(
     790             :     const Sequence< double >& aSeq ) throw (RuntimeException)
     791             : {
     792           2 :     _arDouble = aSeq;
     793           2 :     return aSeq;
     794             : }
     795             : 
     796           2 : Sequence< TestEnum > SAL_CALL Test_Impl::setSequenceEnum(
     797             :     const Sequence< TestEnum >& aSeq ) throw (RuntimeException)
     798             : {
     799           2 :     _arEnum = aSeq;
     800           2 :     return aSeq;
     801             : }
     802             : 
     803           2 : Sequence< OUString > SAL_CALL Test_Impl::setSequenceString(
     804             :     const Sequence< OUString >& aSeq ) throw (RuntimeException)
     805             : {
     806           2 :     _arString = aSeq;
     807           2 :     return aSeq;
     808             : }
     809             : 
     810           2 : Sequence< Reference< XInterface > > SAL_CALL Test_Impl::setSequenceXInterface(
     811             :         const Sequence< Reference< XInterface > >& aSeq )
     812             :         throw (RuntimeException)
     813             : {
     814           2 :     _arObject = aSeq;
     815           2 :     return aSeq;
     816             : }
     817             : 
     818           2 : Sequence<Any > SAL_CALL Test_Impl::setSequenceAny(
     819             :     const Sequence<Any >& aSeq ) throw (RuntimeException)
     820             : {
     821           2 :     _arAny = aSeq;
     822           2 :     return aSeq;
     823             : }
     824             : 
     825           2 : Sequence<TestElement > SAL_CALL Test_Impl::setSequenceStruct(
     826             :     const Sequence< TestElement >& aSeq ) throw (RuntimeException)
     827             : {
     828           2 :     _arStruct = aSeq;
     829           2 :     return aSeq;
     830             : }
     831             : 
     832           2 : Sequence< Sequence< sal_Int32 > > SAL_CALL Test_Impl::setDim2(
     833             :         const Sequence<Sequence< sal_Int32 > >& aSeq ) throw (RuntimeException)
     834             : {
     835           2 :     _arLong2 = aSeq;
     836           2 :     return aSeq;
     837             : }
     838             : 
     839           2 : Sequence< Sequence< Sequence< sal_Int32 > > > SAL_CALL Test_Impl::setDim3(
     840             :         const Sequence< Sequence< Sequence< sal_Int32 > > >& aSeq )
     841             :         throw (RuntimeException)
     842             : {
     843           2 :     _arLong3 = aSeq;
     844           2 :     return aSeq;
     845             : }
     846             : 
     847           1 : void SAL_CALL Test_Impl::setSequencesInOut(Sequence< sal_Bool >& aSeqBoolean,
     848             :                                 Sequence< sal_Unicode >& aSeqChar,
     849             :                                 Sequence< sal_Int8 >& aSeqByte,
     850             :                                 Sequence< sal_Int16 >& aSeqShort,
     851             :                                 Sequence< sal_uInt16 >& aSeqUShort,
     852             :                                 Sequence< sal_Int32 >& aSeqLong,
     853             :                                 Sequence< sal_uInt32 >& aSeqULong,
     854             :                                 Sequence< sal_Int64 >& aSeqHyper,
     855             :                                 Sequence< sal_uInt64 >& aSeqUHyper,
     856             :                                 Sequence< float >& aSeqFloat,
     857             :                                 Sequence< double >& aSeqDouble,
     858             :                                 Sequence< TestEnum >& aSeqTestEnum,
     859             :                                 Sequence< OUString >& aSeqString,
     860             :                                 Sequence<Reference<XInterface > >& aSeqXInterface,
     861             :                                 Sequence< Any >& aSeqAny,
     862             :                                 Sequence< Sequence< sal_Int32 > >& aSeqDim2,
     863             :                                 Sequence< Sequence< Sequence< sal_Int32 > > >& aSeqDim3 )
     864             :         throw (RuntimeException)
     865             : {
     866           1 :     _arBool = aSeqBoolean;
     867           1 :     _arChar = aSeqChar;
     868           1 :     _arByte = aSeqByte;
     869           1 :     _arShort = aSeqShort;
     870           1 :     _arUShort = aSeqUShort;
     871           1 :     _arLong = aSeqLong;
     872           1 :     _arULong = aSeqULong;
     873           1 :     _arHyper  = aSeqHyper;
     874           1 :     _arUHyper = aSeqUHyper;
     875           1 :     _arFloat = aSeqFloat;
     876           1 :     _arDouble = aSeqDouble;
     877           1 :     _arEnum = aSeqTestEnum;
     878           1 :     _arString = aSeqString;
     879           1 :     _arObject = aSeqXInterface;
     880           1 :     _arAny = aSeqAny;
     881           1 :     _arLong2 = aSeqDim2;
     882           1 :     _arLong3 = aSeqDim3;
     883           1 : }
     884             : 
     885           1 : void SAL_CALL Test_Impl::setSequencesOut( Sequence< sal_Bool >& aSeqBoolean,
     886             :                              Sequence< sal_Unicode >& aSeqChar,
     887             :                              Sequence< sal_Int8 >& aSeqByte,
     888             :                              Sequence< sal_Int16 >& aSeqShort,
     889             :                              Sequence< sal_uInt16 >& aSeqUShort,
     890             :                              Sequence< sal_Int32 >& aSeqLong,
     891             :                              Sequence< sal_uInt32 >& aSeqULong,
     892             :                              Sequence< sal_Int64 >& aSeqHyper,
     893             :                              Sequence< sal_uInt64 >& aSeqUHyper,
     894             :                              Sequence< float >& aSeqFloat,
     895             :                              Sequence< double >& aSeqDouble,
     896             :                              Sequence< TestEnum >& aSeqEnum,
     897             :                              Sequence< OUString >& aSeqString,
     898             :                              Sequence< Reference< XInterface > >& aSeqXInterface,
     899             :                              Sequence< Any >& aSeqAny,
     900             :                              Sequence< Sequence< sal_Int32 > >& aSeqDim2,
     901             :                              Sequence< Sequence< Sequence< sal_Int32 > > >& aSeqDim3 )
     902             :         throw (RuntimeException)
     903             : {
     904           1 :     aSeqBoolean = _arBool;
     905           1 :     aSeqChar = _arChar;
     906           1 :     aSeqByte = _arByte;
     907           1 :     aSeqShort = _arShort;
     908           1 :     aSeqUShort = _arUShort;
     909           1 :     aSeqLong = _arLong;
     910           1 :     aSeqULong = _arULong;
     911           1 :     aSeqHyper = _arHyper;
     912           1 :     aSeqUHyper = _arUHyper;
     913           1 :     aSeqFloat = _arFloat;
     914           1 :     aSeqDouble = _arDouble;
     915           1 :     aSeqEnum = _arEnum;
     916           1 :     aSeqString = _arString;
     917           1 :     aSeqXInterface = _arObject;
     918           1 :     aSeqAny = _arAny;
     919           1 :     aSeqDim2 = _arLong2;
     920           1 :     aSeqDim3 = _arLong3;
     921           1 : }
     922             : 
     923           1 : void Test_Impl::testConstructorsService(
     924             :     Reference< XComponentContext > const & context) throw (RuntimeException)
     925             : {
     926           1 :     Sequence< sal_Bool > arg14(1); arg14[0] = true;
     927           2 :     Sequence< sal_Int8 > arg15(1); arg15[0] = SAL_MIN_INT8;
     928           2 :     Sequence< sal_Int16 > arg16(1); arg16[0] = SAL_MIN_INT16;
     929           2 :     Sequence< sal_uInt16 > arg17(1); arg17[0] = SAL_MAX_UINT16;
     930           2 :     Sequence< sal_Int32 > arg18(1); arg18[0] = SAL_MIN_INT32;
     931           2 :     Sequence< sal_uInt32 > arg19(1); arg19[0] = SAL_MAX_UINT32;
     932           2 :     Sequence< sal_Int64 > arg20(1); arg20[0] = SAL_MIN_INT64;
     933           2 :     Sequence< sal_uInt64 > arg21(1); arg21[0] = SAL_MAX_UINT64;
     934           2 :     Sequence< float > arg22(1); arg22[0] = 0.123f;
     935           2 :     Sequence< double > arg23(1); arg23[0] = 0.456;
     936           2 :     Sequence< sal_Unicode > arg24(1); arg24[0] = 'X';
     937           2 :     Sequence< OUString > arg25(1);
     938           1 :     arg25[0] = OUString("test");
     939           2 :     Sequence< Type > arg26(1); arg26[0] = UnoType< Any >::get();
     940           2 :     Sequence< Any > arg27(1); arg27[0] <<= true;
     941           2 :     Sequence< Sequence< sal_Bool > > arg28(1);
     942           1 :     arg28[0] = Sequence< sal_Bool >(1); arg28[0][0] = true;
     943           2 :     Sequence< Sequence< Any > > arg29(1); arg29[0] = Sequence< Any >(1);
     944           1 :     arg29[0][0] <<= true;
     945           2 :     Sequence< TestEnum > arg30(1); arg30[0] = TestEnum_TWO;
     946           2 :     Sequence< TestStruct > arg31(1); arg31[0].member = 10;
     947           2 :     Sequence< TestPolyStruct< sal_Bool > > arg32(1); arg32[0].member = true;
     948           2 :     Sequence< TestPolyStruct< Any > > arg33(1); arg33[0].member <<= true;
     949           2 :     Sequence< Reference< XInterface > > arg34(1);
     950             :     Constructors::create1(context,
     951             :         true,
     952             :         SAL_MIN_INT8,
     953             :         SAL_MIN_INT16,
     954             :         SAL_MAX_UINT16,
     955             :         SAL_MIN_INT32,
     956             :         SAL_MAX_UINT32,
     957             :         SAL_MIN_INT64,
     958             :         SAL_MAX_UINT64,
     959             :         0.123f,
     960             :         0.456,
     961             :         'X',
     962             :         OUString("test"),
     963           1 :         UnoType< Any >::get(),
     964             :         makeAny(true),
     965             :         arg14,
     966             :         arg15,
     967             :         arg16,
     968             :         arg17,
     969             :         arg18,
     970             :         arg19,
     971             :         arg20,
     972             :         arg21,
     973             :         arg22,
     974             :         arg23,
     975             :         arg24,
     976             :         arg25,
     977             :         arg26,
     978             :         arg27,
     979             :         arg28,
     980             :         arg29,
     981             :         arg30,
     982             :         arg31,
     983             :         arg32,
     984             :         arg33,
     985             :         arg34,
     986             :         TestEnum_TWO,
     987             :         TestStruct(10),
     988             :         TestPolyStruct< sal_Bool >(true),
     989             :         TestPolyStruct< Any >(makeAny(true)),
     990           2 :         Reference< XInterface >(0));
     991           2 :     Sequence< Any > args(40);
     992           1 :     args[0] <<= true;
     993           1 :     args[1] <<= SAL_MIN_INT8;
     994           1 :     args[2] <<= SAL_MIN_INT16;
     995           1 :     args[3] <<= SAL_MAX_UINT16;
     996           1 :     args[4] <<= SAL_MIN_INT32;
     997           1 :     args[5] <<= SAL_MAX_UINT32;
     998           1 :     args[6] <<= SAL_MIN_INT64;
     999           1 :     args[7] <<= SAL_MAX_UINT64;
    1000           1 :     args[8] <<= 0.123f;
    1001           1 :     args[9] <<= 0.456;
    1002           1 :     sal_Unicode arg10c = 'X';
    1003           1 :     args[10].setValue(&arg10c, UnoType< UnoCharType >::get());
    1004           1 :     args[11] <<= OUString("test");
    1005           1 :     args[12] <<= UnoType< Any >::get();
    1006           1 :     args[13] <<= true;
    1007           1 :     args[14] <<= arg14;
    1008           1 :     args[15] <<= arg15;
    1009           1 :     args[16] <<= arg16;
    1010           1 :     args[17] <<= arg17;
    1011           1 :     args[18] <<= arg18;
    1012           1 :     args[19] <<= arg19;
    1013           1 :     args[20] <<= arg20;
    1014           1 :     args[21] <<= arg21;
    1015           1 :     args[22] <<= arg22;
    1016           1 :     args[23] <<= arg23;
    1017           1 :     args[24].setValue(&arg24, UnoType< UnoSequenceType< UnoCharType > >::get());
    1018           1 :     args[25] <<= arg25;
    1019           1 :     args[26] <<= arg26;
    1020           1 :     args[27] <<= arg27;
    1021           1 :     args[28] <<= arg28;
    1022           1 :     args[29] <<= arg29;
    1023           1 :     args[30] <<= arg30;
    1024           1 :     args[31] <<= arg31;
    1025           1 :     args[32] <<= arg32;
    1026           1 :     args[33] <<= arg33;
    1027           1 :     args[34] <<= arg34;
    1028           1 :     args[35] <<= TestEnum_TWO;
    1029           1 :     args[36] <<= TestStruct(10);
    1030           1 :     args[37] <<= TestPolyStruct< sal_Bool >(true);
    1031           1 :     args[38] <<= TestPolyStruct< Any >(makeAny(true));
    1032           1 :     args[39] <<= Reference< XInterface >(0);
    1033           1 :     Constructors::create2(context, args);
    1034             : 
    1035           2 :     Sequence<Type> argSeq1(1); argSeq1[0] = cppu::UnoType<sal_Int32>::get();
    1036           2 :     Sequence<Reference<XInterface> > argSeq2(1); argSeq2[0] = static_cast<XComponent*>(new Dummy());
    1037           2 :     Sequence<Reference<XComponent> > argSeq2a(1); argSeq2a[0] = static_cast<XComponent*>(new Dummy());
    1038             : 
    1039           2 :     Sequence<TestPolyStruct2<sal_Unicode, Sequence<Any> > > argSeq3(1);
    1040           1 :     argSeq3[0] = TestPolyStruct2<sal_Unicode, Sequence<Any> >('X', arg27);
    1041           2 :     Sequence<TestPolyStruct2<TestPolyStruct<sal_Unicode>, Sequence<Any> > > argSeq4(1);
    1042           2 :     argSeq4[0] = TestPolyStruct2<TestPolyStruct<sal_Unicode>, Sequence<Any> >(
    1043           1 :         TestPolyStruct<sal_Unicode>('X'), arg27);
    1044           2 :     Sequence<Sequence<sal_Int32> > argSeq5(1);
    1045           1 :     argSeq5[0] = Sequence<sal_Int32>(1); argSeq5[0][0] = SAL_MIN_INT32;
    1046           2 :     Sequence<TestPolyStruct<sal_Int32> > argSeq6(1);
    1047           1 :     argSeq6[0] = TestPolyStruct<sal_Int32>(SAL_MIN_INT32);
    1048           2 :     Sequence<TestPolyStruct<TestPolyStruct2<sal_Unicode, Any> > > argSeq7(1);
    1049           2 :     argSeq7[0] = TestPolyStruct<TestPolyStruct2<sal_Unicode, Any> >(
    1050           1 :         TestPolyStruct2<sal_Unicode, Any>('X', Any(true)));
    1051           2 :     Sequence<TestPolyStruct<TestPolyStruct2<TestPolyStruct2<sal_Unicode, Any>,OUString> > > argSeq8(1);
    1052           2 :     argSeq8[0] = TestPolyStruct<TestPolyStruct2<TestPolyStruct2<sal_Unicode, Any>,OUString> > (
    1053             :         TestPolyStruct2<TestPolyStruct2<sal_Unicode, Any>,OUString>(
    1054           1 :             TestPolyStruct2<sal_Unicode, Any>('X', Any(true)), OUString("test")));
    1055           2 :     Sequence<TestPolyStruct2<OUString, TestPolyStruct2<sal_Unicode, TestPolyStruct<Any> > > > argSeq9(1);
    1056           2 :     argSeq9[0] = TestPolyStruct2<OUString, TestPolyStruct2<sal_Unicode, TestPolyStruct<Any> > >(
    1057             :         OUString("test"), TestPolyStruct2<sal_Unicode, TestPolyStruct<Any> >(
    1058           1 :                      'X', TestPolyStruct<Any>(Any(true))));
    1059           2 :     Sequence<TestPolyStruct2<TestPolyStruct2<sal_Unicode, Any>, TestPolyStruct<sal_Unicode> > > argSeq10(1);
    1060           2 :     argSeq10[0] = TestPolyStruct2<TestPolyStruct2<sal_Unicode, Any>, TestPolyStruct<sal_Unicode> >(
    1061           1 :         TestPolyStruct2<sal_Unicode, Any>('X', Any(true)), TestPolyStruct<sal_Unicode>('X'));
    1062           2 :     Sequence<Sequence<TestPolyStruct<sal_Unicode > > > argSeq11(1);
    1063           1 :     argSeq11[0] = Sequence<TestPolyStruct<sal_Unicode > >(1);
    1064           1 :     argSeq11[0][0] = TestPolyStruct<sal_Unicode>('X');
    1065           2 :     Sequence<Sequence<TestPolyStruct<TestPolyStruct2<sal_Unicode,Any> > > > argSeq12(1);
    1066           1 :     argSeq12[0] = Sequence<TestPolyStruct<TestPolyStruct2<sal_Unicode,Any> > >(1);
    1067           2 :     argSeq12[0][0] = TestPolyStruct<TestPolyStruct2<sal_Unicode,Any> >(
    1068           1 :         TestPolyStruct2<sal_Unicode,Any>('X', Any(true)));
    1069           2 :     Sequence<Sequence<TestPolyStruct<TestPolyStruct2<TestPolyStruct2<sal_Unicode,Any>,OUString> > > > argSeq13(1);
    1070           1 :     argSeq13[0] = Sequence<TestPolyStruct<TestPolyStruct2<TestPolyStruct2<sal_Unicode,Any>,OUString> > >(1);
    1071           2 :     argSeq13[0][0] = TestPolyStruct<TestPolyStruct2<TestPolyStruct2<sal_Unicode,Any>,OUString> >(
    1072             :         TestPolyStruct2<TestPolyStruct2<sal_Unicode,Any>,OUString>(
    1073           1 :             TestPolyStruct2<sal_Unicode,Any>('X', Any(true)), OUString("test")));
    1074           2 :     Sequence<Sequence<TestPolyStruct2<OUString, TestPolyStruct2<sal_Unicode, TestPolyStruct<Any> > > > > argSeq14(1);
    1075           1 :     argSeq14[0] = Sequence<TestPolyStruct2<OUString, TestPolyStruct2<sal_Unicode, TestPolyStruct<Any> > > >(1);
    1076           2 :     argSeq14[0][0] = TestPolyStruct2<OUString, TestPolyStruct2<sal_Unicode, TestPolyStruct<Any> > >(
    1077             :         OUString("test"), TestPolyStruct2<sal_Unicode, TestPolyStruct<Any> >(
    1078           1 :             'X', TestPolyStruct<Any>(Any(true))));
    1079           2 :     Sequence<Sequence<TestPolyStruct2<TestPolyStruct2<sal_Unicode,Any>, TestPolyStruct<sal_Unicode> > > > argSeq15(1);
    1080           1 :     argSeq15[0] = Sequence<TestPolyStruct2<TestPolyStruct2<sal_Unicode,Any>, TestPolyStruct<sal_Unicode> > >(1);
    1081           2 :     argSeq15[0][0] = TestPolyStruct2<TestPolyStruct2<sal_Unicode,Any>, TestPolyStruct<sal_Unicode> >(
    1082           1 :         TestPolyStruct2<sal_Unicode,Any>('X',Any(true)), TestPolyStruct<sal_Unicode>('X'));
    1083             : 
    1084             :     Constructors2::create1(
    1085             :         context,
    1086           1 :         TestPolyStruct<Type>(cppu::UnoType<sal_Int32>::get()),
    1087             :         TestPolyStruct<Any>(Any(true)),
    1088             :         TestPolyStruct<sal_Bool>(true),
    1089             :         TestPolyStruct<sal_Int8>(SAL_MIN_INT8),
    1090             :         TestPolyStruct<sal_Int16>(SAL_MIN_INT16),
    1091             :         TestPolyStruct<sal_Int32>(SAL_MIN_INT32),
    1092             :         TestPolyStruct<sal_Int64>(SAL_MIN_INT64),
    1093             :         TestPolyStruct<sal_Unicode>('X'),
    1094             :         TestPolyStruct<OUString>(OUString("test")),
    1095             :         TestPolyStruct<float>(0.123f),
    1096             :         TestPolyStruct<double>(0.456),
    1097             :         TestPolyStruct<Reference<XInterface> >(static_cast<XBridgeTest2*>(this)),
    1098           1 :         TestPolyStruct<Reference<XComponent> >(static_cast<XComponent*>(new Dummy())),
    1099             :         TestPolyStruct<TestEnum>(TestEnum_TWO),
    1100             :         TestPolyStruct<TestPolyStruct2<sal_Unicode, Any> >(
    1101             :             TestPolyStruct2<sal_Unicode, Any>('X', Any(true))),
    1102             :         TestPolyStruct<TestPolyStruct2<TestPolyStruct2<sal_Unicode, Any>,OUString> > (
    1103             :             TestPolyStruct2<TestPolyStruct2<sal_Unicode, Any>,OUString>(
    1104             :                 TestPolyStruct2<sal_Unicode, Any>('X', Any(true)), OUString("test"))),
    1105             :         TestPolyStruct2<OUString, TestPolyStruct2<sal_Unicode,TestPolyStruct<Any> > >(
    1106             :             OUString("test"),
    1107             :             TestPolyStruct2<sal_Unicode, TestPolyStruct<Any> >('X', TestPolyStruct<Any>(Any(true)))),
    1108             :         TestPolyStruct2<TestPolyStruct2<sal_Unicode, Any>, TestPolyStruct<sal_Unicode> >(
    1109             :             TestPolyStruct2<sal_Unicode, Any>('X', Any(true)),
    1110             :             TestPolyStruct<sal_Unicode>('X')),
    1111             :         TestPolyStruct<Sequence<Type> >(argSeq1),
    1112             :         TestPolyStruct<Sequence<Any> >(arg27),
    1113             :         TestPolyStruct<Sequence<sal_Bool> >(arg14),
    1114             :         TestPolyStruct<Sequence<sal_Int8> >(arg15),
    1115             :         TestPolyStruct<Sequence<sal_Int16> >(arg16),
    1116             :         TestPolyStruct<Sequence<sal_Int32> >(arg18),
    1117             :         TestPolyStruct<Sequence<sal_Int64> >(arg20),
    1118             :         TestPolyStruct<Sequence<sal_Unicode> >(arg24),
    1119             :         TestPolyStruct<Sequence<OUString> >(arg25),
    1120             :         TestPolyStruct<Sequence<float> >(arg22),
    1121             :         TestPolyStruct<Sequence<double> >(arg23),
    1122             :         TestPolyStruct<Sequence<Reference<XInterface> > >(argSeq2),
    1123             :         TestPolyStruct<Sequence<Reference<XComponent> > >(argSeq2a),
    1124             :         TestPolyStruct<Sequence<TestEnum> >(arg30),
    1125             :         TestPolyStruct<Sequence<TestPolyStruct2<sal_Unicode, Sequence<Any> > > >(argSeq3),
    1126             :         TestPolyStruct<Sequence<TestPolyStruct2<TestPolyStruct<sal_Unicode>, Sequence<Any> > > > (argSeq4),
    1127             :         TestPolyStruct<Sequence<Sequence<sal_Int32> > >(argSeq5),
    1128             :         argSeq6,
    1129             :         argSeq7,
    1130             :         argSeq8,
    1131             :         argSeq9,
    1132             :         argSeq10,
    1133             :         argSeq11,
    1134             :         argSeq12,
    1135             :         argSeq13,
    1136             :         argSeq14,
    1137           4 :         argSeq15);
    1138           1 : }
    1139             : 
    1140           4 : Reference< XCurrentContextChecker > Test_Impl::getCurrentContextChecker()
    1141             :     throw (RuntimeException)
    1142             : {
    1143           4 :     return new testtools::bridgetest::CurrentContextChecker;
    1144             : }
    1145             : 
    1146             : // XServiceInfo
    1147             : //__________________________________________________________________________________________________
    1148           0 : OUString Test_Impl::getImplementationName()
    1149             :     throw (RuntimeException)
    1150             : {
    1151           0 :     return OUString( IMPLNAME );
    1152             : }
    1153             : //__________________________________________________________________________________________________
    1154           0 : sal_Bool Test_Impl::supportsService( const OUString & rServiceName )
    1155             :     throw (RuntimeException)
    1156             : {
    1157           0 :     const Sequence< OUString > & rSNL = getSupportedServiceNames();
    1158           0 :     const OUString * pArray = rSNL.getConstArray();
    1159           0 :     for ( sal_Int32 nPos = rSNL.getLength(); nPos--; )
    1160             :     {
    1161           0 :         if (pArray[nPos] == rServiceName)
    1162           0 :             return sal_True;
    1163             :     }
    1164           0 :     return sal_False;
    1165             : }
    1166             : //__________________________________________________________________________________________________
    1167           0 : Sequence< OUString > Test_Impl::getSupportedServiceNames()
    1168             :     throw (RuntimeException)
    1169             : {
    1170           0 :     return bridge_object::getSupportedServiceNames();
    1171             : }
    1172             : 
    1173             : // ...
    1174             : 
    1175             : //==================================================================================================
    1176           1 : static Reference< XInterface > SAL_CALL Test_Impl_create(
    1177             :     SAL_UNUSED_PARAMETER const Reference< XMultiServiceFactory > & )
    1178             : {
    1179           1 :     return Reference< XInterface >( (XBridgeTest *)new Test_Impl() );
    1180             : }
    1181             : 
    1182             : }
    1183             : 
    1184             : extern "C"
    1185             : {
    1186           1 : SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(
    1187             :     const sal_Char * pImplName, SAL_UNUSED_PARAMETER void * pServiceManager,
    1188             :     SAL_UNUSED_PARAMETER void * )
    1189             : {
    1190           1 :     void * pRet = 0;
    1191             : 
    1192           1 :     if (pServiceManager && rtl_str_compare( pImplName, IMPLNAME ) == 0)
    1193             :     {
    1194             :         Reference< XSingleServiceFactory > xFactory( createSingleFactory(
    1195             :             reinterpret_cast< XMultiServiceFactory * >( pServiceManager ),
    1196             :             OUString( IMPLNAME ),
    1197             :             bridge_object::Test_Impl_create,
    1198           1 :             bridge_object::getSupportedServiceNames() ) );
    1199             : 
    1200           1 :         if (xFactory.is())
    1201             :         {
    1202           1 :             xFactory->acquire();
    1203           1 :             pRet = xFactory.get();
    1204           1 :         }
    1205             :     }
    1206             : 
    1207           1 :     return pRet;
    1208             : }
    1209             : }
    1210             : 
    1211             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10