diff options
author | RĂ¼diger Timm <rt@openoffice.org> | 2006-01-10 14:55:19 +0000 |
---|---|---|
committer | RĂ¼diger Timm <rt@openoffice.org> | 2006-01-10 14:55:19 +0000 |
commit | f120c28c8a624fb14d8a4348ca91c0ffffb8da51 (patch) | |
tree | f24220d606ba8f78a66af95861074669a007bca0 /cppu/qa | |
parent | c95dacf6d544882dab8bfcafccb432d750666334 (diff) |
INTEGRATION: CWS sb41 (1.1.2); FILE ADDED
2005/12/13 09:44:05 sb 1.1.2.2: #i57855# Improved tests.
2005/11/24 08:19:41 sb 1.1.2.1: #i57855# Replaced getCppuType (which is still there for backwards compatibility) with new cppu::UnoType and helper cppu::getTypeFavourUnsigned, as GCC 4.1 started to complain about non-conforming uses of getCppuType in template code.
Diffstat (limited to 'cppu/qa')
-rw-r--r-- | cppu/qa/test_unotype.cxx | 557 |
1 files changed, 557 insertions, 0 deletions
diff --git a/cppu/qa/test_unotype.cxx b/cppu/qa/test_unotype.cxx new file mode 100644 index 000000000..ecbcd8fbe --- /dev/null +++ b/cppu/qa/test_unotype.cxx @@ -0,0 +1,557 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: test_unotype.cxx,v $ + * + * $Revision: 1.2 $ + * + * last change: $Author: rt $ $Date: 2006-01-10 15:55:19 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + +#include "sal/config.h" + +#include <typeinfo> + +#include "com/sun/star/beans/Optional.hpp" +#include "com/sun/star/beans/PropertyChangeEvent.hpp" +#include "com/sun/star/lang/EventObject.hpp" +#include "com/sun/star/uno/Exception.hpp" +#include "com/sun/star/uno/Reference.hxx" +#include "com/sun/star/uno/RuntimeException.hpp" +#include "com/sun/star/uno/Sequence.hxx" +#include "com/sun/star/uno/Type.hxx" +#include "com/sun/star/uno/TypeClass.hpp" +#include "com/sun/star/uno/XComponentContext.hpp" +#include "com/sun/star/uno/XInterface.hpp" +#include "cppu/unotype.hxx" +#include "cppunit/simpleheader.hxx" +#include "rtl/ustring.h" +#include "rtl/ustring.hxx" +#include "sal/types.h" + +namespace com { namespace sun { namespace star { namespace uno { + class Any; +} } } } + +namespace { + +namespace css = com::sun::star; + +struct DerivedStruct1: css::lang::EventObject {}; + +struct DerivedStruct2: css::beans::PropertyChangeEvent {}; + +struct DerivedException1: css::uno::Exception {}; + +struct DerivedException2: css::uno::RuntimeException {}; + +struct DerivedInterface1: css::uno::XInterface {}; + +struct DerivedInterface2: css::uno::XComponentContext {}; + +class Test: public ::CppUnit::TestFixture { +public: + void testUnoType(); + + void testGetTypeFavourUnsigned(); + + CPPUNIT_TEST_SUITE(Test); + CPPUNIT_TEST(testUnoType); + CPPUNIT_TEST(testGetTypeFavourUnsigned); + CPPUNIT_TEST_SUITE_END(); +}; + +void Test::testUnoType() { + css::uno::Type t; + t = ::cppu::UnoType< ::cppu::UnoVoidType >::get(); + CPPUNIT_ASSERT_EQUAL(css::uno::TypeClass_VOID, t.getTypeClass()); + CPPUNIT_ASSERT_EQUAL( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("void")), t.getTypeName()); + t = ::cppu::UnoType< bool >::get(); + CPPUNIT_ASSERT_EQUAL(css::uno::TypeClass_BOOLEAN, t.getTypeClass()); + CPPUNIT_ASSERT_EQUAL( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("boolean")), + t.getTypeName()); + CPPUNIT_ASSERT(::cppu::UnoType< ::sal_Bool >::get() == t); + t = ::cppu::UnoType< ::sal_Int8 >::get(); + CPPUNIT_ASSERT_EQUAL(css::uno::TypeClass_BYTE, t.getTypeClass()); + CPPUNIT_ASSERT_EQUAL( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("byte")), t.getTypeName()); + t = ::cppu::UnoType< ::sal_Int16 >::get(); + CPPUNIT_ASSERT_EQUAL(css::uno::TypeClass_SHORT, t.getTypeClass()); + CPPUNIT_ASSERT_EQUAL( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("short")), t.getTypeName()); + t = ::cppu::UnoType< ::cppu::UnoUnsignedShortType >::get(); + CPPUNIT_ASSERT_EQUAL(css::uno::TypeClass_UNSIGNED_SHORT, t.getTypeClass()); + CPPUNIT_ASSERT_EQUAL( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("unsigned short")), + t.getTypeName()); + t = ::cppu::UnoType< ::sal_Int32 >::get(); + CPPUNIT_ASSERT_EQUAL(css::uno::TypeClass_LONG, t.getTypeClass()); + CPPUNIT_ASSERT_EQUAL( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("long")), t.getTypeName()); + t = ::cppu::UnoType< ::sal_uInt32 >::get(); + CPPUNIT_ASSERT_EQUAL(css::uno::TypeClass_UNSIGNED_LONG, t.getTypeClass()); + CPPUNIT_ASSERT_EQUAL( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("unsigned long")), + t.getTypeName()); + t = ::cppu::UnoType< ::sal_Int64 >::get(); + CPPUNIT_ASSERT_EQUAL(css::uno::TypeClass_HYPER, t.getTypeClass()); + CPPUNIT_ASSERT_EQUAL( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("hyper")), t.getTypeName()); + t = ::cppu::UnoType< ::sal_uInt64 >::get(); + CPPUNIT_ASSERT_EQUAL(css::uno::TypeClass_UNSIGNED_HYPER, t.getTypeClass()); + CPPUNIT_ASSERT_EQUAL( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("unsigned hyper")), + t.getTypeName()); + t = ::cppu::UnoType< float >::get(); + CPPUNIT_ASSERT_EQUAL(css::uno::TypeClass_FLOAT, t.getTypeClass()); + CPPUNIT_ASSERT_EQUAL( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("float")), t.getTypeName()); + t = ::cppu::UnoType< double >::get(); + CPPUNIT_ASSERT_EQUAL(css::uno::TypeClass_DOUBLE, t.getTypeClass()); + CPPUNIT_ASSERT_EQUAL( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("double")), + t.getTypeName()); + t = ::cppu::UnoType< ::cppu::UnoCharType >::get(); + CPPUNIT_ASSERT_EQUAL(css::uno::TypeClass_CHAR, t.getTypeClass()); + CPPUNIT_ASSERT_EQUAL( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("char")), t.getTypeName()); + t = ::cppu::UnoType< ::rtl::OUString >::get(); + CPPUNIT_ASSERT_EQUAL(css::uno::TypeClass_STRING, t.getTypeClass()); + CPPUNIT_ASSERT_EQUAL( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("string")), + t.getTypeName()); + t = ::cppu::UnoType< css::uno::Type >::get(); + CPPUNIT_ASSERT_EQUAL(css::uno::TypeClass_TYPE, t.getTypeClass()); + CPPUNIT_ASSERT_EQUAL( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("type")), t.getTypeName()); + t = ::cppu::UnoType< css::uno::Any >::get(); + CPPUNIT_ASSERT_EQUAL(css::uno::TypeClass_ANY, t.getTypeClass()); + CPPUNIT_ASSERT_EQUAL( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("any")), t.getTypeName()); + t = ::cppu::UnoType< ::cppu::UnoSequenceType< ::sal_Int8 > >::get(); + CPPUNIT_ASSERT_EQUAL(css::uno::TypeClass_SEQUENCE, t.getTypeClass()); + CPPUNIT_ASSERT_EQUAL( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("[]byte")), + t.getTypeName()); + CPPUNIT_ASSERT( + ::cppu::UnoType< css::uno::Sequence< ::sal_Int8 > >::get() == t); + t = ::cppu::UnoType< + ::cppu::UnoSequenceType< ::cppu::UnoUnsignedShortType > >::get(); + CPPUNIT_ASSERT_EQUAL(css::uno::TypeClass_SEQUENCE, t.getTypeClass()); + CPPUNIT_ASSERT_EQUAL( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("[]unsigned short")), + t.getTypeName()); + t = ::cppu::UnoType< + ::cppu::UnoSequenceType< ::cppu::UnoCharType > >::get(); + CPPUNIT_ASSERT_EQUAL(css::uno::TypeClass_SEQUENCE, t.getTypeClass()); + CPPUNIT_ASSERT_EQUAL( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("[]char")), + t.getTypeName()); + t = ::cppu::UnoType< ::cppu::UnoSequenceType< ::cppu::UnoSequenceType< + ::sal_Int8 > > >::get(); + CPPUNIT_ASSERT_EQUAL(css::uno::TypeClass_SEQUENCE, t.getTypeClass()); + CPPUNIT_ASSERT_EQUAL( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("[][]byte")), + t.getTypeName()); + CPPUNIT_ASSERT( + ::cppu::UnoType< + css::uno::Sequence< css::uno::Sequence< ::sal_Int8 > > >::get() == t); + t = ::cppu::UnoType< ::cppu::UnoSequenceType< ::cppu::UnoSequenceType< + ::cppu::UnoUnsignedShortType > > >::get(); + CPPUNIT_ASSERT_EQUAL(css::uno::TypeClass_SEQUENCE, t.getTypeClass()); + CPPUNIT_ASSERT_EQUAL( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("[][]unsigned short")), + t.getTypeName()); + t = ::cppu::UnoType< ::cppu::UnoSequenceType< ::cppu::UnoSequenceType< + ::cppu::UnoCharType > > >::get(); + CPPUNIT_ASSERT_EQUAL(css::uno::TypeClass_SEQUENCE, t.getTypeClass()); + CPPUNIT_ASSERT_EQUAL( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("[][]char")), + t.getTypeName()); + t = ::cppu::UnoType< css::uno::TypeClass >::get(); + CPPUNIT_ASSERT_EQUAL(css::uno::TypeClass_ENUM, t.getTypeClass()); + CPPUNIT_ASSERT_EQUAL( + ::rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("com.sun.star.uno.TypeClass")), + t.getTypeName()); + t = ::cppu::UnoType< css::lang::EventObject >::get(); + CPPUNIT_ASSERT_EQUAL(css::uno::TypeClass_STRUCT, t.getTypeClass()); + CPPUNIT_ASSERT_EQUAL( + ::rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("com.sun.star.lang.EventObject")), + t.getTypeName()); + CPPUNIT_ASSERT(::cppu::UnoType< DerivedStruct1 >::get() == t); + t = ::cppu::UnoType< css::beans::PropertyChangeEvent >::get(); + CPPUNIT_ASSERT_EQUAL(css::uno::TypeClass_STRUCT, t.getTypeClass()); + CPPUNIT_ASSERT_EQUAL( + ::rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.beans.PropertyChangeEvent")), + t.getTypeName()); +#if !(defined __SUNPRO_CC && __SUNPRO_CC <= 0x550) // erroneous ambiguity stated + CPPUNIT_ASSERT(::cppu::UnoType< DerivedStruct2 >::get() == t); +#endif + t = ::cppu::UnoType< css::beans::Optional< ::sal_Int8 > >::get(); + CPPUNIT_ASSERT_EQUAL(css::uno::TypeClass_STRUCT, t.getTypeClass()); + CPPUNIT_ASSERT_EQUAL( + ::rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("com.sun.star.beans.Optional<byte>")), + t.getTypeName()); + t = ::cppu::UnoType< css::uno::Exception >::get(); + CPPUNIT_ASSERT_EQUAL(css::uno::TypeClass_EXCEPTION, t.getTypeClass()); + CPPUNIT_ASSERT_EQUAL( + ::rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("com.sun.star.uno.Exception")), + t.getTypeName()); + CPPUNIT_ASSERT(::cppu::UnoType< DerivedException1 >::get() == t); + t = ::cppu::UnoType< css::uno::RuntimeException >::get(); + CPPUNIT_ASSERT_EQUAL(css::uno::TypeClass_EXCEPTION, t.getTypeClass()); + CPPUNIT_ASSERT_EQUAL( + ::rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("com.sun.star.uno.RuntimeException")), + t.getTypeName()); +#if !(defined __SUNPRO_CC && __SUNPRO_CC <= 0x550) // erroneous ambiguity stated + CPPUNIT_ASSERT(::cppu::UnoType< DerivedException2 >::get() == t); +#endif + t = ::cppu::UnoType< css::uno::XInterface >::get(); + CPPUNIT_ASSERT_EQUAL(css::uno::TypeClass_INTERFACE, t.getTypeClass()); + CPPUNIT_ASSERT_EQUAL( + ::rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("com.sun.star.uno.XInterface")), + t.getTypeName()); + CPPUNIT_ASSERT( + ::cppu::UnoType< css::uno::Reference< css::uno::XInterface > >::get() == + t); + CPPUNIT_ASSERT(::cppu::UnoType< DerivedInterface1 >::get() == t); + CPPUNIT_ASSERT( + ::cppu::UnoType< css::uno::Reference< DerivedInterface1 > >::get() == + t); + t = ::cppu::UnoType< css::uno::XComponentContext >::get(); + CPPUNIT_ASSERT_EQUAL(css::uno::TypeClass_INTERFACE, t.getTypeClass()); + CPPUNIT_ASSERT_EQUAL( + ::rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("com.sun.star.uno.XComponentContext")), + t.getTypeName()); + CPPUNIT_ASSERT( + ::cppu::UnoType< + css::uno::Reference< css::uno::XComponentContext > >::get() == t); +#if !(defined __SUNPRO_CC && __SUNPRO_CC <= 0x550) // erroneous ambiguity stated + CPPUNIT_ASSERT(::cppu::UnoType< DerivedInterface2 >::get() == t); + CPPUNIT_ASSERT( + ::cppu::UnoType< css::uno::Reference< DerivedInterface2 > >::get() == + t); +#endif +} + +void Test::testGetTypeFavourUnsigned() { + CPPUNIT_ASSERT(typeid(::sal_Unicode) == typeid(::sal_uInt16)); + CPPUNIT_ASSERT( + ::getCppuType(static_cast< ::sal_Unicode * >(0)) == + ::getCppuType(static_cast< ::sal_uInt16 * >(0))); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourUnsigned(static_cast< ::cppu::UnoVoidType *>(0)) == + ::cppu::UnoType< ::cppu::UnoVoidType >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourUnsigned(static_cast< bool *>(0)) == + ::cppu::UnoType< bool >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourUnsigned(static_cast< bool *>(0)) == + ::getCppuType(static_cast< bool * >(0))); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourUnsigned(static_cast< ::sal_Bool *>(0)) == + ::cppu::UnoType< bool >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourUnsigned(static_cast< ::sal_Bool *>(0)) == + ::getCppuType(static_cast< ::sal_Bool * >(0))); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourUnsigned(static_cast< ::sal_Int8 *>(0)) == + ::cppu::UnoType< ::sal_Int8 >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourUnsigned(static_cast< ::sal_Int8 *>(0)) == + ::getCppuType(static_cast< ::sal_Int8 * >(0))); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourUnsigned(static_cast< ::sal_Int16 *>(0)) == + ::cppu::UnoType< ::sal_Int16 >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourUnsigned(static_cast< ::sal_Int16 *>(0)) == + ::getCppuType(static_cast< ::sal_Int16 * >(0))); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourUnsigned( + static_cast< ::cppu::UnoUnsignedShortType *>(0)) == + ::cppu::UnoType< ::cppu::UnoUnsignedShortType >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourUnsigned(static_cast< ::sal_uInt16 *>(0)) == + ::cppu::UnoType< ::cppu::UnoUnsignedShortType >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourUnsigned(static_cast< ::sal_uInt16 *>(0)) == + ::getCppuType(static_cast< ::sal_uInt16 * >(0))); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourUnsigned(static_cast< ::sal_Int32 *>(0)) == + ::cppu::UnoType< ::sal_Int32 >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourUnsigned(static_cast< ::sal_Int32 *>(0)) == + ::getCppuType(static_cast< ::sal_Int32 * >(0))); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourUnsigned(static_cast< ::sal_uInt32 *>(0)) == + ::cppu::UnoType< ::sal_uInt32 >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourUnsigned(static_cast< ::sal_uInt32 *>(0)) == + ::getCppuType(static_cast< ::sal_uInt32 * >(0))); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourUnsigned(static_cast< ::sal_Int64 *>(0)) == + ::cppu::UnoType< ::sal_Int64 >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourUnsigned(static_cast< ::sal_Int64 *>(0)) == + ::getCppuType(static_cast< ::sal_Int64 * >(0))); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourUnsigned(static_cast< ::sal_uInt64 *>(0)) == + ::cppu::UnoType< ::sal_uInt64 >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourUnsigned(static_cast< ::sal_uInt64 *>(0)) == + ::getCppuType(static_cast< ::sal_uInt64 * >(0))); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourUnsigned(static_cast< float *>(0)) == + ::cppu::UnoType< float >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourUnsigned(static_cast< float *>(0)) == + ::getCppuType(static_cast< float * >(0))); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourUnsigned(static_cast< double *>(0)) == + ::cppu::UnoType< double >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourUnsigned(static_cast< double *>(0)) == + ::getCppuType(static_cast< double * >(0))); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourUnsigned(static_cast< ::cppu::UnoCharType *>(0)) == + ::cppu::UnoType< ::cppu::UnoCharType >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourUnsigned(static_cast< ::sal_Unicode *>(0)) == + ::cppu::UnoType< ::cppu::UnoUnsignedShortType >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourUnsigned(static_cast< ::sal_Unicode *>(0)) == + ::getCppuType(static_cast< ::sal_Unicode * >(0))); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourUnsigned(static_cast< ::rtl::OUString *>(0)) == + ::cppu::UnoType< ::rtl::OUString >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourUnsigned(static_cast< ::rtl::OUString *>(0)) == + ::getCppuType(static_cast< ::rtl::OUString * >(0))); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourUnsigned(static_cast< css::uno::Type *>(0)) == + ::cppu::UnoType< css::uno::Type >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourUnsigned(static_cast< css::uno::Type *>(0)) == + ::getCppuType(static_cast< css::uno::Type * >(0))); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourUnsigned(static_cast< css::uno::Any *>(0)) == + ::cppu::UnoType< css::uno::Any >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourUnsigned(static_cast< css::uno::Any *>(0)) == + ::getCppuType(static_cast< css::uno::Any * >(0))); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourUnsigned( + static_cast< + ::cppu::UnoSequenceType< ::cppu::UnoUnsignedShortType > *>(0)) == + ::cppu::UnoType< + ::cppu::UnoSequenceType< ::cppu::UnoUnsignedShortType > >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourUnsigned( + static_cast< css::uno::Sequence< ::sal_uInt16 > *>(0)) == + ::cppu::UnoType< + ::cppu::UnoSequenceType< ::cppu::UnoUnsignedShortType > >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourUnsigned( + static_cast< css::uno::Sequence< ::sal_uInt16 > *>(0)) == + ::getCppuType(static_cast< css::uno::Sequence< ::sal_uInt16 > * >(0))); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourUnsigned( + static_cast< ::cppu::UnoSequenceType< ::cppu::UnoSequenceType< + ::cppu::UnoUnsignedShortType > > *>(0)) == + ::cppu::UnoType< ::cppu::UnoSequenceType< ::cppu::UnoSequenceType< + ::cppu::UnoUnsignedShortType > > >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourUnsigned( + static_cast< css::uno::Sequence< css::uno::Sequence< + ::sal_uInt16 > > *>(0)) == + ::cppu::UnoType< ::cppu::UnoSequenceType< ::cppu::UnoSequenceType< + ::cppu::UnoUnsignedShortType > > >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourUnsigned( + static_cast< css::uno::Sequence< css::uno::Sequence< + ::sal_uInt16 > > *>(0)) == + ::getCppuType( + static_cast< css::uno::Sequence< css::uno::Sequence< + ::sal_uInt16 > > * >(0))); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourUnsigned( + static_cast< css::uno::Sequence< ::sal_Unicode > *>(0)) == + ::cppu::UnoType< + ::cppu::UnoSequenceType< ::cppu::UnoUnsignedShortType > >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourUnsigned( + static_cast< css::uno::Sequence< ::sal_Unicode > *>(0)) == + ::getCppuType(static_cast< css::uno::Sequence< ::sal_Unicode > *>(0))); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourUnsigned( + static_cast< css::uno::Sequence< css::uno::Sequence< + ::sal_Unicode > > *>(0)) == + ::cppu::UnoType< ::cppu::UnoSequenceType< ::cppu::UnoSequenceType< + ::cppu::UnoUnsignedShortType > > >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourUnsigned( + static_cast< css::uno::Sequence< css::uno::Sequence< + ::sal_Unicode > > *>(0)) == + ::getCppuType( + static_cast< css::uno::Sequence< css::uno::Sequence< + ::sal_Unicode > > *>(0))); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourUnsigned(static_cast< css::uno::TypeClass *>(0)) == + ::cppu::UnoType< css::uno::TypeClass >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourUnsigned(static_cast< css::uno::TypeClass *>(0)) == + ::getCppuType(static_cast< css::uno::TypeClass * >(0))); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourUnsigned( + static_cast< css::lang::EventObject *>(0)) == + ::cppu::UnoType< css::lang::EventObject >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourUnsigned( + static_cast< css::lang::EventObject *>(0)) == + ::getCppuType(static_cast< css::lang::EventObject * >(0))); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourUnsigned(static_cast< DerivedStruct1 *>(0)) == + ::cppu::UnoType< css::lang::EventObject >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourUnsigned(static_cast< DerivedStruct1 *>(0)) == + ::getCppuType(static_cast< DerivedStruct1 * >(0))); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourUnsigned( + static_cast< css::beans::PropertyChangeEvent *>(0)) == + ::cppu::UnoType< css::beans::PropertyChangeEvent >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourUnsigned( + static_cast< css::beans::PropertyChangeEvent *>(0)) == + ::getCppuType(static_cast< css::beans::PropertyChangeEvent * >(0))); +#if !(defined __SUNPRO_CC && __SUNPRO_CC <= 0x550) // erroneous ambiguity stated + CPPUNIT_ASSERT( + ::cppu::getTypeFavourUnsigned(static_cast< DerivedStruct2 *>(0)) == + ::cppu::UnoType< css::beans::PropertyChangeEvent >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourUnsigned(static_cast< DerivedStruct2 *>(0)) == + ::getCppuType(static_cast< DerivedStruct2 *>(0))); +#endif + CPPUNIT_ASSERT( + ::cppu::getTypeFavourUnsigned( + static_cast< css::beans::Optional< ::sal_Int8 > *>(0)) == + ::cppu::UnoType< css::beans::Optional< ::sal_Int8 > >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourUnsigned( + static_cast< css::beans::Optional< ::sal_Int8 > *>(0)) == + ::getCppuType(static_cast< css::beans::Optional< ::sal_Int8 > *>(0))); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourUnsigned(static_cast< css::uno::Exception *>(0)) == + ::cppu::UnoType< css::uno::Exception >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourUnsigned(static_cast< css::uno::Exception *>(0)) == + ::getCppuType(static_cast< css::uno::Exception *>(0))); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourUnsigned(static_cast< DerivedException1 *>(0)) == + ::cppu::UnoType< css::uno::Exception >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourUnsigned(static_cast< DerivedException1 *>(0)) == + ::getCppuType(static_cast< DerivedException1 *>(0))); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourUnsigned( + static_cast< css::uno::RuntimeException *>(0)) == + ::cppu::UnoType< css::uno::RuntimeException >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourUnsigned( + static_cast< css::uno::RuntimeException *>(0)) == + ::getCppuType(static_cast< css::uno::RuntimeException *>(0))); +#if !(defined __SUNPRO_CC && __SUNPRO_CC <= 0x550) // erroneous ambiguity stated + CPPUNIT_ASSERT( + ::cppu::getTypeFavourUnsigned(static_cast< DerivedException2 *>(0)) == + ::cppu::UnoType< css::uno::RuntimeException >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourUnsigned(static_cast< DerivedException2 *>(0)) == + ::getCppuType(static_cast< DerivedException2 *>(0))); +#endif + CPPUNIT_ASSERT( + ::cppu::getTypeFavourUnsigned( + static_cast< css::uno::XInterface *>(0)) == + ::cppu::UnoType< css::uno::XInterface >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourUnsigned( + static_cast< css::uno::Reference< css::uno::XInterface > *>(0)) == + ::cppu::UnoType< css::uno::XInterface >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourUnsigned( + static_cast< css::uno::Reference< css::uno::XInterface > *>(0)) == + ::getCppuType( + static_cast< css::uno::Reference< css::uno::XInterface > *>(0))); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourUnsigned(static_cast< DerivedInterface1 *>(0)) == + ::cppu::UnoType< css::uno::XInterface >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourUnsigned( + static_cast< css::uno::Reference< DerivedInterface1 > *>(0)) == + ::cppu::UnoType< css::uno::XInterface >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourUnsigned( + static_cast< css::uno::XComponentContext *>(0)) == + ::cppu::UnoType< css::uno::XComponentContext >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourUnsigned( + static_cast< + css::uno::Reference< css::uno::XComponentContext > *>(0)) == + ::cppu::UnoType< css::uno::XComponentContext >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourUnsigned( + static_cast< + css::uno::Reference< css::uno::XComponentContext > *>(0)) == + ::getCppuType( + static_cast< + css::uno::Reference< css::uno::XComponentContext > *>(0))); +#if !(defined __SUNPRO_CC && __SUNPRO_CC <= 0x550) // erroneous ambiguity stated + CPPUNIT_ASSERT( + ::cppu::getTypeFavourUnsigned(static_cast< DerivedInterface2 *>(0)) == + ::cppu::UnoType< css::uno::XComponentContext >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourUnsigned( + static_cast< css::uno::Reference< DerivedInterface2 > *>(0)) == + ::cppu::UnoType< css::uno::XComponentContext >::get()); +#endif +} + +CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(Test, "alltests"); + +} + +NOADDITIONAL; |