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 <typeinfo> 30 31 #include "com/sun/star/beans/Optional.hpp" 32 #include "com/sun/star/beans/PropertyChangeEvent.hpp" 33 #include "com/sun/star/lang/EventObject.hpp" 34 #include "com/sun/star/uno/Exception.hpp" 35 #include "com/sun/star/uno/Reference.hxx" 36 #include "com/sun/star/uno/RuntimeException.hpp" 37 #include "com/sun/star/uno/Sequence.hxx" 38 #include "com/sun/star/uno/Type.hxx" 39 #include "com/sun/star/uno/TypeClass.hpp" 40 #include "com/sun/star/uno/XComponentContext.hpp" 41 #include "com/sun/star/uno/XInterface.hpp" 42 #include "cppu/unotype.hxx" 43 #include "testshl/simpleheader.hxx" 44 #include "rtl/ustring.h" 45 #include "rtl/ustring.hxx" 46 #include "sal/types.h" 47 48 namespace com { namespace sun { namespace star { namespace uno { 49 class Any; 50 } } } } 51 52 namespace { 53 54 namespace css = com::sun::star; 55 56 struct DerivedStruct1: css::lang::EventObject {}; 57 58 struct DerivedStruct2: css::beans::PropertyChangeEvent {}; 59 60 struct DerivedException1: css::uno::Exception {}; 61 62 struct DerivedException2: css::uno::RuntimeException {}; 63 64 struct DerivedInterface1: css::uno::XInterface {}; 65 66 struct DerivedInterface2: css::uno::XComponentContext {}; 67 68 class Test: public ::CppUnit::TestFixture { 69 public: 70 void testUnoType(); 71 72 void testGetTypeFavourUnsigned(); 73 74 void testGetTypeFavourChar(); 75 76 CPPUNIT_TEST_SUITE(Test); 77 CPPUNIT_TEST(testUnoType); 78 CPPUNIT_TEST(testGetTypeFavourUnsigned); 79 CPPUNIT_TEST(testGetTypeFavourChar); 80 CPPUNIT_TEST_SUITE_END(); 81 }; 82 83 void Test::testUnoType() { 84 css::uno::Type t; 85 t = ::cppu::UnoType< ::cppu::UnoVoidType >::get(); 86 CPPUNIT_ASSERT_EQUAL(css::uno::TypeClass_VOID, t.getTypeClass()); 87 CPPUNIT_ASSERT_EQUAL( 88 ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("void")), t.getTypeName()); 89 t = ::cppu::UnoType< bool >::get(); 90 CPPUNIT_ASSERT_EQUAL(css::uno::TypeClass_BOOLEAN, t.getTypeClass()); 91 CPPUNIT_ASSERT_EQUAL( 92 ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("boolean")), 93 t.getTypeName()); 94 CPPUNIT_ASSERT(::cppu::UnoType< ::sal_Bool >::get() == t); 95 t = ::cppu::UnoType< ::sal_Int8 >::get(); 96 CPPUNIT_ASSERT_EQUAL(css::uno::TypeClass_BYTE, t.getTypeClass()); 97 CPPUNIT_ASSERT_EQUAL( 98 ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("byte")), t.getTypeName()); 99 t = ::cppu::UnoType< ::sal_Int16 >::get(); 100 CPPUNIT_ASSERT_EQUAL(css::uno::TypeClass_SHORT, t.getTypeClass()); 101 CPPUNIT_ASSERT_EQUAL( 102 ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("short")), t.getTypeName()); 103 t = ::cppu::UnoType< ::cppu::UnoUnsignedShortType >::get(); 104 CPPUNIT_ASSERT_EQUAL(css::uno::TypeClass_UNSIGNED_SHORT, t.getTypeClass()); 105 CPPUNIT_ASSERT_EQUAL( 106 ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("unsigned short")), 107 t.getTypeName()); 108 t = ::cppu::UnoType< ::sal_Int32 >::get(); 109 CPPUNIT_ASSERT_EQUAL(css::uno::TypeClass_LONG, t.getTypeClass()); 110 CPPUNIT_ASSERT_EQUAL( 111 ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("long")), t.getTypeName()); 112 t = ::cppu::UnoType< ::sal_uInt32 >::get(); 113 CPPUNIT_ASSERT_EQUAL(css::uno::TypeClass_UNSIGNED_LONG, t.getTypeClass()); 114 CPPUNIT_ASSERT_EQUAL( 115 ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("unsigned long")), 116 t.getTypeName()); 117 t = ::cppu::UnoType< ::sal_Int64 >::get(); 118 CPPUNIT_ASSERT_EQUAL(css::uno::TypeClass_HYPER, t.getTypeClass()); 119 CPPUNIT_ASSERT_EQUAL( 120 ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("hyper")), t.getTypeName()); 121 t = ::cppu::UnoType< ::sal_uInt64 >::get(); 122 CPPUNIT_ASSERT_EQUAL(css::uno::TypeClass_UNSIGNED_HYPER, t.getTypeClass()); 123 CPPUNIT_ASSERT_EQUAL( 124 ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("unsigned hyper")), 125 t.getTypeName()); 126 t = ::cppu::UnoType< float >::get(); 127 CPPUNIT_ASSERT_EQUAL(css::uno::TypeClass_FLOAT, t.getTypeClass()); 128 CPPUNIT_ASSERT_EQUAL( 129 ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("float")), t.getTypeName()); 130 t = ::cppu::UnoType< double >::get(); 131 CPPUNIT_ASSERT_EQUAL(css::uno::TypeClass_DOUBLE, t.getTypeClass()); 132 CPPUNIT_ASSERT_EQUAL( 133 ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("double")), 134 t.getTypeName()); 135 t = ::cppu::UnoType< ::cppu::UnoCharType >::get(); 136 CPPUNIT_ASSERT_EQUAL(css::uno::TypeClass_CHAR, t.getTypeClass()); 137 CPPUNIT_ASSERT_EQUAL( 138 ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("char")), t.getTypeName()); 139 t = ::cppu::UnoType< ::rtl::OUString >::get(); 140 CPPUNIT_ASSERT_EQUAL(css::uno::TypeClass_STRING, t.getTypeClass()); 141 CPPUNIT_ASSERT_EQUAL( 142 ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("string")), 143 t.getTypeName()); 144 t = ::cppu::UnoType< css::uno::Type >::get(); 145 CPPUNIT_ASSERT_EQUAL(css::uno::TypeClass_TYPE, t.getTypeClass()); 146 CPPUNIT_ASSERT_EQUAL( 147 ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("type")), t.getTypeName()); 148 t = ::cppu::UnoType< css::uno::Any >::get(); 149 CPPUNIT_ASSERT_EQUAL(css::uno::TypeClass_ANY, t.getTypeClass()); 150 CPPUNIT_ASSERT_EQUAL( 151 ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("any")), t.getTypeName()); 152 t = ::cppu::UnoType< ::cppu::UnoSequenceType< ::sal_Int8 > >::get(); 153 CPPUNIT_ASSERT_EQUAL(css::uno::TypeClass_SEQUENCE, t.getTypeClass()); 154 CPPUNIT_ASSERT_EQUAL( 155 ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("[]byte")), 156 t.getTypeName()); 157 CPPUNIT_ASSERT( 158 ::cppu::UnoType< css::uno::Sequence< ::sal_Int8 > >::get() == t); 159 t = ::cppu::UnoType< 160 ::cppu::UnoSequenceType< ::cppu::UnoUnsignedShortType > >::get(); 161 CPPUNIT_ASSERT_EQUAL(css::uno::TypeClass_SEQUENCE, t.getTypeClass()); 162 CPPUNIT_ASSERT_EQUAL( 163 ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("[]unsigned short")), 164 t.getTypeName()); 165 t = ::cppu::UnoType< 166 ::cppu::UnoSequenceType< ::cppu::UnoCharType > >::get(); 167 CPPUNIT_ASSERT_EQUAL(css::uno::TypeClass_SEQUENCE, t.getTypeClass()); 168 CPPUNIT_ASSERT_EQUAL( 169 ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("[]char")), 170 t.getTypeName()); 171 t = ::cppu::UnoType< ::cppu::UnoSequenceType< ::cppu::UnoSequenceType< 172 ::sal_Int8 > > >::get(); 173 CPPUNIT_ASSERT_EQUAL(css::uno::TypeClass_SEQUENCE, t.getTypeClass()); 174 CPPUNIT_ASSERT_EQUAL( 175 ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("[][]byte")), 176 t.getTypeName()); 177 CPPUNIT_ASSERT( 178 ::cppu::UnoType< 179 css::uno::Sequence< css::uno::Sequence< ::sal_Int8 > > >::get() == t); 180 t = ::cppu::UnoType< ::cppu::UnoSequenceType< ::cppu::UnoSequenceType< 181 ::cppu::UnoUnsignedShortType > > >::get(); 182 CPPUNIT_ASSERT_EQUAL(css::uno::TypeClass_SEQUENCE, t.getTypeClass()); 183 CPPUNIT_ASSERT_EQUAL( 184 ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("[][]unsigned short")), 185 t.getTypeName()); 186 t = ::cppu::UnoType< ::cppu::UnoSequenceType< ::cppu::UnoSequenceType< 187 ::cppu::UnoCharType > > >::get(); 188 CPPUNIT_ASSERT_EQUAL(css::uno::TypeClass_SEQUENCE, t.getTypeClass()); 189 CPPUNIT_ASSERT_EQUAL( 190 ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("[][]char")), 191 t.getTypeName()); 192 t = ::cppu::UnoType< css::uno::TypeClass >::get(); 193 CPPUNIT_ASSERT_EQUAL(css::uno::TypeClass_ENUM, t.getTypeClass()); 194 CPPUNIT_ASSERT_EQUAL( 195 ::rtl::OUString( 196 RTL_CONSTASCII_USTRINGPARAM("com.sun.star.uno.TypeClass")), 197 t.getTypeName()); 198 t = ::cppu::UnoType< css::lang::EventObject >::get(); 199 CPPUNIT_ASSERT_EQUAL(css::uno::TypeClass_STRUCT, t.getTypeClass()); 200 CPPUNIT_ASSERT_EQUAL( 201 ::rtl::OUString( 202 RTL_CONSTASCII_USTRINGPARAM("com.sun.star.lang.EventObject")), 203 t.getTypeName()); 204 CPPUNIT_ASSERT(::cppu::UnoType< DerivedStruct1 >::get() == t); 205 t = ::cppu::UnoType< css::beans::PropertyChangeEvent >::get(); 206 CPPUNIT_ASSERT_EQUAL(css::uno::TypeClass_STRUCT, t.getTypeClass()); 207 CPPUNIT_ASSERT_EQUAL( 208 ::rtl::OUString( 209 RTL_CONSTASCII_USTRINGPARAM( 210 "com.sun.star.beans.PropertyChangeEvent")), 211 t.getTypeName()); 212 #if !(defined __SUNPRO_CC && __SUNPRO_CC <= 0x550) // erroneous ambiguity stated 213 CPPUNIT_ASSERT(::cppu::UnoType< DerivedStruct2 >::get() == t); 214 #endif 215 t = ::cppu::UnoType< css::beans::Optional< ::sal_Int8 > >::get(); 216 CPPUNIT_ASSERT_EQUAL(css::uno::TypeClass_STRUCT, t.getTypeClass()); 217 CPPUNIT_ASSERT_EQUAL( 218 ::rtl::OUString( 219 RTL_CONSTASCII_USTRINGPARAM("com.sun.star.beans.Optional<byte>")), 220 t.getTypeName()); 221 t = ::cppu::UnoType< css::uno::Exception >::get(); 222 CPPUNIT_ASSERT_EQUAL(css::uno::TypeClass_EXCEPTION, t.getTypeClass()); 223 CPPUNIT_ASSERT_EQUAL( 224 ::rtl::OUString( 225 RTL_CONSTASCII_USTRINGPARAM("com.sun.star.uno.Exception")), 226 t.getTypeName()); 227 CPPUNIT_ASSERT(::cppu::UnoType< DerivedException1 >::get() == t); 228 t = ::cppu::UnoType< css::uno::RuntimeException >::get(); 229 CPPUNIT_ASSERT_EQUAL(css::uno::TypeClass_EXCEPTION, t.getTypeClass()); 230 CPPUNIT_ASSERT_EQUAL( 231 ::rtl::OUString( 232 RTL_CONSTASCII_USTRINGPARAM("com.sun.star.uno.RuntimeException")), 233 t.getTypeName()); 234 #if !(defined __SUNPRO_CC && __SUNPRO_CC <= 0x550) // erroneous ambiguity stated 235 CPPUNIT_ASSERT(::cppu::UnoType< DerivedException2 >::get() == t); 236 #endif 237 t = ::cppu::UnoType< css::uno::XInterface >::get(); 238 CPPUNIT_ASSERT_EQUAL(css::uno::TypeClass_INTERFACE, t.getTypeClass()); 239 CPPUNIT_ASSERT_EQUAL( 240 ::rtl::OUString( 241 RTL_CONSTASCII_USTRINGPARAM("com.sun.star.uno.XInterface")), 242 t.getTypeName()); 243 CPPUNIT_ASSERT( 244 ::cppu::UnoType< css::uno::Reference< css::uno::XInterface > >::get() == 245 t); 246 CPPUNIT_ASSERT(::cppu::UnoType< DerivedInterface1 >::get() == t); 247 CPPUNIT_ASSERT( 248 ::cppu::UnoType< css::uno::Reference< DerivedInterface1 > >::get() == 249 t); 250 t = ::cppu::UnoType< css::uno::XComponentContext >::get(); 251 CPPUNIT_ASSERT_EQUAL(css::uno::TypeClass_INTERFACE, t.getTypeClass()); 252 CPPUNIT_ASSERT_EQUAL( 253 ::rtl::OUString( 254 RTL_CONSTASCII_USTRINGPARAM("com.sun.star.uno.XComponentContext")), 255 t.getTypeName()); 256 CPPUNIT_ASSERT( 257 ::cppu::UnoType< 258 css::uno::Reference< css::uno::XComponentContext > >::get() == t); 259 #if !(defined __SUNPRO_CC && __SUNPRO_CC <= 0x550) // erroneous ambiguity stated 260 CPPUNIT_ASSERT(::cppu::UnoType< DerivedInterface2 >::get() == t); 261 CPPUNIT_ASSERT( 262 ::cppu::UnoType< css::uno::Reference< DerivedInterface2 > >::get() == 263 t); 264 #endif 265 } 266 267 void Test::testGetTypeFavourUnsigned() { 268 CPPUNIT_ASSERT(typeid(::sal_Unicode) == typeid(::sal_uInt16)); 269 CPPUNIT_ASSERT( 270 ::getCppuType(static_cast< ::sal_Unicode * >(0)) == 271 ::getCppuType(static_cast< ::sal_uInt16 * >(0))); 272 CPPUNIT_ASSERT( 273 ::cppu::getTypeFavourUnsigned( 274 static_cast< ::cppu::UnoVoidType * >(0)) == 275 ::cppu::UnoType< ::cppu::UnoVoidType >::get()); 276 CPPUNIT_ASSERT( 277 ::cppu::getTypeFavourUnsigned(static_cast< bool * >(0)) == 278 ::cppu::UnoType< bool >::get()); 279 CPPUNIT_ASSERT( 280 ::cppu::getTypeFavourUnsigned(static_cast< bool * >(0)) == 281 ::getCppuType(static_cast< bool * >(0))); 282 CPPUNIT_ASSERT( 283 ::cppu::getTypeFavourUnsigned(static_cast< ::sal_Bool * >(0)) == 284 ::cppu::UnoType< bool >::get()); 285 CPPUNIT_ASSERT( 286 ::cppu::getTypeFavourUnsigned(static_cast< ::sal_Bool * >(0)) == 287 ::getCppuType(static_cast< ::sal_Bool * >(0))); 288 CPPUNIT_ASSERT( 289 ::cppu::getTypeFavourUnsigned(static_cast< ::sal_Int8 * >(0)) == 290 ::cppu::UnoType< ::sal_Int8 >::get()); 291 CPPUNIT_ASSERT( 292 ::cppu::getTypeFavourUnsigned(static_cast< ::sal_Int8 * >(0)) == 293 ::getCppuType(static_cast< ::sal_Int8 * >(0))); 294 CPPUNIT_ASSERT( 295 ::cppu::getTypeFavourUnsigned(static_cast< ::sal_Int16 * >(0)) == 296 ::cppu::UnoType< ::sal_Int16 >::get()); 297 CPPUNIT_ASSERT( 298 ::cppu::getTypeFavourUnsigned(static_cast< ::sal_Int16 * >(0)) == 299 ::getCppuType(static_cast< ::sal_Int16 * >(0))); 300 CPPUNIT_ASSERT( 301 ::cppu::getTypeFavourUnsigned( 302 static_cast< ::cppu::UnoUnsignedShortType * >(0)) == 303 ::cppu::UnoType< ::cppu::UnoUnsignedShortType >::get()); 304 CPPUNIT_ASSERT( 305 ::cppu::getTypeFavourUnsigned(static_cast< ::sal_uInt16 * >(0)) == 306 ::cppu::UnoType< ::cppu::UnoUnsignedShortType >::get()); 307 CPPUNIT_ASSERT( 308 ::cppu::getTypeFavourUnsigned(static_cast< ::sal_uInt16 * >(0)) == 309 ::getCppuType(static_cast< ::sal_uInt16 * >(0))); 310 CPPUNIT_ASSERT( 311 ::cppu::getTypeFavourUnsigned(static_cast< ::sal_Int32 * >(0)) == 312 ::cppu::UnoType< ::sal_Int32 >::get()); 313 CPPUNIT_ASSERT( 314 ::cppu::getTypeFavourUnsigned(static_cast< ::sal_Int32 * >(0)) == 315 ::getCppuType(static_cast< ::sal_Int32 * >(0))); 316 CPPUNIT_ASSERT( 317 ::cppu::getTypeFavourUnsigned(static_cast< ::sal_uInt32 * >(0)) == 318 ::cppu::UnoType< ::sal_uInt32 >::get()); 319 CPPUNIT_ASSERT( 320 ::cppu::getTypeFavourUnsigned(static_cast< ::sal_uInt32 * >(0)) == 321 ::getCppuType(static_cast< ::sal_uInt32 * >(0))); 322 CPPUNIT_ASSERT( 323 ::cppu::getTypeFavourUnsigned(static_cast< ::sal_Int64 * >(0)) == 324 ::cppu::UnoType< ::sal_Int64 >::get()); 325 CPPUNIT_ASSERT( 326 ::cppu::getTypeFavourUnsigned(static_cast< ::sal_Int64 * >(0)) == 327 ::getCppuType(static_cast< ::sal_Int64 * >(0))); 328 CPPUNIT_ASSERT( 329 ::cppu::getTypeFavourUnsigned(static_cast< ::sal_uInt64 * >(0)) == 330 ::cppu::UnoType< ::sal_uInt64 >::get()); 331 CPPUNIT_ASSERT( 332 ::cppu::getTypeFavourUnsigned(static_cast< ::sal_uInt64 * >(0)) == 333 ::getCppuType(static_cast< ::sal_uInt64 * >(0))); 334 CPPUNIT_ASSERT( 335 ::cppu::getTypeFavourUnsigned(static_cast< float * >(0)) == 336 ::cppu::UnoType< float >::get()); 337 CPPUNIT_ASSERT( 338 ::cppu::getTypeFavourUnsigned(static_cast< float * >(0)) == 339 ::getCppuType(static_cast< float * >(0))); 340 CPPUNIT_ASSERT( 341 ::cppu::getTypeFavourUnsigned(static_cast< double * >(0)) == 342 ::cppu::UnoType< double >::get()); 343 CPPUNIT_ASSERT( 344 ::cppu::getTypeFavourUnsigned(static_cast< double * >(0)) == 345 ::getCppuType(static_cast< double * >(0))); 346 CPPUNIT_ASSERT( 347 ::cppu::getTypeFavourUnsigned( 348 static_cast< ::cppu::UnoCharType * >(0)) == 349 ::cppu::UnoType< ::cppu::UnoCharType >::get()); 350 CPPUNIT_ASSERT( 351 ::cppu::getTypeFavourUnsigned(static_cast< ::sal_Unicode * >(0)) == 352 ::cppu::UnoType< ::cppu::UnoUnsignedShortType >::get()); 353 CPPUNIT_ASSERT( 354 ::cppu::getTypeFavourUnsigned(static_cast< ::sal_Unicode * >(0)) == 355 ::getCppuType(static_cast< ::sal_Unicode * >(0))); 356 CPPUNIT_ASSERT( 357 ::cppu::getTypeFavourUnsigned(static_cast< ::rtl::OUString * >(0)) == 358 ::cppu::UnoType< ::rtl::OUString >::get()); 359 CPPUNIT_ASSERT( 360 ::cppu::getTypeFavourUnsigned(static_cast< ::rtl::OUString * >(0)) == 361 ::getCppuType(static_cast< ::rtl::OUString * >(0))); 362 CPPUNIT_ASSERT( 363 ::cppu::getTypeFavourUnsigned(static_cast< css::uno::Type * >(0)) == 364 ::cppu::UnoType< css::uno::Type >::get()); 365 CPPUNIT_ASSERT( 366 ::cppu::getTypeFavourUnsigned(static_cast< css::uno::Type * >(0)) == 367 ::getCppuType(static_cast< css::uno::Type * >(0))); 368 CPPUNIT_ASSERT( 369 ::cppu::getTypeFavourUnsigned(static_cast< css::uno::Any * >(0)) == 370 ::cppu::UnoType< css::uno::Any >::get()); 371 CPPUNIT_ASSERT( 372 ::cppu::getTypeFavourUnsigned(static_cast< css::uno::Any * >(0)) == 373 ::getCppuType(static_cast< css::uno::Any * >(0))); 374 CPPUNIT_ASSERT( 375 ::cppu::getTypeFavourUnsigned( 376 static_cast< 377 ::cppu::UnoSequenceType< ::cppu::UnoUnsignedShortType > * >(0)) == 378 ::cppu::UnoType< 379 ::cppu::UnoSequenceType< ::cppu::UnoUnsignedShortType > >::get()); 380 CPPUNIT_ASSERT( 381 ::cppu::getTypeFavourUnsigned( 382 static_cast< css::uno::Sequence< ::sal_uInt16 > * >(0)) == 383 ::cppu::UnoType< 384 ::cppu::UnoSequenceType< ::cppu::UnoUnsignedShortType > >::get()); 385 CPPUNIT_ASSERT( 386 ::cppu::getTypeFavourUnsigned( 387 static_cast< css::uno::Sequence< ::sal_uInt16 > * >(0)) == 388 ::getCppuType(static_cast< css::uno::Sequence< ::sal_uInt16 > * >(0))); 389 CPPUNIT_ASSERT( 390 ::cppu::getTypeFavourUnsigned( 391 static_cast< ::cppu::UnoSequenceType< ::cppu::UnoSequenceType< 392 ::cppu::UnoUnsignedShortType > > * >(0)) == 393 ::cppu::UnoType< ::cppu::UnoSequenceType< ::cppu::UnoSequenceType< 394 ::cppu::UnoUnsignedShortType > > >::get()); 395 CPPUNIT_ASSERT( 396 ::cppu::getTypeFavourUnsigned( 397 static_cast< css::uno::Sequence< css::uno::Sequence< 398 ::sal_uInt16 > > * >(0)) == 399 ::cppu::UnoType< ::cppu::UnoSequenceType< ::cppu::UnoSequenceType< 400 ::cppu::UnoUnsignedShortType > > >::get()); 401 CPPUNIT_ASSERT( 402 ::cppu::getTypeFavourUnsigned( 403 static_cast< css::uno::Sequence< css::uno::Sequence< 404 ::sal_uInt16 > > * >(0)) == 405 ::getCppuType( 406 static_cast< css::uno::Sequence< css::uno::Sequence< 407 ::sal_uInt16 > > * >(0))); 408 CPPUNIT_ASSERT( 409 ::cppu::getTypeFavourUnsigned( 410 static_cast< css::uno::Sequence< ::sal_Unicode > * >(0)) == 411 ::cppu::UnoType< 412 ::cppu::UnoSequenceType< ::cppu::UnoUnsignedShortType > >::get()); 413 CPPUNIT_ASSERT( 414 ::cppu::getTypeFavourUnsigned( 415 static_cast< css::uno::Sequence< ::sal_Unicode > * >(0)) == 416 ::getCppuType(static_cast< css::uno::Sequence< ::sal_Unicode > * >(0))); 417 CPPUNIT_ASSERT( 418 ::cppu::getTypeFavourUnsigned( 419 static_cast< css::uno::Sequence< css::uno::Sequence< 420 ::sal_Unicode > > * >(0)) == 421 ::cppu::UnoType< ::cppu::UnoSequenceType< ::cppu::UnoSequenceType< 422 ::cppu::UnoUnsignedShortType > > >::get()); 423 CPPUNIT_ASSERT( 424 ::cppu::getTypeFavourUnsigned( 425 static_cast< css::uno::Sequence< css::uno::Sequence< 426 ::sal_Unicode > > * >(0)) == 427 ::getCppuType( 428 static_cast< css::uno::Sequence< css::uno::Sequence< 429 ::sal_Unicode > > * >(0))); 430 CPPUNIT_ASSERT( 431 ::cppu::getTypeFavourUnsigned( 432 static_cast< css::uno::TypeClass * >(0)) == 433 ::cppu::UnoType< css::uno::TypeClass >::get()); 434 CPPUNIT_ASSERT( 435 ::cppu::getTypeFavourUnsigned( 436 static_cast< css::uno::TypeClass * >(0)) == 437 ::getCppuType(static_cast< css::uno::TypeClass * >(0))); 438 CPPUNIT_ASSERT( 439 ::cppu::getTypeFavourUnsigned( 440 static_cast< css::lang::EventObject * >(0)) == 441 ::cppu::UnoType< css::lang::EventObject >::get()); 442 CPPUNIT_ASSERT( 443 ::cppu::getTypeFavourUnsigned( 444 static_cast< css::lang::EventObject * >(0)) == 445 ::getCppuType(static_cast< css::lang::EventObject * >(0))); 446 CPPUNIT_ASSERT( 447 ::cppu::getTypeFavourUnsigned(static_cast< DerivedStruct1 * >(0)) == 448 ::cppu::UnoType< css::lang::EventObject >::get()); 449 CPPUNIT_ASSERT( 450 ::cppu::getTypeFavourUnsigned(static_cast< DerivedStruct1 * >(0)) == 451 ::getCppuType(static_cast< DerivedStruct1 * >(0))); 452 CPPUNIT_ASSERT( 453 ::cppu::getTypeFavourUnsigned( 454 static_cast< css::beans::PropertyChangeEvent * >(0)) == 455 ::cppu::UnoType< css::beans::PropertyChangeEvent >::get()); 456 CPPUNIT_ASSERT( 457 ::cppu::getTypeFavourUnsigned( 458 static_cast< css::beans::PropertyChangeEvent * >(0)) == 459 ::getCppuType(static_cast< css::beans::PropertyChangeEvent * >(0))); 460 #if !(defined __SUNPRO_CC && __SUNPRO_CC <= 0x550) // erroneous ambiguity stated 461 CPPUNIT_ASSERT( 462 ::cppu::getTypeFavourUnsigned(static_cast< DerivedStruct2 * >(0)) == 463 ::cppu::UnoType< css::beans::PropertyChangeEvent >::get()); 464 CPPUNIT_ASSERT( 465 ::cppu::getTypeFavourUnsigned(static_cast< DerivedStruct2 * >(0)) == 466 ::getCppuType(static_cast< DerivedStruct2 * >(0))); 467 #endif 468 CPPUNIT_ASSERT( 469 ::cppu::getTypeFavourUnsigned( 470 static_cast< css::beans::Optional< ::sal_Int8 > * >(0)) == 471 ::cppu::UnoType< css::beans::Optional< ::sal_Int8 > >::get()); 472 CPPUNIT_ASSERT( 473 ::cppu::getTypeFavourUnsigned( 474 static_cast< css::beans::Optional< ::sal_Int8 > * >(0)) == 475 ::getCppuType(static_cast< css::beans::Optional< ::sal_Int8 > * >(0))); 476 CPPUNIT_ASSERT( 477 ::cppu::getTypeFavourUnsigned( 478 static_cast< css::uno::Exception * >(0)) == 479 ::cppu::UnoType< css::uno::Exception >::get()); 480 CPPUNIT_ASSERT( 481 ::cppu::getTypeFavourUnsigned( 482 static_cast< css::uno::Exception * >(0)) == 483 ::getCppuType(static_cast< css::uno::Exception * >(0))); 484 CPPUNIT_ASSERT( 485 ::cppu::getTypeFavourUnsigned(static_cast< DerivedException1 * >(0)) == 486 ::cppu::UnoType< css::uno::Exception >::get()); 487 CPPUNIT_ASSERT( 488 ::cppu::getTypeFavourUnsigned(static_cast< DerivedException1 * >(0)) == 489 ::getCppuType(static_cast< DerivedException1 * >(0))); 490 CPPUNIT_ASSERT( 491 ::cppu::getTypeFavourUnsigned( 492 static_cast< css::uno::RuntimeException * >(0)) == 493 ::cppu::UnoType< css::uno::RuntimeException >::get()); 494 CPPUNIT_ASSERT( 495 ::cppu::getTypeFavourUnsigned( 496 static_cast< css::uno::RuntimeException * >(0)) == 497 ::getCppuType(static_cast< css::uno::RuntimeException * >(0))); 498 #if !(defined __SUNPRO_CC && __SUNPRO_CC <= 0x550) // erroneous ambiguity stated 499 CPPUNIT_ASSERT( 500 ::cppu::getTypeFavourUnsigned(static_cast< DerivedException2 * >(0)) == 501 ::cppu::UnoType< css::uno::RuntimeException >::get()); 502 CPPUNIT_ASSERT( 503 ::cppu::getTypeFavourUnsigned(static_cast< DerivedException2 * >(0)) == 504 ::getCppuType(static_cast< DerivedException2 * >(0))); 505 #endif 506 CPPUNIT_ASSERT( 507 ::cppu::getTypeFavourUnsigned( 508 static_cast< css::uno::XInterface * >(0)) == 509 ::cppu::UnoType< css::uno::XInterface >::get()); 510 CPPUNIT_ASSERT( 511 ::cppu::getTypeFavourUnsigned( 512 static_cast< css::uno::Reference< css::uno::XInterface > * >(0)) == 513 ::cppu::UnoType< css::uno::XInterface >::get()); 514 CPPUNIT_ASSERT( 515 ::cppu::getTypeFavourUnsigned( 516 static_cast< css::uno::Reference< css::uno::XInterface > * >(0)) == 517 ::getCppuType( 518 static_cast< css::uno::Reference< css::uno::XInterface > * >(0))); 519 CPPUNIT_ASSERT( 520 ::cppu::getTypeFavourUnsigned(static_cast< DerivedInterface1 * >(0)) == 521 ::cppu::UnoType< css::uno::XInterface >::get()); 522 CPPUNIT_ASSERT( 523 ::cppu::getTypeFavourUnsigned( 524 static_cast< css::uno::Reference< DerivedInterface1 > * >(0)) == 525 ::cppu::UnoType< css::uno::XInterface >::get()); 526 CPPUNIT_ASSERT( 527 ::cppu::getTypeFavourUnsigned( 528 static_cast< css::uno::XComponentContext * >(0)) == 529 ::cppu::UnoType< css::uno::XComponentContext >::get()); 530 CPPUNIT_ASSERT( 531 ::cppu::getTypeFavourUnsigned( 532 static_cast< 533 css::uno::Reference< css::uno::XComponentContext > * >(0)) == 534 ::cppu::UnoType< css::uno::XComponentContext >::get()); 535 CPPUNIT_ASSERT( 536 ::cppu::getTypeFavourUnsigned( 537 static_cast< 538 css::uno::Reference< css::uno::XComponentContext > * >(0)) == 539 ::getCppuType( 540 static_cast< 541 css::uno::Reference< css::uno::XComponentContext > * >(0))); 542 #if !(defined __SUNPRO_CC && __SUNPRO_CC <= 0x550) // erroneous ambiguity stated 543 CPPUNIT_ASSERT( 544 ::cppu::getTypeFavourUnsigned(static_cast< DerivedInterface2 * >(0)) == 545 ::cppu::UnoType< css::uno::XComponentContext >::get()); 546 CPPUNIT_ASSERT( 547 ::cppu::getTypeFavourUnsigned( 548 static_cast< css::uno::Reference< DerivedInterface2 > * >(0)) == 549 ::cppu::UnoType< css::uno::XComponentContext >::get()); 550 #endif 551 } 552 553 void Test::testGetTypeFavourChar() { 554 CPPUNIT_ASSERT(typeid(::sal_Unicode) == typeid(::sal_uInt16)); 555 CPPUNIT_ASSERT( 556 ::getCppuType< ::sal_Unicode >() == ::getCppuType< ::sal_uInt16 >()); 557 CPPUNIT_ASSERT( 558 ::cppu::getTypeFavourChar(static_cast< ::cppu::UnoVoidType * >(0)) == 559 ::cppu::UnoType< ::cppu::UnoVoidType >::get()); 560 CPPUNIT_ASSERT( 561 ::cppu::getTypeFavourChar(static_cast< bool * >(0)) == 562 ::cppu::UnoType< bool >::get()); 563 CPPUNIT_ASSERT( 564 ::cppu::getTypeFavourChar(static_cast< bool * >(0)) == 565 ::getCppuType< bool >()); 566 CPPUNIT_ASSERT( 567 ::cppu::getTypeFavourChar(static_cast< ::sal_Bool * >(0)) == 568 ::cppu::UnoType< bool >::get()); 569 CPPUNIT_ASSERT( 570 ::cppu::getTypeFavourChar(static_cast< ::sal_Bool * >(0)) == 571 ::getCppuType< ::sal_Bool >()); 572 CPPUNIT_ASSERT( 573 ::cppu::getTypeFavourChar(static_cast< ::sal_Int8 * >(0)) == 574 ::cppu::UnoType< ::sal_Int8 >::get()); 575 CPPUNIT_ASSERT( 576 ::cppu::getTypeFavourChar(static_cast< ::sal_Int8 * >(0)) == 577 ::getCppuType< ::sal_Int8 >()); 578 CPPUNIT_ASSERT( 579 ::cppu::getTypeFavourChar(static_cast< ::sal_Int16 * >(0)) == 580 ::cppu::UnoType< ::sal_Int16 >::get()); 581 CPPUNIT_ASSERT( 582 ::cppu::getTypeFavourChar(static_cast< ::sal_Int16 * >(0)) == 583 ::getCppuType< ::sal_Int16 >()); 584 CPPUNIT_ASSERT( 585 ::cppu::getTypeFavourChar( 586 static_cast< ::cppu::UnoUnsignedShortType * >(0)) == 587 ::cppu::UnoType< ::cppu::UnoUnsignedShortType >::get()); 588 CPPUNIT_ASSERT( 589 ::cppu::getTypeFavourChar(static_cast< ::sal_uInt16 * >(0)) == 590 ::cppu::UnoType< ::cppu::UnoCharType >::get()); 591 CPPUNIT_ASSERT( 592 ::cppu::getTypeFavourChar(static_cast< ::sal_Int32 * >(0)) == 593 ::cppu::UnoType< ::sal_Int32 >::get()); 594 CPPUNIT_ASSERT( 595 ::cppu::getTypeFavourChar(static_cast< ::sal_Int32 * >(0)) == 596 ::getCppuType< ::sal_Int32 >()); 597 CPPUNIT_ASSERT( 598 ::cppu::getTypeFavourChar(static_cast< ::sal_uInt32 * >(0)) == 599 ::cppu::UnoType< ::sal_uInt32 >::get()); 600 CPPUNIT_ASSERT( 601 ::cppu::getTypeFavourChar(static_cast< ::sal_uInt32 * >(0)) == 602 ::getCppuType< ::sal_uInt32 >()); 603 CPPUNIT_ASSERT( 604 ::cppu::getTypeFavourChar(static_cast< ::sal_Int64 * >(0)) == 605 ::cppu::UnoType< ::sal_Int64 >::get()); 606 CPPUNIT_ASSERT( 607 ::cppu::getTypeFavourChar(static_cast< ::sal_Int64 * >(0)) == 608 ::getCppuType< ::sal_Int64 >()); 609 CPPUNIT_ASSERT( 610 ::cppu::getTypeFavourChar(static_cast< ::sal_uInt64 * >(0)) == 611 ::cppu::UnoType< ::sal_uInt64 >::get()); 612 CPPUNIT_ASSERT( 613 ::cppu::getTypeFavourChar(static_cast< ::sal_uInt64 * >(0)) == 614 ::getCppuType< ::sal_uInt64 >()); 615 CPPUNIT_ASSERT( 616 ::cppu::getTypeFavourChar(static_cast< float * >(0)) == 617 ::cppu::UnoType< float >::get()); 618 CPPUNIT_ASSERT( 619 ::cppu::getTypeFavourChar(static_cast< float * >(0)) == 620 ::getCppuType< float >()); 621 CPPUNIT_ASSERT( 622 ::cppu::getTypeFavourChar(static_cast< double * >(0)) == 623 ::cppu::UnoType< double >::get()); 624 CPPUNIT_ASSERT( 625 ::cppu::getTypeFavourChar(static_cast< double * >(0)) == 626 ::getCppuType< double >()); 627 CPPUNIT_ASSERT( 628 ::cppu::getTypeFavourChar(static_cast< ::cppu::UnoCharType * >(0)) == 629 ::cppu::UnoType< ::cppu::UnoCharType >::get()); 630 CPPUNIT_ASSERT( 631 ::cppu::getTypeFavourChar(static_cast< ::sal_Unicode * >(0)) == 632 ::cppu::UnoType< ::cppu::UnoCharType >::get()); 633 CPPUNIT_ASSERT( 634 ::cppu::getTypeFavourChar(static_cast< ::sal_Unicode * >(0)) == 635 ::getCppuType< ::sal_Unicode >()); 636 CPPUNIT_ASSERT( 637 ::cppu::getTypeFavourChar(static_cast< ::rtl::OUString * >(0)) == 638 ::cppu::UnoType< ::rtl::OUString >::get()); 639 CPPUNIT_ASSERT( 640 ::cppu::getTypeFavourChar(static_cast< ::rtl::OUString * >(0)) == 641 ::getCppuType< ::rtl::OUString >()); 642 CPPUNIT_ASSERT( 643 ::cppu::getTypeFavourChar(static_cast< css::uno::Type * >(0)) == 644 ::cppu::UnoType< css::uno::Type >::get()); 645 CPPUNIT_ASSERT( 646 ::cppu::getTypeFavourChar(static_cast< css::uno::Type * >(0)) == 647 ::getCppuType< css::uno::Type >()); 648 CPPUNIT_ASSERT( 649 ::cppu::getTypeFavourChar(static_cast< css::uno::Any * >(0)) == 650 ::cppu::UnoType< css::uno::Any >::get()); 651 CPPUNIT_ASSERT( 652 ::cppu::getTypeFavourChar(static_cast< css::uno::Any * >(0)) == 653 ::getCppuType< css::uno::Any >()); 654 CPPUNIT_ASSERT( 655 ::cppu::getTypeFavourChar( 656 static_cast< 657 ::cppu::UnoSequenceType< ::cppu::UnoUnsignedShortType > * >(0)) == 658 ::cppu::UnoType< 659 ::cppu::UnoSequenceType< ::cppu::UnoUnsignedShortType > >::get()); 660 CPPUNIT_ASSERT( 661 ::cppu::getTypeFavourChar( 662 static_cast< css::uno::Sequence< ::sal_uInt16 > * >(0)) == 663 ::cppu::UnoType< 664 ::cppu::UnoSequenceType< ::cppu::UnoCharType > >::get()); 665 CPPUNIT_ASSERT( 666 ::cppu::getTypeFavourChar( 667 static_cast< ::cppu::UnoSequenceType< ::cppu::UnoSequenceType< 668 ::cppu::UnoUnsignedShortType > > * >(0)) == 669 ::cppu::UnoType< ::cppu::UnoSequenceType< ::cppu::UnoSequenceType< 670 ::cppu::UnoUnsignedShortType > > >::get()); 671 CPPUNIT_ASSERT( 672 ::cppu::getTypeFavourChar( 673 static_cast< css::uno::Sequence< css::uno::Sequence< 674 ::sal_uInt16 > > * >(0)) == 675 ::cppu::UnoType< ::cppu::UnoSequenceType< ::cppu::UnoSequenceType< 676 ::cppu::UnoCharType > > >::get()); 677 CPPUNIT_ASSERT( 678 ::cppu::getTypeFavourChar( 679 static_cast< css::uno::Sequence< ::sal_Unicode > * >(0)) == 680 ::cppu::UnoType< 681 ::cppu::UnoSequenceType< ::cppu::UnoCharType > >::get()); 682 CPPUNIT_ASSERT( 683 ::cppu::getTypeFavourChar( 684 static_cast< css::uno::Sequence< css::uno::Sequence< 685 ::sal_Unicode > > * >(0)) == 686 ::cppu::UnoType< ::cppu::UnoSequenceType< ::cppu::UnoSequenceType< 687 ::cppu::UnoCharType > > >::get()); 688 CPPUNIT_ASSERT( 689 ::cppu::getTypeFavourChar(static_cast< css::uno::TypeClass * >(0)) == 690 ::cppu::UnoType< css::uno::TypeClass >::get()); 691 CPPUNIT_ASSERT( 692 ::cppu::getTypeFavourChar(static_cast< css::uno::TypeClass * >(0)) == 693 ::getCppuType< css::uno::TypeClass >()); 694 CPPUNIT_ASSERT( 695 ::cppu::getTypeFavourChar( 696 static_cast< css::lang::EventObject * >(0)) == 697 ::cppu::UnoType< css::lang::EventObject >::get()); 698 CPPUNIT_ASSERT( 699 ::cppu::getTypeFavourChar( 700 static_cast< css::lang::EventObject * >(0)) == 701 ::getCppuType< css::lang::EventObject >()); 702 CPPUNIT_ASSERT( 703 ::cppu::getTypeFavourChar(static_cast< DerivedStruct1 * >(0)) == 704 ::cppu::UnoType< css::lang::EventObject >::get()); 705 CPPUNIT_ASSERT( 706 ::cppu::getTypeFavourChar(static_cast< DerivedStruct1 * >(0)) == 707 ::getCppuType< DerivedStruct1 >()); 708 CPPUNIT_ASSERT( 709 ::cppu::getTypeFavourChar( 710 static_cast< css::beans::PropertyChangeEvent * >(0)) == 711 ::cppu::UnoType< css::beans::PropertyChangeEvent >::get()); 712 CPPUNIT_ASSERT( 713 ::cppu::getTypeFavourChar( 714 static_cast< css::beans::PropertyChangeEvent * >(0)) == 715 ::getCppuType< css::beans::PropertyChangeEvent >()); 716 #if !(defined __SUNPRO_CC && __SUNPRO_CC <= 0x550) // erroneous ambiguity stated 717 CPPUNIT_ASSERT( 718 ::cppu::getTypeFavourChar(static_cast< DerivedStruct2 * >(0)) == 719 ::cppu::UnoType< css::beans::PropertyChangeEvent >::get()); 720 CPPUNIT_ASSERT( 721 ::cppu::getTypeFavourChar(static_cast< DerivedStruct2 * >(0)) == 722 ::getCppuType< DerivedStruct2 >()); 723 #endif 724 CPPUNIT_ASSERT( 725 ::cppu::getTypeFavourChar( 726 static_cast< css::beans::Optional< ::sal_Int8 > * >(0)) == 727 ::cppu::UnoType< css::beans::Optional< ::sal_Int8 > >::get()); 728 CPPUNIT_ASSERT( 729 ::cppu::getTypeFavourChar( 730 static_cast< css::beans::Optional< ::sal_Int8 > * >(0)) == 731 ::getCppuType< css::beans::Optional< ::sal_Int8 > >()); 732 CPPUNIT_ASSERT( 733 ::cppu::getTypeFavourChar(static_cast< css::uno::Exception * >(0)) == 734 ::cppu::UnoType< css::uno::Exception >::get()); 735 CPPUNIT_ASSERT( 736 ::cppu::getTypeFavourChar(static_cast< css::uno::Exception * >(0)) == 737 ::getCppuType< css::uno::Exception >()); 738 CPPUNIT_ASSERT( 739 ::cppu::getTypeFavourChar(static_cast< DerivedException1 * >(0)) == 740 ::cppu::UnoType< css::uno::Exception >::get()); 741 CPPUNIT_ASSERT( 742 ::cppu::getTypeFavourChar(static_cast< DerivedException1 * >(0)) == 743 ::getCppuType< DerivedException1 >()); 744 CPPUNIT_ASSERT( 745 ::cppu::getTypeFavourChar( 746 static_cast< css::uno::RuntimeException * >(0)) == 747 ::cppu::UnoType< css::uno::RuntimeException >::get()); 748 CPPUNIT_ASSERT( 749 ::cppu::getTypeFavourChar( 750 static_cast< css::uno::RuntimeException * >(0)) == 751 ::getCppuType< css::uno::RuntimeException >()); 752 #if !(defined __SUNPRO_CC && __SUNPRO_CC <= 0x550) // erroneous ambiguity stated 753 CPPUNIT_ASSERT( 754 ::cppu::getTypeFavourChar(static_cast< DerivedException2 * >(0)) == 755 ::cppu::UnoType< css::uno::RuntimeException >::get()); 756 CPPUNIT_ASSERT( 757 ::cppu::getTypeFavourChar(static_cast< DerivedException2 * >(0)) == 758 ::getCppuType< DerivedException2 >()); 759 #endif 760 CPPUNIT_ASSERT( 761 ::cppu::getTypeFavourChar( 762 static_cast< css::uno::XInterface * >(0)) == 763 ::cppu::UnoType< css::uno::XInterface >::get()); 764 CPPUNIT_ASSERT( 765 ::cppu::getTypeFavourChar( 766 static_cast< css::uno::Reference< css::uno::XInterface > * >(0)) == 767 ::cppu::UnoType< css::uno::XInterface >::get()); 768 CPPUNIT_ASSERT( 769 ::cppu::getTypeFavourChar( 770 static_cast< css::uno::Reference< css::uno::XInterface > * >(0)) == 771 ::getCppuType< css::uno::Reference< css::uno::XInterface > >()); 772 CPPUNIT_ASSERT( 773 ::cppu::getTypeFavourChar(static_cast< DerivedInterface1 * >(0)) == 774 ::cppu::UnoType< css::uno::XInterface >::get()); 775 CPPUNIT_ASSERT( 776 ::cppu::getTypeFavourChar( 777 static_cast< css::uno::Reference< DerivedInterface1 > * >(0)) == 778 ::cppu::UnoType< css::uno::XInterface >::get()); 779 CPPUNIT_ASSERT( 780 ::cppu::getTypeFavourChar( 781 static_cast< css::uno::XComponentContext * >(0)) == 782 ::cppu::UnoType< css::uno::XComponentContext >::get()); 783 CPPUNIT_ASSERT( 784 ::cppu::getTypeFavourChar( 785 static_cast< 786 css::uno::Reference< css::uno::XComponentContext > * >(0)) == 787 ::cppu::UnoType< css::uno::XComponentContext >::get()); 788 CPPUNIT_ASSERT( 789 ::cppu::getTypeFavourChar( 790 static_cast< 791 css::uno::Reference< css::uno::XComponentContext > * >(0)) == 792 ::getCppuType< css::uno::Reference< css::uno::XComponentContext > >()); 793 #if !(defined __SUNPRO_CC && __SUNPRO_CC <= 0x550) // erroneous ambiguity stated 794 CPPUNIT_ASSERT( 795 ::cppu::getTypeFavourChar(static_cast< DerivedInterface2 * >(0)) == 796 ::cppu::UnoType< css::uno::XComponentContext >::get()); 797 CPPUNIT_ASSERT( 798 ::cppu::getTypeFavourChar( 799 static_cast< css::uno::Reference< DerivedInterface2 > * >(0)) == 800 ::cppu::UnoType< css::uno::XComponentContext >::get()); 801 #endif 802 } 803 804 CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(Test, "alltests"); 805 806 } 807 808 NOADDITIONAL; 809