diff options
Diffstat (limited to 'cppu/qa')
-rw-r--r-- | cppu/qa/makefile.mk | 98 | ||||
-rw-r--r-- | cppu/qa/test_any.cxx | 2333 | ||||
-rw-r--r-- | cppu/qa/test_recursion.cxx | 60 | ||||
-rw-r--r-- | cppu/qa/test_reference.cxx | 159 | ||||
-rw-r--r-- | cppu/qa/test_unotype.cxx | 815 | ||||
-rw-r--r-- | cppu/qa/types.idl | 66 | ||||
-rw-r--r-- | cppu/qa/version.map | 38 |
7 files changed, 3569 insertions, 0 deletions
diff --git a/cppu/qa/makefile.mk b/cppu/qa/makefile.mk new file mode 100644 index 000000000000..8b720c832cf4 --- /dev/null +++ b/cppu/qa/makefile.mk @@ -0,0 +1,98 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2008 by Sun Microsystems, Inc. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# $RCSfile: makefile.mk,v $ +# +# $Revision: 1.6.14.1 $ +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# <http://www.openoffice.org/license.html> +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +PRJ := .. +PRJNAME := cppu +TARGET := qa + +ENABLE_EXCEPTIONS := TRUE + +.INCLUDE: settings.mk + +DLLPRE = # no leading "lib" on .so files + +INCPRE += $(MISC)$/$(TARGET)$/inc + +SHL1TARGET = $(TARGET)_any +SHL1OBJS = $(SLO)$/test_any.obj +SHL1STDLIBS = $(CPPULIB) $(CPPUNITLIB) $(TESTSHL2LIB) $(SALLIB) +SHL1VERSIONMAP = version.map +SHL1IMPLIB = i$(SHL1TARGET) +DEF1NAME = $(SHL1TARGET) + +SHL2TARGET = $(TARGET)_unotype +SHL2OBJS = $(SLO)$/test_unotype.obj +SHL2STDLIBS = $(CPPULIB) $(CPPUNITLIB) $(TESTSHL2LIB) $(SALLIB) +SHL2VERSIONMAP = version.map +SHL2IMPLIB = i$(SHL2TARGET) +DEF2NAME = $(SHL2TARGET) + +SHL3TARGET = $(TARGET)_reference +SHL3OBJS = $(SLO)$/test_reference.obj +SHL3STDLIBS = $(CPPULIB) $(CPPUNITLIB) $(TESTSHL2LIB) $(SALLIB) +SHL3VERSIONMAP = version.map +SHL3IMPLIB = i$(SHL3TARGET) +DEF3NAME = $(SHL3TARGET) + +SHL4TARGET = $(TARGET)_recursion +SHL4OBJS = $(SLO)$/test_recursion.obj +SHL4STDLIBS = $(CPPULIB) $(CPPUNITLIB) $(TESTSHL2LIB) $(SALLIB) +SHL4VERSIONMAP = version.map +SHL4IMPLIB = i$(SHL4TARGET) +DEF4NAME = $(SHL4TARGET) + +SLOFILES = $(SHL1OBJS) $(SHL2OBJS) $(SHL3OBJS) $(SHL4OBJS) + +.INCLUDE: target.mk + +ALLTAR: test + +$(SHL1OBJS): $(MISC)$/$(TARGET).cppumaker.flag + +$(MISC)$/$(TARGET).cppumaker.flag: $(MISC)$/$(TARGET).rdb + - $(MKDIRHIER) $(MISC)$/$(TARGET)$/inc + $(CPPUMAKER) -O$(MISC)$/$(TARGET)$/inc -BUCR -C $< \ + $(SOLARBINDIR)$/udkapi.rdb + $(TOUCH) $@ + +$(MISC)$/$(TARGET).rdb: $(MISC)$/$(TARGET)$/types.urd + - rm $@ + $(REGMERGE) $@ /UCR $< + +$(MISC)$/$(TARGET)$/types.urd: types.idl + - $(MKDIR) $(MISC)$/$(TARGET) + $(IDLC) -O$(MISC)$/$(TARGET) -I$(SOLARIDLDIR) -cid -we $< + +test .PHONY: $(SHL1TARGETN) $(SHL2TARGETN) $(SHL3TARGETN) $(SHL4TARGETN) + $(TESTSHL2) $(SHL1TARGETN) + $(TESTSHL2) $(SHL2TARGETN) + $(TESTSHL2) $(SHL3TARGETN) + $(TESTSHL2) $(SHL4TARGETN) diff --git a/cppu/qa/test_any.cxx b/cppu/qa/test_any.cxx new file mode 100644 index 000000000000..785af529e51a --- /dev/null +++ b/cppu/qa/test_any.cxx @@ -0,0 +1,2333 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: test_any.cxx,v $ + * $Revision: 1.6 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_cppu.hxx" + +#include "sal/config.h" + +#include <stdlib.h> // wntmsci10 does not like <cstdlib> + +#include "Enum1.hpp" +#include "Enum2.hpp" +#include "Exception1.hpp" +#include "Exception2.hpp" +#include "Exception2a.hpp" +#include "Exception2b.hpp" +#include "Interface1.hpp" +#include "Interface2.hpp" +#include "Interface2a.hpp" +#include "Interface2b.hpp" +#include "Interface3.hpp" +#include "Poly.hpp" +#include "Struct1.hpp" +#include "Struct2.hpp" +#include "Struct2a.hpp" +#include "Struct2b.hpp" +#include "boost/type_traits/is_same.hpp" +#include "com/sun/star/uno/Any.hxx" +#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/XInterface.hpp" +#include "testshl/simpleheader.hxx" +#include "osl/diagnose.h" +#include "osl/interlck.h" +#include "rtl/string.h" +#include "rtl/ustring.h" +#include "rtl/ustring.hxx" +#include "sal/types.h" + +namespace { + +namespace css = com::sun::star; + +class Base { +public: + Base(): m_count(0) {} + + void acquire() { + if (osl_incrementInterlockedCount(&m_count) == SAL_MAX_INT32) { + abort(); + } + } + + void release() { + if (osl_decrementInterlockedCount(&m_count) == 0) { + delete this; + } + } + +protected: + virtual ~Base() {} + +private: + Base(Base &); // not declared + void operator =(Base &); // not declared + + oslInterlockedCount m_count; +}; + +class Impl1: public Interface1, private Base { +public: + virtual css::uno::Any SAL_CALL queryInterface(css::uno::Type const & type) + throw (css::uno::RuntimeException) + { + if (type + == getCppuType< css::uno::Reference< css::uno::XInterface > >()) + { + css::uno::Reference< css::uno::XInterface > ref( + static_cast< css::uno::XInterface * >(this)); + return css::uno::Any(&ref, type); + } else if (type == getCppuType< css::uno::Reference< Interface1 > >()) { + css::uno::Reference< Interface1 > ref(this); + return css::uno::Any(&ref, type); + } else { + return css::uno::Any(); + } + } + + virtual void SAL_CALL acquire() throw () { + Base::acquire(); + } + + virtual void SAL_CALL release() throw () { + Base::release(); + } +}; + +class Impl2: public Interface2a, public Interface3, private Base { +public: + virtual css::uno::Any SAL_CALL queryInterface(css::uno::Type const & type) + throw (css::uno::RuntimeException) + { + if (type + == getCppuType< css::uno::Reference< css::uno::XInterface > >()) + { + css::uno::Reference< css::uno::XInterface > ref( + static_cast< css::uno::XInterface * >( + static_cast< Interface2a * >(this))); + return css::uno::Any(&ref, type); + } else if (type == getCppuType< css::uno::Reference< Interface2 > >()) { + css::uno::Reference< Interface2 > ref(this); + return css::uno::Any(&ref, type); + } else if (type == getCppuType< css::uno::Reference< Interface2a > >()) + { + css::uno::Reference< Interface2a > ref(this); + return css::uno::Any(&ref, type); + } else if (type == getCppuType< css::uno::Reference< Interface3 > >()) { + css::uno::Reference< Interface3 > ref(this); + return css::uno::Any(&ref, type); + } else { + return css::uno::Any(); + } + } + + virtual void SAL_CALL acquire() throw () { + Base::acquire(); + } + + virtual void SAL_CALL release() throw () { + Base::release(); + } +}; + +class Impl2b: public Interface2b, private Base { +public: + virtual css::uno::Any SAL_CALL queryInterface(css::uno::Type const & type) + throw (css::uno::RuntimeException) + { + if (type + == getCppuType< css::uno::Reference< css::uno::XInterface > >()) + { + css::uno::Reference< css::uno::XInterface > ref( + static_cast< css::uno::XInterface * >( + static_cast< Interface2a * >(this))); + return css::uno::Any(&ref, type); + } else if (type == getCppuType< css::uno::Reference< Interface2 > >()) { + css::uno::Reference< Interface2 > ref(this); + return css::uno::Any(&ref, type); + } else if (type == getCppuType< css::uno::Reference< Interface2a > >()) + { + css::uno::Reference< Interface2a > ref(this); + return css::uno::Any(&ref, type); + } else if (type == getCppuType< css::uno::Reference< Interface2b > >()) + { + css::uno::Reference< Interface2b > ref(this); + return css::uno::Any(&ref, type); + } else { + return css::uno::Any(); + } + } + + virtual void SAL_CALL acquire() throw () { + Base::acquire(); + } + + virtual void SAL_CALL release() throw () { + Base::release(); + } +}; + +class Test: public CppUnit::TestFixture { +public: + void testVoid(); + + void testBoolean(); + + void testByte(); + + void testShort(); + + void testUnsignedShort(); + + void testLong(); + + void testUnsignedLong(); + + void testHyper(); + + void testUnsignedHyper(); + + void testFloat(); + + void testDouble(); + + void testChar(); + + void testString(); + + void testType(); + + void testSequence(); + + void testEnum(); + + void testStruct(); + + void testPoly(); + + void testException(); + + void testInterface(); + + void testNull(); + + CPPUNIT_TEST_SUITE(Test); + CPPUNIT_TEST(testVoid); + CPPUNIT_TEST(testBoolean); + CPPUNIT_TEST(testByte); + CPPUNIT_TEST(testShort); + CPPUNIT_TEST(testUnsignedShort); + CPPUNIT_TEST(testLong); + CPPUNIT_TEST(testUnsignedLong); + CPPUNIT_TEST(testHyper); + CPPUNIT_TEST(testUnsignedHyper); + CPPUNIT_TEST(testFloat); + CPPUNIT_TEST(testDouble); + CPPUNIT_TEST(testChar); + CPPUNIT_TEST(testString); + CPPUNIT_TEST(testType); + CPPUNIT_TEST(testSequence); + CPPUNIT_TEST(testEnum); + CPPUNIT_TEST(testStruct); + CPPUNIT_TEST(testPoly); + CPPUNIT_TEST(testException); + CPPUNIT_TEST(testInterface); + CPPUNIT_TEST(testNull); + CPPUNIT_TEST_SUITE_END(); +}; + +void Test::testVoid() { + css::uno::Any a; + CPPUNIT_ASSERT(a.getValueType() == getVoidCppuType()); + { + bool b = true; + CPPUNIT_ASSERT_MESSAGE("bool", !(a >>= b) && b); + } + { + sal_Bool b = true; + CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b) && b); + } + { + sal_Int8 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a >>= b) && b == 2); + } + { + sal_uInt8 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a >>= b) && b == 2); + } + { + sal_Int16 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a >>= b) && b == 2); + } + { + sal_uInt16 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a >>= b) && b == 2); + } + { + sal_Int32 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a >>= b) && b == 2); + } + { + sal_uInt32 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a >>= b) && b == 2); + } + { + sal_Int64 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_Int64", !(a >>= b) && b == 2); + } + { + sal_uInt64 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_uInt64", !(a >>= b) && b == 2); + } + { + float b = 2; + CPPUNIT_ASSERT_MESSAGE("float", !(a >>= b) && b == 2); + } + { + double b = 2; + CPPUNIT_ASSERT_MESSAGE("double", !(a >>= b) && b == 2); + } + { + sal_Unicode b = '2'; + CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a >>= b) && b == '2'); + } + { + rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2")); + CPPUNIT_ASSERT_MESSAGE( + "rtl::OUString", + !(a >>= b) && b.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2"))); + } + { + css::uno::Type b(getCppuType< rtl::OUString >()); + CPPUNIT_ASSERT_MESSAGE( + "css::uno::Type", + !(a >>= b) && b == getCppuType< rtl::OUString >()); + } + { + css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2"))); + CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a >>= b) && b == a); + } + { + css::uno::Sequence< rtl::OUString > b(2); + CPPUNIT_ASSERT_MESSAGE( + "css::uno::Sequence<rtl::OUString>", !(a >>= b) && b.getLength() == 2); + } + { + Enum1 b = Enum1_M2; + CPPUNIT_ASSERT_MESSAGE("Enum1", !(a >>= b) && b == Enum1_M2); + } + { + Struct1 b(2); + CPPUNIT_ASSERT_MESSAGE("Struct1", !(a >>= b) && b.member == 2); + } + { + Exception1 b( + rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2); + CPPUNIT_ASSERT_MESSAGE("Exception1", !(a >>= b) && b.member == 2); + } + { + css::uno::Reference< Interface1 > i(new Impl1); + css::uno::Reference< Interface1 > b(i); + CPPUNIT_ASSERT_MESSAGE("Interface1", !(a >>= b) && b == i); + } +} + +void Test::testBoolean() { + css::uno::Any a(false); + CPPUNIT_ASSERT(a.getValueType() == getCppuType< sal_Bool >()); + { + bool b = true; + CPPUNIT_ASSERT_MESSAGE("bool", (a >>= b) && !b); + } + { + sal_Bool b = true; + CPPUNIT_ASSERT_MESSAGE("sal_Bool", (a >>= b) && !b); + } + { + sal_Int8 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a >>= b) && b == 2); + } + { + sal_uInt8 b = 2; + if (boost::is_same< sal_uInt8, sal_Bool >::value) { + CPPUNIT_ASSERT_MESSAGE("@sal_uInt8", (a >>= b) && b == 0); + } else { + CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a >>= b) && b == 2); + } + } + { + sal_Int16 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a >>= b) && b == 2); + } + { + sal_uInt16 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a >>= b) && b == 2); + } + { + sal_Int32 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a >>= b) && b == 2); + } + { + sal_uInt32 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a >>= b) && b == 2); + } + { + sal_Int64 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_Int64", !(a >>= b) && b == 2); + } + { + sal_uInt64 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_uInt64", !(a >>= b) && b == 2); + } + { + float b = 2; + CPPUNIT_ASSERT_MESSAGE("float", !(a >>= b) && b == 2); + } + { + double b = 2; + CPPUNIT_ASSERT_MESSAGE("double", !(a >>= b) && b == 2); + } + { + sal_Unicode b = '2'; + CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a >>= b) && b == '2'); + } + { + rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2")); + CPPUNIT_ASSERT_MESSAGE( + "rtl::OUString", + !(a >>= b) && b.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2"))); + } + { + css::uno::Type b(getCppuType< rtl::OUString >()); + CPPUNIT_ASSERT_MESSAGE( + "css::uno::Type", + !(a >>= b) && b == getCppuType< rtl::OUString >()); + } + { + css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2"))); + CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a >>= b) && b == a); + } + { + css::uno::Sequence< rtl::OUString > b(2); + CPPUNIT_ASSERT_MESSAGE( + "css::uno::Sequence<rtl::OUString>", + !(a >>= b) && b.getLength() == 2); + } + { + Enum1 b = Enum1_M2; + CPPUNIT_ASSERT_MESSAGE("Enum1", !(a >>= b) && b == Enum1_M2); + } + { + Struct1 b(2); + CPPUNIT_ASSERT_MESSAGE("Struct1", !(a >>= b) && b.member == 2); + } + { + Exception1 b( + rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2); + CPPUNIT_ASSERT_MESSAGE("Exception1", !(a >>= b) && b.member == 2); + } + { + css::uno::Reference< Interface1 > i(new Impl1); + css::uno::Reference< Interface1 > b(i); + CPPUNIT_ASSERT_MESSAGE("Interface1", !(a >>= b) && b == i); + } +} + +void Test::testByte() { + css::uno::Any a(static_cast< sal_Int8 >(1)); + CPPUNIT_ASSERT(a.getValueType() == getCppuType< sal_Int8 >()); + { + bool b = true; + CPPUNIT_ASSERT_MESSAGE("bool", !(a >>= b) && b); + } + { + sal_Bool b = true; + CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b) && b); + } + { + sal_Int8 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_Int8", (a >>= b) && b == 1); + } + { + sal_uInt8 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a >>= b) && b == 2); + } + { + sal_Int16 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_Int16", (a >>= b) && b == 1); + } + { + sal_uInt16 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_uInt16", (a >>= b) && b == 1); + } + { + sal_Int32 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_Int32", (a >>= b) && b == 1); + } + { + sal_uInt32 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_uInt32", (a >>= b) && b == 1); + } + { + sal_Int64 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_Int64", (a >>= b) && b == 1); + } + { + sal_uInt64 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_uInt64", (a >>= b) && b == 1); + } + { + float b = 2; + CPPUNIT_ASSERT_MESSAGE("float", (a >>= b) && b == 1); + } + { + double b = 2; + CPPUNIT_ASSERT_MESSAGE("double", (a >>= b) && b == 1); + } + { + sal_Unicode b = '2'; + if (boost::is_same< sal_Unicode, sal_uInt16 >::value) { + CPPUNIT_ASSERT_MESSAGE("@sal_Unicode", (a >>= b) && b == 1); + } else { + CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a >>= b) && b == '2'); + } + } + { + rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2")); + CPPUNIT_ASSERT_MESSAGE( + "rtl::OUString", + !(a >>= b) && b.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2"))); + } + { + css::uno::Type b(getCppuType< rtl::OUString >()); + CPPUNIT_ASSERT_MESSAGE( + "css::uno::Type", + !(a >>= b) && b == getCppuType< rtl::OUString >()); + } + { + css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2"))); + CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a >>= b) && b == a); + } + { + css::uno::Sequence< rtl::OUString > b(2); + CPPUNIT_ASSERT_MESSAGE( + "css::uno::Sequence<rtl::OUString>", + !(a >>= b) && b.getLength() == 2); + } + { + Enum1 b = Enum1_M2; + CPPUNIT_ASSERT_MESSAGE("Enum1", !(a >>= b) && b == Enum1_M2); + } + { + Struct1 b(2); + CPPUNIT_ASSERT_MESSAGE("Struct1", !(a >>= b) && b.member == 2); + } + { + Exception1 b( + rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2); + CPPUNIT_ASSERT_MESSAGE("Exception1", !(a >>= b) && b.member == 2); + } + { + css::uno::Reference< Interface1 > i(new Impl1); + css::uno::Reference< Interface1 > b(i); + CPPUNIT_ASSERT_MESSAGE("Interface1", !(a >>= b) && b == i); + } +} + +void Test::testShort() { + css::uno::Any a(static_cast< sal_Int16 >(1)); + CPPUNIT_ASSERT(a.getValueType() == getCppuType< sal_Int16 >()); + { + bool b = true; + CPPUNIT_ASSERT_MESSAGE("bool", !(a >>= b) && b); + } + { + sal_Bool b = true; + CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b) && b); + } + { + sal_Int8 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a >>= b) && b == 2); + } + { + sal_uInt8 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a >>= b) && b == 2); + } + { + sal_Int16 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_Int16", (a >>= b) && b == 1); + } + { + sal_uInt16 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_uInt16", (a >>= b) && b == 1); + } + { + sal_Int32 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_Int32", (a >>= b) && b == 1); + } + { + sal_uInt32 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_uInt32", (a >>= b) && b == 1); + } + { + sal_Int64 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_Int64", (a >>= b) && b == 1); + } + { + sal_uInt64 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_uInt64", (a >>= b) && b == 1); + } + { + float b = 2; + CPPUNIT_ASSERT_MESSAGE("float", (a >>= b) && b == 1); + } + { + double b = 2; + CPPUNIT_ASSERT_MESSAGE("double", (a >>= b) && b == 1); + } + { + sal_Unicode b = '2'; + if (boost::is_same< sal_Unicode, sal_uInt16 >::value) { + CPPUNIT_ASSERT_MESSAGE("@sal_Unicode", (a >>= b) && b == 1); + } else { + CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a >>= b) && b == '2'); + } + } + { + rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2")); + CPPUNIT_ASSERT_MESSAGE( + "rtl::OUString", + !(a >>= b) && b.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2"))); + } + { + css::uno::Type b(getCppuType< rtl::OUString >()); + CPPUNIT_ASSERT_MESSAGE( + "css::uno::Type", + !(a >>= b) && b == getCppuType< rtl::OUString >()); + } + { + css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2"))); + CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a >>= b) && b == a); + } + { + css::uno::Sequence< rtl::OUString > b(2); + CPPUNIT_ASSERT_MESSAGE( + "css::uno::Sequence<rtl::OUString>", + !(a >>= b) && b.getLength() == 2); + } + { + Enum1 b = Enum1_M2; + CPPUNIT_ASSERT_MESSAGE("Enum1", !(a >>= b) && b == Enum1_M2); + } + { + Struct1 b(2); + CPPUNIT_ASSERT_MESSAGE("Struct1", !(a >>= b) && b.member == 2); + } + { + Exception1 b( + rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2); + CPPUNIT_ASSERT_MESSAGE("Exception1", !(a >>= b) && b.member == 2); + } + { + css::uno::Reference< Interface1 > i(new Impl1); + css::uno::Reference< Interface1 > b(i); + CPPUNIT_ASSERT_MESSAGE("Interface1", !(a >>= b) && b == i); + } +} + +void Test::testUnsignedShort() { + sal_uInt16 n = 1; + css::uno::Any a(&n, getCppuType(static_cast< sal_uInt16 const * >(0))); + CPPUNIT_ASSERT( + a.getValueType() == getCppuType(static_cast< sal_uInt16 const * >(0))); + { + bool b = true; + CPPUNIT_ASSERT_MESSAGE("bool", !(a >>= b) && b); + } + { + sal_Bool b = true; + CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b) && b); + } + { + sal_Int8 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a >>= b) && b == 2); + } + { + sal_uInt8 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a >>= b) && b == 2); + } + { + sal_Int16 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_Int16", (a >>= b) && b == 1); + } + { + sal_uInt16 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_uInt16", (a >>= b) && b == 1); + } + { + sal_Int32 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_Int32", (a >>= b) && b == 1); + } + { + sal_uInt32 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_uInt32", (a >>= b) && b == 1); + } + { + sal_Int64 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_Int64", (a >>= b) && b == 1); + } + { + sal_uInt64 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_uInt64", (a >>= b) && b == 1); + } + { + float b = 2; + CPPUNIT_ASSERT_MESSAGE("float", (a >>= b) && b == 1); + } + { + double b = 2; + CPPUNIT_ASSERT_MESSAGE("double", (a >>= b) && b == 1); + } + { + sal_Unicode b = '2'; + if (boost::is_same< sal_Unicode, sal_uInt16 >::value) { + CPPUNIT_ASSERT_MESSAGE("@sal_Unicode", (a >>= b) && b == 1); + } else { + CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a >>= b) && b == '2'); + } + } + { + rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2")); + CPPUNIT_ASSERT_MESSAGE( + "rtl::OUString", + !(a >>= b) && b.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2"))); + } + { + css::uno::Type b(getCppuType< rtl::OUString >()); + CPPUNIT_ASSERT_MESSAGE( + "css::uno::Type", + !(a >>= b) && b == getCppuType< rtl::OUString >()); + } + { + css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2"))); + CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a >>= b) && b == a); + } + { + css::uno::Sequence< rtl::OUString > b(2); + CPPUNIT_ASSERT_MESSAGE( + "css::uno::Sequence<rtl::OUString>", + !(a >>= b) && b.getLength() == 2); + } + { + Enum1 b = Enum1_M2; + CPPUNIT_ASSERT_MESSAGE("Enum1", !(a >>= b) && b == Enum1_M2); + } + { + Struct1 b(2); + CPPUNIT_ASSERT_MESSAGE("Struct1", !(a >>= b) && b.member == 2); + } + { + Exception1 b( + rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2); + CPPUNIT_ASSERT_MESSAGE("Exception1", !(a >>= b) && b.member == 2); + } + { + css::uno::Reference< Interface1 > i(new Impl1); + css::uno::Reference< Interface1 > b(i); + CPPUNIT_ASSERT_MESSAGE("Interface1", !(a >>= b) && b == i); + } +} + +void Test::testLong() { + css::uno::Any a(static_cast< sal_Int32 >(1)); + CPPUNIT_ASSERT(a.getValueType() == getCppuType< sal_Int32 >()); + { + bool b = true; + CPPUNIT_ASSERT_MESSAGE("bool", !(a >>= b) && b); + } + { + sal_Bool b = true; + CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b) && b); + } + { + sal_Int8 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a >>= b) && b == 2); + } + { + sal_uInt8 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a >>= b) && b == 2); + } + { + sal_Int16 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a >>= b) && b == 2); + } + { + sal_uInt16 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a >>= b) && b == 2); + } + { + sal_Int32 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_Int32", (a >>= b) && b == 1); + } + { + sal_uInt32 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_uInt32", (a >>= b) && b == 1); + } + { + sal_Int64 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_Int64", (a >>= b) && b == 1); + } + { + sal_uInt64 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_uInt64", (a >>= b) && b == 1); + } + { + float b = 2; + CPPUNIT_ASSERT_MESSAGE("float", !(a >>= b) && b == 2); + } + { + double b = 2; + CPPUNIT_ASSERT_MESSAGE("double", (a >>= b) && b == 1); + } + { + sal_Unicode b = '2'; + CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a >>= b) && b == '2'); + } + { + rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2")); + CPPUNIT_ASSERT_MESSAGE( + "rtl::OUString", + !(a >>= b) && b.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2"))); + } + { + css::uno::Type b(getCppuType< rtl::OUString >()); + CPPUNIT_ASSERT_MESSAGE( + "css::uno::Type", + !(a >>= b) && b == getCppuType< rtl::OUString >()); + } + { + css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2"))); + CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a >>= b) && b == a); + } + { + css::uno::Sequence< rtl::OUString > b(2); + CPPUNIT_ASSERT_MESSAGE( + "css::uno::Sequence<rtl::OUString>", + !(a >>= b) && b.getLength() == 2); + } + { + Enum1 b = Enum1_M2; + CPPUNIT_ASSERT_MESSAGE("Enum1", !(a >>= b) && b == Enum1_M2); + } + { + Struct1 b(2); + CPPUNIT_ASSERT_MESSAGE("Struct1", !(a >>= b) && b.member == 2); + } + { + Exception1 b( + rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2); + CPPUNIT_ASSERT_MESSAGE("Exception1", !(a >>= b) && b.member == 2); + } + { + css::uno::Reference< Interface1 > i(new Impl1); + css::uno::Reference< Interface1 > b(i); + CPPUNIT_ASSERT_MESSAGE("Interface1", !(a >>= b) && b == i); + } +} + +void Test::testUnsignedLong() { + css::uno::Any a(static_cast< sal_uInt32 >(1)); + CPPUNIT_ASSERT(a.getValueType() == getCppuType< sal_uInt32 >()); + { + bool b = true; + CPPUNIT_ASSERT_MESSAGE("bool", !(a >>= b) && b); + } + { + sal_Bool b = true; + CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b) && b); + } + { + sal_Int8 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a >>= b) && b == 2); + } + { + sal_uInt8 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a >>= b) && b == 2); + } + { + sal_Int16 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a >>= b) && b == 2); + } + { + sal_uInt16 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a >>= b) && b == 2); + } + { + sal_Int32 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_Int32", (a >>= b) && b == 1); + } + { + sal_uInt32 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_uInt32", (a >>= b) && b == 1); + } + { + sal_Int64 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_Int64", (a >>= b) && b == 1); + } + { + sal_uInt64 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_uInt64", (a >>= b) && b == 1); + } + { + float b = 2; + CPPUNIT_ASSERT_MESSAGE("float", !(a >>= b) && b == 2); + } + { + double b = 2; + CPPUNIT_ASSERT_MESSAGE("double", (a >>= b) && b == 1); + } + { + sal_Unicode b = '2'; + CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a >>= b) && b == '2'); + } + { + rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2")); + CPPUNIT_ASSERT_MESSAGE( + "rtl::OUString", + !(a >>= b) && b.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2"))); + } + { + css::uno::Type b(getCppuType< rtl::OUString >()); + CPPUNIT_ASSERT_MESSAGE( + "css::uno::Type", + !(a >>= b) && b == getCppuType< rtl::OUString >()); + } + { + css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2"))); + CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a >>= b) && b == a); + } + { + css::uno::Sequence< rtl::OUString > b(2); + CPPUNIT_ASSERT_MESSAGE( + "css::uno::Sequence<rtl::OUString>", + !(a >>= b) && b.getLength() == 2); + } + { + Enum1 b = Enum1_M2; + CPPUNIT_ASSERT_MESSAGE("Enum1", !(a >>= b) && b == Enum1_M2); + } + { + Struct1 b(2); + CPPUNIT_ASSERT_MESSAGE("Struct1", !(a >>= b) && b.member == 2); + } + { + Exception1 b( + rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2); + CPPUNIT_ASSERT_MESSAGE("Exception1", !(a >>= b) && b.member == 2); + } + { + css::uno::Reference< Interface1 > i(new Impl1); + css::uno::Reference< Interface1 > b(i); + CPPUNIT_ASSERT_MESSAGE("Interface1", !(a >>= b) && b == i); + } +} + +void Test::testHyper() { + css::uno::Any a(static_cast< sal_Int64 >(1)); + CPPUNIT_ASSERT(a.getValueType() == getCppuType< sal_Int64 >()); + { + bool b = true; + CPPUNIT_ASSERT_MESSAGE("bool", !(a >>= b) && b); + } + { + sal_Bool b = true; + CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b) && b); + } + { + sal_Int8 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a >>= b) && b == 2); + } + { + sal_uInt8 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a >>= b) && b == 2); + } + { + sal_Int16 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a >>= b) && b == 2); + } + { + sal_uInt16 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a >>= b) && b == 2); + } + { + sal_Int32 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a >>= b) && b == 2); + } + { + sal_uInt32 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a >>= b) && b == 2); + } + { + sal_Int64 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_Int64", (a >>= b) && b == 1); + } + { + sal_uInt64 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_uInt64", (a >>= b) && b == 1); + } + { + float b = 2; + CPPUNIT_ASSERT_MESSAGE("float", !(a >>= b) && b == 2); + } + { + double b = 2; + CPPUNIT_ASSERT_MESSAGE("double", !(a >>= b) && b == 2); + } + { + sal_Unicode b = '2'; + CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a >>= b) && b == '2'); + } + { + rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2")); + CPPUNIT_ASSERT_MESSAGE( + "rtl::OUString", + !(a >>= b) && b.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2"))); + } + { + css::uno::Type b(getCppuType< rtl::OUString >()); + CPPUNIT_ASSERT_MESSAGE( + "css::uno::Type", + !(a >>= b) && b == getCppuType< rtl::OUString >()); + } + { + css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2"))); + CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a >>= b) && b == a); + } + { + css::uno::Sequence< rtl::OUString > b(2); + CPPUNIT_ASSERT_MESSAGE( + "css::uno::Sequence<rtl::OUString>", + !(a >>= b) && b.getLength() == 2); + } + { + Enum1 b = Enum1_M2; + CPPUNIT_ASSERT_MESSAGE("Enum1", !(a >>= b) && b == Enum1_M2); + } + { + Struct1 b(2); + CPPUNIT_ASSERT_MESSAGE("Struct1", !(a >>= b) && b.member == 2); + } + { + Exception1 b( + rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2); + CPPUNIT_ASSERT_MESSAGE("Exception1", !(a >>= b) && b.member == 2); + } + { + css::uno::Reference< Interface1 > i(new Impl1); + css::uno::Reference< Interface1 > b(i); + CPPUNIT_ASSERT_MESSAGE("Interface1", !(a >>= b) && b == i); + } +} + +void Test::testUnsignedHyper() { + css::uno::Any a(static_cast< sal_uInt64 >(1)); + CPPUNIT_ASSERT(a.getValueType() == getCppuType< sal_uInt64 >()); + { + bool b = true; + CPPUNIT_ASSERT_MESSAGE("bool", !(a >>= b) && b); + } + { + sal_Bool b = true; + CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b) && b); + } + { + sal_Int8 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a >>= b) && b == 2); + } + { + sal_uInt8 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a >>= b) && b == 2); + } + { + sal_Int16 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a >>= b) && b == 2); + } + { + sal_uInt16 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a >>= b) && b == 2); + } + { + sal_Int32 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a >>= b) && b == 2); + } + { + sal_uInt32 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a >>= b) && b == 2); + } + { + sal_Int64 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_Int64", (a >>= b) && b == 1); + } + { + sal_uInt64 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_uInt64", (a >>= b) && b == 1); + } + { + float b = 2; + CPPUNIT_ASSERT_MESSAGE("float", !(a >>= b) && b == 2); + } + { + double b = 2; + CPPUNIT_ASSERT_MESSAGE("double", !(a >>= b) && b == 2); + } + { + sal_Unicode b = '2'; + CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a >>= b) && b == '2'); + } + { + rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2")); + CPPUNIT_ASSERT_MESSAGE( + "rtl::OUString", + !(a >>= b) && b.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2"))); + } + { + css::uno::Type b(getCppuType< rtl::OUString >()); + CPPUNIT_ASSERT_MESSAGE( + "css::uno::Type", + !(a >>= b) && b == getCppuType< rtl::OUString >()); + } + { + css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2"))); + CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a >>= b) && b == a); + } + { + css::uno::Sequence< rtl::OUString > b(2); + CPPUNIT_ASSERT_MESSAGE( + "css::uno::Sequence<rtl::OUString>", + !(a >>= b) && b.getLength() == 2); + } + { + Enum1 b = Enum1_M2; + CPPUNIT_ASSERT_MESSAGE("Enum1", !(a >>= b) && b == Enum1_M2); + } + { + Struct1 b(2); + CPPUNIT_ASSERT_MESSAGE("Struct1", !(a >>= b) && b.member == 2); + } + { + Exception1 b( + rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2); + CPPUNIT_ASSERT_MESSAGE("Exception1", !(a >>= b) && b.member == 2); + } + { + css::uno::Reference< Interface1 > i(new Impl1); + css::uno::Reference< Interface1 > b(i); + CPPUNIT_ASSERT_MESSAGE("Interface1", !(a >>= b) && b == i); + } +} + +void Test::testFloat() { + css::uno::Any a(1.f); + CPPUNIT_ASSERT(a.getValueType() == getCppuType< float >()); + { + bool b = true; + CPPUNIT_ASSERT_MESSAGE("bool", !(a >>= b) && b); + } + { + sal_Bool b = true; + CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b) && b); + } + { + sal_Int8 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a >>= b) && b == 2); + } + { + sal_uInt8 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a >>= b) && b == 2); + } + { + sal_Int16 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a >>= b) && b == 2); + } + { + sal_uInt16 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a >>= b) && b == 2); + } + { + sal_Int32 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a >>= b) && b == 2); + } + { + sal_uInt32 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a >>= b) && b == 2); + } + { + sal_Int64 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_Int64", !(a >>= b) && b == 2); + } + { + sal_uInt64 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_uInt64", !(a >>= b) && b == 2); + } + { + float b = 2; + CPPUNIT_ASSERT_MESSAGE("float", (a >>= b) && b == 1); + } + { + double b = 2; + CPPUNIT_ASSERT_MESSAGE("double", (a >>= b) && b == 1); + } + { + sal_Unicode b = '2'; + CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a >>= b) && b == '2'); + } + { + rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2")); + CPPUNIT_ASSERT_MESSAGE( + "rtl::OUString", + !(a >>= b) && b.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2"))); + } + { + css::uno::Type b(getCppuType< rtl::OUString >()); + CPPUNIT_ASSERT_MESSAGE( + "css::uno::Type", + !(a >>= b) && b == getCppuType< rtl::OUString >()); + } + { + css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2"))); + CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a >>= b) && b == a); + } + { + css::uno::Sequence< rtl::OUString > b(2); + CPPUNIT_ASSERT_MESSAGE( + "css::uno::Sequence<rtl::OUString>", + !(a >>= b) && b.getLength() == 2); + } + { + Enum1 b = Enum1_M2; + CPPUNIT_ASSERT_MESSAGE("Enum1", !(a >>= b) && b == Enum1_M2); + } + { + Struct1 b(2); + CPPUNIT_ASSERT_MESSAGE("Struct1", !(a >>= b) && b.member == 2); + } + { + Exception1 b( + rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2); + CPPUNIT_ASSERT_MESSAGE("Exception1", !(a >>= b) && b.member == 2); + } + { + css::uno::Reference< Interface1 > i(new Impl1); + css::uno::Reference< Interface1 > b(i); + CPPUNIT_ASSERT_MESSAGE("Interface1", !(a >>= b) && b == i); + } +} + +void Test::testDouble() { + css::uno::Any a(1.); + CPPUNIT_ASSERT(a.getValueType() == getCppuType< double >()); + { + bool b = true; + CPPUNIT_ASSERT_MESSAGE("bool", !(a >>= b) && b); + } + { + sal_Bool b = true; + CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b) && b); + } + { + sal_Int8 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a >>= b) && b == 2); + } + { + sal_uInt8 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a >>= b) && b == 2); + } + { + sal_Int16 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a >>= b) && b == 2); + } + { + sal_uInt16 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a >>= b) && b == 2); + } + { + sal_Int32 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a >>= b) && b == 2); + } + { + sal_uInt32 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a >>= b) && b == 2); + } + { + sal_Int64 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_Int64", !(a >>= b) && b == 2); + } + { + sal_uInt64 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_uInt64", !(a >>= b) && b == 2); + } + { + float b = 2; + CPPUNIT_ASSERT_MESSAGE("float", !(a >>= b) && b == 2); + } + { + double b = 2; + CPPUNIT_ASSERT_MESSAGE("double", (a >>= b) && b == 1); + } + { + sal_Unicode b = '2'; + CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a >>= b) && b == '2'); + } + { + rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2")); + CPPUNIT_ASSERT_MESSAGE( + "rtl::OUString", + !(a >>= b) && b.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2"))); + } + { + css::uno::Type b(getCppuType< rtl::OUString >()); + CPPUNIT_ASSERT_MESSAGE( + "css::uno::Type", + !(a >>= b) && b == getCppuType< rtl::OUString >()); + } + { + css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2"))); + CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a >>= b) && b == a); + } + { + css::uno::Sequence< rtl::OUString > b(2); + CPPUNIT_ASSERT_MESSAGE( + "css::uno::Sequence<rtl::OUString>", + !(a >>= b) && b.getLength() == 2); + } + { + Enum1 b = Enum1_M2; + CPPUNIT_ASSERT_MESSAGE("Enum1", !(a >>= b) && b == Enum1_M2); + } + { + Struct1 b(2); + CPPUNIT_ASSERT_MESSAGE("Struct1", !(a >>= b) && b.member == 2); + } + { + Exception1 b( + rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2); + CPPUNIT_ASSERT_MESSAGE("Exception1", !(a >>= b) && b.member == 2); + } + { + css::uno::Reference< Interface1 > i(new Impl1); + css::uno::Reference< Interface1 > b(i); + CPPUNIT_ASSERT_MESSAGE("Interface1", !(a >>= b) && b == i); + } +} + +void Test::testChar() { + sal_Unicode c = '1'; + css::uno::Any a(&c, getCppuType< sal_Unicode >()); + CPPUNIT_ASSERT(a.getValueType() == getCppuType< sal_Unicode >()); + { + bool b = true; + CPPUNIT_ASSERT_MESSAGE("bool", !(a >>= b) && b); + } + { + sal_Bool b = true; + CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b) && b); + } + { + sal_Int8 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a >>= b) && b == 2); + } + { + sal_uInt8 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a >>= b) && b == 2); + } + { + sal_Int16 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a >>= b) && b == 2); + } + { + sal_uInt16 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a >>= b) && b == 2); + } + { + sal_Int32 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a >>= b) && b == 2); + } + { + sal_uInt32 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a >>= b) && b == 2); + } + { + sal_Int64 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_Int64", !(a >>= b) && b == 2); + } + { + sal_uInt64 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_uInt64", !(a >>= b) && b == 2); + } + { + float b = 2; + CPPUNIT_ASSERT_MESSAGE("float", !(a >>= b) && b == 2); + } + { + double b = 2; + CPPUNIT_ASSERT_MESSAGE("double", !(a >>= b) && b == 2); + } + { + sal_Unicode b = '2'; + if (boost::is_same< sal_Unicode, sal_uInt16 >::value) { + CPPUNIT_ASSERT_MESSAGE("@sal_Unicode", !(a >>= b) && b == '2'); + } else { + CPPUNIT_ASSERT_MESSAGE("sal_Unicode", (a >>= b) && b == '1'); + } + } + { + rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2")); + CPPUNIT_ASSERT_MESSAGE( + "rtl::OUString", + !(a >>= b) && b.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2"))); + } + { + css::uno::Type b(getCppuType< rtl::OUString >()); + CPPUNIT_ASSERT_MESSAGE( + "css::uno::Type", + !(a >>= b) && b == getCppuType< rtl::OUString >()); + } + { + css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2"))); + CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a >>= b) && b == a); + } + { + css::uno::Sequence< rtl::OUString > b(2); + CPPUNIT_ASSERT_MESSAGE( + "css::uno::Sequence<rtl::OUString>", + !(a >>= b) && b.getLength() == 2); + } + { + Enum1 b = Enum1_M2; + CPPUNIT_ASSERT_MESSAGE("Enum1", !(a >>= b) && b == Enum1_M2); + } + { + Struct1 b(2); + CPPUNIT_ASSERT_MESSAGE("Struct1", !(a >>= b) && b.member == 2); + } + { + Exception1 b( + rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2); + CPPUNIT_ASSERT_MESSAGE("Exception1", !(a >>= b) && b.member == 2); + } + { + css::uno::Reference< Interface1 > i(new Impl1); + css::uno::Reference< Interface1 > b(i); + CPPUNIT_ASSERT_MESSAGE("Interface1", !(a >>= b) && b == i); + } +} + +void Test::testString() { + css::uno::Any a(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("1"))); + CPPUNIT_ASSERT(a.getValueType() == getCppuType< rtl::OUString >()); + { + bool b = true; + CPPUNIT_ASSERT_MESSAGE("bool", !(a >>= b) && b); + } + { + sal_Bool b = true; + CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b) && b); + } + { + sal_Int8 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a >>= b) && b == 2); + } + { + sal_uInt8 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a >>= b) && b == 2); + } + { + sal_Int16 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a >>= b) && b == 2); + } + { + sal_uInt16 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a >>= b) && b == 2); + } + { + sal_Int32 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a >>= b) && b == 2); + } + { + sal_uInt32 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a >>= b) && b == 2); + } + { + sal_Int64 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_Int64", !(a >>= b) && b == 2); + } + { + sal_uInt64 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_uInt64", !(a >>= b) && b == 2); + } + { + float b = 2; + CPPUNIT_ASSERT_MESSAGE("float", !(a >>= b) && b == 2); + } + { + double b = 2; + CPPUNIT_ASSERT_MESSAGE("double", !(a >>= b) && b == 2); + } + { + sal_Unicode b = '2'; + CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a >>= b) && b == '2'); + } + { + rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2")); + CPPUNIT_ASSERT_MESSAGE( + "rtl::OUString", + (a >>= b) && b.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("1"))); + } + { + css::uno::Type b(getCppuType< rtl::OUString >()); + CPPUNIT_ASSERT_MESSAGE( + "css::uno::Type", + !(a >>= b) && b == getCppuType< rtl::OUString >()); + } + { + css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2"))); + CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a >>= b) && b == a); + } + { + css::uno::Sequence< rtl::OUString > b(2); + CPPUNIT_ASSERT_MESSAGE( + "css::uno::Sequence<rtl::OUString>", + !(a >>= b) && b.getLength() == 2); + } + { + Enum1 b = Enum1_M2; + CPPUNIT_ASSERT_MESSAGE("Enum1", !(a >>= b) && b == Enum1_M2); + } + { + Struct1 b(2); + CPPUNIT_ASSERT_MESSAGE("Struct1", !(a >>= b) && b.member == 2); + } + { + Exception1 b( + rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2); + CPPUNIT_ASSERT_MESSAGE("Exception1", !(a >>= b) && b.member == 2); + } + { + css::uno::Reference< Interface1 > i(new Impl1); + css::uno::Reference< Interface1 > b(i); + CPPUNIT_ASSERT_MESSAGE("Interface1", !(a >>= b) && b == i); + } +} + +void Test::testType() { + css::uno::Any a(getCppuType< sal_Int32 >()); + CPPUNIT_ASSERT(a.getValueType() == getCppuType< css::uno::Type >()); + { + bool b = true; + CPPUNIT_ASSERT_MESSAGE("bool", !(a >>= b) && b); + } + { + sal_Bool b = true; + CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b) && b); + } + { + sal_Int8 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a >>= b) && b == 2); + } + { + sal_uInt8 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a >>= b) && b == 2); + } + { + sal_Int16 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a >>= b) && b == 2); + } + { + sal_uInt16 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a >>= b) && b == 2); + } + { + sal_Int32 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a >>= b) && b == 2); + } + { + sal_uInt32 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a >>= b) && b == 2); + } + { + sal_Int64 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_Int64", !(a >>= b) && b == 2); + } + { + sal_uInt64 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_uInt64", !(a >>= b) && b == 2); + } + { + float b = 2; + CPPUNIT_ASSERT_MESSAGE("float", !(a >>= b) && b == 2); + } + { + double b = 2; + CPPUNIT_ASSERT_MESSAGE("double", !(a >>= b) && b == 2); + } + { + sal_Unicode b = '2'; + CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a >>= b) && b == '2'); + } + { + rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2")); + CPPUNIT_ASSERT_MESSAGE( + "rtl::OUString", + !(a >>= b) && b.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2"))); + } + { + css::uno::Type b(getCppuType< rtl::OUString >()); + CPPUNIT_ASSERT_MESSAGE( + "css::uno::Type", (a >>= b) && b == getCppuType< sal_Int32 >()); + } + { + css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2"))); + CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a >>= b) && b == a); + } + { + css::uno::Sequence< rtl::OUString > b(2); + CPPUNIT_ASSERT_MESSAGE( + "css::uno::Sequence<rtl::OUString>", + !(a >>= b) && b.getLength() == 2); + } + { + Enum1 b = Enum1_M2; + CPPUNIT_ASSERT_MESSAGE("Enum1", !(a >>= b) && b == Enum1_M2); + } + { + Struct1 b(2); + CPPUNIT_ASSERT_MESSAGE("Struct1", !(a >>= b) && b.member == 2); + } + { + Exception1 b( + rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2); + CPPUNIT_ASSERT_MESSAGE("Exception1", !(a >>= b) && b.member == 2); + } + { + css::uno::Reference< Interface1 > i(new Impl1); + css::uno::Reference< Interface1 > b(i); + CPPUNIT_ASSERT_MESSAGE("Interface1", !(a >>= b) && b == i); + } +} + +void Test::testSequence() { + sal_Int32 n = 1; + css::uno::Any a(css::uno::Sequence< sal_Int32 >(&n, 1)); + CPPUNIT_ASSERT( + a.getValueType() == getCppuType< css::uno::Sequence< sal_Int32 > >()); + { + bool b = true; + CPPUNIT_ASSERT_MESSAGE("bool", !(a >>= b) && b); + } + { + sal_Bool b = true; + CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b) && b); + } + { + sal_Int8 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a >>= b) && b == 2); + } + { + sal_uInt8 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a >>= b) && b == 2); + } + { + sal_Int16 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a >>= b) && b == 2); + } + { + sal_uInt16 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a >>= b) && b == 2); + } + { + sal_Int32 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a >>= b) && b == 2); + } + { + sal_uInt32 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a >>= b) && b == 2); + } + { + sal_Int64 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_Int64", !(a >>= b) && b == 2); + } + { + sal_uInt64 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_uInt64", !(a >>= b) && b == 2); + } + { + float b = 2; + CPPUNIT_ASSERT_MESSAGE("float", !(a >>= b) && b == 2); + } + { + double b = 2; + CPPUNIT_ASSERT_MESSAGE("double", !(a >>= b) && b == 2); + } + { + sal_Unicode b = '2'; + CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a >>= b) && b == '2'); + } + { + rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2")); + CPPUNIT_ASSERT_MESSAGE( + "rtl::OUString", + !(a >>= b) && b.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2"))); + } + { + css::uno::Type b(getCppuType< rtl::OUString >()); + CPPUNIT_ASSERT_MESSAGE( + "css::uno::Type", + !(a >>= b) && b == getCppuType< rtl::OUString >()); + } + { + css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2"))); + CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a >>= b) && b == a); + } + { + css::uno::Sequence< rtl::OUString > b(2); + CPPUNIT_ASSERT_MESSAGE( + "css::uno::Sequence<rtl::OUString>", + !(a >>= b) && b.getLength() == 2); + } + { + css::uno::Sequence< sal_Int32 > b(2); + CPPUNIT_ASSERT_MESSAGE( + "css::uno::Sequence<sal_Int32>", + (a >>= b) && b.getLength() == 1 && b[0] == 1); + } + { + Enum1 b = Enum1_M2; + CPPUNIT_ASSERT_MESSAGE("Enum1", !(a >>= b) && b == Enum1_M2); + } + { + Struct1 b(2); + CPPUNIT_ASSERT_MESSAGE("Struct1", !(a >>= b) && b.member == 2); + } + { + Exception1 b( + rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2); + CPPUNIT_ASSERT_MESSAGE("Exception1", !(a >>= b) && b.member == 2); + } + { + css::uno::Reference< Interface1 > i(new Impl1); + css::uno::Reference< Interface1 > b(i); + CPPUNIT_ASSERT_MESSAGE("Interface1", !(a >>= b) && b == i); + } +} + +void Test::testEnum() { + css::uno::Any a(Enum2_M1); + CPPUNIT_ASSERT(a.getValueType() == getCppuType< Enum2 >()); + { + bool b = true; + CPPUNIT_ASSERT_MESSAGE("bool", !(a >>= b) && b); + } + { + sal_Bool b = true; + CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b) && b); + } + { + sal_Int8 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a >>= b) && b == 2); + } + { + sal_uInt8 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a >>= b) && b == 2); + } + { + sal_Int16 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a >>= b) && b == 2); + } + { + sal_uInt16 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a >>= b) && b == 2); + } + { + sal_Int32 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a >>= b) && b == 2); + } + { + sal_uInt32 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a >>= b) && b == 2); + } + { + sal_Int64 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_Int64", !(a >>= b) && b == 2); + } + { + sal_uInt64 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_uInt64", !(a >>= b) && b == 2); + } + { + float b = 2; + CPPUNIT_ASSERT_MESSAGE("float", !(a >>= b) && b == 2); + } + { + double b = 2; + CPPUNIT_ASSERT_MESSAGE("double", !(a >>= b) && b == 2); + } + { + sal_Unicode b = '2'; + CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a >>= b) && b == '2'); + } + { + rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2")); + CPPUNIT_ASSERT_MESSAGE( + "rtl::OUString", + !(a >>= b) && b.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2"))); + } + { + css::uno::Type b(getCppuType< rtl::OUString >()); + CPPUNIT_ASSERT_MESSAGE( + "css::uno::Type", + !(a >>= b) && b == getCppuType< rtl::OUString >()); + } + { + css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2"))); + CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a >>= b) && b == a); + } + { + css::uno::Sequence< rtl::OUString > b(2); + CPPUNIT_ASSERT_MESSAGE( + "css::uno::Sequence<rtl::OUString>", + !(a >>= b) && b.getLength() == 2); + } + { + Enum1 b = Enum1_M2; + CPPUNIT_ASSERT_MESSAGE("Enum1", !(a >>= b) && b == Enum1_M2); + } + { + Enum2 b = Enum2_M2; + CPPUNIT_ASSERT_MESSAGE("Enum2", (a >>= b) && b == Enum2_M1); + } + { + Struct1 b(2); + CPPUNIT_ASSERT_MESSAGE("Struct1", !(a >>= b) && b.member == 2); + } + { + Exception1 b( + rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2); + CPPUNIT_ASSERT_MESSAGE("Exception1", !(a >>= b) && b.member == 2); + } + { + css::uno::Reference< Interface1 > i(new Impl1); + css::uno::Reference< Interface1 > b(i); + CPPUNIT_ASSERT_MESSAGE("Interface1", !(a >>= b) && b == i); + } +} + +void Test::testStruct() { + css::uno::Any a(Struct2a(1, 3)); + CPPUNIT_ASSERT(a.getValueType() == getCppuType< Struct2a >()); + { + bool b = true; + CPPUNIT_ASSERT_MESSAGE("bool", !(a >>= b) && b); + } + { + sal_Bool b = true; + CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b) && b); + } + { + sal_Int8 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a >>= b) && b == 2); + } + { + sal_uInt8 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a >>= b) && b == 2); + } + { + sal_Int16 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a >>= b) && b == 2); + } + { + sal_uInt16 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a >>= b) && b == 2); + } + { + sal_Int32 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a >>= b) && b == 2); + } + { + sal_uInt32 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a >>= b) && b == 2); + } + { + sal_Int64 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_Int64", !(a >>= b) && b == 2); + } + { + sal_uInt64 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_uInt64", !(a >>= b) && b == 2); + } + { + float b = 2; + CPPUNIT_ASSERT_MESSAGE("float", !(a >>= b) && b == 2); + } + { + double b = 2; + CPPUNIT_ASSERT_MESSAGE("double", !(a >>= b) && b == 2); + } + { + sal_Unicode b = '2'; + CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a >>= b) && b == '2'); + } + { + rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2")); + CPPUNIT_ASSERT_MESSAGE( + "rtl::OUString", + !(a >>= b) && b.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2"))); + } + { + css::uno::Type b(getCppuType< rtl::OUString >()); + CPPUNIT_ASSERT_MESSAGE( + "css::uno::Type", + !(a >>= b) && b == getCppuType< rtl::OUString >()); + } + { + css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2"))); + CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a >>= b) && b == a); + } + { + css::uno::Sequence< rtl::OUString > b(2); + CPPUNIT_ASSERT_MESSAGE( + "css::uno::Sequence<rtl::OUString>", + !(a >>= b) && b.getLength() == 2); + } + { + Enum1 b = Enum1_M2; + CPPUNIT_ASSERT_MESSAGE("Enum1", !(a >>= b) && b == Enum1_M2); + } + { + Struct1 b(2); + CPPUNIT_ASSERT_MESSAGE("Struct1", !(a >>= b) && b.member == 2); + } + { + Struct2 b(2); + CPPUNIT_ASSERT_MESSAGE("Struct2", (a >>= b) && b.member == 1); + } + { + Struct2a b(2, 2); + CPPUNIT_ASSERT_MESSAGE( + "Struct2a", (a >>= b) && b.member == 1 && b.member2 == 3); + } + { + Struct2b b(2, 2, 2); + CPPUNIT_ASSERT_MESSAGE("Struct2b", !(a >>= b) && b.member == 2); + } + { + Exception1 b( + rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2); + CPPUNIT_ASSERT_MESSAGE("Exception1", !(a >>= b) && b.member == 2); + } + { + css::uno::Reference< Interface1 > i(new Impl1); + css::uno::Reference< Interface1 > b(i); + CPPUNIT_ASSERT_MESSAGE("Interface1", !(a >>= b) && b == i); + } +} + +void Test::testPoly() { + css::uno::Any a; + a <<= Poly< css::uno::Sequence< ::sal_Unicode > >(); + CPPUNIT_ASSERT_MESSAGE( + "type name", + a.getValueType().getTypeName().equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("Poly<[]char>"))); + CPPUNIT_ASSERT_MESSAGE( + "constructor", + a == css::uno::Any(Poly< css::uno::Sequence< ::sal_Unicode > >())); +} + +void Test::testException() { + css::uno::Any a( + Exception2a( + rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 1, + 3)); + CPPUNIT_ASSERT(a.getValueType() == getCppuType< Exception2a >()); + { + bool b = true; + CPPUNIT_ASSERT_MESSAGE("bool", !(a >>= b) && b); + } + { + sal_Bool b = true; + CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b) && b); + } + { + sal_Int8 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a >>= b) && b == 2); + } + { + sal_uInt8 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a >>= b) && b == 2); + } + { + sal_Int16 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a >>= b) && b == 2); + } + { + sal_uInt16 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a >>= b) && b == 2); + } + { + sal_Int32 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a >>= b) && b == 2); + } + { + sal_uInt32 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a >>= b) && b == 2); + } + { + sal_Int64 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_Int64", !(a >>= b) && b == 2); + } + { + sal_uInt64 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_uInt64", !(a >>= b) && b == 2); + } + { + float b = 2; + CPPUNIT_ASSERT_MESSAGE("float", !(a >>= b) && b == 2); + } + { + double b = 2; + CPPUNIT_ASSERT_MESSAGE("double", !(a >>= b) && b == 2); + } + { + sal_Unicode b = '2'; + CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a >>= b) && b == '2'); + } + { + rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2")); + CPPUNIT_ASSERT_MESSAGE( + "rtl::OUString", + !(a >>= b) && b.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2"))); + } + { + css::uno::Type b(getCppuType< rtl::OUString >()); + CPPUNIT_ASSERT_MESSAGE( + "css::uno::Type", + !(a >>= b) && b == getCppuType< rtl::OUString >()); + } + { + css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2"))); + CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a >>= b) && b == a); + } + { + css::uno::Sequence< rtl::OUString > b(2); + CPPUNIT_ASSERT_MESSAGE( + "css::uno::Sequence<rtl::OUString>", + !(a >>= b) && b.getLength() == 2); + } + { + Enum1 b = Enum1_M2; + CPPUNIT_ASSERT_MESSAGE("Enum1", !(a >>= b) && b == Enum1_M2); + } + { + Struct1 b(2); + CPPUNIT_ASSERT_MESSAGE("Struct1", !(a >>= b) && b.member == 2); + } + { + Exception1 b( + rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2); + CPPUNIT_ASSERT_MESSAGE("Exception1", !(a >>= b) && b.member == 2); + } + { + Exception2 b( + rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2); + CPPUNIT_ASSERT_MESSAGE("Exception2", (a >>= b) && b.member == 1); + } + { + Exception2a b( + rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2, + 2); + CPPUNIT_ASSERT_MESSAGE( + "Exception2a", (a >>= b) && b.member == 1 && b.member2 == 3); + } + { + Exception2b b( + rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2, + 2); + CPPUNIT_ASSERT_MESSAGE("Exception2b", !(a >>= b) && b.member == 2); + } + { + css::uno::Reference< Interface1 > i(new Impl1); + css::uno::Reference< Interface1 > b(i); + CPPUNIT_ASSERT_MESSAGE("Interface1", !(a >>= b) && b == i); + } +} + +void Test::testInterface() { + css::uno::Reference< Interface2a > i2(new Impl2); + css::uno::Any a(i2); + CPPUNIT_ASSERT( + a.getValueType() + == getCppuType< css::uno::Reference< Interface2a > >()); + { + bool b = true; + CPPUNIT_ASSERT_MESSAGE("bool", !(a >>= b) && b); + } + { + sal_Bool b = true; + CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b) && b); + } + { + sal_Int8 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a >>= b) && b == 2); + } + { + sal_uInt8 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a >>= b) && b == 2); + } + { + sal_Int16 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a >>= b) && b == 2); + } + { + sal_uInt16 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a >>= b) && b == 2); + } + { + sal_Int32 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a >>= b) && b == 2); + } + { + sal_uInt32 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a >>= b) && b == 2); + } + { + sal_Int64 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_Int64", !(a >>= b) && b == 2); + } + { + sal_uInt64 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_uInt64", !(a >>= b) && b == 2); + } + { + float b = 2; + CPPUNIT_ASSERT_MESSAGE("float", !(a >>= b) && b == 2); + } + { + double b = 2; + CPPUNIT_ASSERT_MESSAGE("double", !(a >>= b) && b == 2); + } + { + sal_Unicode b = '2'; + CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a >>= b) && b == '2'); + } + { + rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2")); + CPPUNIT_ASSERT_MESSAGE( + "rtl::OUString", + !(a >>= b) && b.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2"))); + } + { + css::uno::Type b(getCppuType< rtl::OUString >()); + CPPUNIT_ASSERT_MESSAGE( + "css::uno::Type", + !(a >>= b) && b == getCppuType< rtl::OUString >()); + } + { + css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2"))); + CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a >>= b) && b == a); + } + { + css::uno::Sequence< rtl::OUString > b(2); + CPPUNIT_ASSERT_MESSAGE( + "css::uno::Sequence<rtl::OUString>", + !(a >>= b) && b.getLength() == 2); + } + { + Enum1 b = Enum1_M2; + CPPUNIT_ASSERT_MESSAGE("Enum1", !(a >>= b) && b == Enum1_M2); + } + { + Struct1 b(2); + CPPUNIT_ASSERT_MESSAGE("Struct1", !(a >>= b) && b.member == 2); + } + { + Exception1 b( + rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2); + CPPUNIT_ASSERT_MESSAGE("Exception1", !(a >>= b) && b.member == 2); + } + { + css::uno::Reference< Interface1 > i(new Impl1); + css::uno::Reference< Interface1 > b(i); + CPPUNIT_ASSERT_MESSAGE("Interface1", !(a >>= b) && b == i); + } + { + css::uno::Reference< Interface2 > b(new Impl2); + CPPUNIT_ASSERT_MESSAGE("Interface2", (a >>= b) && b == i2); + } + { + css::uno::Reference< Interface2a > b(new Impl2); + CPPUNIT_ASSERT_MESSAGE("Interface2a", (a >>= b) && b == i2); + } + { + css::uno::Reference< Interface2b > i(new Impl2b); + css::uno::Reference< Interface2b > b(i); + CPPUNIT_ASSERT_MESSAGE("Interface2b", !(a >>= b) && b == i); + } + { + css::uno::Reference< Interface3 > b(new Impl2); + CPPUNIT_ASSERT_MESSAGE("Interface3", (a >>= b) && b == i2); + } +} + +void Test::testNull() { + css::uno::Any a = css::uno::Any(css::uno::Reference< Interface2a >()); + CPPUNIT_ASSERT( + a.getValueType() + == getCppuType< css::uno::Reference< Interface2a > >()); + { + bool b = true; + CPPUNIT_ASSERT_MESSAGE("bool", !(a >>= b) && b); + } + { + sal_Bool b = true; + CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b) && b); + } + { + sal_Int8 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a >>= b) && b == 2); + } + { + sal_uInt8 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a >>= b) && b == 2); + } + { + sal_Int16 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a >>= b) && b == 2); + } + { + sal_uInt16 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a >>= b) && b == 2); + } + { + sal_Int32 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a >>= b) && b == 2); + } + { + sal_uInt32 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a >>= b) && b == 2); + } + { + sal_Int64 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_Int64", !(a >>= b) && b == 2); + } + { + sal_uInt64 b = 2; + CPPUNIT_ASSERT_MESSAGE("sal_uInt64", !(a >>= b) && b == 2); + } + { + float b = 2; + CPPUNIT_ASSERT_MESSAGE("float", !(a >>= b) && b == 2); + } + { + double b = 2; + CPPUNIT_ASSERT_MESSAGE("double", !(a >>= b) && b == 2); + } + { + sal_Unicode b = '2'; + CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a >>= b) && b == '2'); + } + { + rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2")); + CPPUNIT_ASSERT_MESSAGE( + "rtl::OUString", + !(a >>= b) && b.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2"))); + } + { + css::uno::Type b(getCppuType< rtl::OUString >()); + CPPUNIT_ASSERT_MESSAGE( + "css::uno::Type", + !(a >>= b) && b == getCppuType< rtl::OUString >()); + } + { + css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2"))); + CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a >>= b) && b == a); + } + { + css::uno::Sequence< rtl::OUString > b(2); + CPPUNIT_ASSERT_MESSAGE( + "css::uno::Sequence<rtl::OUString>", + !(a >>= b) && b.getLength() == 2); + } + { + Enum1 b = Enum1_M2; + CPPUNIT_ASSERT_MESSAGE("Enum1", !(a >>= b) && b == Enum1_M2); + } + { + Struct1 b(2); + CPPUNIT_ASSERT_MESSAGE("Struct1", !(a >>= b) && b.member == 2); + } + { + Exception1 b( + rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2); + CPPUNIT_ASSERT_MESSAGE("Exception1", !(a >>= b) && b.member == 2); + } + { + css::uno::Reference< Interface1 > b(new Impl1); + CPPUNIT_ASSERT_MESSAGE( + "Interface1", (a >>= b) && !b.is()); + } + { + css::uno::Reference< Interface2 > b(new Impl2); + CPPUNIT_ASSERT_MESSAGE( + "Interface2", (a >>= b) && !b.is()); + } + { + css::uno::Reference< Interface2a > b(new Impl2); + CPPUNIT_ASSERT_MESSAGE("Interface2a", (a >>= b) && !b.is()); + } + { + css::uno::Reference< Interface2b > b(new Impl2b); + CPPUNIT_ASSERT_MESSAGE( + "Interface2b", (a >>= b) && !b.is()); + } + { + css::uno::Reference< Interface3 > b(new Impl2); + CPPUNIT_ASSERT_MESSAGE( + "Interface3", (a >>= b) && !b.is()); + } +} + +CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(Test, "alltests"); + +} + +NOADDITIONAL; diff --git a/cppu/qa/test_recursion.cxx b/cppu/qa/test_recursion.cxx new file mode 100644 index 000000000000..60853776662b --- /dev/null +++ b/cppu/qa/test_recursion.cxx @@ -0,0 +1,60 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: test_recursion.cxx,v $ + * $Revision: 1.1.2.1 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "precompiled_cppu.hxx" +#include "sal/config.h" + +#include "testshl/simpleheader.hxx" +#include "sal/types.h" + +#include "Rec.hpp" + +namespace +{ + +class Test: public CppUnit::TestFixture { + +public: + void testRecursion(); + + CPPUNIT_TEST_SUITE(Test); + CPPUNIT_TEST(testRecursion); + CPPUNIT_TEST_SUITE_END(); +}; + +void Test::testRecursion() { + CPPUNIT_ASSERT_EQUAL(static_cast< sal_Int32 >(0), Rec().x.getLength()); +} + +CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(Test, "tests"); + +} + +NOADDITIONAL; diff --git a/cppu/qa/test_reference.cxx b/cppu/qa/test_reference.cxx new file mode 100644 index 000000000000..8bb793c655e4 --- /dev/null +++ b/cppu/qa/test_reference.cxx @@ -0,0 +1,159 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: test_reference.cxx,v $ + * $Revision: 1.3 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_cppu.hxx" + +#include "sal/config.h" + +#include "Interface1.hpp" + +#include "testshl/simpleheader.hxx" +#include "rtl/ustring.hxx" +#include "sal/types.h" + +namespace +{ + +using ::com::sun::star::uno::Type; +using ::com::sun::star::uno::Any; +using ::com::sun::star::uno::Reference; +using ::com::sun::star::uno::RuntimeException; +using ::com::sun::star::uno::UNO_SET_THROW; + +class Foo: public Interface1 +{ +public: + Foo() + :m_refCount(0) + { + } + + virtual Any SAL_CALL queryInterface(const Type & _type) + throw (RuntimeException) + { + Any aInterface; + if (_type == getCppuType< Reference< XInterface > >()) + { + Reference< XInterface > ref( static_cast< XInterface * >( this ) ); + aInterface.setValue( &ref, _type ); + } + else if (_type == getCppuType< Reference< Interface1 > >()) + { + Reference< Interface1 > ref( this ); + aInterface.setValue( &ref, _type ); + } + + return Any(); + } + + virtual void SAL_CALL acquire() throw () + { + osl_incrementInterlockedCount( &m_refCount ); + } + + virtual void SAL_CALL release() throw () + { + if ( 0 == osl_decrementInterlockedCount( &m_refCount ) ) + delete this; + } + +protected: + virtual ~Foo() + { + } + +private: + Foo(Foo &); // not declared + Foo& operator =(const Foo&); // not declared + +private: + oslInterlockedCount m_refCount; +}; + +class Test: public ::CppUnit::TestFixture +{ + +public: + void testUnoSetThrow(); + + CPPUNIT_TEST_SUITE(Test); + CPPUNIT_TEST(testUnoSetThrow); + CPPUNIT_TEST_SUITE_END(); +}; + +void Test::testUnoSetThrow() +{ + Reference< Interface1 > xNull; + Reference< Interface1 > xFoo( new Foo ); + + // ctor taking Reference< interface_type > + bool bCaughtException = false; + try { Reference< Interface1 > x( xNull, UNO_SET_THROW ); (void)x; } catch( const RuntimeException& ) { bCaughtException = true; } + CPPUNIT_ASSERT_EQUAL( true, bCaughtException ); + + bCaughtException = false; + try { Reference< Interface1 > x( xFoo, UNO_SET_THROW ); (void)x; } catch( const RuntimeException& ) { bCaughtException = true; } + CPPUNIT_ASSERT_EQUAL( false, bCaughtException ); + + // ctor taking interface_type* + bCaughtException = false; + try { Reference< Interface1 > x( xNull.get(), UNO_SET_THROW ); (void)x; } catch( const RuntimeException& ) { bCaughtException = true; } + CPPUNIT_ASSERT_EQUAL( true, bCaughtException ); + + bCaughtException = false; + try { Reference< Interface1 > x( xFoo.get(), UNO_SET_THROW ); (void)x; } catch( const RuntimeException& ) { bCaughtException = true; } + CPPUNIT_ASSERT_EQUAL( false, bCaughtException ); + + Reference< Interface1 > x; + // "set" taking Reference< interface_type > + bCaughtException = false; + try { x.set( xNull, UNO_SET_THROW ); } catch( const RuntimeException& ) { bCaughtException = true; } + CPPUNIT_ASSERT_EQUAL( true, bCaughtException ); + + bCaughtException = false; + try { x.set( xFoo, UNO_SET_THROW ); } catch( const RuntimeException& ) { bCaughtException = true; } + CPPUNIT_ASSERT_EQUAL( false, bCaughtException ); + + // "set" taking interface_type* + bCaughtException = false; + try { x.set( xNull.get(), UNO_SET_THROW ); } catch( const RuntimeException& ) { bCaughtException = true; } + CPPUNIT_ASSERT_EQUAL( true, bCaughtException ); + + bCaughtException = false; + try { x.set( xFoo.get(), UNO_SET_THROW ); } catch( const RuntimeException& ) { bCaughtException = true; } + CPPUNIT_ASSERT_EQUAL( false, bCaughtException ); +} + +CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(Test, "alltests"); + +} // namespace + +NOADDITIONAL; diff --git a/cppu/qa/test_unotype.cxx b/cppu/qa/test_unotype.cxx new file mode 100644 index 000000000000..ad457d516fa2 --- /dev/null +++ b/cppu/qa/test_unotype.cxx @@ -0,0 +1,815 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: test_unotype.cxx,v $ + * $Revision: 1.5 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_cppu.hxx" + +#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 "testshl/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(); + + void testGetTypeFavourChar(); + + CPPUNIT_TEST_SUITE(Test); + CPPUNIT_TEST(testUnoType); + CPPUNIT_TEST(testGetTypeFavourUnsigned); + CPPUNIT_TEST(testGetTypeFavourChar); + 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 +} + +void Test::testGetTypeFavourChar() { + CPPUNIT_ASSERT(typeid(::sal_Unicode) == typeid(::sal_uInt16)); + CPPUNIT_ASSERT( + ::getCppuType< ::sal_Unicode >() == ::getCppuType< ::sal_uInt16 >()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourChar(static_cast< ::cppu::UnoVoidType * >(0)) == + ::cppu::UnoType< ::cppu::UnoVoidType >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourChar(static_cast< bool * >(0)) == + ::cppu::UnoType< bool >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourChar(static_cast< bool * >(0)) == + ::getCppuType< bool >()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourChar(static_cast< ::sal_Bool * >(0)) == + ::cppu::UnoType< bool >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourChar(static_cast< ::sal_Bool * >(0)) == + ::getCppuType< ::sal_Bool >()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourChar(static_cast< ::sal_Int8 * >(0)) == + ::cppu::UnoType< ::sal_Int8 >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourChar(static_cast< ::sal_Int8 * >(0)) == + ::getCppuType< ::sal_Int8 >()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourChar(static_cast< ::sal_Int16 * >(0)) == + ::cppu::UnoType< ::sal_Int16 >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourChar(static_cast< ::sal_Int16 * >(0)) == + ::getCppuType< ::sal_Int16 >()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourChar( + static_cast< ::cppu::UnoUnsignedShortType * >(0)) == + ::cppu::UnoType< ::cppu::UnoUnsignedShortType >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourChar(static_cast< ::sal_uInt16 * >(0)) == + ::cppu::UnoType< ::cppu::UnoCharType >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourChar(static_cast< ::sal_Int32 * >(0)) == + ::cppu::UnoType< ::sal_Int32 >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourChar(static_cast< ::sal_Int32 * >(0)) == + ::getCppuType< ::sal_Int32 >()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourChar(static_cast< ::sal_uInt32 * >(0)) == + ::cppu::UnoType< ::sal_uInt32 >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourChar(static_cast< ::sal_uInt32 * >(0)) == + ::getCppuType< ::sal_uInt32 >()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourChar(static_cast< ::sal_Int64 * >(0)) == + ::cppu::UnoType< ::sal_Int64 >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourChar(static_cast< ::sal_Int64 * >(0)) == + ::getCppuType< ::sal_Int64 >()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourChar(static_cast< ::sal_uInt64 * >(0)) == + ::cppu::UnoType< ::sal_uInt64 >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourChar(static_cast< ::sal_uInt64 * >(0)) == + ::getCppuType< ::sal_uInt64 >()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourChar(static_cast< float * >(0)) == + ::cppu::UnoType< float >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourChar(static_cast< float * >(0)) == + ::getCppuType< float >()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourChar(static_cast< double * >(0)) == + ::cppu::UnoType< double >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourChar(static_cast< double * >(0)) == + ::getCppuType< double >()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourChar(static_cast< ::cppu::UnoCharType * >(0)) == + ::cppu::UnoType< ::cppu::UnoCharType >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourChar(static_cast< ::sal_Unicode * >(0)) == + ::cppu::UnoType< ::cppu::UnoCharType >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourChar(static_cast< ::sal_Unicode * >(0)) == + ::getCppuType< ::sal_Unicode >()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourChar(static_cast< ::rtl::OUString * >(0)) == + ::cppu::UnoType< ::rtl::OUString >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourChar(static_cast< ::rtl::OUString * >(0)) == + ::getCppuType< ::rtl::OUString >()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourChar(static_cast< css::uno::Type * >(0)) == + ::cppu::UnoType< css::uno::Type >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourChar(static_cast< css::uno::Type * >(0)) == + ::getCppuType< css::uno::Type >()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourChar(static_cast< css::uno::Any * >(0)) == + ::cppu::UnoType< css::uno::Any >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourChar(static_cast< css::uno::Any * >(0)) == + ::getCppuType< css::uno::Any >()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourChar( + static_cast< + ::cppu::UnoSequenceType< ::cppu::UnoUnsignedShortType > * >(0)) == + ::cppu::UnoType< + ::cppu::UnoSequenceType< ::cppu::UnoUnsignedShortType > >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourChar( + static_cast< css::uno::Sequence< ::sal_uInt16 > * >(0)) == + ::cppu::UnoType< + ::cppu::UnoSequenceType< ::cppu::UnoCharType > >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourChar( + static_cast< ::cppu::UnoSequenceType< ::cppu::UnoSequenceType< + ::cppu::UnoUnsignedShortType > > * >(0)) == + ::cppu::UnoType< ::cppu::UnoSequenceType< ::cppu::UnoSequenceType< + ::cppu::UnoUnsignedShortType > > >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourChar( + static_cast< css::uno::Sequence< css::uno::Sequence< + ::sal_uInt16 > > * >(0)) == + ::cppu::UnoType< ::cppu::UnoSequenceType< ::cppu::UnoSequenceType< + ::cppu::UnoCharType > > >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourChar( + static_cast< css::uno::Sequence< ::sal_Unicode > * >(0)) == + ::cppu::UnoType< + ::cppu::UnoSequenceType< ::cppu::UnoCharType > >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourChar( + static_cast< css::uno::Sequence< css::uno::Sequence< + ::sal_Unicode > > * >(0)) == + ::cppu::UnoType< ::cppu::UnoSequenceType< ::cppu::UnoSequenceType< + ::cppu::UnoCharType > > >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourChar(static_cast< css::uno::TypeClass * >(0)) == + ::cppu::UnoType< css::uno::TypeClass >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourChar(static_cast< css::uno::TypeClass * >(0)) == + ::getCppuType< css::uno::TypeClass >()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourChar( + static_cast< css::lang::EventObject * >(0)) == + ::cppu::UnoType< css::lang::EventObject >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourChar( + static_cast< css::lang::EventObject * >(0)) == + ::getCppuType< css::lang::EventObject >()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourChar(static_cast< DerivedStruct1 * >(0)) == + ::cppu::UnoType< css::lang::EventObject >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourChar(static_cast< DerivedStruct1 * >(0)) == + ::getCppuType< DerivedStruct1 >()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourChar( + static_cast< css::beans::PropertyChangeEvent * >(0)) == + ::cppu::UnoType< css::beans::PropertyChangeEvent >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourChar( + static_cast< css::beans::PropertyChangeEvent * >(0)) == + ::getCppuType< css::beans::PropertyChangeEvent >()); +#if !(defined __SUNPRO_CC && __SUNPRO_CC <= 0x550) // erroneous ambiguity stated + CPPUNIT_ASSERT( + ::cppu::getTypeFavourChar(static_cast< DerivedStruct2 * >(0)) == + ::cppu::UnoType< css::beans::PropertyChangeEvent >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourChar(static_cast< DerivedStruct2 * >(0)) == + ::getCppuType< DerivedStruct2 >()); +#endif + CPPUNIT_ASSERT( + ::cppu::getTypeFavourChar( + static_cast< css::beans::Optional< ::sal_Int8 > * >(0)) == + ::cppu::UnoType< css::beans::Optional< ::sal_Int8 > >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourChar( + static_cast< css::beans::Optional< ::sal_Int8 > * >(0)) == + ::getCppuType< css::beans::Optional< ::sal_Int8 > >()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourChar(static_cast< css::uno::Exception * >(0)) == + ::cppu::UnoType< css::uno::Exception >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourChar(static_cast< css::uno::Exception * >(0)) == + ::getCppuType< css::uno::Exception >()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourChar(static_cast< DerivedException1 * >(0)) == + ::cppu::UnoType< css::uno::Exception >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourChar(static_cast< DerivedException1 * >(0)) == + ::getCppuType< DerivedException1 >()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourChar( + static_cast< css::uno::RuntimeException * >(0)) == + ::cppu::UnoType< css::uno::RuntimeException >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourChar( + static_cast< css::uno::RuntimeException * >(0)) == + ::getCppuType< css::uno::RuntimeException >()); +#if !(defined __SUNPRO_CC && __SUNPRO_CC <= 0x550) // erroneous ambiguity stated + CPPUNIT_ASSERT( + ::cppu::getTypeFavourChar(static_cast< DerivedException2 * >(0)) == + ::cppu::UnoType< css::uno::RuntimeException >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourChar(static_cast< DerivedException2 * >(0)) == + ::getCppuType< DerivedException2 >()); +#endif + CPPUNIT_ASSERT( + ::cppu::getTypeFavourChar( + static_cast< css::uno::XInterface * >(0)) == + ::cppu::UnoType< css::uno::XInterface >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourChar( + static_cast< css::uno::Reference< css::uno::XInterface > * >(0)) == + ::cppu::UnoType< css::uno::XInterface >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourChar( + static_cast< css::uno::Reference< css::uno::XInterface > * >(0)) == + ::getCppuType< css::uno::Reference< css::uno::XInterface > >()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourChar(static_cast< DerivedInterface1 * >(0)) == + ::cppu::UnoType< css::uno::XInterface >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourChar( + static_cast< css::uno::Reference< DerivedInterface1 > * >(0)) == + ::cppu::UnoType< css::uno::XInterface >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourChar( + static_cast< css::uno::XComponentContext * >(0)) == + ::cppu::UnoType< css::uno::XComponentContext >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourChar( + static_cast< + css::uno::Reference< css::uno::XComponentContext > * >(0)) == + ::cppu::UnoType< css::uno::XComponentContext >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourChar( + static_cast< + css::uno::Reference< css::uno::XComponentContext > * >(0)) == + ::getCppuType< css::uno::Reference< css::uno::XComponentContext > >()); +#if !(defined __SUNPRO_CC && __SUNPRO_CC <= 0x550) // erroneous ambiguity stated + CPPUNIT_ASSERT( + ::cppu::getTypeFavourChar(static_cast< DerivedInterface2 * >(0)) == + ::cppu::UnoType< css::uno::XComponentContext >::get()); + CPPUNIT_ASSERT( + ::cppu::getTypeFavourChar( + static_cast< css::uno::Reference< DerivedInterface2 > * >(0)) == + ::cppu::UnoType< css::uno::XComponentContext >::get()); +#endif +} + +CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(Test, "alltests"); + +} + +NOADDITIONAL; diff --git a/cppu/qa/types.idl b/cppu/qa/types.idl new file mode 100644 index 000000000000..1d62b5c33b26 --- /dev/null +++ b/cppu/qa/types.idl @@ -0,0 +1,66 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: types.idl,v $ + * $Revision: 1.5.14.1 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "com/sun/star/uno/Exception.idl" +#include "com/sun/star/uno/XInterface.idl" + +enum Enum1 { M0, M1, M2 }; + +enum Enum2 { M0, M1, M2 }; + +struct Struct1 { long member; }; + +struct Struct2 { long member; }; + +struct Struct2a: Struct2 { long member2; }; + +struct Struct2b: Struct2a { long member3; }; + +struct Poly< T > { long member; }; + +struct Rec { sequence< Rec > x; }; + +exception Exception1: com::sun::star::uno::Exception { long member; }; + +exception Exception2: com::sun::star::uno::Exception { long member; }; + +exception Exception2a: Exception2 { long member2; }; + +exception Exception2b: Exception2a {}; + +interface Interface1 {}; + +interface Interface2 {}; + +interface Interface2a: Interface2 {}; + +interface Interface2b: Interface2a {}; + +interface Interface3 {}; diff --git a/cppu/qa/version.map b/cppu/qa/version.map new file mode 100644 index 000000000000..1bc00f407b81 --- /dev/null +++ b/cppu/qa/version.map @@ -0,0 +1,38 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2008 by Sun Microsystems, Inc. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# $RCSfile: version.map,v $ +# +# $Revision: 1.4 $ +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# <http://www.openoffice.org/license.html> +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +UDK_3_0_0 { + global: + registerAllTestFunction; + + local: + *; +}; |