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