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>
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/noncopyable.hpp"
47 #include "boost/type_traits/is_same.hpp"
48 #include "com/sun/star/uno/Any.hxx"
49 #include "com/sun/star/uno/Reference.hxx"
50 #include "com/sun/star/uno/RuntimeException.hpp"
51 #include "com/sun/star/uno/Sequence.hxx"
52 #include "com/sun/star/uno/Type.hxx"
53 #include "com/sun/star/uno/XInterface.hpp"
54 #include "osl/diagnose.h"
55 #include "osl/interlck.h"
56 #include "rtl/string.h"
57 #include "rtl/ustring.h"
58 #include "rtl/ustring.hxx"
62 class Base
: private boost::noncopyable
{
67 if (osl_atomic_increment(&m_count
) == SAL_MAX_INT32
) {
73 if (osl_atomic_decrement(&m_count
) == 0) {
82 oslInterlockedCount m_count
;
85 class Impl1
: public Interface1
, private Base
{
87 virtual css::uno::Any SAL_CALL
queryInterface(css::uno::Type
const & type
)
88 throw (css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
90 if (type
== cppu::UnoType
<css::uno::XInterface
>::get()) {
91 css::uno::Reference
< css::uno::XInterface
> ref(
92 static_cast< css::uno::XInterface
* >(this));
93 return css::uno::Any(&ref
, type
);
94 } else if (type
== cppu::UnoType
<Interface1
>::get()) {
95 css::uno::Reference
< Interface1
> ref(this);
96 return css::uno::Any(&ref
, type
);
98 return css::uno::Any();
102 virtual void SAL_CALL
acquire() throw () SAL_OVERRIDE
{
106 virtual void SAL_CALL
release() throw () SAL_OVERRIDE
{
111 class Impl2
: public Interface2a
, public Interface3
, private Base
{
113 virtual css::uno::Any SAL_CALL
queryInterface(css::uno::Type
const & type
)
114 throw (css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
116 if (type
== cppu::UnoType
<css::uno::XInterface
>::get()) {
117 css::uno::Reference
< css::uno::XInterface
> ref(
118 static_cast< css::uno::XInterface
* >(
119 static_cast< Interface2a
* >(this)));
120 return css::uno::Any(&ref
, type
);
121 } else if (type
== cppu::UnoType
<Interface2
>::get()) {
122 css::uno::Reference
< Interface2
> ref(this);
123 return css::uno::Any(&ref
, type
);
124 } else if (type
== cppu::UnoType
<Interface2a
>::get()) {
125 css::uno::Reference
< Interface2a
> ref(this);
126 return css::uno::Any(&ref
, type
);
127 } else if (type
== cppu::UnoType
<Interface3
>::get()) {
128 css::uno::Reference
< Interface3
> ref(this);
129 return css::uno::Any(&ref
, type
);
131 return css::uno::Any();
135 virtual void SAL_CALL
acquire() throw () SAL_OVERRIDE
{
139 virtual void SAL_CALL
release() throw () SAL_OVERRIDE
{
144 class Impl2b
: public Interface2b
, private Base
{
146 virtual css::uno::Any SAL_CALL
queryInterface(css::uno::Type
const & type
)
147 throw (css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
149 if (type
== cppu::UnoType
<css::uno::XInterface
>::get()) {
150 css::uno::Reference
< css::uno::XInterface
> ref(
151 static_cast< css::uno::XInterface
* >(
152 static_cast< Interface2a
* >(this)));
153 return css::uno::Any(&ref
, type
);
154 } else if (type
== cppu::UnoType
<Interface2
>::get()) {
155 css::uno::Reference
< Interface2
> ref(this);
156 return css::uno::Any(&ref
, type
);
157 } else if (type
== cppu::UnoType
<Interface2a
>::get()) {
158 css::uno::Reference
< Interface2a
> ref(this);
159 return css::uno::Any(&ref
, type
);
160 } else if (type
== cppu::UnoType
<Interface2b
>::get()) {
161 css::uno::Reference
< Interface2b
> ref(this);
162 return css::uno::Any(&ref
, type
);
164 return css::uno::Any();
168 virtual void SAL_CALL
acquire() throw () SAL_OVERRIDE
{
172 virtual void SAL_CALL
release() throw () SAL_OVERRIDE
{
177 class Test
: public CppUnit::TestFixture
{
183 void testUnsignedShort();
185 void testUnsignedLong();
187 void testUnsignedHyper();
197 void testException();
198 void testInterface();
201 CPPUNIT_TEST_SUITE(Test
);
202 CPPUNIT_TEST(testVoid
);
203 CPPUNIT_TEST(testBoolean
);
204 CPPUNIT_TEST(testByte
);
205 CPPUNIT_TEST(testShort
);
206 CPPUNIT_TEST(testUnsignedShort
);
207 CPPUNIT_TEST(testLong
);
208 CPPUNIT_TEST(testUnsignedLong
);
209 CPPUNIT_TEST(testHyper
);
210 CPPUNIT_TEST(testUnsignedHyper
);
211 CPPUNIT_TEST(testFloat
);
212 CPPUNIT_TEST(testDouble
);
213 CPPUNIT_TEST(testChar
);
214 CPPUNIT_TEST(testString
);
215 CPPUNIT_TEST(testType
);
216 CPPUNIT_TEST(testSequence
);
217 CPPUNIT_TEST(testEnum
);
218 CPPUNIT_TEST(testStruct
);
219 CPPUNIT_TEST(testPoly
);
220 CPPUNIT_TEST(testException
);
221 CPPUNIT_TEST(testInterface
);
222 CPPUNIT_TEST(testNull
);
223 CPPUNIT_TEST_SUITE_END();
226 void Test::testVoid() {
228 CPPUNIT_ASSERT(a
.getValueType() == cppu::UnoType
<void>::get());
231 CPPUNIT_ASSERT_MESSAGE("bool", !(a
>>= b
) && b
);
235 CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a
>>= b
) && b
);
239 CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a
>>= b
) && b
== 2);
243 CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a
>>= b
) && b
== 2);
247 CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a
>>= b
) && b
== 2);
251 CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a
>>= b
) && b
== 2);
255 CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a
>>= b
) && b
== 2);
259 CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a
>>= b
) && b
== 2);
263 CPPUNIT_ASSERT_MESSAGE("sal_Int64", !(a
>>= b
) && b
== 2);
267 CPPUNIT_ASSERT_MESSAGE("sal_uInt64", !(a
>>= b
) && b
== 2);
271 CPPUNIT_ASSERT_MESSAGE("float", !(a
>>= b
) && b
== 2);
275 CPPUNIT_ASSERT_MESSAGE("double", !(a
>>= b
) && b
== 2);
279 CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a
>>= b
) && b
== '2');
282 rtl::OUString
b("2");
283 CPPUNIT_ASSERT_MESSAGE( "rtl::OUString", !(a
>>= b
) && b
== "2" );
286 css::uno::Type
b(cppu::UnoType
<OUString
>::get());
287 CPPUNIT_ASSERT_MESSAGE(
289 !(a
>>= b
) && b
== cppu::UnoType
<OUString
>::get());
292 css::uno::Any
b(rtl::OUString("2"));
293 CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a
>>= b
) && b
== a
);
296 css::uno::Sequence
< rtl::OUString
> b(2);
297 CPPUNIT_ASSERT_MESSAGE(
298 "css::uno::Sequence<rtl::OUString>", !(a
>>= b
) && b
.getLength() == 2);
302 CPPUNIT_ASSERT_MESSAGE("Enum1", !(a
>>= b
) && b
== Enum1_M2
);
306 CPPUNIT_ASSERT_MESSAGE("Struct1", !(a
>>= b
) && b
.member
== 2);
310 rtl::OUString(), css::uno::Reference
< css::uno::XInterface
>(), 2);
311 CPPUNIT_ASSERT_MESSAGE("Exception1", !(a
>>= b
) && b
.member
== 2);
314 css::uno::Reference
< Interface1
> i(new Impl1
);
315 css::uno::Reference
< Interface1
> b(i
);
316 CPPUNIT_ASSERT_MESSAGE("Interface1", !(a
>>= b
) && b
== i
);
320 void Test::testBoolean() {
321 css::uno::Any
a(false);
322 CPPUNIT_ASSERT(a
.getValueType() == cppu::UnoType
<bool>::get());
325 CPPUNIT_ASSERT_MESSAGE("bool", (a
>>= b
) && !b
);
329 CPPUNIT_ASSERT_MESSAGE("sal_Bool", (a
>>= b
) && !b
);
333 CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a
>>= b
) && b
== 2);
337 if (boost::is_same
< sal_uInt8
, sal_Bool
>::value
) {
338 CPPUNIT_ASSERT_MESSAGE("@sal_uInt8", (a
>>= b
) && b
== 0);
340 CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a
>>= b
) && b
== 2);
345 CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a
>>= b
) && b
== 2);
349 CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a
>>= b
) && b
== 2);
353 CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a
>>= b
) && b
== 2);
357 CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a
>>= b
) && b
== 2);
361 CPPUNIT_ASSERT_MESSAGE("sal_Int64", !(a
>>= b
) && b
== 2);
365 CPPUNIT_ASSERT_MESSAGE("sal_uInt64", !(a
>>= b
) && b
== 2);
369 CPPUNIT_ASSERT_MESSAGE("float", !(a
>>= b
) && b
== 2);
373 CPPUNIT_ASSERT_MESSAGE("double", !(a
>>= b
) && b
== 2);
377 CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a
>>= b
) && b
== '2');
380 rtl::OUString
b("2");
381 CPPUNIT_ASSERT_MESSAGE( "rtl::OUString", !(a
>>= b
) && b
== "2" );
384 css::uno::Type
b(cppu::UnoType
<OUString
>::get());
385 CPPUNIT_ASSERT_MESSAGE(
387 !(a
>>= b
) && b
== cppu::UnoType
<OUString
>::get());
390 css::uno::Any
b(rtl::OUString("2"));
391 CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a
>>= b
) && b
== a
);
394 css::uno::Sequence
< rtl::OUString
> b(2);
395 CPPUNIT_ASSERT_MESSAGE(
396 "css::uno::Sequence<rtl::OUString>",
397 !(a
>>= b
) && b
.getLength() == 2);
401 CPPUNIT_ASSERT_MESSAGE("Enum1", !(a
>>= b
) && b
== Enum1_M2
);
405 CPPUNIT_ASSERT_MESSAGE("Struct1", !(a
>>= b
) && b
.member
== 2);
409 rtl::OUString(), css::uno::Reference
< css::uno::XInterface
>(), 2);
410 CPPUNIT_ASSERT_MESSAGE("Exception1", !(a
>>= b
) && b
.member
== 2);
413 css::uno::Reference
< Interface1
> i(new Impl1
);
414 css::uno::Reference
< Interface1
> b(i
);
415 CPPUNIT_ASSERT_MESSAGE("Interface1", !(a
>>= b
) && b
== i
);
419 void Test::testByte() {
420 css::uno::Any
a(static_cast< sal_Int8
>(1));
421 CPPUNIT_ASSERT(a
.getValueType() == cppu::UnoType
<sal_Int8
>::get());
424 CPPUNIT_ASSERT_MESSAGE("bool", !(a
>>= b
) && b
);
428 CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a
>>= b
) && b
);
432 CPPUNIT_ASSERT_MESSAGE("sal_Int8", (a
>>= b
) && b
== 1);
436 CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a
>>= b
) && b
== 2);
440 CPPUNIT_ASSERT_MESSAGE("sal_Int16", (a
>>= b
) && b
== 1);
444 CPPUNIT_ASSERT_MESSAGE("sal_uInt16", (a
>>= b
) && b
== 1);
448 CPPUNIT_ASSERT_MESSAGE("sal_Int32", (a
>>= b
) && b
== 1);
452 CPPUNIT_ASSERT_MESSAGE("sal_uInt32", (a
>>= b
) && b
== 1);
456 CPPUNIT_ASSERT_MESSAGE("sal_Int64", (a
>>= b
) && b
== 1);
460 CPPUNIT_ASSERT_MESSAGE("sal_uInt64", (a
>>= b
) && b
== 1);
464 CPPUNIT_ASSERT_MESSAGE("float", (a
>>= b
) && b
== 1);
468 CPPUNIT_ASSERT_MESSAGE("double", (a
>>= b
) && b
== 1);
472 if (boost::is_same
< sal_Unicode
, sal_uInt16
>::value
) {
473 CPPUNIT_ASSERT_MESSAGE("@sal_Unicode", (a
>>= b
) && b
== 1);
475 CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a
>>= b
) && b
== '2');
479 rtl::OUString
b("2");
480 CPPUNIT_ASSERT_MESSAGE( "rtl::OUString", !(a
>>= b
) && b
== "2" );
483 css::uno::Type
b(cppu::UnoType
<OUString
>::get());
484 CPPUNIT_ASSERT_MESSAGE(
486 !(a
>>= b
) && b
== cppu::UnoType
<OUString
>::get());
489 css::uno::Any
b(rtl::OUString("2"));
490 CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a
>>= b
) && b
== a
);
493 css::uno::Sequence
< rtl::OUString
> b(2);
494 CPPUNIT_ASSERT_MESSAGE(
495 "css::uno::Sequence<rtl::OUString>",
496 !(a
>>= b
) && b
.getLength() == 2);
500 CPPUNIT_ASSERT_MESSAGE("Enum1", !(a
>>= b
) && b
== Enum1_M2
);
504 CPPUNIT_ASSERT_MESSAGE("Struct1", !(a
>>= b
) && b
.member
== 2);
508 rtl::OUString(), css::uno::Reference
< css::uno::XInterface
>(), 2);
509 CPPUNIT_ASSERT_MESSAGE("Exception1", !(a
>>= b
) && b
.member
== 2);
512 css::uno::Reference
< Interface1
> i(new Impl1
);
513 css::uno::Reference
< Interface1
> b(i
);
514 CPPUNIT_ASSERT_MESSAGE("Interface1", !(a
>>= b
) && b
== i
);
518 void Test::testShort() {
519 css::uno::Any
a(static_cast< sal_Int16
>(1));
520 CPPUNIT_ASSERT(a
.getValueType() == cppu::UnoType
<sal_Int16
>::get());
523 CPPUNIT_ASSERT_MESSAGE("bool", !(a
>>= b
) && b
);
527 CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a
>>= b
) && b
);
531 CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a
>>= b
) && b
== 2);
535 CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a
>>= b
) && b
== 2);
539 CPPUNIT_ASSERT_MESSAGE("sal_Int16", (a
>>= b
) && b
== 1);
543 CPPUNIT_ASSERT_MESSAGE("sal_uInt16", (a
>>= b
) && b
== 1);
547 CPPUNIT_ASSERT_MESSAGE("sal_Int32", (a
>>= b
) && b
== 1);
551 CPPUNIT_ASSERT_MESSAGE("sal_uInt32", (a
>>= b
) && b
== 1);
555 CPPUNIT_ASSERT_MESSAGE("sal_Int64", (a
>>= b
) && b
== 1);
559 CPPUNIT_ASSERT_MESSAGE("sal_uInt64", (a
>>= b
) && b
== 1);
563 CPPUNIT_ASSERT_MESSAGE("float", (a
>>= b
) && b
== 1);
567 CPPUNIT_ASSERT_MESSAGE("double", (a
>>= b
) && b
== 1);
571 if (boost::is_same
< sal_Unicode
, sal_uInt16
>::value
) {
572 CPPUNIT_ASSERT_MESSAGE("@sal_Unicode", (a
>>= b
) && b
== 1);
574 CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a
>>= b
) && b
== '2');
578 rtl::OUString
b("2");
579 CPPUNIT_ASSERT_MESSAGE( "rtl::OUString", !(a
>>= b
) && b
== "2" );
582 css::uno::Type
b(cppu::UnoType
<OUString
>::get());
583 CPPUNIT_ASSERT_MESSAGE(
585 !(a
>>= b
) && b
== cppu::UnoType
<OUString
>::get());
588 css::uno::Any
b(rtl::OUString("2"));
589 CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a
>>= b
) && b
== a
);
592 css::uno::Sequence
< rtl::OUString
> b(2);
593 CPPUNIT_ASSERT_MESSAGE(
594 "css::uno::Sequence<rtl::OUString>",
595 !(a
>>= b
) && b
.getLength() == 2);
599 CPPUNIT_ASSERT_MESSAGE("Enum1", !(a
>>= b
) && b
== Enum1_M2
);
603 CPPUNIT_ASSERT_MESSAGE("Struct1", !(a
>>= b
) && b
.member
== 2);
607 rtl::OUString(), css::uno::Reference
< css::uno::XInterface
>(), 2);
608 CPPUNIT_ASSERT_MESSAGE("Exception1", !(a
>>= b
) && b
.member
== 2);
611 css::uno::Reference
< Interface1
> i(new Impl1
);
612 css::uno::Reference
< Interface1
> b(i
);
613 CPPUNIT_ASSERT_MESSAGE("Interface1", !(a
>>= b
) && b
== i
);
617 void Test::testUnsignedShort() {
619 css::uno::Any
a(&n
, cppu::UnoType
<cppu::UnoUnsignedShortType
>::get());
621 a
.getValueType() == cppu::UnoType
<cppu::UnoUnsignedShortType
>::get());
624 CPPUNIT_ASSERT_MESSAGE("bool", !(a
>>= b
) && b
);
628 CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a
>>= b
) && b
);
632 CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a
>>= b
) && b
== 2);
636 CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a
>>= b
) && b
== 2);
640 CPPUNIT_ASSERT_MESSAGE("sal_Int16", (a
>>= b
) && b
== 1);
644 CPPUNIT_ASSERT_MESSAGE("sal_uInt16", (a
>>= b
) && b
== 1);
648 CPPUNIT_ASSERT_MESSAGE("sal_Int32", (a
>>= b
) && b
== 1);
652 CPPUNIT_ASSERT_MESSAGE("sal_uInt32", (a
>>= b
) && b
== 1);
656 CPPUNIT_ASSERT_MESSAGE("sal_Int64", (a
>>= b
) && b
== 1);
660 CPPUNIT_ASSERT_MESSAGE("sal_uInt64", (a
>>= b
) && b
== 1);
664 CPPUNIT_ASSERT_MESSAGE("float", (a
>>= b
) && b
== 1);
668 CPPUNIT_ASSERT_MESSAGE("double", (a
>>= b
) && b
== 1);
672 if (boost::is_same
< sal_Unicode
, sal_uInt16
>::value
) {
673 CPPUNIT_ASSERT_MESSAGE("@sal_Unicode", (a
>>= b
) && b
== 1);
675 CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a
>>= b
) && b
== '2');
679 rtl::OUString
b("2");
680 CPPUNIT_ASSERT_MESSAGE( "rtl::OUString", !(a
>>= b
) && b
== "2" );
683 css::uno::Type
b(cppu::UnoType
<OUString
>::get());
684 CPPUNIT_ASSERT_MESSAGE(
686 !(a
>>= b
) && b
== cppu::UnoType
<OUString
>::get());
689 css::uno::Any
b(rtl::OUString("2"));
690 CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a
>>= b
) && b
== a
);
693 css::uno::Sequence
< rtl::OUString
> b(2);
694 CPPUNIT_ASSERT_MESSAGE(
695 "css::uno::Sequence<rtl::OUString>",
696 !(a
>>= b
) && b
.getLength() == 2);
700 CPPUNIT_ASSERT_MESSAGE("Enum1", !(a
>>= b
) && b
== Enum1_M2
);
704 CPPUNIT_ASSERT_MESSAGE("Struct1", !(a
>>= b
) && b
.member
== 2);
708 rtl::OUString(), css::uno::Reference
< css::uno::XInterface
>(), 2);
709 CPPUNIT_ASSERT_MESSAGE("Exception1", !(a
>>= b
) && b
.member
== 2);
712 css::uno::Reference
< Interface1
> i(new Impl1
);
713 css::uno::Reference
< Interface1
> b(i
);
714 CPPUNIT_ASSERT_MESSAGE("Interface1", !(a
>>= b
) && b
== i
);
718 void Test::testLong() {
719 css::uno::Any
a(static_cast< sal_Int32
>(1));
720 CPPUNIT_ASSERT(a
.getValueType() == cppu::UnoType
<sal_Int32
>::get());
723 CPPUNIT_ASSERT_MESSAGE("bool", !(a
>>= b
) && b
);
727 CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a
>>= b
) && b
);
731 CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a
>>= b
) && b
== 2);
735 CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a
>>= b
) && b
== 2);
739 CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a
>>= b
) && b
== 2);
743 CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a
>>= b
) && b
== 2);
747 CPPUNIT_ASSERT_MESSAGE("sal_Int32", (a
>>= b
) && b
== 1);
751 CPPUNIT_ASSERT_MESSAGE("sal_uInt32", (a
>>= b
) && b
== 1);
755 CPPUNIT_ASSERT_MESSAGE("sal_Int64", (a
>>= b
) && b
== 1);
759 CPPUNIT_ASSERT_MESSAGE("sal_uInt64", (a
>>= b
) && b
== 1);
763 CPPUNIT_ASSERT_MESSAGE("float", !(a
>>= b
) && b
== 2);
767 CPPUNIT_ASSERT_MESSAGE("double", (a
>>= b
) && b
== 1);
771 CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a
>>= b
) && b
== '2');
774 rtl::OUString
b("2");
775 CPPUNIT_ASSERT_MESSAGE( "rtl::OUString", !(a
>>= b
) && b
== "2" );
778 css::uno::Type
b(cppu::UnoType
<OUString
>::get());
779 CPPUNIT_ASSERT_MESSAGE(
781 !(a
>>= b
) && b
== cppu::UnoType
<OUString
>::get());
784 css::uno::Any
b(rtl::OUString("2"));
785 CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a
>>= b
) && b
== a
);
788 css::uno::Sequence
< rtl::OUString
> b(2);
789 CPPUNIT_ASSERT_MESSAGE(
790 "css::uno::Sequence<rtl::OUString>",
791 !(a
>>= b
) && b
.getLength() == 2);
795 CPPUNIT_ASSERT_MESSAGE("Enum1", !(a
>>= b
) && b
== Enum1_M2
);
799 CPPUNIT_ASSERT_MESSAGE("Struct1", !(a
>>= b
) && b
.member
== 2);
803 rtl::OUString(), css::uno::Reference
< css::uno::XInterface
>(), 2);
804 CPPUNIT_ASSERT_MESSAGE("Exception1", !(a
>>= b
) && b
.member
== 2);
807 css::uno::Reference
< Interface1
> i(new Impl1
);
808 css::uno::Reference
< Interface1
> b(i
);
809 CPPUNIT_ASSERT_MESSAGE("Interface1", !(a
>>= b
) && b
== i
);
813 void Test::testUnsignedLong() {
814 css::uno::Any
a(static_cast< sal_uInt32
>(1));
815 CPPUNIT_ASSERT(a
.getValueType() == cppu::UnoType
<sal_uInt32
>::get());
818 CPPUNIT_ASSERT_MESSAGE("bool", !(a
>>= b
) && b
);
822 CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a
>>= b
) && b
);
826 CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a
>>= b
) && b
== 2);
830 CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a
>>= b
) && b
== 2);
834 CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a
>>= b
) && b
== 2);
838 CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a
>>= b
) && b
== 2);
842 CPPUNIT_ASSERT_MESSAGE("sal_Int32", (a
>>= b
) && b
== 1);
846 CPPUNIT_ASSERT_MESSAGE("sal_uInt32", (a
>>= b
) && b
== 1);
850 CPPUNIT_ASSERT_MESSAGE("sal_Int64", (a
>>= b
) && b
== 1);
854 CPPUNIT_ASSERT_MESSAGE("sal_uInt64", (a
>>= b
) && b
== 1);
858 CPPUNIT_ASSERT_MESSAGE("float", !(a
>>= b
) && b
== 2);
862 CPPUNIT_ASSERT_MESSAGE("double", (a
>>= b
) && b
== 1);
866 CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a
>>= b
) && b
== '2');
869 rtl::OUString
b("2");
870 CPPUNIT_ASSERT_MESSAGE( "rtl::OUString", !(a
>>= b
) && b
== "2" );
873 css::uno::Type
b(cppu::UnoType
<OUString
>::get());
874 CPPUNIT_ASSERT_MESSAGE(
876 !(a
>>= b
) && b
== cppu::UnoType
<OUString
>::get());
879 css::uno::Any
b(rtl::OUString("2"));
880 CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a
>>= b
) && b
== a
);
883 css::uno::Sequence
< rtl::OUString
> b(2);
884 CPPUNIT_ASSERT_MESSAGE(
885 "css::uno::Sequence<rtl::OUString>",
886 !(a
>>= b
) && b
.getLength() == 2);
890 CPPUNIT_ASSERT_MESSAGE("Enum1", !(a
>>= b
) && b
== Enum1_M2
);
894 CPPUNIT_ASSERT_MESSAGE("Struct1", !(a
>>= b
) && b
.member
== 2);
898 rtl::OUString(), css::uno::Reference
< css::uno::XInterface
>(), 2);
899 CPPUNIT_ASSERT_MESSAGE("Exception1", !(a
>>= b
) && b
.member
== 2);
902 css::uno::Reference
< Interface1
> i(new Impl1
);
903 css::uno::Reference
< Interface1
> b(i
);
904 CPPUNIT_ASSERT_MESSAGE("Interface1", !(a
>>= b
) && b
== i
);
908 void Test::testHyper() {
909 css::uno::Any
a(static_cast< sal_Int64
>(1));
910 CPPUNIT_ASSERT(a
.getValueType() == cppu::UnoType
<sal_Int64
>::get());
913 CPPUNIT_ASSERT_MESSAGE("bool", !(a
>>= b
) && b
);
917 CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a
>>= b
) && b
);
921 CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a
>>= b
) && b
== 2);
925 CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a
>>= b
) && b
== 2);
929 CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a
>>= b
) && b
== 2);
933 CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a
>>= b
) && b
== 2);
937 CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a
>>= b
) && b
== 2);
941 CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a
>>= b
) && b
== 2);
945 CPPUNIT_ASSERT_MESSAGE("sal_Int64", (a
>>= b
) && b
== 1);
949 CPPUNIT_ASSERT_MESSAGE("sal_uInt64", (a
>>= b
) && b
== 1);
953 CPPUNIT_ASSERT_MESSAGE("float", !(a
>>= b
) && b
== 2);
957 CPPUNIT_ASSERT_MESSAGE("double", !(a
>>= b
) && b
== 2);
961 CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a
>>= b
) && b
== '2');
964 rtl::OUString
b("2");
965 CPPUNIT_ASSERT_MESSAGE( "rtl::OUString", !(a
>>= b
) && b
== "2" );
968 css::uno::Type
b(cppu::UnoType
<OUString
>::get());
969 CPPUNIT_ASSERT_MESSAGE(
971 !(a
>>= b
) && b
== cppu::UnoType
<OUString
>::get());
974 css::uno::Any
b(rtl::OUString("2"));
975 CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a
>>= b
) && b
== a
);
978 css::uno::Sequence
< rtl::OUString
> b(2);
979 CPPUNIT_ASSERT_MESSAGE(
980 "css::uno::Sequence<rtl::OUString>",
981 !(a
>>= b
) && b
.getLength() == 2);
985 CPPUNIT_ASSERT_MESSAGE("Enum1", !(a
>>= b
) && b
== Enum1_M2
);
989 CPPUNIT_ASSERT_MESSAGE("Struct1", !(a
>>= b
) && b
.member
== 2);
993 rtl::OUString(), css::uno::Reference
< css::uno::XInterface
>(), 2);
994 CPPUNIT_ASSERT_MESSAGE("Exception1", !(a
>>= b
) && b
.member
== 2);
997 css::uno::Reference
< Interface1
> i(new Impl1
);
998 css::uno::Reference
< Interface1
> b(i
);
999 CPPUNIT_ASSERT_MESSAGE("Interface1", !(a
>>= b
) && b
== i
);
1003 void Test::testUnsignedHyper() {
1004 css::uno::Any
a(static_cast< sal_uInt64
>(1));
1005 CPPUNIT_ASSERT(a
.getValueType() == cppu::UnoType
<sal_uInt64
>::get());
1008 CPPUNIT_ASSERT_MESSAGE("bool", !(a
>>= b
) && b
);
1012 CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a
>>= b
) && b
);
1016 CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a
>>= b
) && b
== 2);
1020 CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a
>>= b
) && b
== 2);
1024 CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a
>>= b
) && b
== 2);
1028 CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a
>>= b
) && b
== 2);
1032 CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a
>>= b
) && b
== 2);
1036 CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a
>>= b
) && b
== 2);
1040 CPPUNIT_ASSERT_MESSAGE("sal_Int64", (a
>>= b
) && b
== 1);
1044 CPPUNIT_ASSERT_MESSAGE("sal_uInt64", (a
>>= b
) && b
== 1);
1048 CPPUNIT_ASSERT_MESSAGE("float", !(a
>>= b
) && b
== 2);
1052 CPPUNIT_ASSERT_MESSAGE("double", !(a
>>= b
) && b
== 2);
1055 sal_Unicode b
= '2';
1056 CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a
>>= b
) && b
== '2');
1059 rtl::OUString
b("2");
1060 CPPUNIT_ASSERT_MESSAGE( "rtl::OUString", !(a
>>= b
) && b
== "2" );
1063 css::uno::Type
b(cppu::UnoType
<OUString
>::get());
1064 CPPUNIT_ASSERT_MESSAGE(
1066 !(a
>>= b
) && b
== cppu::UnoType
<OUString
>::get());
1069 css::uno::Any
b(rtl::OUString("2"));
1070 CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a
>>= b
) && b
== a
);
1073 css::uno::Sequence
< rtl::OUString
> b(2);
1074 CPPUNIT_ASSERT_MESSAGE(
1075 "css::uno::Sequence<rtl::OUString>",
1076 !(a
>>= b
) && b
.getLength() == 2);
1080 CPPUNIT_ASSERT_MESSAGE("Enum1", !(a
>>= b
) && b
== Enum1_M2
);
1084 CPPUNIT_ASSERT_MESSAGE("Struct1", !(a
>>= b
) && b
.member
== 2);
1088 rtl::OUString(), css::uno::Reference
< css::uno::XInterface
>(), 2);
1089 CPPUNIT_ASSERT_MESSAGE("Exception1", !(a
>>= b
) && b
.member
== 2);
1092 css::uno::Reference
< Interface1
> i(new Impl1
);
1093 css::uno::Reference
< Interface1
> b(i
);
1094 CPPUNIT_ASSERT_MESSAGE("Interface1", !(a
>>= b
) && b
== i
);
1098 void Test::testFloat() {
1099 css::uno::Any
a(1.f
);
1100 CPPUNIT_ASSERT(a
.getValueType() == cppu::UnoType
<float>::get());
1103 CPPUNIT_ASSERT_MESSAGE("bool", !(a
>>= b
) && b
);
1107 CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a
>>= b
) && b
);
1111 CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a
>>= b
) && b
== 2);
1115 CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a
>>= b
) && b
== 2);
1119 CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a
>>= b
) && b
== 2);
1123 CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a
>>= b
) && b
== 2);
1127 CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a
>>= b
) && b
== 2);
1131 CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a
>>= b
) && b
== 2);
1135 CPPUNIT_ASSERT_MESSAGE("sal_Int64", !(a
>>= b
) && b
== 2);
1139 CPPUNIT_ASSERT_MESSAGE("sal_uInt64", !(a
>>= b
) && b
== 2);
1143 CPPUNIT_ASSERT_MESSAGE("float", (a
>>= b
) && b
== 1);
1147 CPPUNIT_ASSERT_MESSAGE("double", (a
>>= b
) && b
== 1);
1150 sal_Unicode b
= '2';
1151 CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a
>>= b
) && b
== '2');
1154 rtl::OUString
b("2");
1155 CPPUNIT_ASSERT_MESSAGE( "rtl::OUString", !(a
>>= b
) && b
== "2" );
1158 css::uno::Type
b(cppu::UnoType
<OUString
>::get());
1159 CPPUNIT_ASSERT_MESSAGE(
1161 !(a
>>= b
) && b
== cppu::UnoType
<OUString
>::get());
1164 css::uno::Any
b(rtl::OUString("2"));
1165 CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a
>>= b
) && b
== a
);
1168 css::uno::Sequence
< rtl::OUString
> b(2);
1169 CPPUNIT_ASSERT_MESSAGE(
1170 "css::uno::Sequence<rtl::OUString>",
1171 !(a
>>= b
) && b
.getLength() == 2);
1175 CPPUNIT_ASSERT_MESSAGE("Enum1", !(a
>>= b
) && b
== Enum1_M2
);
1179 CPPUNIT_ASSERT_MESSAGE("Struct1", !(a
>>= b
) && b
.member
== 2);
1183 rtl::OUString(), css::uno::Reference
< css::uno::XInterface
>(), 2);
1184 CPPUNIT_ASSERT_MESSAGE("Exception1", !(a
>>= b
) && b
.member
== 2);
1187 css::uno::Reference
< Interface1
> i(new Impl1
);
1188 css::uno::Reference
< Interface1
> b(i
);
1189 CPPUNIT_ASSERT_MESSAGE("Interface1", !(a
>>= b
) && b
== i
);
1193 void Test::testDouble() {
1194 css::uno::Any
a(1.);
1195 CPPUNIT_ASSERT(a
.getValueType() == cppu::UnoType
<double>::get());
1198 CPPUNIT_ASSERT_MESSAGE("bool", !(a
>>= b
) && b
);
1202 CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a
>>= b
) && b
);
1206 CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a
>>= b
) && b
== 2);
1210 CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a
>>= b
) && b
== 2);
1214 CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a
>>= b
) && b
== 2);
1218 CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a
>>= b
) && b
== 2);
1222 CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a
>>= b
) && b
== 2);
1226 CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a
>>= b
) && b
== 2);
1230 CPPUNIT_ASSERT_MESSAGE("sal_Int64", !(a
>>= b
) && b
== 2);
1234 CPPUNIT_ASSERT_MESSAGE("sal_uInt64", !(a
>>= b
) && b
== 2);
1238 CPPUNIT_ASSERT_MESSAGE("float", !(a
>>= b
) && b
== 2);
1242 CPPUNIT_ASSERT_MESSAGE("double", (a
>>= b
) && b
== 1);
1245 sal_Unicode b
= '2';
1246 CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a
>>= b
) && b
== '2');
1249 rtl::OUString
b("2");
1250 CPPUNIT_ASSERT_MESSAGE( "rtl::OUString", !(a
>>= b
) && b
== "2" );
1253 css::uno::Type
b(cppu::UnoType
<OUString
>::get());
1254 CPPUNIT_ASSERT_MESSAGE(
1256 !(a
>>= b
) && b
== cppu::UnoType
<OUString
>::get());
1259 css::uno::Any
b(rtl::OUString("2"));
1260 CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a
>>= b
) && b
== a
);
1263 css::uno::Sequence
< rtl::OUString
> b(2);
1264 CPPUNIT_ASSERT_MESSAGE(
1265 "css::uno::Sequence<rtl::OUString>",
1266 !(a
>>= b
) && b
.getLength() == 2);
1270 CPPUNIT_ASSERT_MESSAGE("Enum1", !(a
>>= b
) && b
== Enum1_M2
);
1274 CPPUNIT_ASSERT_MESSAGE("Struct1", !(a
>>= b
) && b
.member
== 2);
1278 rtl::OUString(), css::uno::Reference
< css::uno::XInterface
>(), 2);
1279 CPPUNIT_ASSERT_MESSAGE("Exception1", !(a
>>= b
) && b
.member
== 2);
1282 css::uno::Reference
< Interface1
> i(new Impl1
);
1283 css::uno::Reference
< Interface1
> b(i
);
1284 CPPUNIT_ASSERT_MESSAGE("Interface1", !(a
>>= b
) && b
== i
);
1288 void Test::testChar() {
1289 sal_Unicode c
= '1';
1290 css::uno::Any
a(&c
, cppu::UnoType
<cppu::UnoCharType
>::get());
1291 CPPUNIT_ASSERT(a
.getValueType() == cppu::UnoType
<cppu::UnoCharType
>::get());
1294 CPPUNIT_ASSERT_MESSAGE("bool", !(a
>>= b
) && b
);
1298 CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a
>>= b
) && b
);
1302 CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a
>>= b
) && b
== 2);
1306 CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a
>>= b
) && b
== 2);
1310 CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a
>>= b
) && b
== 2);
1314 CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a
>>= b
) && b
== 2);
1318 CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a
>>= b
) && b
== 2);
1322 CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a
>>= b
) && b
== 2);
1326 CPPUNIT_ASSERT_MESSAGE("sal_Int64", !(a
>>= b
) && b
== 2);
1330 CPPUNIT_ASSERT_MESSAGE("sal_uInt64", !(a
>>= b
) && b
== 2);
1334 CPPUNIT_ASSERT_MESSAGE("float", !(a
>>= b
) && b
== 2);
1338 CPPUNIT_ASSERT_MESSAGE("double", !(a
>>= b
) && b
== 2);
1341 sal_Unicode b
= '2';
1342 if (boost::is_same
< sal_Unicode
, sal_uInt16
>::value
) {
1343 CPPUNIT_ASSERT_MESSAGE("@sal_Unicode", !(a
>>= b
) && b
== '2');
1345 CPPUNIT_ASSERT_MESSAGE("sal_Unicode", (a
>>= b
) && b
== '1');
1349 rtl::OUString
b("2");
1350 CPPUNIT_ASSERT_MESSAGE( "rtl::OUString", !(a
>>= b
) && b
== "2" );
1353 css::uno::Type
b(cppu::UnoType
<OUString
>::get());
1354 CPPUNIT_ASSERT_MESSAGE(
1356 !(a
>>= b
) && b
== cppu::UnoType
<OUString
>::get());
1359 css::uno::Any
b(rtl::OUString("2"));
1360 CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a
>>= b
) && b
== a
);
1363 css::uno::Sequence
< rtl::OUString
> b(2);
1364 CPPUNIT_ASSERT_MESSAGE(
1365 "css::uno::Sequence<rtl::OUString>",
1366 !(a
>>= b
) && b
.getLength() == 2);
1370 CPPUNIT_ASSERT_MESSAGE("Enum1", !(a
>>= b
) && b
== Enum1_M2
);
1374 CPPUNIT_ASSERT_MESSAGE("Struct1", !(a
>>= b
) && b
.member
== 2);
1378 rtl::OUString(), css::uno::Reference
< css::uno::XInterface
>(), 2);
1379 CPPUNIT_ASSERT_MESSAGE("Exception1", !(a
>>= b
) && b
.member
== 2);
1382 css::uno::Reference
< Interface1
> i(new Impl1
);
1383 css::uno::Reference
< Interface1
> b(i
);
1384 CPPUNIT_ASSERT_MESSAGE("Interface1", !(a
>>= b
) && b
== i
);
1388 void Test::testString() {
1389 css::uno::Any
a(rtl::OUString("1"));
1390 CPPUNIT_ASSERT(a
.getValueType() == cppu::UnoType
<OUString
>::get());
1393 CPPUNIT_ASSERT_MESSAGE("bool", !(a
>>= b
) && b
);
1397 CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a
>>= b
) && b
);
1401 CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a
>>= b
) && b
== 2);
1405 CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a
>>= b
) && b
== 2);
1409 CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a
>>= b
) && b
== 2);
1413 CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a
>>= b
) && b
== 2);
1417 CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a
>>= b
) && b
== 2);
1421 CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a
>>= b
) && b
== 2);
1425 CPPUNIT_ASSERT_MESSAGE("sal_Int64", !(a
>>= b
) && b
== 2);
1429 CPPUNIT_ASSERT_MESSAGE("sal_uInt64", !(a
>>= b
) && b
== 2);
1433 CPPUNIT_ASSERT_MESSAGE("float", !(a
>>= b
) && b
== 2);
1437 CPPUNIT_ASSERT_MESSAGE("double", !(a
>>= b
) && b
== 2);
1440 sal_Unicode b
= '2';
1441 CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a
>>= b
) && b
== '2');
1444 rtl::OUString
b("2");
1445 CPPUNIT_ASSERT_MESSAGE( "rtl::OUString", (a
>>= b
) && b
== "1" );
1448 css::uno::Type
b(cppu::UnoType
<OUString
>::get());
1449 CPPUNIT_ASSERT_MESSAGE(
1451 !(a
>>= b
) && b
== cppu::UnoType
<OUString
>::get());
1454 css::uno::Any
b(rtl::OUString("2"));
1455 CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a
>>= b
) && b
== a
);
1458 css::uno::Sequence
< rtl::OUString
> b(2);
1459 CPPUNIT_ASSERT_MESSAGE(
1460 "css::uno::Sequence<rtl::OUString>",
1461 !(a
>>= b
) && b
.getLength() == 2);
1465 CPPUNIT_ASSERT_MESSAGE("Enum1", !(a
>>= b
) && b
== Enum1_M2
);
1469 CPPUNIT_ASSERT_MESSAGE("Struct1", !(a
>>= b
) && b
.member
== 2);
1473 rtl::OUString(), css::uno::Reference
< css::uno::XInterface
>(), 2);
1474 CPPUNIT_ASSERT_MESSAGE("Exception1", !(a
>>= b
) && b
.member
== 2);
1477 css::uno::Reference
< Interface1
> i(new Impl1
);
1478 css::uno::Reference
< Interface1
> b(i
);
1479 CPPUNIT_ASSERT_MESSAGE("Interface1", !(a
>>= b
) && b
== i
);
1483 void Test::testType() {
1484 css::uno::Any
a(cppu::UnoType
<sal_Int32
>::get());
1485 CPPUNIT_ASSERT(a
.getValueType() == cppu::UnoType
<css::uno::Type
>::get());
1488 CPPUNIT_ASSERT_MESSAGE("bool", !(a
>>= b
) && b
);
1492 CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a
>>= b
) && b
);
1496 CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a
>>= b
) && b
== 2);
1500 CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a
>>= b
) && b
== 2);
1504 CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a
>>= b
) && b
== 2);
1508 CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a
>>= b
) && b
== 2);
1512 CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a
>>= b
) && b
== 2);
1516 CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a
>>= b
) && b
== 2);
1520 CPPUNIT_ASSERT_MESSAGE("sal_Int64", !(a
>>= b
) && b
== 2);
1524 CPPUNIT_ASSERT_MESSAGE("sal_uInt64", !(a
>>= b
) && b
== 2);
1528 CPPUNIT_ASSERT_MESSAGE("float", !(a
>>= b
) && b
== 2);
1532 CPPUNIT_ASSERT_MESSAGE("double", !(a
>>= b
) && b
== 2);
1535 sal_Unicode b
= '2';
1536 CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a
>>= b
) && b
== '2');
1539 rtl::OUString
b("2");
1540 CPPUNIT_ASSERT_MESSAGE( "rtl::OUString", !(a
>>= b
) && b
== "2" );
1543 css::uno::Type
b(cppu::UnoType
<OUString
>::get());
1544 CPPUNIT_ASSERT_MESSAGE(
1545 "css::uno::Type", (a
>>= b
) && b
== cppu::UnoType
<sal_Int32
>::get());
1548 css::uno::Any
b(rtl::OUString("2"));
1549 CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a
>>= b
) && b
== a
);
1552 css::uno::Sequence
< rtl::OUString
> b(2);
1553 CPPUNIT_ASSERT_MESSAGE(
1554 "css::uno::Sequence<rtl::OUString>",
1555 !(a
>>= b
) && b
.getLength() == 2);
1559 CPPUNIT_ASSERT_MESSAGE("Enum1", !(a
>>= b
) && b
== Enum1_M2
);
1563 CPPUNIT_ASSERT_MESSAGE("Struct1", !(a
>>= b
) && b
.member
== 2);
1567 rtl::OUString(), css::uno::Reference
< css::uno::XInterface
>(), 2);
1568 CPPUNIT_ASSERT_MESSAGE("Exception1", !(a
>>= b
) && b
.member
== 2);
1571 css::uno::Reference
< Interface1
> i(new Impl1
);
1572 css::uno::Reference
< Interface1
> b(i
);
1573 CPPUNIT_ASSERT_MESSAGE("Interface1", !(a
>>= b
) && b
== i
);
1577 void Test::testSequence() {
1579 css::uno::Any
a(css::uno::Sequence
< sal_Int32
>(&n
, 1));
1582 == cppu::UnoType
<css::uno::Sequence
<sal_Int32
>>::get());
1585 CPPUNIT_ASSERT_MESSAGE("bool", !(a
>>= b
) && b
);
1589 CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a
>>= b
) && b
);
1593 CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a
>>= b
) && b
== 2);
1597 CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a
>>= b
) && b
== 2);
1601 CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a
>>= b
) && b
== 2);
1605 CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a
>>= b
) && b
== 2);
1609 CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a
>>= b
) && b
== 2);
1613 CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a
>>= b
) && b
== 2);
1617 CPPUNIT_ASSERT_MESSAGE("sal_Int64", !(a
>>= b
) && b
== 2);
1621 CPPUNIT_ASSERT_MESSAGE("sal_uInt64", !(a
>>= b
) && b
== 2);
1625 CPPUNIT_ASSERT_MESSAGE("float", !(a
>>= b
) && b
== 2);
1629 CPPUNIT_ASSERT_MESSAGE("double", !(a
>>= b
) && b
== 2);
1632 sal_Unicode b
= '2';
1633 CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a
>>= b
) && b
== '2');
1636 rtl::OUString
b("2");
1637 CPPUNIT_ASSERT_MESSAGE( "rtl::OUString", !(a
>>= b
) && b
== "2" );
1640 css::uno::Type
b(cppu::UnoType
<OUString
>::get());
1641 CPPUNIT_ASSERT_MESSAGE(
1643 !(a
>>= b
) && b
== cppu::UnoType
<OUString
>::get());
1646 css::uno::Any
b(rtl::OUString("2"));
1647 CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a
>>= b
) && b
== a
);
1650 css::uno::Sequence
< rtl::OUString
> b(2);
1651 CPPUNIT_ASSERT_MESSAGE(
1652 "css::uno::Sequence<rtl::OUString>",
1653 !(a
>>= b
) && b
.getLength() == 2);
1656 css::uno::Sequence
< sal_Int32
> b(2);
1657 CPPUNIT_ASSERT_MESSAGE(
1658 "css::uno::Sequence<sal_Int32>",
1659 (a
>>= b
) && b
.getLength() == 1 && b
[0] == 1);
1663 CPPUNIT_ASSERT_MESSAGE("Enum1", !(a
>>= b
) && b
== Enum1_M2
);
1667 CPPUNIT_ASSERT_MESSAGE("Struct1", !(a
>>= b
) && b
.member
== 2);
1671 rtl::OUString(), css::uno::Reference
< css::uno::XInterface
>(), 2);
1672 CPPUNIT_ASSERT_MESSAGE("Exception1", !(a
>>= b
) && b
.member
== 2);
1675 css::uno::Reference
< Interface1
> i(new Impl1
);
1676 css::uno::Reference
< Interface1
> b(i
);
1677 CPPUNIT_ASSERT_MESSAGE("Interface1", !(a
>>= b
) && b
== i
);
1681 void Test::testEnum() {
1682 css::uno::Any
a(Enum2_M1
);
1683 CPPUNIT_ASSERT(a
.getValueType() == cppu::UnoType
<Enum2
>::get());
1686 CPPUNIT_ASSERT_MESSAGE("bool", !(a
>>= b
) && b
);
1690 CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a
>>= b
) && b
);
1694 CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a
>>= b
) && b
== 2);
1698 CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a
>>= b
) && b
== 2);
1702 CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a
>>= b
) && b
== 2);
1706 CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a
>>= b
) && b
== 2);
1710 CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a
>>= b
) && b
== 2);
1714 CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a
>>= b
) && b
== 2);
1718 CPPUNIT_ASSERT_MESSAGE("sal_Int64", !(a
>>= b
) && b
== 2);
1722 CPPUNIT_ASSERT_MESSAGE("sal_uInt64", !(a
>>= b
) && b
== 2);
1726 CPPUNIT_ASSERT_MESSAGE("float", !(a
>>= b
) && b
== 2);
1730 CPPUNIT_ASSERT_MESSAGE("double", !(a
>>= b
) && b
== 2);
1733 sal_Unicode b
= '2';
1734 CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a
>>= b
) && b
== '2');
1737 rtl::OUString
b("2");
1738 CPPUNIT_ASSERT_MESSAGE( "rtl::OUString", !(a
>>= b
) && b
== "2" );
1741 css::uno::Type
b(cppu::UnoType
<OUString
>::get());
1742 CPPUNIT_ASSERT_MESSAGE(
1744 !(a
>>= b
) && b
== cppu::UnoType
<OUString
>::get());
1747 css::uno::Any
b(rtl::OUString("2"));
1748 CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a
>>= b
) && b
== a
);
1751 css::uno::Sequence
< rtl::OUString
> b(2);
1752 CPPUNIT_ASSERT_MESSAGE(
1753 "css::uno::Sequence<rtl::OUString>",
1754 !(a
>>= b
) && b
.getLength() == 2);
1758 CPPUNIT_ASSERT_MESSAGE("Enum1", !(a
>>= b
) && b
== Enum1_M2
);
1762 CPPUNIT_ASSERT_MESSAGE("Enum2", (a
>>= b
) && b
== Enum2_M1
);
1766 CPPUNIT_ASSERT_MESSAGE("Struct1", !(a
>>= b
) && b
.member
== 2);
1770 rtl::OUString(), css::uno::Reference
< css::uno::XInterface
>(), 2);
1771 CPPUNIT_ASSERT_MESSAGE("Exception1", !(a
>>= b
) && b
.member
== 2);
1774 css::uno::Reference
< Interface1
> i(new Impl1
);
1775 css::uno::Reference
< Interface1
> b(i
);
1776 CPPUNIT_ASSERT_MESSAGE("Interface1", !(a
>>= b
) && b
== i
);
1780 void Test::testStruct() {
1781 css::uno::Any
a(Struct2a(1, 3));
1782 CPPUNIT_ASSERT(a
.getValueType() == cppu::UnoType
<Struct2a
>::get());
1785 CPPUNIT_ASSERT_MESSAGE("bool", !(a
>>= b
) && b
);
1789 CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a
>>= b
) && b
);
1793 CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a
>>= b
) && b
== 2);
1797 CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a
>>= b
) && b
== 2);
1801 CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a
>>= b
) && b
== 2);
1805 CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a
>>= b
) && b
== 2);
1809 CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a
>>= b
) && b
== 2);
1813 CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a
>>= b
) && b
== 2);
1817 CPPUNIT_ASSERT_MESSAGE("sal_Int64", !(a
>>= b
) && b
== 2);
1821 CPPUNIT_ASSERT_MESSAGE("sal_uInt64", !(a
>>= b
) && b
== 2);
1825 CPPUNIT_ASSERT_MESSAGE("float", !(a
>>= b
) && b
== 2);
1829 CPPUNIT_ASSERT_MESSAGE("double", !(a
>>= b
) && b
== 2);
1832 sal_Unicode b
= '2';
1833 CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a
>>= b
) && b
== '2');
1836 rtl::OUString
b("2");
1837 CPPUNIT_ASSERT_MESSAGE( "rtl::OUString", !(a
>>= b
) && b
== "2" );
1840 css::uno::Type
b(cppu::UnoType
<OUString
>::get());
1841 CPPUNIT_ASSERT_MESSAGE(
1843 !(a
>>= b
) && b
== cppu::UnoType
<OUString
>::get());
1846 css::uno::Any
b(rtl::OUString("2"));
1847 CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a
>>= b
) && b
== a
);
1850 css::uno::Sequence
< rtl::OUString
> b(2);
1851 CPPUNIT_ASSERT_MESSAGE(
1852 "css::uno::Sequence<rtl::OUString>",
1853 !(a
>>= b
) && b
.getLength() == 2);
1857 CPPUNIT_ASSERT_MESSAGE("Enum1", !(a
>>= b
) && b
== Enum1_M2
);
1861 CPPUNIT_ASSERT_MESSAGE("Struct1", !(a
>>= b
) && b
.member
== 2);
1865 CPPUNIT_ASSERT_MESSAGE("Struct2", (a
>>= b
) && b
.member
== 1);
1869 CPPUNIT_ASSERT_MESSAGE(
1870 "Struct2a", (a
>>= b
) && b
.member
== 1 && b
.member2
== 3);
1873 Struct2b
b(2, 2, 2);
1874 CPPUNIT_ASSERT_MESSAGE("Struct2b", !(a
>>= b
) && b
.member
== 2);
1878 rtl::OUString(), css::uno::Reference
< css::uno::XInterface
>(), 2);
1879 CPPUNIT_ASSERT_MESSAGE("Exception1", !(a
>>= b
) && b
.member
== 2);
1882 css::uno::Reference
< Interface1
> i(new Impl1
);
1883 css::uno::Reference
< Interface1
> b(i
);
1884 CPPUNIT_ASSERT_MESSAGE("Interface1", !(a
>>= b
) && b
== i
);
1888 void Test::testPoly() {
1890 a
<<= Poly
< css::uno::Sequence
< ::sal_Unicode
> >();
1891 CPPUNIT_ASSERT_MESSAGE( "type name", a
.getValueType().getTypeName() == "Poly<[]char>" );
1892 CPPUNIT_ASSERT_MESSAGE(
1894 a
== css::uno::Any(Poly
< css::uno::Sequence
< ::sal_Unicode
> >()));
1897 void Test::testException() {
1900 rtl::OUString(), css::uno::Reference
< css::uno::XInterface
>(), 1,
1902 CPPUNIT_ASSERT(a
.getValueType() == cppu::UnoType
<Exception2a
>::get());
1905 CPPUNIT_ASSERT_MESSAGE("bool", !(a
>>= b
) && b
);
1909 CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a
>>= b
) && b
);
1913 CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a
>>= b
) && b
== 2);
1917 CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a
>>= b
) && b
== 2);
1921 CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a
>>= b
) && b
== 2);
1925 CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a
>>= b
) && b
== 2);
1929 CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a
>>= b
) && b
== 2);
1933 CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a
>>= b
) && b
== 2);
1937 CPPUNIT_ASSERT_MESSAGE("sal_Int64", !(a
>>= b
) && b
== 2);
1941 CPPUNIT_ASSERT_MESSAGE("sal_uInt64", !(a
>>= b
) && b
== 2);
1945 CPPUNIT_ASSERT_MESSAGE("float", !(a
>>= b
) && b
== 2);
1949 CPPUNIT_ASSERT_MESSAGE("double", !(a
>>= b
) && b
== 2);
1952 sal_Unicode b
= '2';
1953 CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a
>>= b
) && b
== '2');
1956 rtl::OUString
b("2");
1957 CPPUNIT_ASSERT_MESSAGE( "rtl::OUString", !(a
>>= b
) && b
== "2" );
1960 css::uno::Type
b(cppu::UnoType
<OUString
>::get());
1961 CPPUNIT_ASSERT_MESSAGE(
1963 !(a
>>= b
) && b
== cppu::UnoType
<OUString
>::get());
1966 css::uno::Any
b(rtl::OUString("2"));
1967 CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a
>>= b
) && b
== a
);
1970 css::uno::Sequence
< rtl::OUString
> b(2);
1971 CPPUNIT_ASSERT_MESSAGE(
1972 "css::uno::Sequence<rtl::OUString>",
1973 !(a
>>= b
) && b
.getLength() == 2);
1977 CPPUNIT_ASSERT_MESSAGE("Enum1", !(a
>>= b
) && b
== Enum1_M2
);
1981 CPPUNIT_ASSERT_MESSAGE("Struct1", !(a
>>= b
) && b
.member
== 2);
1985 rtl::OUString(), css::uno::Reference
< css::uno::XInterface
>(), 2);
1986 CPPUNIT_ASSERT_MESSAGE("Exception1", !(a
>>= b
) && b
.member
== 2);
1990 rtl::OUString(), css::uno::Reference
< css::uno::XInterface
>(), 2);
1991 CPPUNIT_ASSERT_MESSAGE("Exception2", (a
>>= b
) && b
.member
== 1);
1995 rtl::OUString(), css::uno::Reference
< css::uno::XInterface
>(), 2,
1997 CPPUNIT_ASSERT_MESSAGE(
1998 "Exception2a", (a
>>= b
) && b
.member
== 1 && b
.member2
== 3);
2002 rtl::OUString(), css::uno::Reference
< css::uno::XInterface
>(), 2,
2004 CPPUNIT_ASSERT_MESSAGE("Exception2b", !(a
>>= b
) && b
.member
== 2);
2007 css::uno::Reference
< Interface1
> i(new Impl1
);
2008 css::uno::Reference
< Interface1
> b(i
);
2009 CPPUNIT_ASSERT_MESSAGE("Interface1", !(a
>>= b
) && b
== i
);
2013 void Test::testInterface() {
2014 css::uno::Reference
< Interface2a
> i2(new Impl2
);
2015 css::uno::Any
a(i2
);
2016 CPPUNIT_ASSERT(a
.getValueType() == cppu::UnoType
<Interface2a
>::get());
2019 CPPUNIT_ASSERT_MESSAGE("bool", !(a
>>= b
) && b
);
2023 CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a
>>= b
) && b
);
2027 CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a
>>= b
) && b
== 2);
2031 CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a
>>= b
) && b
== 2);
2035 CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a
>>= b
) && b
== 2);
2039 CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a
>>= b
) && b
== 2);
2043 CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a
>>= b
) && b
== 2);
2047 CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a
>>= b
) && b
== 2);
2051 CPPUNIT_ASSERT_MESSAGE("sal_Int64", !(a
>>= b
) && b
== 2);
2055 CPPUNIT_ASSERT_MESSAGE("sal_uInt64", !(a
>>= b
) && b
== 2);
2059 CPPUNIT_ASSERT_MESSAGE("float", !(a
>>= b
) && b
== 2);
2063 CPPUNIT_ASSERT_MESSAGE("double", !(a
>>= b
) && b
== 2);
2066 sal_Unicode b
= '2';
2067 CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a
>>= b
) && b
== '2');
2070 rtl::OUString
b("2");
2071 CPPUNIT_ASSERT_MESSAGE( "rtl::OUString", !(a
>>= b
) && b
== "2" );
2074 css::uno::Type
b(cppu::UnoType
<OUString
>::get());
2075 CPPUNIT_ASSERT_MESSAGE(
2077 !(a
>>= b
) && b
== cppu::UnoType
<OUString
>::get());
2080 css::uno::Any
b(rtl::OUString("2"));
2081 CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a
>>= b
) && b
== a
);
2084 css::uno::Sequence
< rtl::OUString
> b(2);
2085 CPPUNIT_ASSERT_MESSAGE(
2086 "css::uno::Sequence<rtl::OUString>",
2087 !(a
>>= b
) && b
.getLength() == 2);
2091 CPPUNIT_ASSERT_MESSAGE("Enum1", !(a
>>= b
) && b
== Enum1_M2
);
2095 CPPUNIT_ASSERT_MESSAGE("Struct1", !(a
>>= b
) && b
.member
== 2);
2099 rtl::OUString(), css::uno::Reference
< css::uno::XInterface
>(), 2);
2100 CPPUNIT_ASSERT_MESSAGE("Exception1", !(a
>>= b
) && b
.member
== 2);
2103 css::uno::Reference
< Interface1
> i(new Impl1
);
2104 css::uno::Reference
< Interface1
> b(i
);
2105 CPPUNIT_ASSERT_MESSAGE("Interface1", !(a
>>= b
) && b
== i
);
2108 css::uno::Reference
< Interface2
> b(new Impl2
);
2109 CPPUNIT_ASSERT_MESSAGE("Interface2", (a
>>= b
) && b
== i2
);
2112 css::uno::Reference
< Interface2a
> b(new Impl2
);
2113 CPPUNIT_ASSERT_MESSAGE("Interface2a", (a
>>= b
) && b
== i2
);
2116 css::uno::Reference
< Interface2b
> i(new Impl2b
);
2117 css::uno::Reference
< Interface2b
> b(i
);
2118 CPPUNIT_ASSERT_MESSAGE("Interface2b", !(a
>>= b
) && b
== i
);
2121 css::uno::Reference
< Interface3
> b(new Impl2
);
2122 CPPUNIT_ASSERT_MESSAGE("Interface3", (a
>>= b
) && b
== i2
);
2126 void Test::testNull() {
2127 css::uno::Any a
= css::uno::Any(css::uno::Reference
< Interface2a
>());
2128 CPPUNIT_ASSERT(a
.getValueType() == cppu::UnoType
<Interface2a
>::get());
2131 CPPUNIT_ASSERT_MESSAGE("bool", !(a
>>= b
) && b
);
2135 CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a
>>= b
) && b
);
2139 CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a
>>= b
) && b
== 2);
2143 CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a
>>= b
) && b
== 2);
2147 CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a
>>= b
) && b
== 2);
2151 CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a
>>= b
) && b
== 2);
2155 CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a
>>= b
) && b
== 2);
2159 CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a
>>= b
) && b
== 2);
2163 CPPUNIT_ASSERT_MESSAGE("sal_Int64", !(a
>>= b
) && b
== 2);
2167 CPPUNIT_ASSERT_MESSAGE("sal_uInt64", !(a
>>= b
) && b
== 2);
2171 CPPUNIT_ASSERT_MESSAGE("float", !(a
>>= b
) && b
== 2);
2175 CPPUNIT_ASSERT_MESSAGE("double", !(a
>>= b
) && b
== 2);
2178 sal_Unicode b
= '2';
2179 CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a
>>= b
) && b
== '2');
2182 rtl::OUString
b("2");
2183 CPPUNIT_ASSERT_MESSAGE( "rtl::OUString", !(a
>>= b
) && b
== "2" );
2186 css::uno::Type
b(cppu::UnoType
<OUString
>::get());
2187 CPPUNIT_ASSERT_MESSAGE(
2189 !(a
>>= b
) && b
== cppu::UnoType
<OUString
>::get());
2192 css::uno::Any
b(rtl::OUString("2"));
2193 CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a
>>= b
) && b
== a
);
2196 css::uno::Sequence
< rtl::OUString
> b(2);
2197 CPPUNIT_ASSERT_MESSAGE(
2198 "css::uno::Sequence<rtl::OUString>",
2199 !(a
>>= b
) && b
.getLength() == 2);
2203 CPPUNIT_ASSERT_MESSAGE("Enum1", !(a
>>= b
) && b
== Enum1_M2
);
2207 CPPUNIT_ASSERT_MESSAGE("Struct1", !(a
>>= b
) && b
.member
== 2);
2211 rtl::OUString(), css::uno::Reference
< css::uno::XInterface
>(), 2);
2212 CPPUNIT_ASSERT_MESSAGE("Exception1", !(a
>>= b
) && b
.member
== 2);
2215 css::uno::Reference
< Interface1
> b(new Impl1
);
2216 CPPUNIT_ASSERT_MESSAGE(
2217 "Interface1", (a
>>= b
) && !b
.is());
2220 css::uno::Reference
< Interface2
> b(new Impl2
);
2221 CPPUNIT_ASSERT_MESSAGE(
2222 "Interface2", (a
>>= b
) && !b
.is());
2225 css::uno::Reference
< Interface2a
> b(new Impl2
);
2226 CPPUNIT_ASSERT_MESSAGE("Interface2a", (a
>>= b
) && !b
.is());
2229 css::uno::Reference
< Interface2b
> b(new Impl2b
);
2230 CPPUNIT_ASSERT_MESSAGE(
2231 "Interface2b", (a
>>= b
) && !b
.is());
2234 css::uno::Reference
< Interface3
> b(new Impl2
);
2235 CPPUNIT_ASSERT_MESSAGE(
2236 "Interface3", (a
>>= b
) && !b
.is());
2240 CPPUNIT_TEST_SUITE_REGISTRATION(Test
);
2244 CPPUNIT_PLUGIN_IMPLEMENT();
2246 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */