1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #include <sal/types.h>
22 #include <stdlib.h> // wntmsci10 does not like <cstdlib>
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>
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"
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"
67 if (osl_atomic_increment(&m_count
) == SAL_MAX_INT32
) {
73 if (osl_atomic_decrement(&m_count
) == 0) {
82 Base(Base
&); // not declared
83 void operator =(Base
&); // not declared
85 oslInterlockedCount m_count
;
88 class Impl1
: public Interface1
, private Base
{
90 virtual css::uno::Any SAL_CALL
queryInterface(css::uno::Type
const & type
)
91 throw (css::uno::RuntimeException
)
94 == getCppuType
< css::uno::Reference
< css::uno::XInterface
> >())
96 css::uno::Reference
< css::uno::XInterface
> ref(
97 static_cast< css::uno::XInterface
* >(this));
98 return css::uno::Any(&ref
, type
);
99 } else if (type
== getCppuType
< css::uno::Reference
< Interface1
> >()) {
100 css::uno::Reference
< Interface1
> ref(this);
101 return css::uno::Any(&ref
, type
);
103 return css::uno::Any();
107 virtual void SAL_CALL
acquire() throw () {
111 virtual void SAL_CALL
release() throw () {
116 class Impl2
: public Interface2a
, public Interface3
, private Base
{
118 virtual css::uno::Any SAL_CALL
queryInterface(css::uno::Type
const & type
)
119 throw (css::uno::RuntimeException
)
122 == getCppuType
< css::uno::Reference
< css::uno::XInterface
> >())
124 css::uno::Reference
< css::uno::XInterface
> ref(
125 static_cast< css::uno::XInterface
* >(
126 static_cast< Interface2a
* >(this)));
127 return css::uno::Any(&ref
, type
);
128 } else if (type
== getCppuType
< css::uno::Reference
< Interface2
> >()) {
129 css::uno::Reference
< Interface2
> ref(this);
130 return css::uno::Any(&ref
, type
);
131 } else if (type
== getCppuType
< css::uno::Reference
< Interface2a
> >())
133 css::uno::Reference
< Interface2a
> ref(this);
134 return css::uno::Any(&ref
, type
);
135 } else if (type
== getCppuType
< css::uno::Reference
< Interface3
> >()) {
136 css::uno::Reference
< Interface3
> ref(this);
137 return css::uno::Any(&ref
, type
);
139 return css::uno::Any();
143 virtual void SAL_CALL
acquire() throw () {
147 virtual void SAL_CALL
release() throw () {
152 class Impl2b
: public Interface2b
, private Base
{
154 virtual css::uno::Any SAL_CALL
queryInterface(css::uno::Type
const & type
)
155 throw (css::uno::RuntimeException
)
158 == getCppuType
< css::uno::Reference
< css::uno::XInterface
> >())
160 css::uno::Reference
< css::uno::XInterface
> ref(
161 static_cast< css::uno::XInterface
* >(
162 static_cast< Interface2a
* >(this)));
163 return css::uno::Any(&ref
, type
);
164 } else if (type
== getCppuType
< css::uno::Reference
< Interface2
> >()) {
165 css::uno::Reference
< Interface2
> ref(this);
166 return css::uno::Any(&ref
, type
);
167 } else if (type
== getCppuType
< css::uno::Reference
< Interface2a
> >())
169 css::uno::Reference
< Interface2a
> ref(this);
170 return css::uno::Any(&ref
, type
);
171 } else if (type
== getCppuType
< css::uno::Reference
< Interface2b
> >())
173 css::uno::Reference
< Interface2b
> ref(this);
174 return css::uno::Any(&ref
, type
);
176 return css::uno::Any();
180 virtual void SAL_CALL
acquire() throw () {
184 virtual void SAL_CALL
release() throw () {
189 class Test
: public CppUnit::TestFixture
{
195 void testUnsignedShort();
197 void testUnsignedLong();
199 void testUnsignedHyper();
209 void testException();
210 void testInterface();
213 CPPUNIT_TEST_SUITE(Test
);
214 CPPUNIT_TEST(testVoid
);
215 CPPUNIT_TEST(testBoolean
);
216 CPPUNIT_TEST(testByte
);
217 CPPUNIT_TEST(testShort
);
218 CPPUNIT_TEST(testUnsignedShort
);
219 CPPUNIT_TEST(testLong
);
220 CPPUNIT_TEST(testUnsignedLong
);
221 CPPUNIT_TEST(testHyper
);
222 CPPUNIT_TEST(testUnsignedHyper
);
223 CPPUNIT_TEST(testFloat
);
224 CPPUNIT_TEST(testDouble
);
225 CPPUNIT_TEST(testChar
);
226 CPPUNIT_TEST(testString
);
227 CPPUNIT_TEST(testType
);
228 CPPUNIT_TEST(testSequence
);
229 CPPUNIT_TEST(testEnum
);
230 CPPUNIT_TEST(testStruct
);
231 CPPUNIT_TEST(testPoly
);
232 CPPUNIT_TEST(testException
);
233 CPPUNIT_TEST(testInterface
);
234 CPPUNIT_TEST(testNull
);
235 CPPUNIT_TEST_SUITE_END();
238 void Test::testVoid() {
240 CPPUNIT_ASSERT(a
.getValueType() == getVoidCppuType());
243 CPPUNIT_ASSERT_MESSAGE("bool", !(a
>>= b
) && b
);
247 CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a
>>= b
) && b
);
251 CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a
>>= b
) && b
== 2);
255 CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a
>>= b
) && b
== 2);
259 CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a
>>= b
) && b
== 2);
263 CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a
>>= b
) && b
== 2);
267 CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a
>>= b
) && b
== 2);
271 CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a
>>= b
) && b
== 2);
275 CPPUNIT_ASSERT_MESSAGE("sal_Int64", !(a
>>= b
) && b
== 2);
279 CPPUNIT_ASSERT_MESSAGE("sal_uInt64", !(a
>>= b
) && b
== 2);
283 CPPUNIT_ASSERT_MESSAGE("float", !(a
>>= b
) && b
== 2);
287 CPPUNIT_ASSERT_MESSAGE("double", !(a
>>= b
) && b
== 2);
291 CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a
>>= b
) && b
== '2');
294 rtl::OUString
b(RTL_CONSTASCII_USTRINGPARAM("2"));
295 CPPUNIT_ASSERT_MESSAGE( "rtl::OUString", !(a
>>= b
) && b
== "2" );
298 css::uno::Type
b(getCppuType
< rtl::OUString
>());
299 CPPUNIT_ASSERT_MESSAGE(
301 !(a
>>= b
) && b
== getCppuType
< rtl::OUString
>());
304 css::uno::Any
b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
305 CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a
>>= b
) && b
== a
);
308 css::uno::Sequence
< rtl::OUString
> b(2);
309 CPPUNIT_ASSERT_MESSAGE(
310 "css::uno::Sequence<rtl::OUString>", !(a
>>= b
) && b
.getLength() == 2);
314 CPPUNIT_ASSERT_MESSAGE("Enum1", !(a
>>= b
) && b
== Enum1_M2
);
318 CPPUNIT_ASSERT_MESSAGE("Struct1", !(a
>>= b
) && b
.member
== 2);
322 rtl::OUString(), css::uno::Reference
< css::uno::XInterface
>(), 2);
323 CPPUNIT_ASSERT_MESSAGE("Exception1", !(a
>>= b
) && b
.member
== 2);
326 css::uno::Reference
< Interface1
> i(new Impl1
);
327 css::uno::Reference
< Interface1
> b(i
);
328 CPPUNIT_ASSERT_MESSAGE("Interface1", !(a
>>= b
) && b
== i
);
332 void Test::testBoolean() {
333 css::uno::Any
a(false);
334 CPPUNIT_ASSERT(a
.getValueType() == getCppuType
< sal_Bool
>());
337 CPPUNIT_ASSERT_MESSAGE("bool", (a
>>= b
) && !b
);
341 CPPUNIT_ASSERT_MESSAGE("sal_Bool", (a
>>= b
) && !b
);
345 CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a
>>= b
) && b
== 2);
349 if (boost::is_same
< sal_uInt8
, sal_Bool
>::value
) {
350 CPPUNIT_ASSERT_MESSAGE("@sal_uInt8", (a
>>= b
) && b
== 0);
352 CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a
>>= b
) && b
== 2);
357 CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a
>>= b
) && b
== 2);
361 CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a
>>= b
) && b
== 2);
365 CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a
>>= b
) && b
== 2);
369 CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a
>>= b
) && b
== 2);
373 CPPUNIT_ASSERT_MESSAGE("sal_Int64", !(a
>>= b
) && b
== 2);
377 CPPUNIT_ASSERT_MESSAGE("sal_uInt64", !(a
>>= b
) && b
== 2);
381 CPPUNIT_ASSERT_MESSAGE("float", !(a
>>= b
) && b
== 2);
385 CPPUNIT_ASSERT_MESSAGE("double", !(a
>>= b
) && b
== 2);
389 CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a
>>= b
) && b
== '2');
392 rtl::OUString
b(RTL_CONSTASCII_USTRINGPARAM("2"));
393 CPPUNIT_ASSERT_MESSAGE( "rtl::OUString", !(a
>>= b
) && b
== "2" );
396 css::uno::Type
b(getCppuType
< rtl::OUString
>());
397 CPPUNIT_ASSERT_MESSAGE(
399 !(a
>>= b
) && b
== getCppuType
< rtl::OUString
>());
402 css::uno::Any
b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
403 CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a
>>= b
) && b
== a
);
406 css::uno::Sequence
< rtl::OUString
> b(2);
407 CPPUNIT_ASSERT_MESSAGE(
408 "css::uno::Sequence<rtl::OUString>",
409 !(a
>>= b
) && b
.getLength() == 2);
413 CPPUNIT_ASSERT_MESSAGE("Enum1", !(a
>>= b
) && b
== Enum1_M2
);
417 CPPUNIT_ASSERT_MESSAGE("Struct1", !(a
>>= b
) && b
.member
== 2);
421 rtl::OUString(), css::uno::Reference
< css::uno::XInterface
>(), 2);
422 CPPUNIT_ASSERT_MESSAGE("Exception1", !(a
>>= b
) && b
.member
== 2);
425 css::uno::Reference
< Interface1
> i(new Impl1
);
426 css::uno::Reference
< Interface1
> b(i
);
427 CPPUNIT_ASSERT_MESSAGE("Interface1", !(a
>>= b
) && b
== i
);
431 void Test::testByte() {
432 css::uno::Any
a(static_cast< sal_Int8
>(1));
433 CPPUNIT_ASSERT(a
.getValueType() == getCppuType
< sal_Int8
>());
436 CPPUNIT_ASSERT_MESSAGE("bool", !(a
>>= b
) && b
);
440 CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a
>>= b
) && b
);
444 CPPUNIT_ASSERT_MESSAGE("sal_Int8", (a
>>= b
) && b
== 1);
448 CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a
>>= b
) && b
== 2);
452 CPPUNIT_ASSERT_MESSAGE("sal_Int16", (a
>>= b
) && b
== 1);
456 CPPUNIT_ASSERT_MESSAGE("sal_uInt16", (a
>>= b
) && b
== 1);
460 CPPUNIT_ASSERT_MESSAGE("sal_Int32", (a
>>= b
) && b
== 1);
464 CPPUNIT_ASSERT_MESSAGE("sal_uInt32", (a
>>= b
) && b
== 1);
468 CPPUNIT_ASSERT_MESSAGE("sal_Int64", (a
>>= b
) && b
== 1);
472 CPPUNIT_ASSERT_MESSAGE("sal_uInt64", (a
>>= b
) && b
== 1);
476 CPPUNIT_ASSERT_MESSAGE("float", (a
>>= b
) && b
== 1);
480 CPPUNIT_ASSERT_MESSAGE("double", (a
>>= b
) && b
== 1);
484 if (boost::is_same
< sal_Unicode
, sal_uInt16
>::value
) {
485 CPPUNIT_ASSERT_MESSAGE("@sal_Unicode", (a
>>= b
) && b
== 1);
487 CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a
>>= b
) && b
== '2');
491 rtl::OUString
b(RTL_CONSTASCII_USTRINGPARAM("2"));
492 CPPUNIT_ASSERT_MESSAGE( "rtl::OUString", !(a
>>= b
) && b
== "2" );
495 css::uno::Type
b(getCppuType
< rtl::OUString
>());
496 CPPUNIT_ASSERT_MESSAGE(
498 !(a
>>= b
) && b
== getCppuType
< rtl::OUString
>());
501 css::uno::Any
b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
502 CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a
>>= b
) && b
== a
);
505 css::uno::Sequence
< rtl::OUString
> b(2);
506 CPPUNIT_ASSERT_MESSAGE(
507 "css::uno::Sequence<rtl::OUString>",
508 !(a
>>= b
) && b
.getLength() == 2);
512 CPPUNIT_ASSERT_MESSAGE("Enum1", !(a
>>= b
) && b
== Enum1_M2
);
516 CPPUNIT_ASSERT_MESSAGE("Struct1", !(a
>>= b
) && b
.member
== 2);
520 rtl::OUString(), css::uno::Reference
< css::uno::XInterface
>(), 2);
521 CPPUNIT_ASSERT_MESSAGE("Exception1", !(a
>>= b
) && b
.member
== 2);
524 css::uno::Reference
< Interface1
> i(new Impl1
);
525 css::uno::Reference
< Interface1
> b(i
);
526 CPPUNIT_ASSERT_MESSAGE("Interface1", !(a
>>= b
) && b
== i
);
530 void Test::testShort() {
531 css::uno::Any
a(static_cast< sal_Int16
>(1));
532 CPPUNIT_ASSERT(a
.getValueType() == getCppuType
< sal_Int16
>());
535 CPPUNIT_ASSERT_MESSAGE("bool", !(a
>>= b
) && b
);
539 CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a
>>= b
) && b
);
543 CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a
>>= b
) && b
== 2);
547 CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a
>>= b
) && b
== 2);
551 CPPUNIT_ASSERT_MESSAGE("sal_Int16", (a
>>= b
) && b
== 1);
555 CPPUNIT_ASSERT_MESSAGE("sal_uInt16", (a
>>= b
) && b
== 1);
559 CPPUNIT_ASSERT_MESSAGE("sal_Int32", (a
>>= b
) && b
== 1);
563 CPPUNIT_ASSERT_MESSAGE("sal_uInt32", (a
>>= b
) && b
== 1);
567 CPPUNIT_ASSERT_MESSAGE("sal_Int64", (a
>>= b
) && b
== 1);
571 CPPUNIT_ASSERT_MESSAGE("sal_uInt64", (a
>>= b
) && b
== 1);
575 CPPUNIT_ASSERT_MESSAGE("float", (a
>>= b
) && b
== 1);
579 CPPUNIT_ASSERT_MESSAGE("double", (a
>>= b
) && b
== 1);
583 if (boost::is_same
< sal_Unicode
, sal_uInt16
>::value
) {
584 CPPUNIT_ASSERT_MESSAGE("@sal_Unicode", (a
>>= b
) && b
== 1);
586 CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a
>>= b
) && b
== '2');
590 rtl::OUString
b(RTL_CONSTASCII_USTRINGPARAM("2"));
591 CPPUNIT_ASSERT_MESSAGE( "rtl::OUString", !(a
>>= b
) && b
== "2" );
594 css::uno::Type
b(getCppuType
< rtl::OUString
>());
595 CPPUNIT_ASSERT_MESSAGE(
597 !(a
>>= b
) && b
== getCppuType
< rtl::OUString
>());
600 css::uno::Any
b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
601 CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a
>>= b
) && b
== a
);
604 css::uno::Sequence
< rtl::OUString
> b(2);
605 CPPUNIT_ASSERT_MESSAGE(
606 "css::uno::Sequence<rtl::OUString>",
607 !(a
>>= b
) && b
.getLength() == 2);
611 CPPUNIT_ASSERT_MESSAGE("Enum1", !(a
>>= b
) && b
== Enum1_M2
);
615 CPPUNIT_ASSERT_MESSAGE("Struct1", !(a
>>= b
) && b
.member
== 2);
619 rtl::OUString(), css::uno::Reference
< css::uno::XInterface
>(), 2);
620 CPPUNIT_ASSERT_MESSAGE("Exception1", !(a
>>= b
) && b
.member
== 2);
623 css::uno::Reference
< Interface1
> i(new Impl1
);
624 css::uno::Reference
< Interface1
> b(i
);
625 CPPUNIT_ASSERT_MESSAGE("Interface1", !(a
>>= b
) && b
== i
);
629 void Test::testUnsignedShort() {
631 css::uno::Any
a(&n
, getCppuType(static_cast< sal_uInt16
const * >(0)));
633 a
.getValueType() == getCppuType(static_cast< sal_uInt16
const * >(0)));
636 CPPUNIT_ASSERT_MESSAGE("bool", !(a
>>= b
) && b
);
640 CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a
>>= b
) && b
);
644 CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a
>>= b
) && b
== 2);
648 CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a
>>= b
) && b
== 2);
652 CPPUNIT_ASSERT_MESSAGE("sal_Int16", (a
>>= b
) && b
== 1);
656 CPPUNIT_ASSERT_MESSAGE("sal_uInt16", (a
>>= b
) && b
== 1);
660 CPPUNIT_ASSERT_MESSAGE("sal_Int32", (a
>>= b
) && b
== 1);
664 CPPUNIT_ASSERT_MESSAGE("sal_uInt32", (a
>>= b
) && b
== 1);
668 CPPUNIT_ASSERT_MESSAGE("sal_Int64", (a
>>= b
) && b
== 1);
672 CPPUNIT_ASSERT_MESSAGE("sal_uInt64", (a
>>= b
) && b
== 1);
676 CPPUNIT_ASSERT_MESSAGE("float", (a
>>= b
) && b
== 1);
680 CPPUNIT_ASSERT_MESSAGE("double", (a
>>= b
) && b
== 1);
684 if (boost::is_same
< sal_Unicode
, sal_uInt16
>::value
) {
685 CPPUNIT_ASSERT_MESSAGE("@sal_Unicode", (a
>>= b
) && b
== 1);
687 CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a
>>= b
) && b
== '2');
691 rtl::OUString
b(RTL_CONSTASCII_USTRINGPARAM("2"));
692 CPPUNIT_ASSERT_MESSAGE( "rtl::OUString", !(a
>>= b
) && b
== "2" );
695 css::uno::Type
b(getCppuType
< rtl::OUString
>());
696 CPPUNIT_ASSERT_MESSAGE(
698 !(a
>>= b
) && b
== getCppuType
< rtl::OUString
>());
701 css::uno::Any
b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
702 CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a
>>= b
) && b
== a
);
705 css::uno::Sequence
< rtl::OUString
> b(2);
706 CPPUNIT_ASSERT_MESSAGE(
707 "css::uno::Sequence<rtl::OUString>",
708 !(a
>>= b
) && b
.getLength() == 2);
712 CPPUNIT_ASSERT_MESSAGE("Enum1", !(a
>>= b
) && b
== Enum1_M2
);
716 CPPUNIT_ASSERT_MESSAGE("Struct1", !(a
>>= b
) && b
.member
== 2);
720 rtl::OUString(), css::uno::Reference
< css::uno::XInterface
>(), 2);
721 CPPUNIT_ASSERT_MESSAGE("Exception1", !(a
>>= b
) && b
.member
== 2);
724 css::uno::Reference
< Interface1
> i(new Impl1
);
725 css::uno::Reference
< Interface1
> b(i
);
726 CPPUNIT_ASSERT_MESSAGE("Interface1", !(a
>>= b
) && b
== i
);
730 void Test::testLong() {
731 css::uno::Any
a(static_cast< sal_Int32
>(1));
732 CPPUNIT_ASSERT(a
.getValueType() == getCppuType
< sal_Int32
>());
735 CPPUNIT_ASSERT_MESSAGE("bool", !(a
>>= b
) && b
);
739 CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a
>>= b
) && b
);
743 CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a
>>= b
) && b
== 2);
747 CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a
>>= b
) && b
== 2);
751 CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a
>>= b
) && b
== 2);
755 CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a
>>= b
) && b
== 2);
759 CPPUNIT_ASSERT_MESSAGE("sal_Int32", (a
>>= b
) && b
== 1);
763 CPPUNIT_ASSERT_MESSAGE("sal_uInt32", (a
>>= b
) && b
== 1);
767 CPPUNIT_ASSERT_MESSAGE("sal_Int64", (a
>>= b
) && b
== 1);
771 CPPUNIT_ASSERT_MESSAGE("sal_uInt64", (a
>>= b
) && b
== 1);
775 CPPUNIT_ASSERT_MESSAGE("float", !(a
>>= b
) && b
== 2);
779 CPPUNIT_ASSERT_MESSAGE("double", (a
>>= b
) && b
== 1);
783 CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a
>>= b
) && b
== '2');
786 rtl::OUString
b(RTL_CONSTASCII_USTRINGPARAM("2"));
787 CPPUNIT_ASSERT_MESSAGE( "rtl::OUString", !(a
>>= b
) && b
== "2" );
790 css::uno::Type
b(getCppuType
< rtl::OUString
>());
791 CPPUNIT_ASSERT_MESSAGE(
793 !(a
>>= b
) && b
== getCppuType
< rtl::OUString
>());
796 css::uno::Any
b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
797 CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a
>>= b
) && b
== a
);
800 css::uno::Sequence
< rtl::OUString
> b(2);
801 CPPUNIT_ASSERT_MESSAGE(
802 "css::uno::Sequence<rtl::OUString>",
803 !(a
>>= b
) && b
.getLength() == 2);
807 CPPUNIT_ASSERT_MESSAGE("Enum1", !(a
>>= b
) && b
== Enum1_M2
);
811 CPPUNIT_ASSERT_MESSAGE("Struct1", !(a
>>= b
) && b
.member
== 2);
815 rtl::OUString(), css::uno::Reference
< css::uno::XInterface
>(), 2);
816 CPPUNIT_ASSERT_MESSAGE("Exception1", !(a
>>= b
) && b
.member
== 2);
819 css::uno::Reference
< Interface1
> i(new Impl1
);
820 css::uno::Reference
< Interface1
> b(i
);
821 CPPUNIT_ASSERT_MESSAGE("Interface1", !(a
>>= b
) && b
== i
);
825 void Test::testUnsignedLong() {
826 css::uno::Any
a(static_cast< sal_uInt32
>(1));
827 CPPUNIT_ASSERT(a
.getValueType() == getCppuType
< sal_uInt32
>());
830 CPPUNIT_ASSERT_MESSAGE("bool", !(a
>>= b
) && b
);
834 CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a
>>= b
) && b
);
838 CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a
>>= b
) && b
== 2);
842 CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a
>>= b
) && b
== 2);
846 CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a
>>= b
) && b
== 2);
850 CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a
>>= b
) && b
== 2);
854 CPPUNIT_ASSERT_MESSAGE("sal_Int32", (a
>>= b
) && b
== 1);
858 CPPUNIT_ASSERT_MESSAGE("sal_uInt32", (a
>>= b
) && b
== 1);
862 CPPUNIT_ASSERT_MESSAGE("sal_Int64", (a
>>= b
) && b
== 1);
866 CPPUNIT_ASSERT_MESSAGE("sal_uInt64", (a
>>= b
) && b
== 1);
870 CPPUNIT_ASSERT_MESSAGE("float", !(a
>>= b
) && b
== 2);
874 CPPUNIT_ASSERT_MESSAGE("double", (a
>>= b
) && b
== 1);
878 CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a
>>= b
) && b
== '2');
881 rtl::OUString
b(RTL_CONSTASCII_USTRINGPARAM("2"));
882 CPPUNIT_ASSERT_MESSAGE( "rtl::OUString", !(a
>>= b
) && b
== "2" );
885 css::uno::Type
b(getCppuType
< rtl::OUString
>());
886 CPPUNIT_ASSERT_MESSAGE(
888 !(a
>>= b
) && b
== getCppuType
< rtl::OUString
>());
891 css::uno::Any
b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
892 CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a
>>= b
) && b
== a
);
895 css::uno::Sequence
< rtl::OUString
> b(2);
896 CPPUNIT_ASSERT_MESSAGE(
897 "css::uno::Sequence<rtl::OUString>",
898 !(a
>>= b
) && b
.getLength() == 2);
902 CPPUNIT_ASSERT_MESSAGE("Enum1", !(a
>>= b
) && b
== Enum1_M2
);
906 CPPUNIT_ASSERT_MESSAGE("Struct1", !(a
>>= b
) && b
.member
== 2);
910 rtl::OUString(), css::uno::Reference
< css::uno::XInterface
>(), 2);
911 CPPUNIT_ASSERT_MESSAGE("Exception1", !(a
>>= b
) && b
.member
== 2);
914 css::uno::Reference
< Interface1
> i(new Impl1
);
915 css::uno::Reference
< Interface1
> b(i
);
916 CPPUNIT_ASSERT_MESSAGE("Interface1", !(a
>>= b
) && b
== i
);
920 void Test::testHyper() {
921 css::uno::Any
a(static_cast< sal_Int64
>(1));
922 CPPUNIT_ASSERT(a
.getValueType() == getCppuType
< sal_Int64
>());
925 CPPUNIT_ASSERT_MESSAGE("bool", !(a
>>= b
) && b
);
929 CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a
>>= b
) && b
);
933 CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a
>>= b
) && b
== 2);
937 CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a
>>= b
) && b
== 2);
941 CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a
>>= b
) && b
== 2);
945 CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a
>>= b
) && b
== 2);
949 CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a
>>= b
) && b
== 2);
953 CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a
>>= b
) && b
== 2);
957 CPPUNIT_ASSERT_MESSAGE("sal_Int64", (a
>>= b
) && b
== 1);
961 CPPUNIT_ASSERT_MESSAGE("sal_uInt64", (a
>>= b
) && b
== 1);
965 CPPUNIT_ASSERT_MESSAGE("float", !(a
>>= b
) && b
== 2);
969 CPPUNIT_ASSERT_MESSAGE("double", !(a
>>= b
) && b
== 2);
973 CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a
>>= b
) && b
== '2');
976 rtl::OUString
b(RTL_CONSTASCII_USTRINGPARAM("2"));
977 CPPUNIT_ASSERT_MESSAGE( "rtl::OUString", !(a
>>= b
) && b
== "2" );
980 css::uno::Type
b(getCppuType
< rtl::OUString
>());
981 CPPUNIT_ASSERT_MESSAGE(
983 !(a
>>= b
) && b
== getCppuType
< rtl::OUString
>());
986 css::uno::Any
b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
987 CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a
>>= b
) && b
== a
);
990 css::uno::Sequence
< rtl::OUString
> b(2);
991 CPPUNIT_ASSERT_MESSAGE(
992 "css::uno::Sequence<rtl::OUString>",
993 !(a
>>= b
) && b
.getLength() == 2);
997 CPPUNIT_ASSERT_MESSAGE("Enum1", !(a
>>= b
) && b
== Enum1_M2
);
1001 CPPUNIT_ASSERT_MESSAGE("Struct1", !(a
>>= b
) && b
.member
== 2);
1005 rtl::OUString(), css::uno::Reference
< css::uno::XInterface
>(), 2);
1006 CPPUNIT_ASSERT_MESSAGE("Exception1", !(a
>>= b
) && b
.member
== 2);
1009 css::uno::Reference
< Interface1
> i(new Impl1
);
1010 css::uno::Reference
< Interface1
> b(i
);
1011 CPPUNIT_ASSERT_MESSAGE("Interface1", !(a
>>= b
) && b
== i
);
1015 void Test::testUnsignedHyper() {
1016 css::uno::Any
a(static_cast< sal_uInt64
>(1));
1017 CPPUNIT_ASSERT(a
.getValueType() == getCppuType
< sal_uInt64
>());
1020 CPPUNIT_ASSERT_MESSAGE("bool", !(a
>>= b
) && b
);
1024 CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a
>>= b
) && b
);
1028 CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a
>>= b
) && b
== 2);
1032 CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a
>>= b
) && b
== 2);
1036 CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a
>>= b
) && b
== 2);
1040 CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a
>>= b
) && b
== 2);
1044 CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a
>>= b
) && b
== 2);
1048 CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a
>>= b
) && b
== 2);
1052 CPPUNIT_ASSERT_MESSAGE("sal_Int64", (a
>>= b
) && b
== 1);
1056 CPPUNIT_ASSERT_MESSAGE("sal_uInt64", (a
>>= b
) && b
== 1);
1060 CPPUNIT_ASSERT_MESSAGE("float", !(a
>>= b
) && b
== 2);
1064 CPPUNIT_ASSERT_MESSAGE("double", !(a
>>= b
) && b
== 2);
1067 sal_Unicode b
= '2';
1068 CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a
>>= b
) && b
== '2');
1071 rtl::OUString
b(RTL_CONSTASCII_USTRINGPARAM("2"));
1072 CPPUNIT_ASSERT_MESSAGE( "rtl::OUString", !(a
>>= b
) && b
== "2" );
1075 css::uno::Type
b(getCppuType
< rtl::OUString
>());
1076 CPPUNIT_ASSERT_MESSAGE(
1078 !(a
>>= b
) && b
== getCppuType
< rtl::OUString
>());
1081 css::uno::Any
b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
1082 CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a
>>= b
) && b
== a
);
1085 css::uno::Sequence
< rtl::OUString
> b(2);
1086 CPPUNIT_ASSERT_MESSAGE(
1087 "css::uno::Sequence<rtl::OUString>",
1088 !(a
>>= b
) && b
.getLength() == 2);
1092 CPPUNIT_ASSERT_MESSAGE("Enum1", !(a
>>= b
) && b
== Enum1_M2
);
1096 CPPUNIT_ASSERT_MESSAGE("Struct1", !(a
>>= b
) && b
.member
== 2);
1100 rtl::OUString(), css::uno::Reference
< css::uno::XInterface
>(), 2);
1101 CPPUNIT_ASSERT_MESSAGE("Exception1", !(a
>>= b
) && b
.member
== 2);
1104 css::uno::Reference
< Interface1
> i(new Impl1
);
1105 css::uno::Reference
< Interface1
> b(i
);
1106 CPPUNIT_ASSERT_MESSAGE("Interface1", !(a
>>= b
) && b
== i
);
1110 void Test::testFloat() {
1111 css::uno::Any
a(1.f
);
1112 CPPUNIT_ASSERT(a
.getValueType() == getCppuType
< float >());
1115 CPPUNIT_ASSERT_MESSAGE("bool", !(a
>>= b
) && b
);
1119 CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a
>>= b
) && b
);
1123 CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a
>>= b
) && b
== 2);
1127 CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a
>>= b
) && b
== 2);
1131 CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a
>>= b
) && b
== 2);
1135 CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a
>>= b
) && b
== 2);
1139 CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a
>>= b
) && b
== 2);
1143 CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a
>>= b
) && b
== 2);
1147 CPPUNIT_ASSERT_MESSAGE("sal_Int64", !(a
>>= b
) && b
== 2);
1151 CPPUNIT_ASSERT_MESSAGE("sal_uInt64", !(a
>>= b
) && b
== 2);
1155 CPPUNIT_ASSERT_MESSAGE("float", (a
>>= b
) && b
== 1);
1159 CPPUNIT_ASSERT_MESSAGE("double", (a
>>= b
) && b
== 1);
1162 sal_Unicode b
= '2';
1163 CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a
>>= b
) && b
== '2');
1166 rtl::OUString
b(RTL_CONSTASCII_USTRINGPARAM("2"));
1167 CPPUNIT_ASSERT_MESSAGE( "rtl::OUString", !(a
>>= b
) && b
== "2" );
1170 css::uno::Type
b(getCppuType
< rtl::OUString
>());
1171 CPPUNIT_ASSERT_MESSAGE(
1173 !(a
>>= b
) && b
== getCppuType
< rtl::OUString
>());
1176 css::uno::Any
b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
1177 CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a
>>= b
) && b
== a
);
1180 css::uno::Sequence
< rtl::OUString
> b(2);
1181 CPPUNIT_ASSERT_MESSAGE(
1182 "css::uno::Sequence<rtl::OUString>",
1183 !(a
>>= b
) && b
.getLength() == 2);
1187 CPPUNIT_ASSERT_MESSAGE("Enum1", !(a
>>= b
) && b
== Enum1_M2
);
1191 CPPUNIT_ASSERT_MESSAGE("Struct1", !(a
>>= b
) && b
.member
== 2);
1195 rtl::OUString(), css::uno::Reference
< css::uno::XInterface
>(), 2);
1196 CPPUNIT_ASSERT_MESSAGE("Exception1", !(a
>>= b
) && b
.member
== 2);
1199 css::uno::Reference
< Interface1
> i(new Impl1
);
1200 css::uno::Reference
< Interface1
> b(i
);
1201 CPPUNIT_ASSERT_MESSAGE("Interface1", !(a
>>= b
) && b
== i
);
1205 void Test::testDouble() {
1206 css::uno::Any
a(1.);
1207 CPPUNIT_ASSERT(a
.getValueType() == getCppuType
< double >());
1210 CPPUNIT_ASSERT_MESSAGE("bool", !(a
>>= b
) && b
);
1214 CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a
>>= b
) && b
);
1218 CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a
>>= b
) && b
== 2);
1222 CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a
>>= b
) && b
== 2);
1226 CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a
>>= b
) && b
== 2);
1230 CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a
>>= b
) && b
== 2);
1234 CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a
>>= b
) && b
== 2);
1238 CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a
>>= b
) && b
== 2);
1242 CPPUNIT_ASSERT_MESSAGE("sal_Int64", !(a
>>= b
) && b
== 2);
1246 CPPUNIT_ASSERT_MESSAGE("sal_uInt64", !(a
>>= b
) && b
== 2);
1250 CPPUNIT_ASSERT_MESSAGE("float", !(a
>>= b
) && b
== 2);
1254 CPPUNIT_ASSERT_MESSAGE("double", (a
>>= b
) && b
== 1);
1257 sal_Unicode b
= '2';
1258 CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a
>>= b
) && b
== '2');
1261 rtl::OUString
b(RTL_CONSTASCII_USTRINGPARAM("2"));
1262 CPPUNIT_ASSERT_MESSAGE( "rtl::OUString", !(a
>>= b
) && b
== "2" );
1265 css::uno::Type
b(getCppuType
< rtl::OUString
>());
1266 CPPUNIT_ASSERT_MESSAGE(
1268 !(a
>>= b
) && b
== getCppuType
< rtl::OUString
>());
1271 css::uno::Any
b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
1272 CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a
>>= b
) && b
== a
);
1275 css::uno::Sequence
< rtl::OUString
> b(2);
1276 CPPUNIT_ASSERT_MESSAGE(
1277 "css::uno::Sequence<rtl::OUString>",
1278 !(a
>>= b
) && b
.getLength() == 2);
1282 CPPUNIT_ASSERT_MESSAGE("Enum1", !(a
>>= b
) && b
== Enum1_M2
);
1286 CPPUNIT_ASSERT_MESSAGE("Struct1", !(a
>>= b
) && b
.member
== 2);
1290 rtl::OUString(), css::uno::Reference
< css::uno::XInterface
>(), 2);
1291 CPPUNIT_ASSERT_MESSAGE("Exception1", !(a
>>= b
) && b
.member
== 2);
1294 css::uno::Reference
< Interface1
> i(new Impl1
);
1295 css::uno::Reference
< Interface1
> b(i
);
1296 CPPUNIT_ASSERT_MESSAGE("Interface1", !(a
>>= b
) && b
== i
);
1300 void Test::testChar() {
1301 sal_Unicode c
= '1';
1302 css::uno::Any
a(&c
, getCppuType
< sal_Unicode
>());
1303 CPPUNIT_ASSERT(a
.getValueType() == getCppuType
< sal_Unicode
>());
1306 CPPUNIT_ASSERT_MESSAGE("bool", !(a
>>= b
) && b
);
1310 CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a
>>= b
) && b
);
1314 CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a
>>= b
) && b
== 2);
1318 CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a
>>= b
) && b
== 2);
1322 CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a
>>= b
) && b
== 2);
1326 CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a
>>= b
) && b
== 2);
1330 CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a
>>= b
) && b
== 2);
1334 CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a
>>= b
) && b
== 2);
1338 CPPUNIT_ASSERT_MESSAGE("sal_Int64", !(a
>>= b
) && b
== 2);
1342 CPPUNIT_ASSERT_MESSAGE("sal_uInt64", !(a
>>= b
) && b
== 2);
1346 CPPUNIT_ASSERT_MESSAGE("float", !(a
>>= b
) && b
== 2);
1350 CPPUNIT_ASSERT_MESSAGE("double", !(a
>>= b
) && b
== 2);
1353 sal_Unicode b
= '2';
1354 if (boost::is_same
< sal_Unicode
, sal_uInt16
>::value
) {
1355 CPPUNIT_ASSERT_MESSAGE("@sal_Unicode", !(a
>>= b
) && b
== '2');
1357 CPPUNIT_ASSERT_MESSAGE("sal_Unicode", (a
>>= b
) && b
== '1');
1361 rtl::OUString
b(RTL_CONSTASCII_USTRINGPARAM("2"));
1362 CPPUNIT_ASSERT_MESSAGE( "rtl::OUString", !(a
>>= b
) && b
== "2" );
1365 css::uno::Type
b(getCppuType
< rtl::OUString
>());
1366 CPPUNIT_ASSERT_MESSAGE(
1368 !(a
>>= b
) && b
== getCppuType
< rtl::OUString
>());
1371 css::uno::Any
b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
1372 CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a
>>= b
) && b
== a
);
1375 css::uno::Sequence
< rtl::OUString
> b(2);
1376 CPPUNIT_ASSERT_MESSAGE(
1377 "css::uno::Sequence<rtl::OUString>",
1378 !(a
>>= b
) && b
.getLength() == 2);
1382 CPPUNIT_ASSERT_MESSAGE("Enum1", !(a
>>= b
) && b
== Enum1_M2
);
1386 CPPUNIT_ASSERT_MESSAGE("Struct1", !(a
>>= b
) && b
.member
== 2);
1390 rtl::OUString(), css::uno::Reference
< css::uno::XInterface
>(), 2);
1391 CPPUNIT_ASSERT_MESSAGE("Exception1", !(a
>>= b
) && b
.member
== 2);
1394 css::uno::Reference
< Interface1
> i(new Impl1
);
1395 css::uno::Reference
< Interface1
> b(i
);
1396 CPPUNIT_ASSERT_MESSAGE("Interface1", !(a
>>= b
) && b
== i
);
1400 void Test::testString() {
1401 css::uno::Any
a(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("1")));
1402 CPPUNIT_ASSERT(a
.getValueType() == getCppuType
< rtl::OUString
>());
1405 CPPUNIT_ASSERT_MESSAGE("bool", !(a
>>= b
) && b
);
1409 CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a
>>= b
) && b
);
1413 CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a
>>= b
) && b
== 2);
1417 CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a
>>= b
) && b
== 2);
1421 CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a
>>= b
) && b
== 2);
1425 CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a
>>= b
) && b
== 2);
1429 CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a
>>= b
) && b
== 2);
1433 CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a
>>= b
) && b
== 2);
1437 CPPUNIT_ASSERT_MESSAGE("sal_Int64", !(a
>>= b
) && b
== 2);
1441 CPPUNIT_ASSERT_MESSAGE("sal_uInt64", !(a
>>= b
) && b
== 2);
1445 CPPUNIT_ASSERT_MESSAGE("float", !(a
>>= b
) && b
== 2);
1449 CPPUNIT_ASSERT_MESSAGE("double", !(a
>>= b
) && b
== 2);
1452 sal_Unicode b
= '2';
1453 CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a
>>= b
) && b
== '2');
1456 rtl::OUString
b(RTL_CONSTASCII_USTRINGPARAM("2"));
1457 CPPUNIT_ASSERT_MESSAGE( "rtl::OUString", (a
>>= b
) && b
== "1" );
1460 css::uno::Type
b(getCppuType
< rtl::OUString
>());
1461 CPPUNIT_ASSERT_MESSAGE(
1463 !(a
>>= b
) && b
== getCppuType
< rtl::OUString
>());
1466 css::uno::Any
b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
1467 CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a
>>= b
) && b
== a
);
1470 css::uno::Sequence
< rtl::OUString
> b(2);
1471 CPPUNIT_ASSERT_MESSAGE(
1472 "css::uno::Sequence<rtl::OUString>",
1473 !(a
>>= b
) && b
.getLength() == 2);
1477 CPPUNIT_ASSERT_MESSAGE("Enum1", !(a
>>= b
) && b
== Enum1_M2
);
1481 CPPUNIT_ASSERT_MESSAGE("Struct1", !(a
>>= b
) && b
.member
== 2);
1485 rtl::OUString(), css::uno::Reference
< css::uno::XInterface
>(), 2);
1486 CPPUNIT_ASSERT_MESSAGE("Exception1", !(a
>>= b
) && b
.member
== 2);
1489 css::uno::Reference
< Interface1
> i(new Impl1
);
1490 css::uno::Reference
< Interface1
> b(i
);
1491 CPPUNIT_ASSERT_MESSAGE("Interface1", !(a
>>= b
) && b
== i
);
1495 void Test::testType() {
1496 css::uno::Any
a(getCppuType
< sal_Int32
>());
1497 CPPUNIT_ASSERT(a
.getValueType() == getCppuType
< css::uno::Type
>());
1500 CPPUNIT_ASSERT_MESSAGE("bool", !(a
>>= b
) && b
);
1504 CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a
>>= b
) && b
);
1508 CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a
>>= b
) && b
== 2);
1512 CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a
>>= b
) && b
== 2);
1516 CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a
>>= b
) && b
== 2);
1520 CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a
>>= b
) && b
== 2);
1524 CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a
>>= b
) && b
== 2);
1528 CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a
>>= b
) && b
== 2);
1532 CPPUNIT_ASSERT_MESSAGE("sal_Int64", !(a
>>= b
) && b
== 2);
1536 CPPUNIT_ASSERT_MESSAGE("sal_uInt64", !(a
>>= b
) && b
== 2);
1540 CPPUNIT_ASSERT_MESSAGE("float", !(a
>>= b
) && b
== 2);
1544 CPPUNIT_ASSERT_MESSAGE("double", !(a
>>= b
) && b
== 2);
1547 sal_Unicode b
= '2';
1548 CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a
>>= b
) && b
== '2');
1551 rtl::OUString
b(RTL_CONSTASCII_USTRINGPARAM("2"));
1552 CPPUNIT_ASSERT_MESSAGE( "rtl::OUString", !(a
>>= b
) && b
== "2" );
1555 css::uno::Type
b(getCppuType
< rtl::OUString
>());
1556 CPPUNIT_ASSERT_MESSAGE(
1557 "css::uno::Type", (a
>>= b
) && b
== getCppuType
< sal_Int32
>());
1560 css::uno::Any
b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
1561 CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a
>>= b
) && b
== a
);
1564 css::uno::Sequence
< rtl::OUString
> b(2);
1565 CPPUNIT_ASSERT_MESSAGE(
1566 "css::uno::Sequence<rtl::OUString>",
1567 !(a
>>= b
) && b
.getLength() == 2);
1571 CPPUNIT_ASSERT_MESSAGE("Enum1", !(a
>>= b
) && b
== Enum1_M2
);
1575 CPPUNIT_ASSERT_MESSAGE("Struct1", !(a
>>= b
) && b
.member
== 2);
1579 rtl::OUString(), css::uno::Reference
< css::uno::XInterface
>(), 2);
1580 CPPUNIT_ASSERT_MESSAGE("Exception1", !(a
>>= b
) && b
.member
== 2);
1583 css::uno::Reference
< Interface1
> i(new Impl1
);
1584 css::uno::Reference
< Interface1
> b(i
);
1585 CPPUNIT_ASSERT_MESSAGE("Interface1", !(a
>>= b
) && b
== i
);
1589 void Test::testSequence() {
1591 css::uno::Any
a(css::uno::Sequence
< sal_Int32
>(&n
, 1));
1593 a
.getValueType() == getCppuType
< css::uno::Sequence
< sal_Int32
> >());
1596 CPPUNIT_ASSERT_MESSAGE("bool", !(a
>>= b
) && b
);
1600 CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a
>>= b
) && b
);
1604 CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a
>>= b
) && b
== 2);
1608 CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a
>>= b
) && b
== 2);
1612 CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a
>>= b
) && b
== 2);
1616 CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a
>>= b
) && b
== 2);
1620 CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a
>>= b
) && b
== 2);
1624 CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a
>>= b
) && b
== 2);
1628 CPPUNIT_ASSERT_MESSAGE("sal_Int64", !(a
>>= b
) && b
== 2);
1632 CPPUNIT_ASSERT_MESSAGE("sal_uInt64", !(a
>>= b
) && b
== 2);
1636 CPPUNIT_ASSERT_MESSAGE("float", !(a
>>= b
) && b
== 2);
1640 CPPUNIT_ASSERT_MESSAGE("double", !(a
>>= b
) && b
== 2);
1643 sal_Unicode b
= '2';
1644 CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a
>>= b
) && b
== '2');
1647 rtl::OUString
b(RTL_CONSTASCII_USTRINGPARAM("2"));
1648 CPPUNIT_ASSERT_MESSAGE( "rtl::OUString", !(a
>>= b
) && b
== "2" );
1651 css::uno::Type
b(getCppuType
< rtl::OUString
>());
1652 CPPUNIT_ASSERT_MESSAGE(
1654 !(a
>>= b
) && b
== getCppuType
< rtl::OUString
>());
1657 css::uno::Any
b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
1658 CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a
>>= b
) && b
== a
);
1661 css::uno::Sequence
< rtl::OUString
> b(2);
1662 CPPUNIT_ASSERT_MESSAGE(
1663 "css::uno::Sequence<rtl::OUString>",
1664 !(a
>>= b
) && b
.getLength() == 2);
1667 css::uno::Sequence
< sal_Int32
> b(2);
1668 CPPUNIT_ASSERT_MESSAGE(
1669 "css::uno::Sequence<sal_Int32>",
1670 (a
>>= b
) && b
.getLength() == 1 && b
[0] == 1);
1674 CPPUNIT_ASSERT_MESSAGE("Enum1", !(a
>>= b
) && b
== Enum1_M2
);
1678 CPPUNIT_ASSERT_MESSAGE("Struct1", !(a
>>= b
) && b
.member
== 2);
1682 rtl::OUString(), css::uno::Reference
< css::uno::XInterface
>(), 2);
1683 CPPUNIT_ASSERT_MESSAGE("Exception1", !(a
>>= b
) && b
.member
== 2);
1686 css::uno::Reference
< Interface1
> i(new Impl1
);
1687 css::uno::Reference
< Interface1
> b(i
);
1688 CPPUNIT_ASSERT_MESSAGE("Interface1", !(a
>>= b
) && b
== i
);
1692 void Test::testEnum() {
1693 css::uno::Any
a(Enum2_M1
);
1694 CPPUNIT_ASSERT(a
.getValueType() == getCppuType
< Enum2
>());
1697 CPPUNIT_ASSERT_MESSAGE("bool", !(a
>>= b
) && b
);
1701 CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a
>>= b
) && b
);
1705 CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a
>>= b
) && b
== 2);
1709 CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a
>>= b
) && b
== 2);
1713 CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a
>>= b
) && b
== 2);
1717 CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a
>>= b
) && b
== 2);
1721 CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a
>>= b
) && b
== 2);
1725 CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a
>>= b
) && b
== 2);
1729 CPPUNIT_ASSERT_MESSAGE("sal_Int64", !(a
>>= b
) && b
== 2);
1733 CPPUNIT_ASSERT_MESSAGE("sal_uInt64", !(a
>>= b
) && b
== 2);
1737 CPPUNIT_ASSERT_MESSAGE("float", !(a
>>= b
) && b
== 2);
1741 CPPUNIT_ASSERT_MESSAGE("double", !(a
>>= b
) && b
== 2);
1744 sal_Unicode b
= '2';
1745 CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a
>>= b
) && b
== '2');
1748 rtl::OUString
b(RTL_CONSTASCII_USTRINGPARAM("2"));
1749 CPPUNIT_ASSERT_MESSAGE( "rtl::OUString", !(a
>>= b
) && b
== "2" );
1752 css::uno::Type
b(getCppuType
< rtl::OUString
>());
1753 CPPUNIT_ASSERT_MESSAGE(
1755 !(a
>>= b
) && b
== getCppuType
< rtl::OUString
>());
1758 css::uno::Any
b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
1759 CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a
>>= b
) && b
== a
);
1762 css::uno::Sequence
< rtl::OUString
> b(2);
1763 CPPUNIT_ASSERT_MESSAGE(
1764 "css::uno::Sequence<rtl::OUString>",
1765 !(a
>>= b
) && b
.getLength() == 2);
1769 CPPUNIT_ASSERT_MESSAGE("Enum1", !(a
>>= b
) && b
== Enum1_M2
);
1773 CPPUNIT_ASSERT_MESSAGE("Enum2", (a
>>= b
) && b
== Enum2_M1
);
1777 CPPUNIT_ASSERT_MESSAGE("Struct1", !(a
>>= b
) && b
.member
== 2);
1781 rtl::OUString(), css::uno::Reference
< css::uno::XInterface
>(), 2);
1782 CPPUNIT_ASSERT_MESSAGE("Exception1", !(a
>>= b
) && b
.member
== 2);
1785 css::uno::Reference
< Interface1
> i(new Impl1
);
1786 css::uno::Reference
< Interface1
> b(i
);
1787 CPPUNIT_ASSERT_MESSAGE("Interface1", !(a
>>= b
) && b
== i
);
1791 void Test::testStruct() {
1792 css::uno::Any
a(Struct2a(1, 3));
1793 CPPUNIT_ASSERT(a
.getValueType() == getCppuType
< Struct2a
>());
1796 CPPUNIT_ASSERT_MESSAGE("bool", !(a
>>= b
) && b
);
1800 CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a
>>= b
) && b
);
1804 CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a
>>= b
) && b
== 2);
1808 CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a
>>= b
) && b
== 2);
1812 CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a
>>= b
) && b
== 2);
1816 CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a
>>= b
) && b
== 2);
1820 CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a
>>= b
) && b
== 2);
1824 CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a
>>= b
) && b
== 2);
1828 CPPUNIT_ASSERT_MESSAGE("sal_Int64", !(a
>>= b
) && b
== 2);
1832 CPPUNIT_ASSERT_MESSAGE("sal_uInt64", !(a
>>= b
) && b
== 2);
1836 CPPUNIT_ASSERT_MESSAGE("float", !(a
>>= b
) && b
== 2);
1840 CPPUNIT_ASSERT_MESSAGE("double", !(a
>>= b
) && b
== 2);
1843 sal_Unicode b
= '2';
1844 CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a
>>= b
) && b
== '2');
1847 rtl::OUString
b(RTL_CONSTASCII_USTRINGPARAM("2"));
1848 CPPUNIT_ASSERT_MESSAGE( "rtl::OUString", !(a
>>= b
) && b
== "2" );
1851 css::uno::Type
b(getCppuType
< rtl::OUString
>());
1852 CPPUNIT_ASSERT_MESSAGE(
1854 !(a
>>= b
) && b
== getCppuType
< rtl::OUString
>());
1857 css::uno::Any
b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
1858 CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a
>>= b
) && b
== a
);
1861 css::uno::Sequence
< rtl::OUString
> b(2);
1862 CPPUNIT_ASSERT_MESSAGE(
1863 "css::uno::Sequence<rtl::OUString>",
1864 !(a
>>= b
) && b
.getLength() == 2);
1868 CPPUNIT_ASSERT_MESSAGE("Enum1", !(a
>>= b
) && b
== Enum1_M2
);
1872 CPPUNIT_ASSERT_MESSAGE("Struct1", !(a
>>= b
) && b
.member
== 2);
1876 CPPUNIT_ASSERT_MESSAGE("Struct2", (a
>>= b
) && b
.member
== 1);
1880 CPPUNIT_ASSERT_MESSAGE(
1881 "Struct2a", (a
>>= b
) && b
.member
== 1 && b
.member2
== 3);
1884 Struct2b
b(2, 2, 2);
1885 CPPUNIT_ASSERT_MESSAGE("Struct2b", !(a
>>= b
) && b
.member
== 2);
1889 rtl::OUString(), css::uno::Reference
< css::uno::XInterface
>(), 2);
1890 CPPUNIT_ASSERT_MESSAGE("Exception1", !(a
>>= b
) && b
.member
== 2);
1893 css::uno::Reference
< Interface1
> i(new Impl1
);
1894 css::uno::Reference
< Interface1
> b(i
);
1895 CPPUNIT_ASSERT_MESSAGE("Interface1", !(a
>>= b
) && b
== i
);
1899 void Test::testPoly() {
1901 a
<<= Poly
< css::uno::Sequence
< ::sal_Unicode
> >();
1902 CPPUNIT_ASSERT_MESSAGE( "type name", a
.getValueType().getTypeName() == "Poly<[]char>" );
1903 CPPUNIT_ASSERT_MESSAGE(
1905 a
== css::uno::Any(Poly
< css::uno::Sequence
< ::sal_Unicode
> >()));
1908 void Test::testException() {
1911 rtl::OUString(), css::uno::Reference
< css::uno::XInterface
>(), 1,
1913 CPPUNIT_ASSERT(a
.getValueType() == getCppuType
< Exception2a
>());
1916 CPPUNIT_ASSERT_MESSAGE("bool", !(a
>>= b
) && b
);
1920 CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a
>>= b
) && b
);
1924 CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a
>>= b
) && b
== 2);
1928 CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a
>>= b
) && b
== 2);
1932 CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a
>>= b
) && b
== 2);
1936 CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a
>>= b
) && b
== 2);
1940 CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a
>>= b
) && b
== 2);
1944 CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a
>>= b
) && b
== 2);
1948 CPPUNIT_ASSERT_MESSAGE("sal_Int64", !(a
>>= b
) && b
== 2);
1952 CPPUNIT_ASSERT_MESSAGE("sal_uInt64", !(a
>>= b
) && b
== 2);
1956 CPPUNIT_ASSERT_MESSAGE("float", !(a
>>= b
) && b
== 2);
1960 CPPUNIT_ASSERT_MESSAGE("double", !(a
>>= b
) && b
== 2);
1963 sal_Unicode b
= '2';
1964 CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a
>>= b
) && b
== '2');
1967 rtl::OUString
b(RTL_CONSTASCII_USTRINGPARAM("2"));
1968 CPPUNIT_ASSERT_MESSAGE( "rtl::OUString", !(a
>>= b
) && b
== "2" );
1971 css::uno::Type
b(getCppuType
< rtl::OUString
>());
1972 CPPUNIT_ASSERT_MESSAGE(
1974 !(a
>>= b
) && b
== getCppuType
< rtl::OUString
>());
1977 css::uno::Any
b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
1978 CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a
>>= b
) && b
== a
);
1981 css::uno::Sequence
< rtl::OUString
> b(2);
1982 CPPUNIT_ASSERT_MESSAGE(
1983 "css::uno::Sequence<rtl::OUString>",
1984 !(a
>>= b
) && b
.getLength() == 2);
1988 CPPUNIT_ASSERT_MESSAGE("Enum1", !(a
>>= b
) && b
== Enum1_M2
);
1992 CPPUNIT_ASSERT_MESSAGE("Struct1", !(a
>>= b
) && b
.member
== 2);
1996 rtl::OUString(), css::uno::Reference
< css::uno::XInterface
>(), 2);
1997 CPPUNIT_ASSERT_MESSAGE("Exception1", !(a
>>= b
) && b
.member
== 2);
2001 rtl::OUString(), css::uno::Reference
< css::uno::XInterface
>(), 2);
2002 CPPUNIT_ASSERT_MESSAGE("Exception2", (a
>>= b
) && b
.member
== 1);
2006 rtl::OUString(), css::uno::Reference
< css::uno::XInterface
>(), 2,
2008 CPPUNIT_ASSERT_MESSAGE(
2009 "Exception2a", (a
>>= b
) && b
.member
== 1 && b
.member2
== 3);
2013 rtl::OUString(), css::uno::Reference
< css::uno::XInterface
>(), 2,
2015 CPPUNIT_ASSERT_MESSAGE("Exception2b", !(a
>>= b
) && b
.member
== 2);
2018 css::uno::Reference
< Interface1
> i(new Impl1
);
2019 css::uno::Reference
< Interface1
> b(i
);
2020 CPPUNIT_ASSERT_MESSAGE("Interface1", !(a
>>= b
) && b
== i
);
2024 void Test::testInterface() {
2025 css::uno::Reference
< Interface2a
> i2(new Impl2
);
2026 css::uno::Any
a(i2
);
2029 == getCppuType
< css::uno::Reference
< Interface2a
> >());
2032 CPPUNIT_ASSERT_MESSAGE("bool", !(a
>>= b
) && b
);
2036 CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a
>>= b
) && b
);
2040 CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a
>>= b
) && b
== 2);
2044 CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a
>>= b
) && b
== 2);
2048 CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a
>>= b
) && b
== 2);
2052 CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a
>>= b
) && b
== 2);
2056 CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a
>>= b
) && b
== 2);
2060 CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a
>>= b
) && b
== 2);
2064 CPPUNIT_ASSERT_MESSAGE("sal_Int64", !(a
>>= b
) && b
== 2);
2068 CPPUNIT_ASSERT_MESSAGE("sal_uInt64", !(a
>>= b
) && b
== 2);
2072 CPPUNIT_ASSERT_MESSAGE("float", !(a
>>= b
) && b
== 2);
2076 CPPUNIT_ASSERT_MESSAGE("double", !(a
>>= b
) && b
== 2);
2079 sal_Unicode b
= '2';
2080 CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a
>>= b
) && b
== '2');
2083 rtl::OUString
b(RTL_CONSTASCII_USTRINGPARAM("2"));
2084 CPPUNIT_ASSERT_MESSAGE( "rtl::OUString", !(a
>>= b
) && b
== "2" );
2087 css::uno::Type
b(getCppuType
< rtl::OUString
>());
2088 CPPUNIT_ASSERT_MESSAGE(
2090 !(a
>>= b
) && b
== getCppuType
< rtl::OUString
>());
2093 css::uno::Any
b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
2094 CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a
>>= b
) && b
== a
);
2097 css::uno::Sequence
< rtl::OUString
> b(2);
2098 CPPUNIT_ASSERT_MESSAGE(
2099 "css::uno::Sequence<rtl::OUString>",
2100 !(a
>>= b
) && b
.getLength() == 2);
2104 CPPUNIT_ASSERT_MESSAGE("Enum1", !(a
>>= b
) && b
== Enum1_M2
);
2108 CPPUNIT_ASSERT_MESSAGE("Struct1", !(a
>>= b
) && b
.member
== 2);
2112 rtl::OUString(), css::uno::Reference
< css::uno::XInterface
>(), 2);
2113 CPPUNIT_ASSERT_MESSAGE("Exception1", !(a
>>= b
) && b
.member
== 2);
2116 css::uno::Reference
< Interface1
> i(new Impl1
);
2117 css::uno::Reference
< Interface1
> b(i
);
2118 CPPUNIT_ASSERT_MESSAGE("Interface1", !(a
>>= b
) && b
== i
);
2121 css::uno::Reference
< Interface2
> b(new Impl2
);
2122 CPPUNIT_ASSERT_MESSAGE("Interface2", (a
>>= b
) && b
== i2
);
2125 css::uno::Reference
< Interface2a
> b(new Impl2
);
2126 CPPUNIT_ASSERT_MESSAGE("Interface2a", (a
>>= b
) && b
== i2
);
2129 css::uno::Reference
< Interface2b
> i(new Impl2b
);
2130 css::uno::Reference
< Interface2b
> b(i
);
2131 CPPUNIT_ASSERT_MESSAGE("Interface2b", !(a
>>= b
) && b
== i
);
2134 css::uno::Reference
< Interface3
> b(new Impl2
);
2135 CPPUNIT_ASSERT_MESSAGE("Interface3", (a
>>= b
) && b
== i2
);
2139 void Test::testNull() {
2140 css::uno::Any a
= css::uno::Any(css::uno::Reference
< Interface2a
>());
2143 == getCppuType
< css::uno::Reference
< Interface2a
> >());
2146 CPPUNIT_ASSERT_MESSAGE("bool", !(a
>>= b
) && b
);
2150 CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a
>>= b
) && b
);
2154 CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a
>>= b
) && b
== 2);
2158 CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a
>>= b
) && b
== 2);
2162 CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a
>>= b
) && b
== 2);
2166 CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a
>>= b
) && b
== 2);
2170 CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a
>>= b
) && b
== 2);
2174 CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a
>>= b
) && b
== 2);
2178 CPPUNIT_ASSERT_MESSAGE("sal_Int64", !(a
>>= b
) && b
== 2);
2182 CPPUNIT_ASSERT_MESSAGE("sal_uInt64", !(a
>>= b
) && b
== 2);
2186 CPPUNIT_ASSERT_MESSAGE("float", !(a
>>= b
) && b
== 2);
2190 CPPUNIT_ASSERT_MESSAGE("double", !(a
>>= b
) && b
== 2);
2193 sal_Unicode b
= '2';
2194 CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a
>>= b
) && b
== '2');
2197 rtl::OUString
b(RTL_CONSTASCII_USTRINGPARAM("2"));
2198 CPPUNIT_ASSERT_MESSAGE( "rtl::OUString", !(a
>>= b
) && b
== "2" );
2201 css::uno::Type
b(getCppuType
< rtl::OUString
>());
2202 CPPUNIT_ASSERT_MESSAGE(
2204 !(a
>>= b
) && b
== getCppuType
< rtl::OUString
>());
2207 css::uno::Any
b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
2208 CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a
>>= b
) && b
== a
);
2211 css::uno::Sequence
< rtl::OUString
> b(2);
2212 CPPUNIT_ASSERT_MESSAGE(
2213 "css::uno::Sequence<rtl::OUString>",
2214 !(a
>>= b
) && b
.getLength() == 2);
2218 CPPUNIT_ASSERT_MESSAGE("Enum1", !(a
>>= b
) && b
== Enum1_M2
);
2222 CPPUNIT_ASSERT_MESSAGE("Struct1", !(a
>>= b
) && b
.member
== 2);
2226 rtl::OUString(), css::uno::Reference
< css::uno::XInterface
>(), 2);
2227 CPPUNIT_ASSERT_MESSAGE("Exception1", !(a
>>= b
) && b
.member
== 2);
2230 css::uno::Reference
< Interface1
> b(new Impl1
);
2231 CPPUNIT_ASSERT_MESSAGE(
2232 "Interface1", (a
>>= b
) && !b
.is());
2235 css::uno::Reference
< Interface2
> b(new Impl2
);
2236 CPPUNIT_ASSERT_MESSAGE(
2237 "Interface2", (a
>>= b
) && !b
.is());
2240 css::uno::Reference
< Interface2a
> b(new Impl2
);
2241 CPPUNIT_ASSERT_MESSAGE("Interface2a", (a
>>= b
) && !b
.is());
2244 css::uno::Reference
< Interface2b
> b(new Impl2b
);
2245 CPPUNIT_ASSERT_MESSAGE(
2246 "Interface2b", (a
>>= b
) && !b
.is());
2249 css::uno::Reference
< Interface3
> b(new Impl2
);
2250 CPPUNIT_ASSERT_MESSAGE(
2251 "Interface3", (a
>>= b
) && !b
.is());
2255 CPPUNIT_TEST_SUITE_REGISTRATION(Test
);
2259 CPPUNIT_PLUGIN_IMPLEMENT();
2261 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */