LCOV - code coverage report
Current view: top level - libreoffice/cppu/qa - test_any.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 1123 1150 97.7 %
Date: 2012-12-17 Functions: 50 54 92.6 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       5             :  * This Source Code Form is subject to the terms of the Mozilla Public
       6             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       7             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       8             :  *
       9             :  * This file incorporates work covered by the following license notice:
      10             :  *
      11             :  *   Licensed to the Apache Software Foundation (ASF) under one or more
      12             :  *   contributor license agreements. See the NOTICE file distributed
      13             :  *   with this work for additional information regarding copyright
      14             :  *   ownership. The ASF licenses this file to you under the Apache
      15             :  *   License, Version 2.0 (the "License"); you may not use this file
      16             :  *   except in compliance with the License. You may obtain a copy of
      17             :  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
      18             :  */
      19             : 
      20             : #include <sal/types.h>
      21             : 
      22             : #include <stdlib.h> // wntmsci10 does not like <cstdlib>
      23             : 
      24             : #include <cppunit/TestSuite.h>
      25             : #include <cppunit/TestFixture.h>
      26             : #include <cppunit/TestCase.h>
      27             : #include <cppunit/plugin/TestPlugIn.h>
      28             : #include <cppunit/extensions/HelperMacros.h>
      29             : 
      30             : #include "Enum1.hpp"
      31             : #include "Enum2.hpp"
      32             : #include "Exception1.hpp"
      33             : #include "Exception2.hpp"
      34             : #include "Exception2a.hpp"
      35             : #include "Exception2b.hpp"
      36             : #include "Interface1.hpp"
      37             : #include "Interface2.hpp"
      38             : #include "Interface2a.hpp"
      39             : #include "Interface2b.hpp"
      40             : #include "Interface3.hpp"
      41             : #include "Poly.hpp"
      42             : #include "Struct1.hpp"
      43             : #include "Struct2.hpp"
      44             : #include "Struct2a.hpp"
      45             : #include "Struct2b.hpp"
      46             : #include "boost/type_traits/is_same.hpp"
      47             : #include "com/sun/star/uno/Any.hxx"
      48             : #include "com/sun/star/uno/Reference.hxx"
      49             : #include "com/sun/star/uno/RuntimeException.hpp"
      50             : #include "com/sun/star/uno/Sequence.hxx"
      51             : #include "com/sun/star/uno/Type.hxx"
      52             : #include "com/sun/star/uno/XInterface.hpp"
      53             : #include "osl/diagnose.h"
      54             : #include "osl/interlck.h"
      55             : #include "rtl/string.h"
      56             : #include "rtl/ustring.h"
      57             : #include "rtl/ustring.hxx"
      58             : #include "sal/types.h"
      59             : 
      60             : namespace {
      61             : 
      62             : class Base {
      63             : public:
      64          58 :     Base(): m_count(0) {}
      65             : 
      66         120 :     void acquire() {
      67         120 :         if (osl_atomic_increment(&m_count) == SAL_MAX_INT32) {
      68           0 :             abort();
      69             :         }
      70         120 :     }
      71             : 
      72         120 :     void release() {
      73         120 :         if (osl_atomic_decrement(&m_count) == 0) {
      74          58 :             delete this;
      75             :         }
      76         120 :     }
      77             : 
      78             : protected:
      79          58 :     virtual ~Base() {}
      80             : 
      81             : private:
      82             :     Base(Base &); // not declared
      83             :     void operator =(Base &); // not declared
      84             : 
      85             :     oslInterlockedCount m_count;
      86             : };
      87             : 
      88         120 : class Impl1: public Interface1, private Base {
      89             : public:
      90           0 :     virtual css::uno::Any SAL_CALL queryInterface(css::uno::Type const & type)
      91             :         throw (css::uno::RuntimeException)
      92             :     {
      93           0 :         if (type
      94           0 :             == getCppuType< css::uno::Reference< css::uno::XInterface > >())
      95             :         {
      96             :             css::uno::Reference< css::uno::XInterface > ref(
      97           0 :                 static_cast< css::uno::XInterface * >(this));
      98           0 :             return css::uno::Any(&ref, type);
      99           0 :         } else if (type == getCppuType< css::uno::Reference< Interface1 > >()) {
     100           0 :             css::uno::Reference< Interface1 > ref(this);
     101           0 :             return css::uno::Any(&ref, type);
     102             :         } else {
     103           0 :             return css::uno::Any();
     104             :         }
     105             :     }
     106             : 
     107          78 :     virtual void SAL_CALL acquire() throw () {
     108          78 :         Base::acquire();
     109          78 :     }
     110             : 
     111          78 :     virtual void SAL_CALL release() throw () {
     112          78 :         Base::release();
     113          78 :     }
     114             : };
     115             : 
     116          42 : class Impl2: public Interface2a, public Interface3, private Base {
     117             : public:
     118          12 :     virtual css::uno::Any SAL_CALL queryInterface(css::uno::Type const & type)
     119             :         throw (css::uno::RuntimeException)
     120             :     {
     121          12 :         if (type
     122          12 :             == getCppuType< css::uno::Reference< css::uno::XInterface > >())
     123             :         {
     124             :             css::uno::Reference< css::uno::XInterface > ref(
     125             :                 static_cast< css::uno::XInterface * >(
     126           4 :                     static_cast< Interface2a * >(this)));
     127           4 :             return css::uno::Any(&ref, type);
     128           8 :         } else if (type == getCppuType< css::uno::Reference< Interface2 > >()) {
     129           2 :             css::uno::Reference< Interface2 > ref(this);
     130           2 :             return css::uno::Any(&ref, type);
     131           6 :         } else if (type == getCppuType< css::uno::Reference< Interface2a > >())
     132             :         {
     133           0 :             css::uno::Reference< Interface2a > ref(this);
     134           0 :             return css::uno::Any(&ref, type);
     135           6 :         } else if (type == getCppuType< css::uno::Reference< Interface3 > >()) {
     136           2 :             css::uno::Reference< Interface3 > ref(this);
     137           2 :             return css::uno::Any(&ref, type);
     138             :         } else {
     139           4 :             return css::uno::Any();
     140             :         }
     141             :     }
     142             : 
     143          36 :     virtual void SAL_CALL acquire() throw () {
     144          36 :         Base::acquire();
     145          36 :     }
     146             : 
     147          36 :     virtual void SAL_CALL release() throw () {
     148          36 :         Base::release();
     149          36 :     }
     150             : };
     151             : 
     152          12 : class Impl2b: public Interface2b, private Base {
     153             : public:
     154           0 :     virtual css::uno::Any SAL_CALL queryInterface(css::uno::Type const & type)
     155             :         throw (css::uno::RuntimeException)
     156             :     {
     157           0 :         if (type
     158           0 :             == getCppuType< css::uno::Reference< css::uno::XInterface > >())
     159             :         {
     160             :             css::uno::Reference< css::uno::XInterface > ref(
     161             :                 static_cast< css::uno::XInterface * >(
     162           0 :                     static_cast< Interface2a * >(this)));
     163           0 :             return css::uno::Any(&ref, type);
     164           0 :         } else if (type == getCppuType< css::uno::Reference< Interface2 > >()) {
     165           0 :             css::uno::Reference< Interface2 > ref(this);
     166           0 :             return css::uno::Any(&ref, type);
     167           0 :         } else if (type == getCppuType< css::uno::Reference< Interface2a > >())
     168             :         {
     169           0 :             css::uno::Reference< Interface2a > ref(this);
     170           0 :             return css::uno::Any(&ref, type);
     171           0 :         } else if (type == getCppuType< css::uno::Reference< Interface2b > >())
     172             :         {
     173           0 :             css::uno::Reference< Interface2b > ref(this);
     174           0 :             return css::uno::Any(&ref, type);
     175             :         } else {
     176           0 :             return css::uno::Any();
     177             :         }
     178             :     }
     179             : 
     180           6 :     virtual void SAL_CALL acquire() throw () {
     181           6 :         Base::acquire();
     182           6 :     }
     183             : 
     184           6 :     virtual void SAL_CALL release() throw () {
     185           6 :         Base::release();
     186           6 :     }
     187             : };
     188             : 
     189         126 : class Test: public CppUnit::TestFixture {
     190             : public:
     191             :     void testVoid();
     192             :     void testBoolean();
     193             :     void testByte();
     194             :     void testShort();
     195             :     void testUnsignedShort();
     196             :     void testLong();
     197             :     void testUnsignedLong();
     198             :     void testHyper();
     199             :     void testUnsignedHyper();
     200             :     void testFloat();
     201             :     void testDouble();
     202             :     void testChar();
     203             :     void testString();
     204             :     void testType();
     205             :     void testSequence();
     206             :     void testEnum();
     207             :     void testStruct();
     208             :     void testPoly();
     209             :     void testException();
     210             :     void testInterface();
     211             :     void testNull();
     212             : 
     213           4 :     CPPUNIT_TEST_SUITE(Test);
     214           2 :     CPPUNIT_TEST(testVoid);
     215           2 :     CPPUNIT_TEST(testBoolean);
     216           2 :     CPPUNIT_TEST(testByte);
     217           2 :     CPPUNIT_TEST(testShort);
     218           2 :     CPPUNIT_TEST(testUnsignedShort);
     219           2 :     CPPUNIT_TEST(testLong);
     220           2 :     CPPUNIT_TEST(testUnsignedLong);
     221           2 :     CPPUNIT_TEST(testHyper);
     222           2 :     CPPUNIT_TEST(testUnsignedHyper);
     223           2 :     CPPUNIT_TEST(testFloat);
     224           2 :     CPPUNIT_TEST(testDouble);
     225           2 :     CPPUNIT_TEST(testChar);
     226           2 :     CPPUNIT_TEST(testString);
     227           2 :     CPPUNIT_TEST(testType);
     228           2 :     CPPUNIT_TEST(testSequence);
     229           2 :     CPPUNIT_TEST(testEnum);
     230           2 :     CPPUNIT_TEST(testStruct);
     231           2 :     CPPUNIT_TEST(testPoly);
     232           2 :     CPPUNIT_TEST(testException);
     233           2 :     CPPUNIT_TEST(testInterface);
     234           2 :     CPPUNIT_TEST(testNull);
     235           4 :     CPPUNIT_TEST_SUITE_END();
     236             : };
     237             : 
     238           2 : void Test::testVoid() {
     239           2 :     css::uno::Any a;
     240           2 :     CPPUNIT_ASSERT(a.getValueType() == getVoidCppuType());
     241             :     {
     242           2 :         bool b = true;
     243           2 :         CPPUNIT_ASSERT_MESSAGE("bool", !(a >>= b) && b);
     244             :     }
     245             :     {
     246           2 :         sal_Bool b = true;
     247           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b) && b);
     248             :     }
     249             :     {
     250           2 :         sal_Int8 b = 2;
     251           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a >>= b) && b == 2);
     252             :     }
     253             :     {
     254           2 :         sal_uInt8 b = 2;
     255           2 :         CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a >>= b) && b == 2);
     256             :     }
     257             :     {
     258           2 :         sal_Int16 b = 2;
     259           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a >>= b) && b == 2);
     260             :     }
     261             :     {
     262           2 :         sal_uInt16 b = 2;
     263           2 :         CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a >>= b) && b == 2);
     264             :     }
     265             :     {
     266           2 :         sal_Int32 b = 2;
     267           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a >>= b) && b == 2);
     268             :     }
     269             :     {
     270           2 :         sal_uInt32 b = 2;
     271           2 :         CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a >>= b) && b == 2);
     272             :     }
     273             :     {
     274           2 :         sal_Int64 b = 2;
     275           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Int64", !(a >>= b) && b == 2);
     276             :     }
     277             :     {
     278           2 :         sal_uInt64 b = 2;
     279           2 :         CPPUNIT_ASSERT_MESSAGE("sal_uInt64", !(a >>= b) && b == 2);
     280             :     }
     281             :     {
     282           2 :         float b = 2;
     283           2 :         CPPUNIT_ASSERT_MESSAGE("float", !(a >>= b) && b == 2);
     284             :     }
     285             :     {
     286           2 :         double b = 2;
     287           2 :         CPPUNIT_ASSERT_MESSAGE("double", !(a >>= b) && b == 2);
     288             :     }
     289             :     {
     290           2 :         sal_Unicode b = '2';
     291           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a >>= b) && b == '2');
     292             :     }
     293             :     {
     294           2 :         rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2"));
     295           2 :         CPPUNIT_ASSERT_MESSAGE( "rtl::OUString", !(a >>= b) && b == "2" );
     296             :     }
     297             :     {
     298           2 :         css::uno::Type b(getCppuType< rtl::OUString >());
     299           4 :         CPPUNIT_ASSERT_MESSAGE(
     300             :             "css::uno::Type",
     301           4 :             !(a >>= b) && b == getCppuType< rtl::OUString >());
     302             :     }
     303             :     {
     304           2 :         css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
     305           2 :         CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a >>= b) && b == a);
     306             :     }
     307             :     {
     308           2 :         css::uno::Sequence< rtl::OUString > b(2);
     309           4 :         CPPUNIT_ASSERT_MESSAGE(
     310           4 :             "css::uno::Sequence<rtl::OUString>", !(a >>= b) && b.getLength() == 2);
     311             :     }
     312             :     {
     313           2 :         Enum1 b = Enum1_M2;
     314           2 :         CPPUNIT_ASSERT_MESSAGE("Enum1", !(a >>= b) && b == Enum1_M2);
     315             :     }
     316             :     {
     317           2 :         Struct1 b(2);
     318           2 :         CPPUNIT_ASSERT_MESSAGE("Struct1", !(a >>= b) && b.member == 2);
     319             :     }
     320             :     {
     321             :         Exception1 b(
     322           2 :             rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2);
     323           2 :         CPPUNIT_ASSERT_MESSAGE("Exception1", !(a >>= b) && b.member == 2);
     324             :     }
     325             :     {
     326           2 :         css::uno::Reference< Interface1 > i(new Impl1);
     327           2 :         css::uno::Reference< Interface1 > b(i);
     328           2 :         CPPUNIT_ASSERT_MESSAGE("Interface1", !(a >>= b) && b == i);
     329           2 :     }
     330           2 : }
     331             : 
     332           2 : void Test::testBoolean() {
     333           2 :     css::uno::Any a(false);
     334           2 :     CPPUNIT_ASSERT(a.getValueType() == getCppuType< sal_Bool >());
     335             :     {
     336           2 :         bool b = true;
     337           2 :         CPPUNIT_ASSERT_MESSAGE("bool", (a >>= b) && !b);
     338             :     }
     339             :     {
     340           2 :         sal_Bool b = true;
     341           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Bool", (a >>= b) && !b);
     342             :     }
     343             :     {
     344           2 :         sal_Int8 b = 2;
     345           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a >>= b) && b == 2);
     346             :     }
     347             :     {
     348           2 :         sal_uInt8 b = 2;
     349             :         if (boost::is_same< sal_uInt8, sal_Bool >::value) {
     350           2 :             CPPUNIT_ASSERT_MESSAGE("@sal_uInt8", (a >>= b) && b == 0);
     351             :         } else {
     352             :             CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a >>= b) && b == 2);
     353             :         }
     354             :     }
     355             :     {
     356           2 :         sal_Int16 b = 2;
     357           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a >>= b) && b == 2);
     358             :     }
     359             :     {
     360           2 :         sal_uInt16 b = 2;
     361           2 :         CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a >>= b) && b == 2);
     362             :     }
     363             :     {
     364           2 :         sal_Int32 b = 2;
     365           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a >>= b) && b == 2);
     366             :     }
     367             :     {
     368           2 :         sal_uInt32 b = 2;
     369           2 :         CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a >>= b) && b == 2);
     370             :     }
     371             :     {
     372           2 :         sal_Int64 b = 2;
     373           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Int64", !(a >>= b) && b == 2);
     374             :     }
     375             :     {
     376           2 :         sal_uInt64 b = 2;
     377           2 :         CPPUNIT_ASSERT_MESSAGE("sal_uInt64", !(a >>= b) && b == 2);
     378             :     }
     379             :     {
     380           2 :         float b = 2;
     381           2 :         CPPUNIT_ASSERT_MESSAGE("float", !(a >>= b) && b == 2);
     382             :     }
     383             :     {
     384           2 :         double b = 2;
     385           2 :         CPPUNIT_ASSERT_MESSAGE("double", !(a >>= b) && b == 2);
     386             :     }
     387             :     {
     388           2 :         sal_Unicode b = '2';
     389           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a >>= b) && b == '2');
     390             :     }
     391             :     {
     392           2 :         rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2"));
     393           2 :         CPPUNIT_ASSERT_MESSAGE( "rtl::OUString", !(a >>= b) && b == "2" );
     394             :     }
     395             :     {
     396           2 :         css::uno::Type b(getCppuType< rtl::OUString >());
     397           4 :         CPPUNIT_ASSERT_MESSAGE(
     398             :             "css::uno::Type",
     399           4 :             !(a >>= b) && b == getCppuType< rtl::OUString >());
     400             :     }
     401             :     {
     402           2 :         css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
     403           2 :         CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a >>= b) && b == a);
     404             :     }
     405             :     {
     406           2 :         css::uno::Sequence< rtl::OUString > b(2);
     407           4 :         CPPUNIT_ASSERT_MESSAGE(
     408             :             "css::uno::Sequence<rtl::OUString>",
     409           4 :             !(a >>= b) && b.getLength() == 2);
     410             :     }
     411             :     {
     412           2 :         Enum1 b = Enum1_M2;
     413           2 :         CPPUNIT_ASSERT_MESSAGE("Enum1", !(a >>= b) && b == Enum1_M2);
     414             :     }
     415             :     {
     416           2 :         Struct1 b(2);
     417           2 :         CPPUNIT_ASSERT_MESSAGE("Struct1", !(a >>= b) && b.member == 2);
     418             :     }
     419             :     {
     420             :         Exception1 b(
     421           2 :             rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2);
     422           2 :         CPPUNIT_ASSERT_MESSAGE("Exception1", !(a >>= b) && b.member == 2);
     423             :     }
     424             :     {
     425           2 :         css::uno::Reference< Interface1 > i(new Impl1);
     426           2 :         css::uno::Reference< Interface1 > b(i);
     427           2 :         CPPUNIT_ASSERT_MESSAGE("Interface1", !(a >>= b) && b == i);
     428           2 :     }
     429           2 : }
     430             : 
     431           2 : void Test::testByte() {
     432           2 :     css::uno::Any a(static_cast< sal_Int8 >(1));
     433           2 :     CPPUNIT_ASSERT(a.getValueType() == getCppuType< sal_Int8 >());
     434             :     {
     435           2 :         bool b = true;
     436           2 :         CPPUNIT_ASSERT_MESSAGE("bool", !(a >>= b) && b);
     437             :     }
     438             :     {
     439           2 :         sal_Bool b = true;
     440           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b) && b);
     441             :     }
     442             :     {
     443           2 :         sal_Int8 b = 2;
     444           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Int8", (a >>= b) && b == 1);
     445             :     }
     446             :     {
     447           2 :         sal_uInt8 b = 2;
     448           2 :         CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a >>= b) && b == 2);
     449             :     }
     450             :     {
     451           2 :         sal_Int16 b = 2;
     452           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Int16", (a >>= b) && b == 1);
     453             :     }
     454             :     {
     455           2 :         sal_uInt16 b = 2;
     456           2 :         CPPUNIT_ASSERT_MESSAGE("sal_uInt16", (a >>= b) && b == 1);
     457             :     }
     458             :     {
     459           2 :         sal_Int32 b = 2;
     460           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Int32", (a >>= b) && b == 1);
     461             :     }
     462             :     {
     463           2 :         sal_uInt32 b = 2;
     464           2 :         CPPUNIT_ASSERT_MESSAGE("sal_uInt32", (a >>= b) && b == 1);
     465             :     }
     466             :     {
     467           2 :         sal_Int64 b = 2;
     468           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Int64", (a >>= b) && b == 1);
     469             :     }
     470             :     {
     471           2 :         sal_uInt64 b = 2;
     472           2 :         CPPUNIT_ASSERT_MESSAGE("sal_uInt64", (a >>= b) && b == 1);
     473             :     }
     474             :     {
     475           2 :         float b = 2;
     476           2 :         CPPUNIT_ASSERT_MESSAGE("float", (a >>= b) && b == 1);
     477             :     }
     478             :     {
     479           2 :         double b = 2;
     480           2 :         CPPUNIT_ASSERT_MESSAGE("double", (a >>= b) && b == 1);
     481             :     }
     482             :     {
     483           2 :         sal_Unicode b = '2';
     484             :         if (boost::is_same< sal_Unicode, sal_uInt16 >::value) {
     485           2 :             CPPUNIT_ASSERT_MESSAGE("@sal_Unicode", (a >>= b) && b == 1);
     486             :         } else {
     487             :             CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a >>= b) && b == '2');
     488             :         }
     489             :     }
     490             :     {
     491           2 :         rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2"));
     492           2 :         CPPUNIT_ASSERT_MESSAGE( "rtl::OUString", !(a >>= b) && b == "2" );
     493             :     }
     494             :     {
     495           2 :         css::uno::Type b(getCppuType< rtl::OUString >());
     496           4 :         CPPUNIT_ASSERT_MESSAGE(
     497             :             "css::uno::Type",
     498           4 :             !(a >>= b) && b == getCppuType< rtl::OUString >());
     499             :     }
     500             :     {
     501           2 :         css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
     502           2 :         CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a >>= b) && b == a);
     503             :     }
     504             :     {
     505           2 :         css::uno::Sequence< rtl::OUString > b(2);
     506           4 :         CPPUNIT_ASSERT_MESSAGE(
     507             :             "css::uno::Sequence<rtl::OUString>",
     508           4 :             !(a >>= b) && b.getLength() == 2);
     509             :     }
     510             :     {
     511           2 :         Enum1 b = Enum1_M2;
     512           2 :         CPPUNIT_ASSERT_MESSAGE("Enum1", !(a >>= b) && b == Enum1_M2);
     513             :     }
     514             :     {
     515           2 :         Struct1 b(2);
     516           2 :         CPPUNIT_ASSERT_MESSAGE("Struct1", !(a >>= b) && b.member == 2);
     517             :     }
     518             :     {
     519             :         Exception1 b(
     520           2 :             rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2);
     521           2 :         CPPUNIT_ASSERT_MESSAGE("Exception1", !(a >>= b) && b.member == 2);
     522             :     }
     523             :     {
     524           2 :         css::uno::Reference< Interface1 > i(new Impl1);
     525           2 :         css::uno::Reference< Interface1 > b(i);
     526           2 :         CPPUNIT_ASSERT_MESSAGE("Interface1", !(a >>= b) && b == i);
     527           2 :     }
     528           2 : }
     529             : 
     530           2 : void Test::testShort() {
     531           2 :     css::uno::Any a(static_cast< sal_Int16 >(1));
     532           2 :     CPPUNIT_ASSERT(a.getValueType() == getCppuType< sal_Int16 >());
     533             :     {
     534           2 :         bool b = true;
     535           2 :         CPPUNIT_ASSERT_MESSAGE("bool", !(a >>= b) && b);
     536             :     }
     537             :     {
     538           2 :         sal_Bool b = true;
     539           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b) && b);
     540             :     }
     541             :     {
     542           2 :         sal_Int8 b = 2;
     543           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a >>= b) && b == 2);
     544             :     }
     545             :     {
     546           2 :         sal_uInt8 b = 2;
     547           2 :         CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a >>= b) && b == 2);
     548             :     }
     549             :     {
     550           2 :         sal_Int16 b = 2;
     551           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Int16", (a >>= b) && b == 1);
     552             :     }
     553             :     {
     554           2 :         sal_uInt16 b = 2;
     555           2 :         CPPUNIT_ASSERT_MESSAGE("sal_uInt16", (a >>= b) && b == 1);
     556             :     }
     557             :     {
     558           2 :         sal_Int32 b = 2;
     559           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Int32", (a >>= b) && b == 1);
     560             :     }
     561             :     {
     562           2 :         sal_uInt32 b = 2;
     563           2 :         CPPUNIT_ASSERT_MESSAGE("sal_uInt32", (a >>= b) && b == 1);
     564             :     }
     565             :     {
     566           2 :         sal_Int64 b = 2;
     567           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Int64", (a >>= b) && b == 1);
     568             :     }
     569             :     {
     570           2 :         sal_uInt64 b = 2;
     571           2 :         CPPUNIT_ASSERT_MESSAGE("sal_uInt64", (a >>= b) && b == 1);
     572             :     }
     573             :     {
     574           2 :         float b = 2;
     575           2 :         CPPUNIT_ASSERT_MESSAGE("float", (a >>= b) && b == 1);
     576             :     }
     577             :     {
     578           2 :         double b = 2;
     579           2 :         CPPUNIT_ASSERT_MESSAGE("double", (a >>= b) && b == 1);
     580             :     }
     581             :     {
     582           2 :         sal_Unicode b = '2';
     583             :         if (boost::is_same< sal_Unicode, sal_uInt16 >::value) {
     584           2 :             CPPUNIT_ASSERT_MESSAGE("@sal_Unicode", (a >>= b) && b == 1);
     585             :         } else {
     586             :             CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a >>= b) && b == '2');
     587             :         }
     588             :     }
     589             :     {
     590           2 :         rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2"));
     591           2 :         CPPUNIT_ASSERT_MESSAGE( "rtl::OUString", !(a >>= b) && b == "2" );
     592             :     }
     593             :     {
     594           2 :         css::uno::Type b(getCppuType< rtl::OUString >());
     595           4 :         CPPUNIT_ASSERT_MESSAGE(
     596             :             "css::uno::Type",
     597           4 :             !(a >>= b) && b == getCppuType< rtl::OUString >());
     598             :     }
     599             :     {
     600           2 :         css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
     601           2 :         CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a >>= b) && b == a);
     602             :     }
     603             :     {
     604           2 :         css::uno::Sequence< rtl::OUString > b(2);
     605           4 :         CPPUNIT_ASSERT_MESSAGE(
     606             :             "css::uno::Sequence<rtl::OUString>",
     607           4 :             !(a >>= b) && b.getLength() == 2);
     608             :     }
     609             :     {
     610           2 :         Enum1 b = Enum1_M2;
     611           2 :         CPPUNIT_ASSERT_MESSAGE("Enum1", !(a >>= b) && b == Enum1_M2);
     612             :     }
     613             :     {
     614           2 :         Struct1 b(2);
     615           2 :         CPPUNIT_ASSERT_MESSAGE("Struct1", !(a >>= b) && b.member == 2);
     616             :     }
     617             :     {
     618             :         Exception1 b(
     619           2 :             rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2);
     620           2 :         CPPUNIT_ASSERT_MESSAGE("Exception1", !(a >>= b) && b.member == 2);
     621             :     }
     622             :     {
     623           2 :         css::uno::Reference< Interface1 > i(new Impl1);
     624           2 :         css::uno::Reference< Interface1 > b(i);
     625           2 :         CPPUNIT_ASSERT_MESSAGE("Interface1", !(a >>= b) && b == i);
     626           2 :     }
     627           2 : }
     628             : 
     629           2 : void Test::testUnsignedShort() {
     630           2 :     sal_uInt16 n = 1;
     631           2 :     css::uno::Any a(&n, getCppuType(static_cast< sal_uInt16 const * >(0)));
     632           4 :     CPPUNIT_ASSERT(
     633           2 :         a.getValueType() == getCppuType(static_cast< sal_uInt16 const * >(0)));
     634             :     {
     635           2 :         bool b = true;
     636           2 :         CPPUNIT_ASSERT_MESSAGE("bool", !(a >>= b) && b);
     637             :     }
     638             :     {
     639           2 :         sal_Bool b = true;
     640           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b) && b);
     641             :     }
     642             :     {
     643           2 :         sal_Int8 b = 2;
     644           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a >>= b) && b == 2);
     645             :     }
     646             :     {
     647           2 :         sal_uInt8 b = 2;
     648           2 :         CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a >>= b) && b == 2);
     649             :     }
     650             :     {
     651           2 :         sal_Int16 b = 2;
     652           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Int16", (a >>= b) && b == 1);
     653             :     }
     654             :     {
     655           2 :         sal_uInt16 b = 2;
     656           2 :         CPPUNIT_ASSERT_MESSAGE("sal_uInt16", (a >>= b) && b == 1);
     657             :     }
     658             :     {
     659           2 :         sal_Int32 b = 2;
     660           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Int32", (a >>= b) && b == 1);
     661             :     }
     662             :     {
     663           2 :         sal_uInt32 b = 2;
     664           2 :         CPPUNIT_ASSERT_MESSAGE("sal_uInt32", (a >>= b) && b == 1);
     665             :     }
     666             :     {
     667           2 :         sal_Int64 b = 2;
     668           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Int64", (a >>= b) && b == 1);
     669             :     }
     670             :     {
     671           2 :         sal_uInt64 b = 2;
     672           2 :         CPPUNIT_ASSERT_MESSAGE("sal_uInt64", (a >>= b) && b == 1);
     673             :     }
     674             :     {
     675           2 :         float b = 2;
     676           2 :         CPPUNIT_ASSERT_MESSAGE("float", (a >>= b) && b == 1);
     677             :     }
     678             :     {
     679           2 :         double b = 2;
     680           2 :         CPPUNIT_ASSERT_MESSAGE("double", (a >>= b) && b == 1);
     681             :     }
     682             :     {
     683           2 :         sal_Unicode b = '2';
     684             :         if (boost::is_same< sal_Unicode, sal_uInt16 >::value) {
     685           2 :             CPPUNIT_ASSERT_MESSAGE("@sal_Unicode", (a >>= b) && b == 1);
     686             :         } else {
     687             :             CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a >>= b) && b == '2');
     688             :         }
     689             :     }
     690             :     {
     691           2 :         rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2"));
     692           2 :         CPPUNIT_ASSERT_MESSAGE( "rtl::OUString", !(a >>= b) && b == "2" );
     693             :     }
     694             :     {
     695           2 :         css::uno::Type b(getCppuType< rtl::OUString >());
     696           4 :         CPPUNIT_ASSERT_MESSAGE(
     697             :             "css::uno::Type",
     698           4 :             !(a >>= b) && b == getCppuType< rtl::OUString >());
     699             :     }
     700             :     {
     701           2 :         css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
     702           2 :         CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a >>= b) && b == a);
     703             :     }
     704             :     {
     705           2 :         css::uno::Sequence< rtl::OUString > b(2);
     706           4 :         CPPUNIT_ASSERT_MESSAGE(
     707             :             "css::uno::Sequence<rtl::OUString>",
     708           4 :             !(a >>= b) && b.getLength() == 2);
     709             :     }
     710             :     {
     711           2 :         Enum1 b = Enum1_M2;
     712           2 :         CPPUNIT_ASSERT_MESSAGE("Enum1", !(a >>= b) && b == Enum1_M2);
     713             :     }
     714             :     {
     715           2 :         Struct1 b(2);
     716           2 :         CPPUNIT_ASSERT_MESSAGE("Struct1", !(a >>= b) && b.member == 2);
     717             :     }
     718             :     {
     719             :         Exception1 b(
     720           2 :             rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2);
     721           2 :         CPPUNIT_ASSERT_MESSAGE("Exception1", !(a >>= b) && b.member == 2);
     722             :     }
     723             :     {
     724           2 :         css::uno::Reference< Interface1 > i(new Impl1);
     725           2 :         css::uno::Reference< Interface1 > b(i);
     726           2 :         CPPUNIT_ASSERT_MESSAGE("Interface1", !(a >>= b) && b == i);
     727           2 :     }
     728           2 : }
     729             : 
     730           2 : void Test::testLong() {
     731           2 :     css::uno::Any a(static_cast< sal_Int32 >(1));
     732           2 :     CPPUNIT_ASSERT(a.getValueType() == getCppuType< sal_Int32 >());
     733             :     {
     734           2 :         bool b = true;
     735           2 :         CPPUNIT_ASSERT_MESSAGE("bool", !(a >>= b) && b);
     736             :     }
     737             :     {
     738           2 :         sal_Bool b = true;
     739           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b) && b);
     740             :     }
     741             :     {
     742           2 :         sal_Int8 b = 2;
     743           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a >>= b) && b == 2);
     744             :     }
     745             :     {
     746           2 :         sal_uInt8 b = 2;
     747           2 :         CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a >>= b) && b == 2);
     748             :     }
     749             :     {
     750           2 :         sal_Int16 b = 2;
     751           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a >>= b) && b == 2);
     752             :     }
     753             :     {
     754           2 :         sal_uInt16 b = 2;
     755           2 :         CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a >>= b) && b == 2);
     756             :     }
     757             :     {
     758           2 :         sal_Int32 b = 2;
     759           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Int32", (a >>= b) && b == 1);
     760             :     }
     761             :     {
     762           2 :         sal_uInt32 b = 2;
     763           2 :         CPPUNIT_ASSERT_MESSAGE("sal_uInt32", (a >>= b) && b == 1);
     764             :     }
     765             :     {
     766           2 :         sal_Int64 b = 2;
     767           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Int64", (a >>= b) && b == 1);
     768             :     }
     769             :     {
     770           2 :         sal_uInt64 b = 2;
     771           2 :         CPPUNIT_ASSERT_MESSAGE("sal_uInt64", (a >>= b) && b == 1);
     772             :     }
     773             :     {
     774           2 :         float b = 2;
     775           2 :         CPPUNIT_ASSERT_MESSAGE("float", !(a >>= b) && b == 2);
     776             :     }
     777             :     {
     778           2 :         double b = 2;
     779           2 :         CPPUNIT_ASSERT_MESSAGE("double", (a >>= b) && b == 1);
     780             :     }
     781             :     {
     782           2 :         sal_Unicode b = '2';
     783           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a >>= b) && b == '2');
     784             :     }
     785             :     {
     786           2 :         rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2"));
     787           2 :         CPPUNIT_ASSERT_MESSAGE( "rtl::OUString", !(a >>= b) && b == "2" );
     788             :     }
     789             :     {
     790           2 :         css::uno::Type b(getCppuType< rtl::OUString >());
     791           4 :         CPPUNIT_ASSERT_MESSAGE(
     792             :             "css::uno::Type",
     793           4 :             !(a >>= b) && b == getCppuType< rtl::OUString >());
     794             :     }
     795             :     {
     796           2 :         css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
     797           2 :         CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a >>= b) && b == a);
     798             :     }
     799             :     {
     800           2 :         css::uno::Sequence< rtl::OUString > b(2);
     801           4 :         CPPUNIT_ASSERT_MESSAGE(
     802             :             "css::uno::Sequence<rtl::OUString>",
     803           4 :             !(a >>= b) && b.getLength() == 2);
     804             :     }
     805             :     {
     806           2 :         Enum1 b = Enum1_M2;
     807           2 :         CPPUNIT_ASSERT_MESSAGE("Enum1", !(a >>= b) && b == Enum1_M2);
     808             :     }
     809             :     {
     810           2 :         Struct1 b(2);
     811           2 :         CPPUNIT_ASSERT_MESSAGE("Struct1", !(a >>= b) && b.member == 2);
     812             :     }
     813             :     {
     814             :         Exception1 b(
     815           2 :             rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2);
     816           2 :         CPPUNIT_ASSERT_MESSAGE("Exception1", !(a >>= b) && b.member == 2);
     817             :     }
     818             :     {
     819           2 :         css::uno::Reference< Interface1 > i(new Impl1);
     820           2 :         css::uno::Reference< Interface1 > b(i);
     821           2 :         CPPUNIT_ASSERT_MESSAGE("Interface1", !(a >>= b) && b == i);
     822           2 :     }
     823           2 : }
     824             : 
     825           2 : void Test::testUnsignedLong() {
     826           2 :     css::uno::Any a(static_cast< sal_uInt32 >(1));
     827           2 :     CPPUNIT_ASSERT(a.getValueType() == getCppuType< sal_uInt32 >());
     828             :     {
     829           2 :         bool b = true;
     830           2 :         CPPUNIT_ASSERT_MESSAGE("bool", !(a >>= b) && b);
     831             :     }
     832             :     {
     833           2 :         sal_Bool b = true;
     834           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b) && b);
     835             :     }
     836             :     {
     837           2 :         sal_Int8 b = 2;
     838           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a >>= b) && b == 2);
     839             :     }
     840             :     {
     841           2 :         sal_uInt8 b = 2;
     842           2 :         CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a >>= b) && b == 2);
     843             :     }
     844             :     {
     845           2 :         sal_Int16 b = 2;
     846           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a >>= b) && b == 2);
     847             :     }
     848             :     {
     849           2 :         sal_uInt16 b = 2;
     850           2 :         CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a >>= b) && b == 2);
     851             :     }
     852             :     {
     853           2 :         sal_Int32 b = 2;
     854           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Int32", (a >>= b) && b == 1);
     855             :     }
     856             :     {
     857           2 :         sal_uInt32 b = 2;
     858           2 :         CPPUNIT_ASSERT_MESSAGE("sal_uInt32", (a >>= b) && b == 1);
     859             :     }
     860             :     {
     861           2 :         sal_Int64 b = 2;
     862           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Int64", (a >>= b) && b == 1);
     863             :     }
     864             :     {
     865           2 :         sal_uInt64 b = 2;
     866           2 :         CPPUNIT_ASSERT_MESSAGE("sal_uInt64", (a >>= b) && b == 1);
     867             :     }
     868             :     {
     869           2 :         float b = 2;
     870           2 :         CPPUNIT_ASSERT_MESSAGE("float", !(a >>= b) && b == 2);
     871             :     }
     872             :     {
     873           2 :         double b = 2;
     874           2 :         CPPUNIT_ASSERT_MESSAGE("double", (a >>= b) && b == 1);
     875             :     }
     876             :     {
     877           2 :         sal_Unicode b = '2';
     878           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a >>= b) && b == '2');
     879             :     }
     880             :     {
     881           2 :         rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2"));
     882           2 :         CPPUNIT_ASSERT_MESSAGE( "rtl::OUString", !(a >>= b) && b == "2" );
     883             :     }
     884             :     {
     885           2 :         css::uno::Type b(getCppuType< rtl::OUString >());
     886           4 :         CPPUNIT_ASSERT_MESSAGE(
     887             :             "css::uno::Type",
     888           4 :             !(a >>= b) && b == getCppuType< rtl::OUString >());
     889             :     }
     890             :     {
     891           2 :         css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
     892           2 :         CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a >>= b) && b == a);
     893             :     }
     894             :     {
     895           2 :         css::uno::Sequence< rtl::OUString > b(2);
     896           4 :         CPPUNIT_ASSERT_MESSAGE(
     897             :             "css::uno::Sequence<rtl::OUString>",
     898           4 :             !(a >>= b) && b.getLength() == 2);
     899             :     }
     900             :     {
     901           2 :         Enum1 b = Enum1_M2;
     902           2 :         CPPUNIT_ASSERT_MESSAGE("Enum1", !(a >>= b) && b == Enum1_M2);
     903             :     }
     904             :     {
     905           2 :         Struct1 b(2);
     906           2 :         CPPUNIT_ASSERT_MESSAGE("Struct1", !(a >>= b) && b.member == 2);
     907             :     }
     908             :     {
     909             :         Exception1 b(
     910           2 :             rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2);
     911           2 :         CPPUNIT_ASSERT_MESSAGE("Exception1", !(a >>= b) && b.member == 2);
     912             :     }
     913             :     {
     914           2 :         css::uno::Reference< Interface1 > i(new Impl1);
     915           2 :         css::uno::Reference< Interface1 > b(i);
     916           2 :         CPPUNIT_ASSERT_MESSAGE("Interface1", !(a >>= b) && b == i);
     917           2 :     }
     918           2 : }
     919             : 
     920           2 : void Test::testHyper() {
     921           2 :     css::uno::Any a(static_cast< sal_Int64 >(1));
     922           2 :     CPPUNIT_ASSERT(a.getValueType() == getCppuType< sal_Int64 >());
     923             :     {
     924           2 :         bool b = true;
     925           2 :         CPPUNIT_ASSERT_MESSAGE("bool", !(a >>= b) && b);
     926             :     }
     927             :     {
     928           2 :         sal_Bool b = true;
     929           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b) && b);
     930             :     }
     931             :     {
     932           2 :         sal_Int8 b = 2;
     933           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a >>= b) && b == 2);
     934             :     }
     935             :     {
     936           2 :         sal_uInt8 b = 2;
     937           2 :         CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a >>= b) && b == 2);
     938             :     }
     939             :     {
     940           2 :         sal_Int16 b = 2;
     941           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a >>= b) && b == 2);
     942             :     }
     943             :     {
     944           2 :         sal_uInt16 b = 2;
     945           2 :         CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a >>= b) && b == 2);
     946             :     }
     947             :     {
     948           2 :         sal_Int32 b = 2;
     949           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a >>= b) && b == 2);
     950             :     }
     951             :     {
     952           2 :         sal_uInt32 b = 2;
     953           2 :         CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a >>= b) && b == 2);
     954             :     }
     955             :     {
     956           2 :         sal_Int64 b = 2;
     957           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Int64", (a >>= b) && b == 1);
     958             :     }
     959             :     {
     960           2 :         sal_uInt64 b = 2;
     961           2 :         CPPUNIT_ASSERT_MESSAGE("sal_uInt64", (a >>= b) && b == 1);
     962             :     }
     963             :     {
     964           2 :         float b = 2;
     965           2 :         CPPUNIT_ASSERT_MESSAGE("float", !(a >>= b) && b == 2);
     966             :     }
     967             :     {
     968           2 :         double b = 2;
     969           2 :         CPPUNIT_ASSERT_MESSAGE("double", !(a >>= b) && b == 2);
     970             :     }
     971             :     {
     972           2 :         sal_Unicode b = '2';
     973           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a >>= b) && b == '2');
     974             :     }
     975             :     {
     976           2 :         rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2"));
     977           2 :         CPPUNIT_ASSERT_MESSAGE( "rtl::OUString", !(a >>= b) && b == "2" );
     978             :     }
     979             :     {
     980           2 :         css::uno::Type b(getCppuType< rtl::OUString >());
     981           4 :         CPPUNIT_ASSERT_MESSAGE(
     982             :             "css::uno::Type",
     983           4 :             !(a >>= b) && b == getCppuType< rtl::OUString >());
     984             :     }
     985             :     {
     986           2 :         css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
     987           2 :         CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a >>= b) && b == a);
     988             :     }
     989             :     {
     990           2 :         css::uno::Sequence< rtl::OUString > b(2);
     991           4 :         CPPUNIT_ASSERT_MESSAGE(
     992             :             "css::uno::Sequence<rtl::OUString>",
     993           4 :             !(a >>= b) && b.getLength() == 2);
     994             :     }
     995             :     {
     996           2 :         Enum1 b = Enum1_M2;
     997           2 :         CPPUNIT_ASSERT_MESSAGE("Enum1", !(a >>= b) && b == Enum1_M2);
     998             :     }
     999             :     {
    1000           2 :         Struct1 b(2);
    1001           2 :         CPPUNIT_ASSERT_MESSAGE("Struct1", !(a >>= b) && b.member == 2);
    1002             :     }
    1003             :     {
    1004             :         Exception1 b(
    1005           2 :             rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2);
    1006           2 :         CPPUNIT_ASSERT_MESSAGE("Exception1", !(a >>= b) && b.member == 2);
    1007             :     }
    1008             :     {
    1009           2 :         css::uno::Reference< Interface1 > i(new Impl1);
    1010           2 :         css::uno::Reference< Interface1 > b(i);
    1011           2 :         CPPUNIT_ASSERT_MESSAGE("Interface1", !(a >>= b) && b == i);
    1012           2 :     }
    1013           2 : }
    1014             : 
    1015           2 : void Test::testUnsignedHyper() {
    1016           2 :     css::uno::Any a(static_cast< sal_uInt64 >(1));
    1017           2 :     CPPUNIT_ASSERT(a.getValueType() == getCppuType< sal_uInt64 >());
    1018             :     {
    1019           2 :         bool b = true;
    1020           2 :         CPPUNIT_ASSERT_MESSAGE("bool", !(a >>= b) && b);
    1021             :     }
    1022             :     {
    1023           2 :         sal_Bool b = true;
    1024           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b) && b);
    1025             :     }
    1026             :     {
    1027           2 :         sal_Int8 b = 2;
    1028           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a >>= b) && b == 2);
    1029             :     }
    1030             :     {
    1031           2 :         sal_uInt8 b = 2;
    1032           2 :         CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a >>= b) && b == 2);
    1033             :     }
    1034             :     {
    1035           2 :         sal_Int16 b = 2;
    1036           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a >>= b) && b == 2);
    1037             :     }
    1038             :     {
    1039           2 :         sal_uInt16 b = 2;
    1040           2 :         CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a >>= b) && b == 2);
    1041             :     }
    1042             :     {
    1043           2 :         sal_Int32 b = 2;
    1044           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a >>= b) && b == 2);
    1045             :     }
    1046             :     {
    1047           2 :         sal_uInt32 b = 2;
    1048           2 :         CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a >>= b) && b == 2);
    1049             :     }
    1050             :     {
    1051           2 :         sal_Int64 b = 2;
    1052           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Int64", (a >>= b) && b == 1);
    1053             :     }
    1054             :     {
    1055           2 :         sal_uInt64 b = 2;
    1056           2 :         CPPUNIT_ASSERT_MESSAGE("sal_uInt64", (a >>= b) && b == 1);
    1057             :     }
    1058             :     {
    1059           2 :         float b = 2;
    1060           2 :         CPPUNIT_ASSERT_MESSAGE("float", !(a >>= b) && b == 2);
    1061             :     }
    1062             :     {
    1063           2 :         double b = 2;
    1064           2 :         CPPUNIT_ASSERT_MESSAGE("double", !(a >>= b) && b == 2);
    1065             :     }
    1066             :     {
    1067           2 :         sal_Unicode b = '2';
    1068           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a >>= b) && b == '2');
    1069             :     }
    1070             :     {
    1071           2 :         rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2"));
    1072           2 :         CPPUNIT_ASSERT_MESSAGE( "rtl::OUString", !(a >>= b) && b == "2" );
    1073             :     }
    1074             :     {
    1075           2 :         css::uno::Type b(getCppuType< rtl::OUString >());
    1076           4 :         CPPUNIT_ASSERT_MESSAGE(
    1077             :             "css::uno::Type",
    1078           4 :             !(a >>= b) && b == getCppuType< rtl::OUString >());
    1079             :     }
    1080             :     {
    1081           2 :         css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
    1082           2 :         CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a >>= b) && b == a);
    1083             :     }
    1084             :     {
    1085           2 :         css::uno::Sequence< rtl::OUString > b(2);
    1086           4 :         CPPUNIT_ASSERT_MESSAGE(
    1087             :             "css::uno::Sequence<rtl::OUString>",
    1088           4 :             !(a >>= b) && b.getLength() == 2);
    1089             :     }
    1090             :     {
    1091           2 :         Enum1 b = Enum1_M2;
    1092           2 :         CPPUNIT_ASSERT_MESSAGE("Enum1", !(a >>= b) && b == Enum1_M2);
    1093             :     }
    1094             :     {
    1095           2 :         Struct1 b(2);
    1096           2 :         CPPUNIT_ASSERT_MESSAGE("Struct1", !(a >>= b) && b.member == 2);
    1097             :     }
    1098             :     {
    1099             :         Exception1 b(
    1100           2 :             rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2);
    1101           2 :         CPPUNIT_ASSERT_MESSAGE("Exception1", !(a >>= b) && b.member == 2);
    1102             :     }
    1103             :     {
    1104           2 :         css::uno::Reference< Interface1 > i(new Impl1);
    1105           2 :         css::uno::Reference< Interface1 > b(i);
    1106           2 :         CPPUNIT_ASSERT_MESSAGE("Interface1", !(a >>= b) && b == i);
    1107           2 :     }
    1108           2 : }
    1109             : 
    1110           2 : void Test::testFloat() {
    1111           2 :     css::uno::Any a(1.f);
    1112           2 :     CPPUNIT_ASSERT(a.getValueType() == getCppuType< float >());
    1113             :     {
    1114           2 :         bool b = true;
    1115           2 :         CPPUNIT_ASSERT_MESSAGE("bool", !(a >>= b) && b);
    1116             :     }
    1117             :     {
    1118           2 :         sal_Bool b = true;
    1119           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b) && b);
    1120             :     }
    1121             :     {
    1122           2 :         sal_Int8 b = 2;
    1123           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a >>= b) && b == 2);
    1124             :     }
    1125             :     {
    1126           2 :         sal_uInt8 b = 2;
    1127           2 :         CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a >>= b) && b == 2);
    1128             :     }
    1129             :     {
    1130           2 :         sal_Int16 b = 2;
    1131           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a >>= b) && b == 2);
    1132             :     }
    1133             :     {
    1134           2 :         sal_uInt16 b = 2;
    1135           2 :         CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a >>= b) && b == 2);
    1136             :     }
    1137             :     {
    1138           2 :         sal_Int32 b = 2;
    1139           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a >>= b) && b == 2);
    1140             :     }
    1141             :     {
    1142           2 :         sal_uInt32 b = 2;
    1143           2 :         CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a >>= b) && b == 2);
    1144             :     }
    1145             :     {
    1146           2 :         sal_Int64 b = 2;
    1147           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Int64", !(a >>= b) && b == 2);
    1148             :     }
    1149             :     {
    1150           2 :         sal_uInt64 b = 2;
    1151           2 :         CPPUNIT_ASSERT_MESSAGE("sal_uInt64", !(a >>= b) && b == 2);
    1152             :     }
    1153             :     {
    1154           2 :         float b = 2;
    1155           2 :         CPPUNIT_ASSERT_MESSAGE("float", (a >>= b) && b == 1);
    1156             :     }
    1157             :     {
    1158           2 :         double b = 2;
    1159           2 :         CPPUNIT_ASSERT_MESSAGE("double", (a >>= b) && b == 1);
    1160             :     }
    1161             :     {
    1162           2 :         sal_Unicode b = '2';
    1163           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a >>= b) && b == '2');
    1164             :     }
    1165             :     {
    1166           2 :         rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2"));
    1167           2 :         CPPUNIT_ASSERT_MESSAGE( "rtl::OUString", !(a >>= b) && b == "2" );
    1168             :     }
    1169             :     {
    1170           2 :         css::uno::Type b(getCppuType< rtl::OUString >());
    1171           4 :         CPPUNIT_ASSERT_MESSAGE(
    1172             :             "css::uno::Type",
    1173           4 :             !(a >>= b) && b == getCppuType< rtl::OUString >());
    1174             :     }
    1175             :     {
    1176           2 :         css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
    1177           2 :         CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a >>= b) && b == a);
    1178             :     }
    1179             :     {
    1180           2 :         css::uno::Sequence< rtl::OUString > b(2);
    1181           4 :         CPPUNIT_ASSERT_MESSAGE(
    1182             :             "css::uno::Sequence<rtl::OUString>",
    1183           4 :             !(a >>= b) && b.getLength() == 2);
    1184             :     }
    1185             :     {
    1186           2 :         Enum1 b = Enum1_M2;
    1187           2 :         CPPUNIT_ASSERT_MESSAGE("Enum1", !(a >>= b) && b == Enum1_M2);
    1188             :     }
    1189             :     {
    1190           2 :         Struct1 b(2);
    1191           2 :         CPPUNIT_ASSERT_MESSAGE("Struct1", !(a >>= b) && b.member == 2);
    1192             :     }
    1193             :     {
    1194             :         Exception1 b(
    1195           2 :             rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2);
    1196           2 :         CPPUNIT_ASSERT_MESSAGE("Exception1", !(a >>= b) && b.member == 2);
    1197             :     }
    1198             :     {
    1199           2 :         css::uno::Reference< Interface1 > i(new Impl1);
    1200           2 :         css::uno::Reference< Interface1 > b(i);
    1201           2 :         CPPUNIT_ASSERT_MESSAGE("Interface1", !(a >>= b) && b == i);
    1202           2 :     }
    1203           2 : }
    1204             : 
    1205           2 : void Test::testDouble() {
    1206           2 :     css::uno::Any a(1.);
    1207           2 :     CPPUNIT_ASSERT(a.getValueType() == getCppuType< double >());
    1208             :     {
    1209           2 :         bool b = true;
    1210           2 :         CPPUNIT_ASSERT_MESSAGE("bool", !(a >>= b) && b);
    1211             :     }
    1212             :     {
    1213           2 :         sal_Bool b = true;
    1214           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b) && b);
    1215             :     }
    1216             :     {
    1217           2 :         sal_Int8 b = 2;
    1218           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a >>= b) && b == 2);
    1219             :     }
    1220             :     {
    1221           2 :         sal_uInt8 b = 2;
    1222           2 :         CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a >>= b) && b == 2);
    1223             :     }
    1224             :     {
    1225           2 :         sal_Int16 b = 2;
    1226           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a >>= b) && b == 2);
    1227             :     }
    1228             :     {
    1229           2 :         sal_uInt16 b = 2;
    1230           2 :         CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a >>= b) && b == 2);
    1231             :     }
    1232             :     {
    1233           2 :         sal_Int32 b = 2;
    1234           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a >>= b) && b == 2);
    1235             :     }
    1236             :     {
    1237           2 :         sal_uInt32 b = 2;
    1238           2 :         CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a >>= b) && b == 2);
    1239             :     }
    1240             :     {
    1241           2 :         sal_Int64 b = 2;
    1242           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Int64", !(a >>= b) && b == 2);
    1243             :     }
    1244             :     {
    1245           2 :         sal_uInt64 b = 2;
    1246           2 :         CPPUNIT_ASSERT_MESSAGE("sal_uInt64", !(a >>= b) && b == 2);
    1247             :     }
    1248             :     {
    1249           2 :         float b = 2;
    1250           2 :         CPPUNIT_ASSERT_MESSAGE("float", !(a >>= b) && b == 2);
    1251             :     }
    1252             :     {
    1253           2 :         double b = 2;
    1254           2 :         CPPUNIT_ASSERT_MESSAGE("double", (a >>= b) && b == 1);
    1255             :     }
    1256             :     {
    1257           2 :         sal_Unicode b = '2';
    1258           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a >>= b) && b == '2');
    1259             :     }
    1260             :     {
    1261           2 :         rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2"));
    1262           2 :         CPPUNIT_ASSERT_MESSAGE( "rtl::OUString", !(a >>= b) && b == "2" );
    1263             :     }
    1264             :     {
    1265           2 :         css::uno::Type b(getCppuType< rtl::OUString >());
    1266           4 :         CPPUNIT_ASSERT_MESSAGE(
    1267             :             "css::uno::Type",
    1268           4 :             !(a >>= b) && b == getCppuType< rtl::OUString >());
    1269             :     }
    1270             :     {
    1271           2 :         css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
    1272           2 :         CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a >>= b) && b == a);
    1273             :     }
    1274             :     {
    1275           2 :         css::uno::Sequence< rtl::OUString > b(2);
    1276           4 :         CPPUNIT_ASSERT_MESSAGE(
    1277             :             "css::uno::Sequence<rtl::OUString>",
    1278           4 :             !(a >>= b) && b.getLength() == 2);
    1279             :     }
    1280             :     {
    1281           2 :         Enum1 b = Enum1_M2;
    1282           2 :         CPPUNIT_ASSERT_MESSAGE("Enum1", !(a >>= b) && b == Enum1_M2);
    1283             :     }
    1284             :     {
    1285           2 :         Struct1 b(2);
    1286           2 :         CPPUNIT_ASSERT_MESSAGE("Struct1", !(a >>= b) && b.member == 2);
    1287             :     }
    1288             :     {
    1289             :         Exception1 b(
    1290           2 :             rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2);
    1291           2 :         CPPUNIT_ASSERT_MESSAGE("Exception1", !(a >>= b) && b.member == 2);
    1292             :     }
    1293             :     {
    1294           2 :         css::uno::Reference< Interface1 > i(new Impl1);
    1295           2 :         css::uno::Reference< Interface1 > b(i);
    1296           2 :         CPPUNIT_ASSERT_MESSAGE("Interface1", !(a >>= b) && b == i);
    1297           2 :     }
    1298           2 : }
    1299             : 
    1300           2 : void Test::testChar() {
    1301           2 :     sal_Unicode c = '1';
    1302           2 :     css::uno::Any a(&c, getCppuType< sal_Unicode >());
    1303           2 :     CPPUNIT_ASSERT(a.getValueType() == getCppuType< sal_Unicode >());
    1304             :     {
    1305           2 :         bool b = true;
    1306           2 :         CPPUNIT_ASSERT_MESSAGE("bool", !(a >>= b) && b);
    1307             :     }
    1308             :     {
    1309           2 :         sal_Bool b = true;
    1310           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b) && b);
    1311             :     }
    1312             :     {
    1313           2 :         sal_Int8 b = 2;
    1314           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a >>= b) && b == 2);
    1315             :     }
    1316             :     {
    1317           2 :         sal_uInt8 b = 2;
    1318           2 :         CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a >>= b) && b == 2);
    1319             :     }
    1320             :     {
    1321           2 :         sal_Int16 b = 2;
    1322           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a >>= b) && b == 2);
    1323             :     }
    1324             :     {
    1325           2 :         sal_uInt16 b = 2;
    1326           2 :         CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a >>= b) && b == 2);
    1327             :     }
    1328             :     {
    1329           2 :         sal_Int32 b = 2;
    1330           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a >>= b) && b == 2);
    1331             :     }
    1332             :     {
    1333           2 :         sal_uInt32 b = 2;
    1334           2 :         CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a >>= b) && b == 2);
    1335             :     }
    1336             :     {
    1337           2 :         sal_Int64 b = 2;
    1338           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Int64", !(a >>= b) && b == 2);
    1339             :     }
    1340             :     {
    1341           2 :         sal_uInt64 b = 2;
    1342           2 :         CPPUNIT_ASSERT_MESSAGE("sal_uInt64", !(a >>= b) && b == 2);
    1343             :     }
    1344             :     {
    1345           2 :         float b = 2;
    1346           2 :         CPPUNIT_ASSERT_MESSAGE("float", !(a >>= b) && b == 2);
    1347             :     }
    1348             :     {
    1349           2 :         double b = 2;
    1350           2 :         CPPUNIT_ASSERT_MESSAGE("double", !(a >>= b) && b == 2);
    1351             :     }
    1352             :     {
    1353           2 :         sal_Unicode b = '2';
    1354             :         if (boost::is_same< sal_Unicode, sal_uInt16 >::value) {
    1355           2 :             CPPUNIT_ASSERT_MESSAGE("@sal_Unicode", !(a >>= b) && b == '2');
    1356             :         } else {
    1357             :             CPPUNIT_ASSERT_MESSAGE("sal_Unicode", (a >>= b) && b == '1');
    1358             :         }
    1359             :     }
    1360             :     {
    1361           2 :         rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2"));
    1362           2 :         CPPUNIT_ASSERT_MESSAGE( "rtl::OUString", !(a >>= b) && b == "2" );
    1363             :     }
    1364             :     {
    1365           2 :         css::uno::Type b(getCppuType< rtl::OUString >());
    1366           4 :         CPPUNIT_ASSERT_MESSAGE(
    1367             :             "css::uno::Type",
    1368           4 :             !(a >>= b) && b == getCppuType< rtl::OUString >());
    1369             :     }
    1370             :     {
    1371           2 :         css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
    1372           2 :         CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a >>= b) && b == a);
    1373             :     }
    1374             :     {
    1375           2 :         css::uno::Sequence< rtl::OUString > b(2);
    1376           4 :         CPPUNIT_ASSERT_MESSAGE(
    1377             :             "css::uno::Sequence<rtl::OUString>",
    1378           4 :             !(a >>= b) && b.getLength() == 2);
    1379             :     }
    1380             :     {
    1381           2 :         Enum1 b = Enum1_M2;
    1382           2 :         CPPUNIT_ASSERT_MESSAGE("Enum1", !(a >>= b) && b == Enum1_M2);
    1383             :     }
    1384             :     {
    1385           2 :         Struct1 b(2);
    1386           2 :         CPPUNIT_ASSERT_MESSAGE("Struct1", !(a >>= b) && b.member == 2);
    1387             :     }
    1388             :     {
    1389             :         Exception1 b(
    1390           2 :             rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2);
    1391           2 :         CPPUNIT_ASSERT_MESSAGE("Exception1", !(a >>= b) && b.member == 2);
    1392             :     }
    1393             :     {
    1394           2 :         css::uno::Reference< Interface1 > i(new Impl1);
    1395           2 :         css::uno::Reference< Interface1 > b(i);
    1396           2 :         CPPUNIT_ASSERT_MESSAGE("Interface1", !(a >>= b) && b == i);
    1397           2 :     }
    1398           2 : }
    1399             : 
    1400           2 : void Test::testString() {
    1401           2 :     css::uno::Any a(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("1")));
    1402           2 :     CPPUNIT_ASSERT(a.getValueType() == getCppuType< rtl::OUString >());
    1403             :     {
    1404           2 :         bool b = true;
    1405           2 :         CPPUNIT_ASSERT_MESSAGE("bool", !(a >>= b) && b);
    1406             :     }
    1407             :     {
    1408           2 :         sal_Bool b = true;
    1409           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b) && b);
    1410             :     }
    1411             :     {
    1412           2 :         sal_Int8 b = 2;
    1413           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a >>= b) && b == 2);
    1414             :     }
    1415             :     {
    1416           2 :         sal_uInt8 b = 2;
    1417           2 :         CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a >>= b) && b == 2);
    1418             :     }
    1419             :     {
    1420           2 :         sal_Int16 b = 2;
    1421           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a >>= b) && b == 2);
    1422             :     }
    1423             :     {
    1424           2 :         sal_uInt16 b = 2;
    1425           2 :         CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a >>= b) && b == 2);
    1426             :     }
    1427             :     {
    1428           2 :         sal_Int32 b = 2;
    1429           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a >>= b) && b == 2);
    1430             :     }
    1431             :     {
    1432           2 :         sal_uInt32 b = 2;
    1433           2 :         CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a >>= b) && b == 2);
    1434             :     }
    1435             :     {
    1436           2 :         sal_Int64 b = 2;
    1437           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Int64", !(a >>= b) && b == 2);
    1438             :     }
    1439             :     {
    1440           2 :         sal_uInt64 b = 2;
    1441           2 :         CPPUNIT_ASSERT_MESSAGE("sal_uInt64", !(a >>= b) && b == 2);
    1442             :     }
    1443             :     {
    1444           2 :         float b = 2;
    1445           2 :         CPPUNIT_ASSERT_MESSAGE("float", !(a >>= b) && b == 2);
    1446             :     }
    1447             :     {
    1448           2 :         double b = 2;
    1449           2 :         CPPUNIT_ASSERT_MESSAGE("double", !(a >>= b) && b == 2);
    1450             :     }
    1451             :     {
    1452           2 :         sal_Unicode b = '2';
    1453           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a >>= b) && b == '2');
    1454             :     }
    1455             :     {
    1456           2 :         rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2"));
    1457           2 :         CPPUNIT_ASSERT_MESSAGE( "rtl::OUString", (a >>= b) && b == "1" );
    1458             :     }
    1459             :     {
    1460           2 :         css::uno::Type b(getCppuType< rtl::OUString >());
    1461           4 :         CPPUNIT_ASSERT_MESSAGE(
    1462             :             "css::uno::Type",
    1463           4 :             !(a >>= b) && b == getCppuType< rtl::OUString >());
    1464             :     }
    1465             :     {
    1466           2 :         css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
    1467           2 :         CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a >>= b) && b == a);
    1468             :     }
    1469             :     {
    1470           2 :         css::uno::Sequence< rtl::OUString > b(2);
    1471           4 :         CPPUNIT_ASSERT_MESSAGE(
    1472             :             "css::uno::Sequence<rtl::OUString>",
    1473           4 :             !(a >>= b) && b.getLength() == 2);
    1474             :     }
    1475             :     {
    1476           2 :         Enum1 b = Enum1_M2;
    1477           2 :         CPPUNIT_ASSERT_MESSAGE("Enum1", !(a >>= b) && b == Enum1_M2);
    1478             :     }
    1479             :     {
    1480           2 :         Struct1 b(2);
    1481           2 :         CPPUNIT_ASSERT_MESSAGE("Struct1", !(a >>= b) && b.member == 2);
    1482             :     }
    1483             :     {
    1484             :         Exception1 b(
    1485           2 :             rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2);
    1486           2 :         CPPUNIT_ASSERT_MESSAGE("Exception1", !(a >>= b) && b.member == 2);
    1487             :     }
    1488             :     {
    1489           2 :         css::uno::Reference< Interface1 > i(new Impl1);
    1490           2 :         css::uno::Reference< Interface1 > b(i);
    1491           2 :         CPPUNIT_ASSERT_MESSAGE("Interface1", !(a >>= b) && b == i);
    1492           2 :     }
    1493           2 : }
    1494             : 
    1495           2 : void Test::testType() {
    1496           2 :     css::uno::Any a(getCppuType< sal_Int32 >());
    1497           2 :     CPPUNIT_ASSERT(a.getValueType() == getCppuType< css::uno::Type >());
    1498             :     {
    1499           2 :         bool b = true;
    1500           2 :         CPPUNIT_ASSERT_MESSAGE("bool", !(a >>= b) && b);
    1501             :     }
    1502             :     {
    1503           2 :         sal_Bool b = true;
    1504           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b) && b);
    1505             :     }
    1506             :     {
    1507           2 :         sal_Int8 b = 2;
    1508           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a >>= b) && b == 2);
    1509             :     }
    1510             :     {
    1511           2 :         sal_uInt8 b = 2;
    1512           2 :         CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a >>= b) && b == 2);
    1513             :     }
    1514             :     {
    1515           2 :         sal_Int16 b = 2;
    1516           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a >>= b) && b == 2);
    1517             :     }
    1518             :     {
    1519           2 :         sal_uInt16 b = 2;
    1520           2 :         CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a >>= b) && b == 2);
    1521             :     }
    1522             :     {
    1523           2 :         sal_Int32 b = 2;
    1524           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a >>= b) && b == 2);
    1525             :     }
    1526             :     {
    1527           2 :         sal_uInt32 b = 2;
    1528           2 :         CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a >>= b) && b == 2);
    1529             :     }
    1530             :     {
    1531           2 :         sal_Int64 b = 2;
    1532           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Int64", !(a >>= b) && b == 2);
    1533             :     }
    1534             :     {
    1535           2 :         sal_uInt64 b = 2;
    1536           2 :         CPPUNIT_ASSERT_MESSAGE("sal_uInt64", !(a >>= b) && b == 2);
    1537             :     }
    1538             :     {
    1539           2 :         float b = 2;
    1540           2 :         CPPUNIT_ASSERT_MESSAGE("float", !(a >>= b) && b == 2);
    1541             :     }
    1542             :     {
    1543           2 :         double b = 2;
    1544           2 :         CPPUNIT_ASSERT_MESSAGE("double", !(a >>= b) && b == 2);
    1545             :     }
    1546             :     {
    1547           2 :         sal_Unicode b = '2';
    1548           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a >>= b) && b == '2');
    1549             :     }
    1550             :     {
    1551           2 :         rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2"));
    1552           2 :         CPPUNIT_ASSERT_MESSAGE( "rtl::OUString", !(a >>= b) && b == "2" );
    1553             :     }
    1554             :     {
    1555           2 :         css::uno::Type b(getCppuType< rtl::OUString >());
    1556           4 :         CPPUNIT_ASSERT_MESSAGE(
    1557           4 :             "css::uno::Type", (a >>= b) && b == getCppuType< sal_Int32 >());
    1558             :     }
    1559             :     {
    1560           2 :         css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
    1561           2 :         CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a >>= b) && b == a);
    1562             :     }
    1563             :     {
    1564           2 :         css::uno::Sequence< rtl::OUString > b(2);
    1565           4 :         CPPUNIT_ASSERT_MESSAGE(
    1566             :             "css::uno::Sequence<rtl::OUString>",
    1567           4 :             !(a >>= b) && b.getLength() == 2);
    1568             :     }
    1569             :     {
    1570           2 :         Enum1 b = Enum1_M2;
    1571           2 :         CPPUNIT_ASSERT_MESSAGE("Enum1", !(a >>= b) && b == Enum1_M2);
    1572             :     }
    1573             :     {
    1574           2 :         Struct1 b(2);
    1575           2 :         CPPUNIT_ASSERT_MESSAGE("Struct1", !(a >>= b) && b.member == 2);
    1576             :     }
    1577             :     {
    1578             :         Exception1 b(
    1579           2 :             rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2);
    1580           2 :         CPPUNIT_ASSERT_MESSAGE("Exception1", !(a >>= b) && b.member == 2);
    1581             :     }
    1582             :     {
    1583           2 :         css::uno::Reference< Interface1 > i(new Impl1);
    1584           2 :         css::uno::Reference< Interface1 > b(i);
    1585           2 :         CPPUNIT_ASSERT_MESSAGE("Interface1", !(a >>= b) && b == i);
    1586           2 :     }
    1587           2 : }
    1588             : 
    1589           2 : void Test::testSequence() {
    1590           2 :     sal_Int32 n = 1;
    1591           2 :     css::uno::Any a(css::uno::Sequence< sal_Int32 >(&n, 1));
    1592           4 :     CPPUNIT_ASSERT(
    1593           2 :         a.getValueType() == getCppuType< css::uno::Sequence< sal_Int32 > >());
    1594             :     {
    1595           2 :         bool b = true;
    1596           2 :         CPPUNIT_ASSERT_MESSAGE("bool", !(a >>= b) && b);
    1597             :     }
    1598             :     {
    1599           2 :         sal_Bool b = true;
    1600           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b) && b);
    1601             :     }
    1602             :     {
    1603           2 :         sal_Int8 b = 2;
    1604           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a >>= b) && b == 2);
    1605             :     }
    1606             :     {
    1607           2 :         sal_uInt8 b = 2;
    1608           2 :         CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a >>= b) && b == 2);
    1609             :     }
    1610             :     {
    1611           2 :         sal_Int16 b = 2;
    1612           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a >>= b) && b == 2);
    1613             :     }
    1614             :     {
    1615           2 :         sal_uInt16 b = 2;
    1616           2 :         CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a >>= b) && b == 2);
    1617             :     }
    1618             :     {
    1619           2 :         sal_Int32 b = 2;
    1620           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a >>= b) && b == 2);
    1621             :     }
    1622             :     {
    1623           2 :         sal_uInt32 b = 2;
    1624           2 :         CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a >>= b) && b == 2);
    1625             :     }
    1626             :     {
    1627           2 :         sal_Int64 b = 2;
    1628           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Int64", !(a >>= b) && b == 2);
    1629             :     }
    1630             :     {
    1631           2 :         sal_uInt64 b = 2;
    1632           2 :         CPPUNIT_ASSERT_MESSAGE("sal_uInt64", !(a >>= b) && b == 2);
    1633             :     }
    1634             :     {
    1635           2 :         float b = 2;
    1636           2 :         CPPUNIT_ASSERT_MESSAGE("float", !(a >>= b) && b == 2);
    1637             :     }
    1638             :     {
    1639           2 :         double b = 2;
    1640           2 :         CPPUNIT_ASSERT_MESSAGE("double", !(a >>= b) && b == 2);
    1641             :     }
    1642             :     {
    1643           2 :         sal_Unicode b = '2';
    1644           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a >>= b) && b == '2');
    1645             :     }
    1646             :     {
    1647           2 :         rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2"));
    1648           2 :         CPPUNIT_ASSERT_MESSAGE( "rtl::OUString", !(a >>= b) && b == "2" );
    1649             :     }
    1650             :     {
    1651           2 :         css::uno::Type b(getCppuType< rtl::OUString >());
    1652           4 :         CPPUNIT_ASSERT_MESSAGE(
    1653             :             "css::uno::Type",
    1654           4 :             !(a >>= b) && b == getCppuType< rtl::OUString >());
    1655             :     }
    1656             :     {
    1657           2 :         css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
    1658           2 :         CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a >>= b) && b == a);
    1659             :     }
    1660             :     {
    1661           2 :         css::uno::Sequence< rtl::OUString > b(2);
    1662           4 :         CPPUNIT_ASSERT_MESSAGE(
    1663             :             "css::uno::Sequence<rtl::OUString>",
    1664           4 :             !(a >>= b) && b.getLength() == 2);
    1665             :     }
    1666             :     {
    1667           2 :         css::uno::Sequence< sal_Int32 > b(2);
    1668           4 :         CPPUNIT_ASSERT_MESSAGE(
    1669             :             "css::uno::Sequence<sal_Int32>",
    1670           4 :             (a >>= b) && b.getLength() == 1 && b[0] == 1);
    1671             :     }
    1672             :     {
    1673           2 :         Enum1 b = Enum1_M2;
    1674           2 :         CPPUNIT_ASSERT_MESSAGE("Enum1", !(a >>= b) && b == Enum1_M2);
    1675             :     }
    1676             :     {
    1677           2 :         Struct1 b(2);
    1678           2 :         CPPUNIT_ASSERT_MESSAGE("Struct1", !(a >>= b) && b.member == 2);
    1679             :     }
    1680             :     {
    1681             :         Exception1 b(
    1682           2 :             rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2);
    1683           2 :         CPPUNIT_ASSERT_MESSAGE("Exception1", !(a >>= b) && b.member == 2);
    1684             :     }
    1685             :     {
    1686           2 :         css::uno::Reference< Interface1 > i(new Impl1);
    1687           2 :         css::uno::Reference< Interface1 > b(i);
    1688           2 :         CPPUNIT_ASSERT_MESSAGE("Interface1", !(a >>= b) && b == i);
    1689           2 :     }
    1690           2 : }
    1691             : 
    1692           2 : void Test::testEnum() {
    1693           2 :     css::uno::Any a(Enum2_M1);
    1694           2 :     CPPUNIT_ASSERT(a.getValueType() == getCppuType< Enum2 >());
    1695             :     {
    1696           2 :         bool b = true;
    1697           2 :         CPPUNIT_ASSERT_MESSAGE("bool", !(a >>= b) && b);
    1698             :     }
    1699             :     {
    1700           2 :         sal_Bool b = true;
    1701           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b) && b);
    1702             :     }
    1703             :     {
    1704           2 :         sal_Int8 b = 2;
    1705           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a >>= b) && b == 2);
    1706             :     }
    1707             :     {
    1708           2 :         sal_uInt8 b = 2;
    1709           2 :         CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a >>= b) && b == 2);
    1710             :     }
    1711             :     {
    1712           2 :         sal_Int16 b = 2;
    1713           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a >>= b) && b == 2);
    1714             :     }
    1715             :     {
    1716           2 :         sal_uInt16 b = 2;
    1717           2 :         CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a >>= b) && b == 2);
    1718             :     }
    1719             :     {
    1720           2 :         sal_Int32 b = 2;
    1721           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a >>= b) && b == 2);
    1722             :     }
    1723             :     {
    1724           2 :         sal_uInt32 b = 2;
    1725           2 :         CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a >>= b) && b == 2);
    1726             :     }
    1727             :     {
    1728           2 :         sal_Int64 b = 2;
    1729           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Int64", !(a >>= b) && b == 2);
    1730             :     }
    1731             :     {
    1732           2 :         sal_uInt64 b = 2;
    1733           2 :         CPPUNIT_ASSERT_MESSAGE("sal_uInt64", !(a >>= b) && b == 2);
    1734             :     }
    1735             :     {
    1736           2 :         float b = 2;
    1737           2 :         CPPUNIT_ASSERT_MESSAGE("float", !(a >>= b) && b == 2);
    1738             :     }
    1739             :     {
    1740           2 :         double b = 2;
    1741           2 :         CPPUNIT_ASSERT_MESSAGE("double", !(a >>= b) && b == 2);
    1742             :     }
    1743             :     {
    1744           2 :         sal_Unicode b = '2';
    1745           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a >>= b) && b == '2');
    1746             :     }
    1747             :     {
    1748           2 :         rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2"));
    1749           2 :         CPPUNIT_ASSERT_MESSAGE( "rtl::OUString", !(a >>= b) && b == "2" );
    1750             :     }
    1751             :     {
    1752           2 :         css::uno::Type b(getCppuType< rtl::OUString >());
    1753           4 :         CPPUNIT_ASSERT_MESSAGE(
    1754             :             "css::uno::Type",
    1755           4 :             !(a >>= b) && b == getCppuType< rtl::OUString >());
    1756             :     }
    1757             :     {
    1758           2 :         css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
    1759           2 :         CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a >>= b) && b == a);
    1760             :     }
    1761             :     {
    1762           2 :         css::uno::Sequence< rtl::OUString > b(2);
    1763           4 :         CPPUNIT_ASSERT_MESSAGE(
    1764             :             "css::uno::Sequence<rtl::OUString>",
    1765           4 :             !(a >>= b) && b.getLength() == 2);
    1766             :     }
    1767             :     {
    1768           2 :         Enum1 b = Enum1_M2;
    1769           2 :         CPPUNIT_ASSERT_MESSAGE("Enum1", !(a >>= b) && b == Enum1_M2);
    1770             :     }
    1771             :     {
    1772           2 :         Enum2 b = Enum2_M2;
    1773           2 :         CPPUNIT_ASSERT_MESSAGE("Enum2", (a >>= b) && b == Enum2_M1);
    1774             :     }
    1775             :     {
    1776           2 :         Struct1 b(2);
    1777           2 :         CPPUNIT_ASSERT_MESSAGE("Struct1", !(a >>= b) && b.member == 2);
    1778             :     }
    1779             :     {
    1780             :         Exception1 b(
    1781           2 :             rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2);
    1782           2 :         CPPUNIT_ASSERT_MESSAGE("Exception1", !(a >>= b) && b.member == 2);
    1783             :     }
    1784             :     {
    1785           2 :         css::uno::Reference< Interface1 > i(new Impl1);
    1786           2 :         css::uno::Reference< Interface1 > b(i);
    1787           2 :         CPPUNIT_ASSERT_MESSAGE("Interface1", !(a >>= b) && b == i);
    1788           2 :     }
    1789           2 : }
    1790             : 
    1791           2 : void Test::testStruct() {
    1792           2 :     css::uno::Any a(Struct2a(1, 3));
    1793           2 :     CPPUNIT_ASSERT(a.getValueType() == getCppuType< Struct2a >());
    1794             :     {
    1795           2 :         bool b = true;
    1796           2 :         CPPUNIT_ASSERT_MESSAGE("bool", !(a >>= b) && b);
    1797             :     }
    1798             :     {
    1799           2 :         sal_Bool b = true;
    1800           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b) && b);
    1801             :     }
    1802             :     {
    1803           2 :         sal_Int8 b = 2;
    1804           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a >>= b) && b == 2);
    1805             :     }
    1806             :     {
    1807           2 :         sal_uInt8 b = 2;
    1808           2 :         CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a >>= b) && b == 2);
    1809             :     }
    1810             :     {
    1811           2 :         sal_Int16 b = 2;
    1812           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a >>= b) && b == 2);
    1813             :     }
    1814             :     {
    1815           2 :         sal_uInt16 b = 2;
    1816           2 :         CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a >>= b) && b == 2);
    1817             :     }
    1818             :     {
    1819           2 :         sal_Int32 b = 2;
    1820           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a >>= b) && b == 2);
    1821             :     }
    1822             :     {
    1823           2 :         sal_uInt32 b = 2;
    1824           2 :         CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a >>= b) && b == 2);
    1825             :     }
    1826             :     {
    1827           2 :         sal_Int64 b = 2;
    1828           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Int64", !(a >>= b) && b == 2);
    1829             :     }
    1830             :     {
    1831           2 :         sal_uInt64 b = 2;
    1832           2 :         CPPUNIT_ASSERT_MESSAGE("sal_uInt64", !(a >>= b) && b == 2);
    1833             :     }
    1834             :     {
    1835           2 :         float b = 2;
    1836           2 :         CPPUNIT_ASSERT_MESSAGE("float", !(a >>= b) && b == 2);
    1837             :     }
    1838             :     {
    1839           2 :         double b = 2;
    1840           2 :         CPPUNIT_ASSERT_MESSAGE("double", !(a >>= b) && b == 2);
    1841             :     }
    1842             :     {
    1843           2 :         sal_Unicode b = '2';
    1844           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a >>= b) && b == '2');
    1845             :     }
    1846             :     {
    1847           2 :         rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2"));
    1848           2 :         CPPUNIT_ASSERT_MESSAGE( "rtl::OUString", !(a >>= b) && b == "2" );
    1849             :     }
    1850             :     {
    1851           2 :         css::uno::Type b(getCppuType< rtl::OUString >());
    1852           4 :         CPPUNIT_ASSERT_MESSAGE(
    1853             :             "css::uno::Type",
    1854           4 :             !(a >>= b) && b == getCppuType< rtl::OUString >());
    1855             :     }
    1856             :     {
    1857           2 :         css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
    1858           2 :         CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a >>= b) && b == a);
    1859             :     }
    1860             :     {
    1861           2 :         css::uno::Sequence< rtl::OUString > b(2);
    1862           4 :         CPPUNIT_ASSERT_MESSAGE(
    1863             :             "css::uno::Sequence<rtl::OUString>",
    1864           4 :             !(a >>= b) && b.getLength() == 2);
    1865             :     }
    1866             :     {
    1867           2 :         Enum1 b = Enum1_M2;
    1868           2 :         CPPUNIT_ASSERT_MESSAGE("Enum1", !(a >>= b) && b == Enum1_M2);
    1869             :     }
    1870             :     {
    1871           2 :         Struct1 b(2);
    1872           2 :         CPPUNIT_ASSERT_MESSAGE("Struct1", !(a >>= b) && b.member == 2);
    1873             :     }
    1874             :     {
    1875           2 :         Struct2 b(2);
    1876           2 :         CPPUNIT_ASSERT_MESSAGE("Struct2", (a >>= b) && b.member == 1);
    1877             :     }
    1878             :     {
    1879           2 :         Struct2a b(2, 2);
    1880           4 :         CPPUNIT_ASSERT_MESSAGE(
    1881           2 :             "Struct2a", (a >>= b) && b.member == 1 && b.member2 == 3);
    1882             :     }
    1883             :     {
    1884           2 :         Struct2b b(2, 2, 2);
    1885           2 :         CPPUNIT_ASSERT_MESSAGE("Struct2b", !(a >>= b) && b.member == 2);
    1886             :     }
    1887             :     {
    1888             :         Exception1 b(
    1889           2 :             rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2);
    1890           2 :         CPPUNIT_ASSERT_MESSAGE("Exception1", !(a >>= b) && b.member == 2);
    1891             :     }
    1892             :     {
    1893           2 :         css::uno::Reference< Interface1 > i(new Impl1);
    1894           2 :         css::uno::Reference< Interface1 > b(i);
    1895           2 :         CPPUNIT_ASSERT_MESSAGE("Interface1", !(a >>= b) && b == i);
    1896           2 :     }
    1897           2 : }
    1898             : 
    1899           2 : void Test::testPoly() {
    1900           2 :     css::uno::Any a;
    1901           2 :     a <<= Poly< css::uno::Sequence< ::sal_Unicode > >();
    1902           2 :     CPPUNIT_ASSERT_MESSAGE( "type name", a.getValueType().getTypeName() == "Poly<[]char>" );
    1903           4 :     CPPUNIT_ASSERT_MESSAGE(
    1904             :         "constructor",
    1905           4 :         a == css::uno::Any(Poly< css::uno::Sequence< ::sal_Unicode > >()));
    1906           2 : }
    1907             : 
    1908           2 : void Test::testException() {
    1909             :     css::uno::Any a(
    1910             :         Exception2a(
    1911             :             rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 1,
    1912           2 :             3));
    1913           2 :     CPPUNIT_ASSERT(a.getValueType() == getCppuType< Exception2a >());
    1914             :     {
    1915           2 :         bool b = true;
    1916           2 :         CPPUNIT_ASSERT_MESSAGE("bool", !(a >>= b) && b);
    1917             :     }
    1918             :     {
    1919           2 :         sal_Bool b = true;
    1920           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b) && b);
    1921             :     }
    1922             :     {
    1923           2 :         sal_Int8 b = 2;
    1924           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a >>= b) && b == 2);
    1925             :     }
    1926             :     {
    1927           2 :         sal_uInt8 b = 2;
    1928           2 :         CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a >>= b) && b == 2);
    1929             :     }
    1930             :     {
    1931           2 :         sal_Int16 b = 2;
    1932           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a >>= b) && b == 2);
    1933             :     }
    1934             :     {
    1935           2 :         sal_uInt16 b = 2;
    1936           2 :         CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a >>= b) && b == 2);
    1937             :     }
    1938             :     {
    1939           2 :         sal_Int32 b = 2;
    1940           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a >>= b) && b == 2);
    1941             :     }
    1942             :     {
    1943           2 :         sal_uInt32 b = 2;
    1944           2 :         CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a >>= b) && b == 2);
    1945             :     }
    1946             :     {
    1947           2 :         sal_Int64 b = 2;
    1948           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Int64", !(a >>= b) && b == 2);
    1949             :     }
    1950             :     {
    1951           2 :         sal_uInt64 b = 2;
    1952           2 :         CPPUNIT_ASSERT_MESSAGE("sal_uInt64", !(a >>= b) && b == 2);
    1953             :     }
    1954             :     {
    1955           2 :         float b = 2;
    1956           2 :         CPPUNIT_ASSERT_MESSAGE("float", !(a >>= b) && b == 2);
    1957             :     }
    1958             :     {
    1959           2 :         double b = 2;
    1960           2 :         CPPUNIT_ASSERT_MESSAGE("double", !(a >>= b) && b == 2);
    1961             :     }
    1962             :     {
    1963           2 :         sal_Unicode b = '2';
    1964           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a >>= b) && b == '2');
    1965             :     }
    1966             :     {
    1967           2 :         rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2"));
    1968           2 :         CPPUNIT_ASSERT_MESSAGE( "rtl::OUString", !(a >>= b) && b == "2" );
    1969             :     }
    1970             :     {
    1971           2 :         css::uno::Type b(getCppuType< rtl::OUString >());
    1972           4 :         CPPUNIT_ASSERT_MESSAGE(
    1973             :             "css::uno::Type",
    1974           4 :             !(a >>= b) && b == getCppuType< rtl::OUString >());
    1975             :     }
    1976             :     {
    1977           2 :         css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
    1978           2 :         CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a >>= b) && b == a);
    1979             :     }
    1980             :     {
    1981           2 :         css::uno::Sequence< rtl::OUString > b(2);
    1982           4 :         CPPUNIT_ASSERT_MESSAGE(
    1983             :             "css::uno::Sequence<rtl::OUString>",
    1984           4 :             !(a >>= b) && b.getLength() == 2);
    1985             :     }
    1986             :     {
    1987           2 :         Enum1 b = Enum1_M2;
    1988           2 :         CPPUNIT_ASSERT_MESSAGE("Enum1", !(a >>= b) && b == Enum1_M2);
    1989             :     }
    1990             :     {
    1991           2 :         Struct1 b(2);
    1992           2 :         CPPUNIT_ASSERT_MESSAGE("Struct1", !(a >>= b) && b.member == 2);
    1993             :     }
    1994             :     {
    1995             :         Exception1 b(
    1996           2 :             rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2);
    1997           2 :         CPPUNIT_ASSERT_MESSAGE("Exception1", !(a >>= b) && b.member == 2);
    1998             :     }
    1999             :     {
    2000             :         Exception2 b(
    2001           2 :             rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2);
    2002           2 :         CPPUNIT_ASSERT_MESSAGE("Exception2", (a >>= b) && b.member == 1);
    2003             :     }
    2004             :     {
    2005             :         Exception2a b(
    2006             :             rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2,
    2007           2 :             2);
    2008           4 :         CPPUNIT_ASSERT_MESSAGE(
    2009           4 :             "Exception2a", (a >>= b) && b.member == 1 && b.member2 == 3);
    2010             :     }
    2011             :     {
    2012             :         Exception2b b(
    2013             :             rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2,
    2014           2 :             2);
    2015           2 :         CPPUNIT_ASSERT_MESSAGE("Exception2b", !(a >>= b) && b.member == 2);
    2016             :     }
    2017             :     {
    2018           2 :         css::uno::Reference< Interface1 > i(new Impl1);
    2019           2 :         css::uno::Reference< Interface1 > b(i);
    2020           2 :         CPPUNIT_ASSERT_MESSAGE("Interface1", !(a >>= b) && b == i);
    2021           2 :     }
    2022           2 : }
    2023             : 
    2024           2 : void Test::testInterface() {
    2025           2 :     css::uno::Reference< Interface2a > i2(new Impl2);
    2026           2 :     css::uno::Any a(i2);
    2027           4 :     CPPUNIT_ASSERT(
    2028             :         a.getValueType()
    2029           2 :         == getCppuType< css::uno::Reference< Interface2a > >());
    2030             :     {
    2031           2 :         bool b = true;
    2032           2 :         CPPUNIT_ASSERT_MESSAGE("bool", !(a >>= b) && b);
    2033             :     }
    2034             :     {
    2035           2 :         sal_Bool b = true;
    2036           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b) && b);
    2037             :     }
    2038             :     {
    2039           2 :         sal_Int8 b = 2;
    2040           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a >>= b) && b == 2);
    2041             :     }
    2042             :     {
    2043           2 :         sal_uInt8 b = 2;
    2044           2 :         CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a >>= b) && b == 2);
    2045             :     }
    2046             :     {
    2047           2 :         sal_Int16 b = 2;
    2048           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a >>= b) && b == 2);
    2049             :     }
    2050             :     {
    2051           2 :         sal_uInt16 b = 2;
    2052           2 :         CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a >>= b) && b == 2);
    2053             :     }
    2054             :     {
    2055           2 :         sal_Int32 b = 2;
    2056           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a >>= b) && b == 2);
    2057             :     }
    2058             :     {
    2059           2 :         sal_uInt32 b = 2;
    2060           2 :         CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a >>= b) && b == 2);
    2061             :     }
    2062             :     {
    2063           2 :         sal_Int64 b = 2;
    2064           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Int64", !(a >>= b) && b == 2);
    2065             :     }
    2066             :     {
    2067           2 :         sal_uInt64 b = 2;
    2068           2 :         CPPUNIT_ASSERT_MESSAGE("sal_uInt64", !(a >>= b) && b == 2);
    2069             :     }
    2070             :     {
    2071           2 :         float b = 2;
    2072           2 :         CPPUNIT_ASSERT_MESSAGE("float", !(a >>= b) && b == 2);
    2073             :     }
    2074             :     {
    2075           2 :         double b = 2;
    2076           2 :         CPPUNIT_ASSERT_MESSAGE("double", !(a >>= b) && b == 2);
    2077             :     }
    2078             :     {
    2079           2 :         sal_Unicode b = '2';
    2080           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a >>= b) && b == '2');
    2081             :     }
    2082             :     {
    2083           2 :         rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2"));
    2084           2 :         CPPUNIT_ASSERT_MESSAGE( "rtl::OUString", !(a >>= b) && b == "2" );
    2085             :     }
    2086             :     {
    2087           2 :         css::uno::Type b(getCppuType< rtl::OUString >());
    2088           4 :         CPPUNIT_ASSERT_MESSAGE(
    2089             :             "css::uno::Type",
    2090           4 :             !(a >>= b) && b == getCppuType< rtl::OUString >());
    2091             :     }
    2092             :     {
    2093           2 :         css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
    2094           2 :         CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a >>= b) && b == a);
    2095             :     }
    2096             :     {
    2097           2 :         css::uno::Sequence< rtl::OUString > b(2);
    2098           4 :         CPPUNIT_ASSERT_MESSAGE(
    2099             :             "css::uno::Sequence<rtl::OUString>",
    2100           4 :             !(a >>= b) && b.getLength() == 2);
    2101             :     }
    2102             :     {
    2103           2 :         Enum1 b = Enum1_M2;
    2104           2 :         CPPUNIT_ASSERT_MESSAGE("Enum1", !(a >>= b) && b == Enum1_M2);
    2105             :     }
    2106             :     {
    2107           2 :         Struct1 b(2);
    2108           2 :         CPPUNIT_ASSERT_MESSAGE("Struct1", !(a >>= b) && b.member == 2);
    2109             :     }
    2110             :     {
    2111             :         Exception1 b(
    2112           2 :             rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2);
    2113           2 :         CPPUNIT_ASSERT_MESSAGE("Exception1", !(a >>= b) && b.member == 2);
    2114             :     }
    2115             :     {
    2116           2 :         css::uno::Reference< Interface1 > i(new Impl1);
    2117           2 :         css::uno::Reference< Interface1 > b(i);
    2118           2 :         CPPUNIT_ASSERT_MESSAGE("Interface1", !(a >>= b) && b == i);
    2119             :     }
    2120             :     {
    2121           2 :         css::uno::Reference< Interface2 > b(new Impl2);
    2122           2 :         CPPUNIT_ASSERT_MESSAGE("Interface2", (a >>= b) && b == i2);
    2123             :     }
    2124             :     {
    2125           2 :         css::uno::Reference< Interface2a > b(new Impl2);
    2126           2 :         CPPUNIT_ASSERT_MESSAGE("Interface2a", (a >>= b) && b == i2);
    2127             :     }
    2128             :     {
    2129           2 :         css::uno::Reference< Interface2b > i(new Impl2b);
    2130           2 :         css::uno::Reference< Interface2b > b(i);
    2131           2 :         CPPUNIT_ASSERT_MESSAGE("Interface2b", !(a >>= b) && b == i);
    2132             :     }
    2133             :     {
    2134           2 :         css::uno::Reference< Interface3 > b(new Impl2);
    2135           2 :         CPPUNIT_ASSERT_MESSAGE("Interface3", (a >>= b) && b == i2);
    2136           2 :     }
    2137           2 : }
    2138             : 
    2139           2 : void Test::testNull() {
    2140           2 :     css::uno::Any a = css::uno::Any(css::uno::Reference< Interface2a >());
    2141           4 :     CPPUNIT_ASSERT(
    2142             :         a.getValueType()
    2143           2 :         == getCppuType< css::uno::Reference< Interface2a > >());
    2144             :     {
    2145           2 :         bool b = true;
    2146           2 :         CPPUNIT_ASSERT_MESSAGE("bool", !(a >>= b) && b);
    2147             :     }
    2148             :     {
    2149           2 :         sal_Bool b = true;
    2150           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b) && b);
    2151             :     }
    2152             :     {
    2153           2 :         sal_Int8 b = 2;
    2154           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a >>= b) && b == 2);
    2155             :     }
    2156             :     {
    2157           2 :         sal_uInt8 b = 2;
    2158           2 :         CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a >>= b) && b == 2);
    2159             :     }
    2160             :     {
    2161           2 :         sal_Int16 b = 2;
    2162           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a >>= b) && b == 2);
    2163             :     }
    2164             :     {
    2165           2 :         sal_uInt16 b = 2;
    2166           2 :         CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a >>= b) && b == 2);
    2167             :     }
    2168             :     {
    2169           2 :         sal_Int32 b = 2;
    2170           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a >>= b) && b == 2);
    2171             :     }
    2172             :     {
    2173           2 :         sal_uInt32 b = 2;
    2174           2 :         CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a >>= b) && b == 2);
    2175             :     }
    2176             :     {
    2177           2 :         sal_Int64 b = 2;
    2178           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Int64", !(a >>= b) && b == 2);
    2179             :     }
    2180             :     {
    2181           2 :         sal_uInt64 b = 2;
    2182           2 :         CPPUNIT_ASSERT_MESSAGE("sal_uInt64", !(a >>= b) && b == 2);
    2183             :     }
    2184             :     {
    2185           2 :         float b = 2;
    2186           2 :         CPPUNIT_ASSERT_MESSAGE("float", !(a >>= b) && b == 2);
    2187             :     }
    2188             :     {
    2189           2 :         double b = 2;
    2190           2 :         CPPUNIT_ASSERT_MESSAGE("double", !(a >>= b) && b == 2);
    2191             :     }
    2192             :     {
    2193           2 :         sal_Unicode b = '2';
    2194           2 :         CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a >>= b) && b == '2');
    2195             :     }
    2196             :     {
    2197           2 :         rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2"));
    2198           2 :         CPPUNIT_ASSERT_MESSAGE( "rtl::OUString", !(a >>= b) && b == "2" );
    2199             :     }
    2200             :     {
    2201           2 :         css::uno::Type b(getCppuType< rtl::OUString >());
    2202           4 :         CPPUNIT_ASSERT_MESSAGE(
    2203             :             "css::uno::Type",
    2204           4 :             !(a >>= b) && b == getCppuType< rtl::OUString >());
    2205             :     }
    2206             :     {
    2207           2 :         css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
    2208           2 :         CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a >>= b) && b == a);
    2209             :     }
    2210             :     {
    2211           2 :         css::uno::Sequence< rtl::OUString > b(2);
    2212           4 :         CPPUNIT_ASSERT_MESSAGE(
    2213             :             "css::uno::Sequence<rtl::OUString>",
    2214           4 :             !(a >>= b) && b.getLength() == 2);
    2215             :     }
    2216             :     {
    2217           2 :         Enum1 b = Enum1_M2;
    2218           2 :         CPPUNIT_ASSERT_MESSAGE("Enum1", !(a >>= b) && b == Enum1_M2);
    2219             :     }
    2220             :     {
    2221           2 :         Struct1 b(2);
    2222           2 :         CPPUNIT_ASSERT_MESSAGE("Struct1", !(a >>= b) && b.member == 2);
    2223             :     }
    2224             :     {
    2225             :         Exception1 b(
    2226           2 :             rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2);
    2227           2 :         CPPUNIT_ASSERT_MESSAGE("Exception1", !(a >>= b) && b.member == 2);
    2228             :     }
    2229             :     {
    2230           2 :         css::uno::Reference< Interface1 > b(new Impl1);
    2231           4 :         CPPUNIT_ASSERT_MESSAGE(
    2232           4 :             "Interface1", (a >>= b) && !b.is());
    2233             :     }
    2234             :     {
    2235           2 :         css::uno::Reference< Interface2 > b(new Impl2);
    2236           4 :         CPPUNIT_ASSERT_MESSAGE(
    2237           4 :             "Interface2", (a >>= b) && !b.is());
    2238             :     }
    2239             :     {
    2240           2 :         css::uno::Reference< Interface2a > b(new Impl2);
    2241           2 :         CPPUNIT_ASSERT_MESSAGE("Interface2a", (a >>= b) && !b.is());
    2242             :     }
    2243             :     {
    2244           2 :         css::uno::Reference< Interface2b > b(new Impl2b);
    2245           4 :         CPPUNIT_ASSERT_MESSAGE(
    2246           4 :             "Interface2b", (a >>= b) && !b.is());
    2247             :     }
    2248             :     {
    2249           2 :         css::uno::Reference< Interface3 > b(new Impl2);
    2250           4 :         CPPUNIT_ASSERT_MESSAGE(
    2251           4 :             "Interface3", (a >>= b) && !b.is());
    2252           2 :     }
    2253           2 : }
    2254             : 
    2255           2 : CPPUNIT_TEST_SUITE_REGISTRATION(Test);
    2256             : 
    2257             : }
    2258             : 
    2259           8 : CPPUNIT_PLUGIN_IMPLEMENT();
    2260             : 
    2261             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10