1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: test_any.cxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_cppu.hxx"
34 #include "sal/config.h"
36 #include <stdlib.h> // wntmsci10 does not like <cstdlib>
40 #include "Exception1.hpp"
41 #include "Exception2.hpp"
42 #include "Exception2a.hpp"
43 #include "Exception2b.hpp"
44 #include "Interface1.hpp"
45 #include "Interface2.hpp"
46 #include "Interface2a.hpp"
47 #include "Interface2b.hpp"
48 #include "Interface3.hpp"
50 #include "Struct1.hpp"
51 #include "Struct2.hpp"
52 #include "Struct2a.hpp"
53 #include "Struct2b.hpp"
54 #include "boost/type_traits/is_same.hpp"
55 #include "com/sun/star/uno/Any.hxx"
56 #include "com/sun/star/uno/Reference.hxx"
57 #include "com/sun/star/uno/RuntimeException.hpp"
58 #include "com/sun/star/uno/Sequence.hxx"
59 #include "com/sun/star/uno/Type.hxx"
60 #include "com/sun/star/uno/XInterface.hpp"
61 #include "cppunit/simpleheader.hxx"
62 #include "osl/diagnose.h"
63 #include "osl/interlck.h"
64 #include "rtl/string.h"
65 #include "rtl/ustring.h"
66 #include "rtl/ustring.hxx"
67 #include "sal/types.h"
71 namespace css
= com::sun::star
;
78 if (osl_incrementInterlockedCount(&m_count
) == SAL_MAX_INT32
) {
84 if (osl_decrementInterlockedCount(&m_count
) == 0) {
93 Base(Base
&); // not declared
94 void operator =(Base
&); // not declared
96 oslInterlockedCount m_count
;
99 class Impl1
: public Interface1
, private Base
{
101 virtual css::uno::Any SAL_CALL
queryInterface(css::uno::Type
const & type
)
102 throw (css::uno::RuntimeException
)
105 == getCppuType
< css::uno::Reference
< css::uno::XInterface
> >())
107 css::uno::Reference
< css::uno::XInterface
> ref(
108 static_cast< css::uno::XInterface
* >(this));
109 return css::uno::Any(&ref
, type
);
110 } else if (type
== getCppuType
< css::uno::Reference
< Interface1
> >()) {
111 css::uno::Reference
< Interface1
> ref(this);
112 return css::uno::Any(&ref
, type
);
114 return css::uno::Any();
118 virtual void SAL_CALL
acquire() throw () {
122 virtual void SAL_CALL
release() throw () {
127 class Impl2
: public Interface2a
, public Interface3
, private Base
{
129 virtual css::uno::Any SAL_CALL
queryInterface(css::uno::Type
const & type
)
130 throw (css::uno::RuntimeException
)
133 == getCppuType
< css::uno::Reference
< css::uno::XInterface
> >())
135 css::uno::Reference
< css::uno::XInterface
> ref(
136 static_cast< css::uno::XInterface
* >(
137 static_cast< Interface2a
* >(this)));
138 return css::uno::Any(&ref
, type
);
139 } else if (type
== getCppuType
< css::uno::Reference
< Interface2
> >()) {
140 css::uno::Reference
< Interface2
> ref(this);
141 return css::uno::Any(&ref
, type
);
142 } else if (type
== getCppuType
< css::uno::Reference
< Interface2a
> >())
144 css::uno::Reference
< Interface2a
> ref(this);
145 return css::uno::Any(&ref
, type
);
146 } else if (type
== getCppuType
< css::uno::Reference
< Interface3
> >()) {
147 css::uno::Reference
< Interface3
> ref(this);
148 return css::uno::Any(&ref
, type
);
150 return css::uno::Any();
154 virtual void SAL_CALL
acquire() throw () {
158 virtual void SAL_CALL
release() throw () {
163 class Impl2b
: public Interface2b
, private Base
{
165 virtual css::uno::Any SAL_CALL
queryInterface(css::uno::Type
const & type
)
166 throw (css::uno::RuntimeException
)
169 == getCppuType
< css::uno::Reference
< css::uno::XInterface
> >())
171 css::uno::Reference
< css::uno::XInterface
> ref(
172 static_cast< css::uno::XInterface
* >(
173 static_cast< Interface2a
* >(this)));
174 return css::uno::Any(&ref
, type
);
175 } else if (type
== getCppuType
< css::uno::Reference
< Interface2
> >()) {
176 css::uno::Reference
< Interface2
> ref(this);
177 return css::uno::Any(&ref
, type
);
178 } else if (type
== getCppuType
< css::uno::Reference
< Interface2a
> >())
180 css::uno::Reference
< Interface2a
> ref(this);
181 return css::uno::Any(&ref
, type
);
182 } else if (type
== getCppuType
< css::uno::Reference
< Interface2b
> >())
184 css::uno::Reference
< Interface2b
> ref(this);
185 return css::uno::Any(&ref
, type
);
187 return css::uno::Any();
191 virtual void SAL_CALL
acquire() throw () {
195 virtual void SAL_CALL
release() throw () {
200 class Test
: public CppUnit::TestFixture
{
210 void testUnsignedShort();
214 void testUnsignedLong();
218 void testUnsignedHyper();
238 void testException();
240 void testInterface();
244 CPPUNIT_TEST_SUITE(Test
);
245 CPPUNIT_TEST(testVoid
);
246 CPPUNIT_TEST(testBoolean
);
247 CPPUNIT_TEST(testByte
);
248 CPPUNIT_TEST(testShort
);
249 CPPUNIT_TEST(testUnsignedShort
);
250 CPPUNIT_TEST(testLong
);
251 CPPUNIT_TEST(testUnsignedLong
);
252 CPPUNIT_TEST(testHyper
);
253 CPPUNIT_TEST(testUnsignedHyper
);
254 CPPUNIT_TEST(testFloat
);
255 CPPUNIT_TEST(testDouble
);
256 CPPUNIT_TEST(testChar
);
257 CPPUNIT_TEST(testString
);
258 CPPUNIT_TEST(testType
);
259 CPPUNIT_TEST(testSequence
);
260 CPPUNIT_TEST(testEnum
);
261 CPPUNIT_TEST(testStruct
);
262 CPPUNIT_TEST(testPoly
);
263 CPPUNIT_TEST(testException
);
264 CPPUNIT_TEST(testInterface
);
265 CPPUNIT_TEST(testNull
);
266 CPPUNIT_TEST_SUITE_END();
269 void Test::testVoid() {
271 CPPUNIT_ASSERT(a
.getValueType() == getVoidCppuType());
274 CPPUNIT_ASSERT_MESSAGE("bool", !(a
>>= b
) && b
);
278 CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a
>>= b
) && b
);
282 CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a
>>= b
) && b
== 2);
286 CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a
>>= b
) && b
== 2);
290 CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a
>>= b
) && b
== 2);
294 CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a
>>= b
) && b
== 2);
298 CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a
>>= b
) && b
== 2);
302 CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a
>>= b
) && b
== 2);
306 CPPUNIT_ASSERT_MESSAGE("sal_Int64", !(a
>>= b
) && b
== 2);
310 CPPUNIT_ASSERT_MESSAGE("sal_uInt64", !(a
>>= b
) && b
== 2);
314 CPPUNIT_ASSERT_MESSAGE("float", !(a
>>= b
) && b
== 2);
318 CPPUNIT_ASSERT_MESSAGE("double", !(a
>>= b
) && b
== 2);
322 CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a
>>= b
) && b
== '2');
325 rtl::OUString
b(RTL_CONSTASCII_USTRINGPARAM("2"));
326 CPPUNIT_ASSERT_MESSAGE(
328 !(a
>>= b
) && b
.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2")));
331 css::uno::Type
b(getCppuType
< rtl::OUString
>());
332 CPPUNIT_ASSERT_MESSAGE(
334 !(a
>>= b
) && b
== getCppuType
< rtl::OUString
>());
337 css::uno::Any
b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
338 CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a
>>= b
) && b
== a
);
341 css::uno::Sequence
< rtl::OUString
> b(2);
342 CPPUNIT_ASSERT_MESSAGE(
343 "css::uno::Sequence<rtl::OUString>", !(a
>>= b
) && b
.getLength() == 2);
347 CPPUNIT_ASSERT_MESSAGE("Enum1", !(a
>>= b
) && b
== Enum1_M2
);
351 CPPUNIT_ASSERT_MESSAGE("Struct1", !(a
>>= b
) && b
.member
== 2);
355 rtl::OUString(), css::uno::Reference
< css::uno::XInterface
>(), 2);
356 CPPUNIT_ASSERT_MESSAGE("Exception1", !(a
>>= b
) && b
.member
== 2);
359 css::uno::Reference
< Interface1
> i(new Impl1
);
360 css::uno::Reference
< Interface1
> b(i
);
361 CPPUNIT_ASSERT_MESSAGE("Interface1", !(a
>>= b
) && b
== i
);
365 void Test::testBoolean() {
366 css::uno::Any
a(false);
367 CPPUNIT_ASSERT(a
.getValueType() == getCppuType
< sal_Bool
>());
370 CPPUNIT_ASSERT_MESSAGE("bool", (a
>>= b
) && !b
);
374 CPPUNIT_ASSERT_MESSAGE("sal_Bool", (a
>>= b
) && !b
);
378 CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a
>>= b
) && b
== 2);
382 if (boost::is_same
< sal_uInt8
, sal_Bool
>::value
) {
383 CPPUNIT_ASSERT_MESSAGE("@sal_uInt8", (a
>>= b
) && b
== 0);
385 CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a
>>= b
) && b
== 2);
390 CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a
>>= b
) && b
== 2);
394 CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a
>>= b
) && b
== 2);
398 CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a
>>= b
) && b
== 2);
402 CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a
>>= b
) && b
== 2);
406 CPPUNIT_ASSERT_MESSAGE("sal_Int64", !(a
>>= b
) && b
== 2);
410 CPPUNIT_ASSERT_MESSAGE("sal_uInt64", !(a
>>= b
) && b
== 2);
414 CPPUNIT_ASSERT_MESSAGE("float", !(a
>>= b
) && b
== 2);
418 CPPUNIT_ASSERT_MESSAGE("double", !(a
>>= b
) && b
== 2);
422 CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a
>>= b
) && b
== '2');
425 rtl::OUString
b(RTL_CONSTASCII_USTRINGPARAM("2"));
426 CPPUNIT_ASSERT_MESSAGE(
428 !(a
>>= b
) && b
.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2")));
431 css::uno::Type
b(getCppuType
< rtl::OUString
>());
432 CPPUNIT_ASSERT_MESSAGE(
434 !(a
>>= b
) && b
== getCppuType
< rtl::OUString
>());
437 css::uno::Any
b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
438 CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a
>>= b
) && b
== a
);
441 css::uno::Sequence
< rtl::OUString
> b(2);
442 CPPUNIT_ASSERT_MESSAGE(
443 "css::uno::Sequence<rtl::OUString>",
444 !(a
>>= b
) && b
.getLength() == 2);
448 CPPUNIT_ASSERT_MESSAGE("Enum1", !(a
>>= b
) && b
== Enum1_M2
);
452 CPPUNIT_ASSERT_MESSAGE("Struct1", !(a
>>= b
) && b
.member
== 2);
456 rtl::OUString(), css::uno::Reference
< css::uno::XInterface
>(), 2);
457 CPPUNIT_ASSERT_MESSAGE("Exception1", !(a
>>= b
) && b
.member
== 2);
460 css::uno::Reference
< Interface1
> i(new Impl1
);
461 css::uno::Reference
< Interface1
> b(i
);
462 CPPUNIT_ASSERT_MESSAGE("Interface1", !(a
>>= b
) && b
== i
);
466 void Test::testByte() {
467 css::uno::Any
a(static_cast< sal_Int8
>(1));
468 CPPUNIT_ASSERT(a
.getValueType() == getCppuType
< sal_Int8
>());
471 CPPUNIT_ASSERT_MESSAGE("bool", !(a
>>= b
) && b
);
475 CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a
>>= b
) && b
);
479 CPPUNIT_ASSERT_MESSAGE("sal_Int8", (a
>>= b
) && b
== 1);
483 CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a
>>= b
) && b
== 2);
487 CPPUNIT_ASSERT_MESSAGE("sal_Int16", (a
>>= b
) && b
== 1);
491 CPPUNIT_ASSERT_MESSAGE("sal_uInt16", (a
>>= b
) && b
== 1);
495 CPPUNIT_ASSERT_MESSAGE("sal_Int32", (a
>>= b
) && b
== 1);
499 CPPUNIT_ASSERT_MESSAGE("sal_uInt32", (a
>>= b
) && b
== 1);
503 CPPUNIT_ASSERT_MESSAGE("sal_Int64", (a
>>= b
) && b
== 1);
507 CPPUNIT_ASSERT_MESSAGE("sal_uInt64", (a
>>= b
) && b
== 1);
511 CPPUNIT_ASSERT_MESSAGE("float", (a
>>= b
) && b
== 1);
515 CPPUNIT_ASSERT_MESSAGE("double", (a
>>= b
) && b
== 1);
519 if (boost::is_same
< sal_Unicode
, sal_uInt16
>::value
) {
520 CPPUNIT_ASSERT_MESSAGE("@sal_Unicode", (a
>>= b
) && b
== 1);
522 CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a
>>= b
) && b
== '2');
526 rtl::OUString
b(RTL_CONSTASCII_USTRINGPARAM("2"));
527 CPPUNIT_ASSERT_MESSAGE(
529 !(a
>>= b
) && b
.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2")));
532 css::uno::Type
b(getCppuType
< rtl::OUString
>());
533 CPPUNIT_ASSERT_MESSAGE(
535 !(a
>>= b
) && b
== getCppuType
< rtl::OUString
>());
538 css::uno::Any
b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
539 CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a
>>= b
) && b
== a
);
542 css::uno::Sequence
< rtl::OUString
> b(2);
543 CPPUNIT_ASSERT_MESSAGE(
544 "css::uno::Sequence<rtl::OUString>",
545 !(a
>>= b
) && b
.getLength() == 2);
549 CPPUNIT_ASSERT_MESSAGE("Enum1", !(a
>>= b
) && b
== Enum1_M2
);
553 CPPUNIT_ASSERT_MESSAGE("Struct1", !(a
>>= b
) && b
.member
== 2);
557 rtl::OUString(), css::uno::Reference
< css::uno::XInterface
>(), 2);
558 CPPUNIT_ASSERT_MESSAGE("Exception1", !(a
>>= b
) && b
.member
== 2);
561 css::uno::Reference
< Interface1
> i(new Impl1
);
562 css::uno::Reference
< Interface1
> b(i
);
563 CPPUNIT_ASSERT_MESSAGE("Interface1", !(a
>>= b
) && b
== i
);
567 void Test::testShort() {
568 css::uno::Any
a(static_cast< sal_Int16
>(1));
569 CPPUNIT_ASSERT(a
.getValueType() == getCppuType
< sal_Int16
>());
572 CPPUNIT_ASSERT_MESSAGE("bool", !(a
>>= b
) && b
);
576 CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a
>>= b
) && b
);
580 CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a
>>= b
) && b
== 2);
584 CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a
>>= b
) && b
== 2);
588 CPPUNIT_ASSERT_MESSAGE("sal_Int16", (a
>>= b
) && b
== 1);
592 CPPUNIT_ASSERT_MESSAGE("sal_uInt16", (a
>>= b
) && b
== 1);
596 CPPUNIT_ASSERT_MESSAGE("sal_Int32", (a
>>= b
) && b
== 1);
600 CPPUNIT_ASSERT_MESSAGE("sal_uInt32", (a
>>= b
) && b
== 1);
604 CPPUNIT_ASSERT_MESSAGE("sal_Int64", (a
>>= b
) && b
== 1);
608 CPPUNIT_ASSERT_MESSAGE("sal_uInt64", (a
>>= b
) && b
== 1);
612 CPPUNIT_ASSERT_MESSAGE("float", (a
>>= b
) && b
== 1);
616 CPPUNIT_ASSERT_MESSAGE("double", (a
>>= b
) && b
== 1);
620 if (boost::is_same
< sal_Unicode
, sal_uInt16
>::value
) {
621 CPPUNIT_ASSERT_MESSAGE("@sal_Unicode", (a
>>= b
) && b
== 1);
623 CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a
>>= b
) && b
== '2');
627 rtl::OUString
b(RTL_CONSTASCII_USTRINGPARAM("2"));
628 CPPUNIT_ASSERT_MESSAGE(
630 !(a
>>= b
) && b
.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2")));
633 css::uno::Type
b(getCppuType
< rtl::OUString
>());
634 CPPUNIT_ASSERT_MESSAGE(
636 !(a
>>= b
) && b
== getCppuType
< rtl::OUString
>());
639 css::uno::Any
b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
640 CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a
>>= b
) && b
== a
);
643 css::uno::Sequence
< rtl::OUString
> b(2);
644 CPPUNIT_ASSERT_MESSAGE(
645 "css::uno::Sequence<rtl::OUString>",
646 !(a
>>= b
) && b
.getLength() == 2);
650 CPPUNIT_ASSERT_MESSAGE("Enum1", !(a
>>= b
) && b
== Enum1_M2
);
654 CPPUNIT_ASSERT_MESSAGE("Struct1", !(a
>>= b
) && b
.member
== 2);
658 rtl::OUString(), css::uno::Reference
< css::uno::XInterface
>(), 2);
659 CPPUNIT_ASSERT_MESSAGE("Exception1", !(a
>>= b
) && b
.member
== 2);
662 css::uno::Reference
< Interface1
> i(new Impl1
);
663 css::uno::Reference
< Interface1
> b(i
);
664 CPPUNIT_ASSERT_MESSAGE("Interface1", !(a
>>= b
) && b
== i
);
668 void Test::testUnsignedShort() {
670 css::uno::Any
a(&n
, getCppuType(static_cast< sal_uInt16
const * >(0)));
672 a
.getValueType() == getCppuType(static_cast< sal_uInt16
const * >(0)));
675 CPPUNIT_ASSERT_MESSAGE("bool", !(a
>>= b
) && b
);
679 CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a
>>= b
) && b
);
683 CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a
>>= b
) && b
== 2);
687 CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a
>>= b
) && b
== 2);
691 CPPUNIT_ASSERT_MESSAGE("sal_Int16", (a
>>= b
) && b
== 1);
695 CPPUNIT_ASSERT_MESSAGE("sal_uInt16", (a
>>= b
) && b
== 1);
699 CPPUNIT_ASSERT_MESSAGE("sal_Int32", (a
>>= b
) && b
== 1);
703 CPPUNIT_ASSERT_MESSAGE("sal_uInt32", (a
>>= b
) && b
== 1);
707 CPPUNIT_ASSERT_MESSAGE("sal_Int64", (a
>>= b
) && b
== 1);
711 CPPUNIT_ASSERT_MESSAGE("sal_uInt64", (a
>>= b
) && b
== 1);
715 CPPUNIT_ASSERT_MESSAGE("float", (a
>>= b
) && b
== 1);
719 CPPUNIT_ASSERT_MESSAGE("double", (a
>>= b
) && b
== 1);
723 if (boost::is_same
< sal_Unicode
, sal_uInt16
>::value
) {
724 CPPUNIT_ASSERT_MESSAGE("@sal_Unicode", (a
>>= b
) && b
== 1);
726 CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a
>>= b
) && b
== '2');
730 rtl::OUString
b(RTL_CONSTASCII_USTRINGPARAM("2"));
731 CPPUNIT_ASSERT_MESSAGE(
733 !(a
>>= b
) && b
.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2")));
736 css::uno::Type
b(getCppuType
< rtl::OUString
>());
737 CPPUNIT_ASSERT_MESSAGE(
739 !(a
>>= b
) && b
== getCppuType
< rtl::OUString
>());
742 css::uno::Any
b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
743 CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a
>>= b
) && b
== a
);
746 css::uno::Sequence
< rtl::OUString
> b(2);
747 CPPUNIT_ASSERT_MESSAGE(
748 "css::uno::Sequence<rtl::OUString>",
749 !(a
>>= b
) && b
.getLength() == 2);
753 CPPUNIT_ASSERT_MESSAGE("Enum1", !(a
>>= b
) && b
== Enum1_M2
);
757 CPPUNIT_ASSERT_MESSAGE("Struct1", !(a
>>= b
) && b
.member
== 2);
761 rtl::OUString(), css::uno::Reference
< css::uno::XInterface
>(), 2);
762 CPPUNIT_ASSERT_MESSAGE("Exception1", !(a
>>= b
) && b
.member
== 2);
765 css::uno::Reference
< Interface1
> i(new Impl1
);
766 css::uno::Reference
< Interface1
> b(i
);
767 CPPUNIT_ASSERT_MESSAGE("Interface1", !(a
>>= b
) && b
== i
);
771 void Test::testLong() {
772 css::uno::Any
a(static_cast< sal_Int32
>(1));
773 CPPUNIT_ASSERT(a
.getValueType() == getCppuType
< sal_Int32
>());
776 CPPUNIT_ASSERT_MESSAGE("bool", !(a
>>= b
) && b
);
780 CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a
>>= b
) && b
);
784 CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a
>>= b
) && b
== 2);
788 CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a
>>= b
) && b
== 2);
792 CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a
>>= b
) && b
== 2);
796 CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a
>>= b
) && b
== 2);
800 CPPUNIT_ASSERT_MESSAGE("sal_Int32", (a
>>= b
) && b
== 1);
804 CPPUNIT_ASSERT_MESSAGE("sal_uInt32", (a
>>= b
) && b
== 1);
808 CPPUNIT_ASSERT_MESSAGE("sal_Int64", (a
>>= b
) && b
== 1);
812 CPPUNIT_ASSERT_MESSAGE("sal_uInt64", (a
>>= b
) && b
== 1);
816 CPPUNIT_ASSERT_MESSAGE("float", !(a
>>= b
) && b
== 2);
820 CPPUNIT_ASSERT_MESSAGE("double", (a
>>= b
) && b
== 1);
824 CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a
>>= b
) && b
== '2');
827 rtl::OUString
b(RTL_CONSTASCII_USTRINGPARAM("2"));
828 CPPUNIT_ASSERT_MESSAGE(
830 !(a
>>= b
) && b
.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2")));
833 css::uno::Type
b(getCppuType
< rtl::OUString
>());
834 CPPUNIT_ASSERT_MESSAGE(
836 !(a
>>= b
) && b
== getCppuType
< rtl::OUString
>());
839 css::uno::Any
b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
840 CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a
>>= b
) && b
== a
);
843 css::uno::Sequence
< rtl::OUString
> b(2);
844 CPPUNIT_ASSERT_MESSAGE(
845 "css::uno::Sequence<rtl::OUString>",
846 !(a
>>= b
) && b
.getLength() == 2);
850 CPPUNIT_ASSERT_MESSAGE("Enum1", !(a
>>= b
) && b
== Enum1_M2
);
854 CPPUNIT_ASSERT_MESSAGE("Struct1", !(a
>>= b
) && b
.member
== 2);
858 rtl::OUString(), css::uno::Reference
< css::uno::XInterface
>(), 2);
859 CPPUNIT_ASSERT_MESSAGE("Exception1", !(a
>>= b
) && b
.member
== 2);
862 css::uno::Reference
< Interface1
> i(new Impl1
);
863 css::uno::Reference
< Interface1
> b(i
);
864 CPPUNIT_ASSERT_MESSAGE("Interface1", !(a
>>= b
) && b
== i
);
868 void Test::testUnsignedLong() {
869 css::uno::Any
a(static_cast< sal_uInt32
>(1));
870 CPPUNIT_ASSERT(a
.getValueType() == getCppuType
< sal_uInt32
>());
873 CPPUNIT_ASSERT_MESSAGE("bool", !(a
>>= b
) && b
);
877 CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a
>>= b
) && b
);
881 CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a
>>= b
) && b
== 2);
885 CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a
>>= b
) && b
== 2);
889 CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a
>>= b
) && b
== 2);
893 CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a
>>= b
) && b
== 2);
897 CPPUNIT_ASSERT_MESSAGE("sal_Int32", (a
>>= b
) && b
== 1);
901 CPPUNIT_ASSERT_MESSAGE("sal_uInt32", (a
>>= b
) && b
== 1);
905 CPPUNIT_ASSERT_MESSAGE("sal_Int64", (a
>>= b
) && b
== 1);
909 CPPUNIT_ASSERT_MESSAGE("sal_uInt64", (a
>>= b
) && b
== 1);
913 CPPUNIT_ASSERT_MESSAGE("float", !(a
>>= b
) && b
== 2);
917 CPPUNIT_ASSERT_MESSAGE("double", (a
>>= b
) && b
== 1);
921 CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a
>>= b
) && b
== '2');
924 rtl::OUString
b(RTL_CONSTASCII_USTRINGPARAM("2"));
925 CPPUNIT_ASSERT_MESSAGE(
927 !(a
>>= b
) && b
.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2")));
930 css::uno::Type
b(getCppuType
< rtl::OUString
>());
931 CPPUNIT_ASSERT_MESSAGE(
933 !(a
>>= b
) && b
== getCppuType
< rtl::OUString
>());
936 css::uno::Any
b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
937 CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a
>>= b
) && b
== a
);
940 css::uno::Sequence
< rtl::OUString
> b(2);
941 CPPUNIT_ASSERT_MESSAGE(
942 "css::uno::Sequence<rtl::OUString>",
943 !(a
>>= b
) && b
.getLength() == 2);
947 CPPUNIT_ASSERT_MESSAGE("Enum1", !(a
>>= b
) && b
== Enum1_M2
);
951 CPPUNIT_ASSERT_MESSAGE("Struct1", !(a
>>= b
) && b
.member
== 2);
955 rtl::OUString(), css::uno::Reference
< css::uno::XInterface
>(), 2);
956 CPPUNIT_ASSERT_MESSAGE("Exception1", !(a
>>= b
) && b
.member
== 2);
959 css::uno::Reference
< Interface1
> i(new Impl1
);
960 css::uno::Reference
< Interface1
> b(i
);
961 CPPUNIT_ASSERT_MESSAGE("Interface1", !(a
>>= b
) && b
== i
);
965 void Test::testHyper() {
966 css::uno::Any
a(static_cast< sal_Int64
>(1));
967 CPPUNIT_ASSERT(a
.getValueType() == getCppuType
< sal_Int64
>());
970 CPPUNIT_ASSERT_MESSAGE("bool", !(a
>>= b
) && b
);
974 CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a
>>= b
) && b
);
978 CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a
>>= b
) && b
== 2);
982 CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a
>>= b
) && b
== 2);
986 CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a
>>= b
) && b
== 2);
990 CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a
>>= b
) && b
== 2);
994 CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a
>>= b
) && b
== 2);
998 CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a
>>= b
) && b
== 2);
1002 CPPUNIT_ASSERT_MESSAGE("sal_Int64", (a
>>= b
) && b
== 1);
1006 CPPUNIT_ASSERT_MESSAGE("sal_uInt64", (a
>>= b
) && b
== 1);
1010 CPPUNIT_ASSERT_MESSAGE("float", !(a
>>= b
) && b
== 2);
1014 CPPUNIT_ASSERT_MESSAGE("double", !(a
>>= b
) && b
== 2);
1017 sal_Unicode b
= '2';
1018 CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a
>>= b
) && b
== '2');
1021 rtl::OUString
b(RTL_CONSTASCII_USTRINGPARAM("2"));
1022 CPPUNIT_ASSERT_MESSAGE(
1024 !(a
>>= b
) && b
.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2")));
1027 css::uno::Type
b(getCppuType
< rtl::OUString
>());
1028 CPPUNIT_ASSERT_MESSAGE(
1030 !(a
>>= b
) && b
== getCppuType
< rtl::OUString
>());
1033 css::uno::Any
b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
1034 CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a
>>= b
) && b
== a
);
1037 css::uno::Sequence
< rtl::OUString
> b(2);
1038 CPPUNIT_ASSERT_MESSAGE(
1039 "css::uno::Sequence<rtl::OUString>",
1040 !(a
>>= b
) && b
.getLength() == 2);
1044 CPPUNIT_ASSERT_MESSAGE("Enum1", !(a
>>= b
) && b
== Enum1_M2
);
1048 CPPUNIT_ASSERT_MESSAGE("Struct1", !(a
>>= b
) && b
.member
== 2);
1052 rtl::OUString(), css::uno::Reference
< css::uno::XInterface
>(), 2);
1053 CPPUNIT_ASSERT_MESSAGE("Exception1", !(a
>>= b
) && b
.member
== 2);
1056 css::uno::Reference
< Interface1
> i(new Impl1
);
1057 css::uno::Reference
< Interface1
> b(i
);
1058 CPPUNIT_ASSERT_MESSAGE("Interface1", !(a
>>= b
) && b
== i
);
1062 void Test::testUnsignedHyper() {
1063 css::uno::Any
a(static_cast< sal_uInt64
>(1));
1064 CPPUNIT_ASSERT(a
.getValueType() == getCppuType
< sal_uInt64
>());
1067 CPPUNIT_ASSERT_MESSAGE("bool", !(a
>>= b
) && b
);
1071 CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a
>>= b
) && b
);
1075 CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a
>>= b
) && b
== 2);
1079 CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a
>>= b
) && b
== 2);
1083 CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a
>>= b
) && b
== 2);
1087 CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a
>>= b
) && b
== 2);
1091 CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a
>>= b
) && b
== 2);
1095 CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a
>>= b
) && b
== 2);
1099 CPPUNIT_ASSERT_MESSAGE("sal_Int64", (a
>>= b
) && b
== 1);
1103 CPPUNIT_ASSERT_MESSAGE("sal_uInt64", (a
>>= b
) && b
== 1);
1107 CPPUNIT_ASSERT_MESSAGE("float", !(a
>>= b
) && b
== 2);
1111 CPPUNIT_ASSERT_MESSAGE("double", !(a
>>= b
) && b
== 2);
1114 sal_Unicode b
= '2';
1115 CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a
>>= b
) && b
== '2');
1118 rtl::OUString
b(RTL_CONSTASCII_USTRINGPARAM("2"));
1119 CPPUNIT_ASSERT_MESSAGE(
1121 !(a
>>= b
) && b
.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2")));
1124 css::uno::Type
b(getCppuType
< rtl::OUString
>());
1125 CPPUNIT_ASSERT_MESSAGE(
1127 !(a
>>= b
) && b
== getCppuType
< rtl::OUString
>());
1130 css::uno::Any
b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
1131 CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a
>>= b
) && b
== a
);
1134 css::uno::Sequence
< rtl::OUString
> b(2);
1135 CPPUNIT_ASSERT_MESSAGE(
1136 "css::uno::Sequence<rtl::OUString>",
1137 !(a
>>= b
) && b
.getLength() == 2);
1141 CPPUNIT_ASSERT_MESSAGE("Enum1", !(a
>>= b
) && b
== Enum1_M2
);
1145 CPPUNIT_ASSERT_MESSAGE("Struct1", !(a
>>= b
) && b
.member
== 2);
1149 rtl::OUString(), css::uno::Reference
< css::uno::XInterface
>(), 2);
1150 CPPUNIT_ASSERT_MESSAGE("Exception1", !(a
>>= b
) && b
.member
== 2);
1153 css::uno::Reference
< Interface1
> i(new Impl1
);
1154 css::uno::Reference
< Interface1
> b(i
);
1155 CPPUNIT_ASSERT_MESSAGE("Interface1", !(a
>>= b
) && b
== i
);
1159 void Test::testFloat() {
1160 css::uno::Any
a(1.f
);
1161 CPPUNIT_ASSERT(a
.getValueType() == getCppuType
< float >());
1164 CPPUNIT_ASSERT_MESSAGE("bool", !(a
>>= b
) && b
);
1168 CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a
>>= b
) && b
);
1172 CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a
>>= b
) && b
== 2);
1176 CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a
>>= b
) && b
== 2);
1180 CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a
>>= b
) && b
== 2);
1184 CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a
>>= b
) && b
== 2);
1188 CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a
>>= b
) && b
== 2);
1192 CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a
>>= b
) && b
== 2);
1196 CPPUNIT_ASSERT_MESSAGE("sal_Int64", !(a
>>= b
) && b
== 2);
1200 CPPUNIT_ASSERT_MESSAGE("sal_uInt64", !(a
>>= b
) && b
== 2);
1204 CPPUNIT_ASSERT_MESSAGE("float", (a
>>= b
) && b
== 1);
1208 CPPUNIT_ASSERT_MESSAGE("double", (a
>>= b
) && b
== 1);
1211 sal_Unicode b
= '2';
1212 CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a
>>= b
) && b
== '2');
1215 rtl::OUString
b(RTL_CONSTASCII_USTRINGPARAM("2"));
1216 CPPUNIT_ASSERT_MESSAGE(
1218 !(a
>>= b
) && b
.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2")));
1221 css::uno::Type
b(getCppuType
< rtl::OUString
>());
1222 CPPUNIT_ASSERT_MESSAGE(
1224 !(a
>>= b
) && b
== getCppuType
< rtl::OUString
>());
1227 css::uno::Any
b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
1228 CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a
>>= b
) && b
== a
);
1231 css::uno::Sequence
< rtl::OUString
> b(2);
1232 CPPUNIT_ASSERT_MESSAGE(
1233 "css::uno::Sequence<rtl::OUString>",
1234 !(a
>>= b
) && b
.getLength() == 2);
1238 CPPUNIT_ASSERT_MESSAGE("Enum1", !(a
>>= b
) && b
== Enum1_M2
);
1242 CPPUNIT_ASSERT_MESSAGE("Struct1", !(a
>>= b
) && b
.member
== 2);
1246 rtl::OUString(), css::uno::Reference
< css::uno::XInterface
>(), 2);
1247 CPPUNIT_ASSERT_MESSAGE("Exception1", !(a
>>= b
) && b
.member
== 2);
1250 css::uno::Reference
< Interface1
> i(new Impl1
);
1251 css::uno::Reference
< Interface1
> b(i
);
1252 CPPUNIT_ASSERT_MESSAGE("Interface1", !(a
>>= b
) && b
== i
);
1256 void Test::testDouble() {
1257 css::uno::Any
a(1.);
1258 CPPUNIT_ASSERT(a
.getValueType() == getCppuType
< double >());
1261 CPPUNIT_ASSERT_MESSAGE("bool", !(a
>>= b
) && b
);
1265 CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a
>>= b
) && b
);
1269 CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a
>>= b
) && b
== 2);
1273 CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a
>>= b
) && b
== 2);
1277 CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a
>>= b
) && b
== 2);
1281 CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a
>>= b
) && b
== 2);
1285 CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a
>>= b
) && b
== 2);
1289 CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a
>>= b
) && b
== 2);
1293 CPPUNIT_ASSERT_MESSAGE("sal_Int64", !(a
>>= b
) && b
== 2);
1297 CPPUNIT_ASSERT_MESSAGE("sal_uInt64", !(a
>>= b
) && b
== 2);
1301 CPPUNIT_ASSERT_MESSAGE("float", !(a
>>= b
) && b
== 2);
1305 CPPUNIT_ASSERT_MESSAGE("double", (a
>>= b
) && b
== 1);
1308 sal_Unicode b
= '2';
1309 CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a
>>= b
) && b
== '2');
1312 rtl::OUString
b(RTL_CONSTASCII_USTRINGPARAM("2"));
1313 CPPUNIT_ASSERT_MESSAGE(
1315 !(a
>>= b
) && b
.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2")));
1318 css::uno::Type
b(getCppuType
< rtl::OUString
>());
1319 CPPUNIT_ASSERT_MESSAGE(
1321 !(a
>>= b
) && b
== getCppuType
< rtl::OUString
>());
1324 css::uno::Any
b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
1325 CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a
>>= b
) && b
== a
);
1328 css::uno::Sequence
< rtl::OUString
> b(2);
1329 CPPUNIT_ASSERT_MESSAGE(
1330 "css::uno::Sequence<rtl::OUString>",
1331 !(a
>>= b
) && b
.getLength() == 2);
1335 CPPUNIT_ASSERT_MESSAGE("Enum1", !(a
>>= b
) && b
== Enum1_M2
);
1339 CPPUNIT_ASSERT_MESSAGE("Struct1", !(a
>>= b
) && b
.member
== 2);
1343 rtl::OUString(), css::uno::Reference
< css::uno::XInterface
>(), 2);
1344 CPPUNIT_ASSERT_MESSAGE("Exception1", !(a
>>= b
) && b
.member
== 2);
1347 css::uno::Reference
< Interface1
> i(new Impl1
);
1348 css::uno::Reference
< Interface1
> b(i
);
1349 CPPUNIT_ASSERT_MESSAGE("Interface1", !(a
>>= b
) && b
== i
);
1353 void Test::testChar() {
1354 sal_Unicode c
= '1';
1355 css::uno::Any
a(&c
, getCppuType
< sal_Unicode
>());
1356 CPPUNIT_ASSERT(a
.getValueType() == getCppuType
< sal_Unicode
>());
1359 CPPUNIT_ASSERT_MESSAGE("bool", !(a
>>= b
) && b
);
1363 CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a
>>= b
) && b
);
1367 CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a
>>= b
) && b
== 2);
1371 CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a
>>= b
) && b
== 2);
1375 CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a
>>= b
) && b
== 2);
1379 CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a
>>= b
) && b
== 2);
1383 CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a
>>= b
) && b
== 2);
1387 CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a
>>= b
) && b
== 2);
1391 CPPUNIT_ASSERT_MESSAGE("sal_Int64", !(a
>>= b
) && b
== 2);
1395 CPPUNIT_ASSERT_MESSAGE("sal_uInt64", !(a
>>= b
) && b
== 2);
1399 CPPUNIT_ASSERT_MESSAGE("float", !(a
>>= b
) && b
== 2);
1403 CPPUNIT_ASSERT_MESSAGE("double", !(a
>>= b
) && b
== 2);
1406 sal_Unicode b
= '2';
1407 if (boost::is_same
< sal_Unicode
, sal_uInt16
>::value
) {
1408 CPPUNIT_ASSERT_MESSAGE("@sal_Unicode", !(a
>>= b
) && b
== '2');
1410 CPPUNIT_ASSERT_MESSAGE("sal_Unicode", (a
>>= b
) && b
== '1');
1414 rtl::OUString
b(RTL_CONSTASCII_USTRINGPARAM("2"));
1415 CPPUNIT_ASSERT_MESSAGE(
1417 !(a
>>= b
) && b
.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2")));
1420 css::uno::Type
b(getCppuType
< rtl::OUString
>());
1421 CPPUNIT_ASSERT_MESSAGE(
1423 !(a
>>= b
) && b
== getCppuType
< rtl::OUString
>());
1426 css::uno::Any
b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
1427 CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a
>>= b
) && b
== a
);
1430 css::uno::Sequence
< rtl::OUString
> b(2);
1431 CPPUNIT_ASSERT_MESSAGE(
1432 "css::uno::Sequence<rtl::OUString>",
1433 !(a
>>= b
) && b
.getLength() == 2);
1437 CPPUNIT_ASSERT_MESSAGE("Enum1", !(a
>>= b
) && b
== Enum1_M2
);
1441 CPPUNIT_ASSERT_MESSAGE("Struct1", !(a
>>= b
) && b
.member
== 2);
1445 rtl::OUString(), css::uno::Reference
< css::uno::XInterface
>(), 2);
1446 CPPUNIT_ASSERT_MESSAGE("Exception1", !(a
>>= b
) && b
.member
== 2);
1449 css::uno::Reference
< Interface1
> i(new Impl1
);
1450 css::uno::Reference
< Interface1
> b(i
);
1451 CPPUNIT_ASSERT_MESSAGE("Interface1", !(a
>>= b
) && b
== i
);
1455 void Test::testString() {
1456 css::uno::Any
a(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("1")));
1457 CPPUNIT_ASSERT(a
.getValueType() == getCppuType
< rtl::OUString
>());
1460 CPPUNIT_ASSERT_MESSAGE("bool", !(a
>>= b
) && b
);
1464 CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a
>>= b
) && b
);
1468 CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a
>>= b
) && b
== 2);
1472 CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a
>>= b
) && b
== 2);
1476 CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a
>>= b
) && b
== 2);
1480 CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a
>>= b
) && b
== 2);
1484 CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a
>>= b
) && b
== 2);
1488 CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a
>>= b
) && b
== 2);
1492 CPPUNIT_ASSERT_MESSAGE("sal_Int64", !(a
>>= b
) && b
== 2);
1496 CPPUNIT_ASSERT_MESSAGE("sal_uInt64", !(a
>>= b
) && b
== 2);
1500 CPPUNIT_ASSERT_MESSAGE("float", !(a
>>= b
) && b
== 2);
1504 CPPUNIT_ASSERT_MESSAGE("double", !(a
>>= b
) && b
== 2);
1507 sal_Unicode b
= '2';
1508 CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a
>>= b
) && b
== '2');
1511 rtl::OUString
b(RTL_CONSTASCII_USTRINGPARAM("2"));
1512 CPPUNIT_ASSERT_MESSAGE(
1514 (a
>>= b
) && b
.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("1")));
1517 css::uno::Type
b(getCppuType
< rtl::OUString
>());
1518 CPPUNIT_ASSERT_MESSAGE(
1520 !(a
>>= b
) && b
== getCppuType
< rtl::OUString
>());
1523 css::uno::Any
b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
1524 CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a
>>= b
) && b
== a
);
1527 css::uno::Sequence
< rtl::OUString
> b(2);
1528 CPPUNIT_ASSERT_MESSAGE(
1529 "css::uno::Sequence<rtl::OUString>",
1530 !(a
>>= b
) && b
.getLength() == 2);
1534 CPPUNIT_ASSERT_MESSAGE("Enum1", !(a
>>= b
) && b
== Enum1_M2
);
1538 CPPUNIT_ASSERT_MESSAGE("Struct1", !(a
>>= b
) && b
.member
== 2);
1542 rtl::OUString(), css::uno::Reference
< css::uno::XInterface
>(), 2);
1543 CPPUNIT_ASSERT_MESSAGE("Exception1", !(a
>>= b
) && b
.member
== 2);
1546 css::uno::Reference
< Interface1
> i(new Impl1
);
1547 css::uno::Reference
< Interface1
> b(i
);
1548 CPPUNIT_ASSERT_MESSAGE("Interface1", !(a
>>= b
) && b
== i
);
1552 void Test::testType() {
1553 css::uno::Any
a(getCppuType
< sal_Int32
>());
1554 CPPUNIT_ASSERT(a
.getValueType() == getCppuType
< css::uno::Type
>());
1557 CPPUNIT_ASSERT_MESSAGE("bool", !(a
>>= b
) && b
);
1561 CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a
>>= b
) && b
);
1565 CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a
>>= b
) && b
== 2);
1569 CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a
>>= b
) && b
== 2);
1573 CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a
>>= b
) && b
== 2);
1577 CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a
>>= b
) && b
== 2);
1581 CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a
>>= b
) && b
== 2);
1585 CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a
>>= b
) && b
== 2);
1589 CPPUNIT_ASSERT_MESSAGE("sal_Int64", !(a
>>= b
) && b
== 2);
1593 CPPUNIT_ASSERT_MESSAGE("sal_uInt64", !(a
>>= b
) && b
== 2);
1597 CPPUNIT_ASSERT_MESSAGE("float", !(a
>>= b
) && b
== 2);
1601 CPPUNIT_ASSERT_MESSAGE("double", !(a
>>= b
) && b
== 2);
1604 sal_Unicode b
= '2';
1605 CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a
>>= b
) && b
== '2');
1608 rtl::OUString
b(RTL_CONSTASCII_USTRINGPARAM("2"));
1609 CPPUNIT_ASSERT_MESSAGE(
1611 !(a
>>= b
) && b
.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2")));
1614 css::uno::Type
b(getCppuType
< rtl::OUString
>());
1615 CPPUNIT_ASSERT_MESSAGE(
1616 "css::uno::Type", (a
>>= b
) && b
== getCppuType
< sal_Int32
>());
1619 css::uno::Any
b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
1620 CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a
>>= b
) && b
== a
);
1623 css::uno::Sequence
< rtl::OUString
> b(2);
1624 CPPUNIT_ASSERT_MESSAGE(
1625 "css::uno::Sequence<rtl::OUString>",
1626 !(a
>>= b
) && b
.getLength() == 2);
1630 CPPUNIT_ASSERT_MESSAGE("Enum1", !(a
>>= b
) && b
== Enum1_M2
);
1634 CPPUNIT_ASSERT_MESSAGE("Struct1", !(a
>>= b
) && b
.member
== 2);
1638 rtl::OUString(), css::uno::Reference
< css::uno::XInterface
>(), 2);
1639 CPPUNIT_ASSERT_MESSAGE("Exception1", !(a
>>= b
) && b
.member
== 2);
1642 css::uno::Reference
< Interface1
> i(new Impl1
);
1643 css::uno::Reference
< Interface1
> b(i
);
1644 CPPUNIT_ASSERT_MESSAGE("Interface1", !(a
>>= b
) && b
== i
);
1648 void Test::testSequence() {
1650 css::uno::Any
a(css::uno::Sequence
< sal_Int32
>(&n
, 1));
1652 a
.getValueType() == getCppuType
< css::uno::Sequence
< sal_Int32
> >());
1655 CPPUNIT_ASSERT_MESSAGE("bool", !(a
>>= b
) && b
);
1659 CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a
>>= b
) && b
);
1663 CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a
>>= b
) && b
== 2);
1667 CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a
>>= b
) && b
== 2);
1671 CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a
>>= b
) && b
== 2);
1675 CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a
>>= b
) && b
== 2);
1679 CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a
>>= b
) && b
== 2);
1683 CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a
>>= b
) && b
== 2);
1687 CPPUNIT_ASSERT_MESSAGE("sal_Int64", !(a
>>= b
) && b
== 2);
1691 CPPUNIT_ASSERT_MESSAGE("sal_uInt64", !(a
>>= b
) && b
== 2);
1695 CPPUNIT_ASSERT_MESSAGE("float", !(a
>>= b
) && b
== 2);
1699 CPPUNIT_ASSERT_MESSAGE("double", !(a
>>= b
) && b
== 2);
1702 sal_Unicode b
= '2';
1703 CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a
>>= b
) && b
== '2');
1706 rtl::OUString
b(RTL_CONSTASCII_USTRINGPARAM("2"));
1707 CPPUNIT_ASSERT_MESSAGE(
1709 !(a
>>= b
) && b
.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2")));
1712 css::uno::Type
b(getCppuType
< rtl::OUString
>());
1713 CPPUNIT_ASSERT_MESSAGE(
1715 !(a
>>= b
) && b
== getCppuType
< rtl::OUString
>());
1718 css::uno::Any
b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
1719 CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a
>>= b
) && b
== a
);
1722 css::uno::Sequence
< rtl::OUString
> b(2);
1723 CPPUNIT_ASSERT_MESSAGE(
1724 "css::uno::Sequence<rtl::OUString>",
1725 !(a
>>= b
) && b
.getLength() == 2);
1728 css::uno::Sequence
< sal_Int32
> b(2);
1729 CPPUNIT_ASSERT_MESSAGE(
1730 "css::uno::Sequence<sal_Int32>",
1731 (a
>>= b
) && b
.getLength() == 1 && b
[0] == 1);
1735 CPPUNIT_ASSERT_MESSAGE("Enum1", !(a
>>= b
) && b
== Enum1_M2
);
1739 CPPUNIT_ASSERT_MESSAGE("Struct1", !(a
>>= b
) && b
.member
== 2);
1743 rtl::OUString(), css::uno::Reference
< css::uno::XInterface
>(), 2);
1744 CPPUNIT_ASSERT_MESSAGE("Exception1", !(a
>>= b
) && b
.member
== 2);
1747 css::uno::Reference
< Interface1
> i(new Impl1
);
1748 css::uno::Reference
< Interface1
> b(i
);
1749 CPPUNIT_ASSERT_MESSAGE("Interface1", !(a
>>= b
) && b
== i
);
1753 void Test::testEnum() {
1754 css::uno::Any
a(Enum2_M1
);
1755 CPPUNIT_ASSERT(a
.getValueType() == getCppuType
< Enum2
>());
1758 CPPUNIT_ASSERT_MESSAGE("bool", !(a
>>= b
) && b
);
1762 CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a
>>= b
) && b
);
1766 CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a
>>= b
) && b
== 2);
1770 CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a
>>= b
) && b
== 2);
1774 CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a
>>= b
) && b
== 2);
1778 CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a
>>= b
) && b
== 2);
1782 CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a
>>= b
) && b
== 2);
1786 CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a
>>= b
) && b
== 2);
1790 CPPUNIT_ASSERT_MESSAGE("sal_Int64", !(a
>>= b
) && b
== 2);
1794 CPPUNIT_ASSERT_MESSAGE("sal_uInt64", !(a
>>= b
) && b
== 2);
1798 CPPUNIT_ASSERT_MESSAGE("float", !(a
>>= b
) && b
== 2);
1802 CPPUNIT_ASSERT_MESSAGE("double", !(a
>>= b
) && b
== 2);
1805 sal_Unicode b
= '2';
1806 CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a
>>= b
) && b
== '2');
1809 rtl::OUString
b(RTL_CONSTASCII_USTRINGPARAM("2"));
1810 CPPUNIT_ASSERT_MESSAGE(
1812 !(a
>>= b
) && b
.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2")));
1815 css::uno::Type
b(getCppuType
< rtl::OUString
>());
1816 CPPUNIT_ASSERT_MESSAGE(
1818 !(a
>>= b
) && b
== getCppuType
< rtl::OUString
>());
1821 css::uno::Any
b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
1822 CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a
>>= b
) && b
== a
);
1825 css::uno::Sequence
< rtl::OUString
> b(2);
1826 CPPUNIT_ASSERT_MESSAGE(
1827 "css::uno::Sequence<rtl::OUString>",
1828 !(a
>>= b
) && b
.getLength() == 2);
1832 CPPUNIT_ASSERT_MESSAGE("Enum1", !(a
>>= b
) && b
== Enum1_M2
);
1836 CPPUNIT_ASSERT_MESSAGE("Enum2", (a
>>= b
) && b
== Enum2_M1
);
1840 CPPUNIT_ASSERT_MESSAGE("Struct1", !(a
>>= b
) && b
.member
== 2);
1844 rtl::OUString(), css::uno::Reference
< css::uno::XInterface
>(), 2);
1845 CPPUNIT_ASSERT_MESSAGE("Exception1", !(a
>>= b
) && b
.member
== 2);
1848 css::uno::Reference
< Interface1
> i(new Impl1
);
1849 css::uno::Reference
< Interface1
> b(i
);
1850 CPPUNIT_ASSERT_MESSAGE("Interface1", !(a
>>= b
) && b
== i
);
1854 void Test::testStruct() {
1855 css::uno::Any
a(Struct2a(1, 3));
1856 CPPUNIT_ASSERT(a
.getValueType() == getCppuType
< Struct2a
>());
1859 CPPUNIT_ASSERT_MESSAGE("bool", !(a
>>= b
) && b
);
1863 CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a
>>= b
) && b
);
1867 CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a
>>= b
) && b
== 2);
1871 CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a
>>= b
) && b
== 2);
1875 CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a
>>= b
) && b
== 2);
1879 CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a
>>= b
) && b
== 2);
1883 CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a
>>= b
) && b
== 2);
1887 CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a
>>= b
) && b
== 2);
1891 CPPUNIT_ASSERT_MESSAGE("sal_Int64", !(a
>>= b
) && b
== 2);
1895 CPPUNIT_ASSERT_MESSAGE("sal_uInt64", !(a
>>= b
) && b
== 2);
1899 CPPUNIT_ASSERT_MESSAGE("float", !(a
>>= b
) && b
== 2);
1903 CPPUNIT_ASSERT_MESSAGE("double", !(a
>>= b
) && b
== 2);
1906 sal_Unicode b
= '2';
1907 CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a
>>= b
) && b
== '2');
1910 rtl::OUString
b(RTL_CONSTASCII_USTRINGPARAM("2"));
1911 CPPUNIT_ASSERT_MESSAGE(
1913 !(a
>>= b
) && b
.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2")));
1916 css::uno::Type
b(getCppuType
< rtl::OUString
>());
1917 CPPUNIT_ASSERT_MESSAGE(
1919 !(a
>>= b
) && b
== getCppuType
< rtl::OUString
>());
1922 css::uno::Any
b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
1923 CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a
>>= b
) && b
== a
);
1926 css::uno::Sequence
< rtl::OUString
> b(2);
1927 CPPUNIT_ASSERT_MESSAGE(
1928 "css::uno::Sequence<rtl::OUString>",
1929 !(a
>>= b
) && b
.getLength() == 2);
1933 CPPUNIT_ASSERT_MESSAGE("Enum1", !(a
>>= b
) && b
== Enum1_M2
);
1937 CPPUNIT_ASSERT_MESSAGE("Struct1", !(a
>>= b
) && b
.member
== 2);
1941 CPPUNIT_ASSERT_MESSAGE("Struct2", (a
>>= b
) && b
.member
== 1);
1945 CPPUNIT_ASSERT_MESSAGE(
1946 "Struct2a", (a
>>= b
) && b
.member
== 1 && b
.member2
== 3);
1949 Struct2b
b(2, 2, 2);
1950 CPPUNIT_ASSERT_MESSAGE("Struct2b", !(a
>>= b
) && b
.member
== 2);
1954 rtl::OUString(), css::uno::Reference
< css::uno::XInterface
>(), 2);
1955 CPPUNIT_ASSERT_MESSAGE("Exception1", !(a
>>= b
) && b
.member
== 2);
1958 css::uno::Reference
< Interface1
> i(new Impl1
);
1959 css::uno::Reference
< Interface1
> b(i
);
1960 CPPUNIT_ASSERT_MESSAGE("Interface1", !(a
>>= b
) && b
== i
);
1964 void Test::testPoly() {
1966 a
<<= Poly
< css::uno::Sequence
< ::sal_Unicode
> >();
1967 CPPUNIT_ASSERT_MESSAGE(
1969 a
.getValueType().getTypeName().equalsAsciiL(
1970 RTL_CONSTASCII_STRINGPARAM("Poly<[]char>")));
1971 CPPUNIT_ASSERT_MESSAGE(
1973 a
== css::uno::Any(Poly
< css::uno::Sequence
< ::sal_Unicode
> >()));
1976 void Test::testException() {
1979 rtl::OUString(), css::uno::Reference
< css::uno::XInterface
>(), 1,
1981 CPPUNIT_ASSERT(a
.getValueType() == getCppuType
< Exception2a
>());
1984 CPPUNIT_ASSERT_MESSAGE("bool", !(a
>>= b
) && b
);
1988 CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a
>>= b
) && b
);
1992 CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a
>>= b
) && b
== 2);
1996 CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a
>>= b
) && b
== 2);
2000 CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a
>>= b
) && b
== 2);
2004 CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a
>>= b
) && b
== 2);
2008 CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a
>>= b
) && b
== 2);
2012 CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a
>>= b
) && b
== 2);
2016 CPPUNIT_ASSERT_MESSAGE("sal_Int64", !(a
>>= b
) && b
== 2);
2020 CPPUNIT_ASSERT_MESSAGE("sal_uInt64", !(a
>>= b
) && b
== 2);
2024 CPPUNIT_ASSERT_MESSAGE("float", !(a
>>= b
) && b
== 2);
2028 CPPUNIT_ASSERT_MESSAGE("double", !(a
>>= b
) && b
== 2);
2031 sal_Unicode b
= '2';
2032 CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a
>>= b
) && b
== '2');
2035 rtl::OUString
b(RTL_CONSTASCII_USTRINGPARAM("2"));
2036 CPPUNIT_ASSERT_MESSAGE(
2038 !(a
>>= b
) && b
.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2")));
2041 css::uno::Type
b(getCppuType
< rtl::OUString
>());
2042 CPPUNIT_ASSERT_MESSAGE(
2044 !(a
>>= b
) && b
== getCppuType
< rtl::OUString
>());
2047 css::uno::Any
b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
2048 CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a
>>= b
) && b
== a
);
2051 css::uno::Sequence
< rtl::OUString
> b(2);
2052 CPPUNIT_ASSERT_MESSAGE(
2053 "css::uno::Sequence<rtl::OUString>",
2054 !(a
>>= b
) && b
.getLength() == 2);
2058 CPPUNIT_ASSERT_MESSAGE("Enum1", !(a
>>= b
) && b
== Enum1_M2
);
2062 CPPUNIT_ASSERT_MESSAGE("Struct1", !(a
>>= b
) && b
.member
== 2);
2066 rtl::OUString(), css::uno::Reference
< css::uno::XInterface
>(), 2);
2067 CPPUNIT_ASSERT_MESSAGE("Exception1", !(a
>>= b
) && b
.member
== 2);
2071 rtl::OUString(), css::uno::Reference
< css::uno::XInterface
>(), 2);
2072 CPPUNIT_ASSERT_MESSAGE("Exception2", (a
>>= b
) && b
.member
== 1);
2076 rtl::OUString(), css::uno::Reference
< css::uno::XInterface
>(), 2,
2078 CPPUNIT_ASSERT_MESSAGE(
2079 "Exception2a", (a
>>= b
) && b
.member
== 1 && b
.member2
== 3);
2083 rtl::OUString(), css::uno::Reference
< css::uno::XInterface
>(), 2,
2085 CPPUNIT_ASSERT_MESSAGE("Exception2b", !(a
>>= b
) && b
.member
== 2);
2088 css::uno::Reference
< Interface1
> i(new Impl1
);
2089 css::uno::Reference
< Interface1
> b(i
);
2090 CPPUNIT_ASSERT_MESSAGE("Interface1", !(a
>>= b
) && b
== i
);
2094 void Test::testInterface() {
2095 css::uno::Reference
< Interface2a
> i2(new Impl2
);
2096 css::uno::Any
a(i2
);
2099 == getCppuType
< css::uno::Reference
< Interface2a
> >());
2102 CPPUNIT_ASSERT_MESSAGE("bool", !(a
>>= b
) && b
);
2106 CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a
>>= b
) && b
);
2110 CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a
>>= b
) && b
== 2);
2114 CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a
>>= b
) && b
== 2);
2118 CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a
>>= b
) && b
== 2);
2122 CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a
>>= b
) && b
== 2);
2126 CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a
>>= b
) && b
== 2);
2130 CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a
>>= b
) && b
== 2);
2134 CPPUNIT_ASSERT_MESSAGE("sal_Int64", !(a
>>= b
) && b
== 2);
2138 CPPUNIT_ASSERT_MESSAGE("sal_uInt64", !(a
>>= b
) && b
== 2);
2142 CPPUNIT_ASSERT_MESSAGE("float", !(a
>>= b
) && b
== 2);
2146 CPPUNIT_ASSERT_MESSAGE("double", !(a
>>= b
) && b
== 2);
2149 sal_Unicode b
= '2';
2150 CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a
>>= b
) && b
== '2');
2153 rtl::OUString
b(RTL_CONSTASCII_USTRINGPARAM("2"));
2154 CPPUNIT_ASSERT_MESSAGE(
2156 !(a
>>= b
) && b
.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2")));
2159 css::uno::Type
b(getCppuType
< rtl::OUString
>());
2160 CPPUNIT_ASSERT_MESSAGE(
2162 !(a
>>= b
) && b
== getCppuType
< rtl::OUString
>());
2165 css::uno::Any
b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
2166 CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a
>>= b
) && b
== a
);
2169 css::uno::Sequence
< rtl::OUString
> b(2);
2170 CPPUNIT_ASSERT_MESSAGE(
2171 "css::uno::Sequence<rtl::OUString>",
2172 !(a
>>= b
) && b
.getLength() == 2);
2176 CPPUNIT_ASSERT_MESSAGE("Enum1", !(a
>>= b
) && b
== Enum1_M2
);
2180 CPPUNIT_ASSERT_MESSAGE("Struct1", !(a
>>= b
) && b
.member
== 2);
2184 rtl::OUString(), css::uno::Reference
< css::uno::XInterface
>(), 2);
2185 CPPUNIT_ASSERT_MESSAGE("Exception1", !(a
>>= b
) && b
.member
== 2);
2188 css::uno::Reference
< Interface1
> i(new Impl1
);
2189 css::uno::Reference
< Interface1
> b(i
);
2190 CPPUNIT_ASSERT_MESSAGE("Interface1", !(a
>>= b
) && b
== i
);
2193 css::uno::Reference
< Interface2
> b(new Impl2
);
2194 CPPUNIT_ASSERT_MESSAGE("Interface2", (a
>>= b
) && b
== i2
);
2197 css::uno::Reference
< Interface2a
> b(new Impl2
);
2198 CPPUNIT_ASSERT_MESSAGE("Interface2a", (a
>>= b
) && b
== i2
);
2201 css::uno::Reference
< Interface2b
> i(new Impl2b
);
2202 css::uno::Reference
< Interface2b
> b(i
);
2203 CPPUNIT_ASSERT_MESSAGE("Interface2b", !(a
>>= b
) && b
== i
);
2206 css::uno::Reference
< Interface3
> b(new Impl2
);
2207 CPPUNIT_ASSERT_MESSAGE("Interface3", (a
>>= b
) && b
== i2
);
2211 void Test::testNull() {
2212 css::uno::Any a
= css::uno::Any(css::uno::Reference
< Interface2a
>());
2215 == getCppuType
< css::uno::Reference
< Interface2a
> >());
2218 CPPUNIT_ASSERT_MESSAGE("bool", !(a
>>= b
) && b
);
2222 CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a
>>= b
) && b
);
2226 CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a
>>= b
) && b
== 2);
2230 CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a
>>= b
) && b
== 2);
2234 CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a
>>= b
) && b
== 2);
2238 CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a
>>= b
) && b
== 2);
2242 CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a
>>= b
) && b
== 2);
2246 CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a
>>= b
) && b
== 2);
2250 CPPUNIT_ASSERT_MESSAGE("sal_Int64", !(a
>>= b
) && b
== 2);
2254 CPPUNIT_ASSERT_MESSAGE("sal_uInt64", !(a
>>= b
) && b
== 2);
2258 CPPUNIT_ASSERT_MESSAGE("float", !(a
>>= b
) && b
== 2);
2262 CPPUNIT_ASSERT_MESSAGE("double", !(a
>>= b
) && b
== 2);
2265 sal_Unicode b
= '2';
2266 CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a
>>= b
) && b
== '2');
2269 rtl::OUString
b(RTL_CONSTASCII_USTRINGPARAM("2"));
2270 CPPUNIT_ASSERT_MESSAGE(
2272 !(a
>>= b
) && b
.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2")));
2275 css::uno::Type
b(getCppuType
< rtl::OUString
>());
2276 CPPUNIT_ASSERT_MESSAGE(
2278 !(a
>>= b
) && b
== getCppuType
< rtl::OUString
>());
2281 css::uno::Any
b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
2282 CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a
>>= b
) && b
== a
);
2285 css::uno::Sequence
< rtl::OUString
> b(2);
2286 CPPUNIT_ASSERT_MESSAGE(
2287 "css::uno::Sequence<rtl::OUString>",
2288 !(a
>>= b
) && b
.getLength() == 2);
2292 CPPUNIT_ASSERT_MESSAGE("Enum1", !(a
>>= b
) && b
== Enum1_M2
);
2296 CPPUNIT_ASSERT_MESSAGE("Struct1", !(a
>>= b
) && b
.member
== 2);
2300 rtl::OUString(), css::uno::Reference
< css::uno::XInterface
>(), 2);
2301 CPPUNIT_ASSERT_MESSAGE("Exception1", !(a
>>= b
) && b
.member
== 2);
2304 css::uno::Reference
< Interface1
> b(new Impl1
);
2305 CPPUNIT_ASSERT_MESSAGE(
2306 "Interface1", (a
>>= b
) && !b
.is());
2309 css::uno::Reference
< Interface2
> b(new Impl2
);
2310 CPPUNIT_ASSERT_MESSAGE(
2311 "Interface2", (a
>>= b
) && !b
.is());
2314 css::uno::Reference
< Interface2a
> b(new Impl2
);
2315 CPPUNIT_ASSERT_MESSAGE("Interface2a", (a
>>= b
) && !b
.is());
2318 css::uno::Reference
< Interface2b
> b(new Impl2b
);
2319 CPPUNIT_ASSERT_MESSAGE(
2320 "Interface2b", (a
>>= b
) && !b
.is());
2323 css::uno::Reference
< Interface3
> b(new Impl2
);
2324 CPPUNIT_ASSERT_MESSAGE(
2325 "Interface3", (a
>>= b
) && !b
.is());
2329 CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(Test
, "alltests");