Version 3.6.0.2, tag libreoffice-3.6.0.2
[LibreOffice.git] / cppu / qa / test_unotype.cxx
blob546200ac71985e2376bd6e620d9bb2ceaed3263f
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
29 #include "sal/config.h"
30 #include "sal/precppunit.hxx"
32 #ifdef IOS
33 #define CPPUNIT_PLUGIN_EXPORTED_NAME cppunitTest_qa_cppu_unotype
34 #endif
36 #include <cppunit/TestSuite.h>
37 #include <cppunit/TestFixture.h>
38 #include <cppunit/TestCase.h>
39 #include <cppunit/plugin/TestPlugIn.h>
40 #include <cppunit/extensions/HelperMacros.h>
42 #include <typeinfo>
44 #include "com/sun/star/beans/Optional.hpp"
45 #include "com/sun/star/beans/PropertyChangeEvent.hpp"
46 #include "com/sun/star/lang/EventObject.hpp"
47 #include "com/sun/star/uno/Exception.hpp"
48 #include "com/sun/star/uno/Reference.hxx"
49 #include "com/sun/star/uno/RuntimeException.hpp"
50 #include "com/sun/star/uno/Sequence.hxx"
51 #include "com/sun/star/uno/Type.hxx"
52 #include "com/sun/star/uno/TypeClass.hpp"
53 #include "com/sun/star/uno/XComponentContext.hpp"
54 #include "com/sun/star/uno/XInterface.hpp"
55 #include "cppu/unotype.hxx"
56 #include "rtl/oustringostreaminserter.hxx"
57 #include "rtl/ustring.h"
58 #include "rtl/ustring.hxx"
59 #include "sal/types.h"
61 namespace com { namespace sun { namespace star { namespace uno {
62 class Any;
63 } } } }
65 namespace {
67 namespace css = com::sun::star;
69 struct DerivedStruct1: css::lang::EventObject {};
71 struct DerivedStruct2: css::beans::PropertyChangeEvent {};
73 struct DerivedException1: css::uno::Exception {};
75 struct DerivedException2: css::uno::RuntimeException {};
77 struct DerivedInterface1: css::uno::XInterface {
78 private:
79 ~DerivedInterface1() {}
80 // avoid warnings about virtual members and non-virtual dtor
83 struct DerivedInterface2: css::uno::XComponentContext {
84 private:
85 ~DerivedInterface2() {}
86 // avoid warnings about virtual members and non-virtual dtor
89 class Test: public ::CppUnit::TestFixture {
90 public:
91 void testUnoType();
93 void testGetTypeFavourUnsigned();
95 void testGetTypeFavourChar();
97 CPPUNIT_TEST_SUITE(Test);
98 CPPUNIT_TEST(testUnoType);
99 CPPUNIT_TEST(testGetTypeFavourUnsigned);
100 CPPUNIT_TEST(testGetTypeFavourChar);
101 CPPUNIT_TEST_SUITE_END();
104 void Test::testUnoType() {
105 css::uno::Type t;
106 t = ::cppu::UnoType< ::cppu::UnoVoidType >::get();
107 CPPUNIT_ASSERT_EQUAL(+css::uno::TypeClass_VOID, +t.getTypeClass());
108 CPPUNIT_ASSERT_EQUAL(
109 ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("void")), t.getTypeName());
110 t = ::cppu::UnoType< bool >::get();
111 CPPUNIT_ASSERT_EQUAL(+css::uno::TypeClass_BOOLEAN, +t.getTypeClass());
112 CPPUNIT_ASSERT_EQUAL(
113 ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("boolean")),
114 t.getTypeName());
115 CPPUNIT_ASSERT(::cppu::UnoType< ::sal_Bool >::get() == t);
116 t = ::cppu::UnoType< ::sal_Int8 >::get();
117 CPPUNIT_ASSERT_EQUAL(+css::uno::TypeClass_BYTE, +t.getTypeClass());
118 CPPUNIT_ASSERT_EQUAL(
119 ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("byte")), t.getTypeName());
120 t = ::cppu::UnoType< ::sal_Int16 >::get();
121 CPPUNIT_ASSERT_EQUAL(+css::uno::TypeClass_SHORT, +t.getTypeClass());
122 CPPUNIT_ASSERT_EQUAL(
123 ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("short")), t.getTypeName());
124 t = ::cppu::UnoType< ::cppu::UnoUnsignedShortType >::get();
125 CPPUNIT_ASSERT_EQUAL(
126 +css::uno::TypeClass_UNSIGNED_SHORT, +t.getTypeClass());
127 CPPUNIT_ASSERT_EQUAL(
128 ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("unsigned short")),
129 t.getTypeName());
130 t = ::cppu::UnoType< ::sal_Int32 >::get();
131 CPPUNIT_ASSERT_EQUAL(+css::uno::TypeClass_LONG, +t.getTypeClass());
132 CPPUNIT_ASSERT_EQUAL(
133 ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("long")), t.getTypeName());
134 t = ::cppu::UnoType< ::sal_uInt32 >::get();
135 CPPUNIT_ASSERT_EQUAL(+css::uno::TypeClass_UNSIGNED_LONG, +t.getTypeClass());
136 CPPUNIT_ASSERT_EQUAL(
137 ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("unsigned long")),
138 t.getTypeName());
139 t = ::cppu::UnoType< ::sal_Int64 >::get();
140 CPPUNIT_ASSERT_EQUAL(+css::uno::TypeClass_HYPER, +t.getTypeClass());
141 CPPUNIT_ASSERT_EQUAL(
142 ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("hyper")), t.getTypeName());
143 t = ::cppu::UnoType< ::sal_uInt64 >::get();
144 CPPUNIT_ASSERT_EQUAL(
145 +css::uno::TypeClass_UNSIGNED_HYPER, +t.getTypeClass());
146 CPPUNIT_ASSERT_EQUAL(
147 ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("unsigned hyper")),
148 t.getTypeName());
149 t = ::cppu::UnoType< float >::get();
150 CPPUNIT_ASSERT_EQUAL(+css::uno::TypeClass_FLOAT, +t.getTypeClass());
151 CPPUNIT_ASSERT_EQUAL(
152 ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("float")), t.getTypeName());
153 t = ::cppu::UnoType< double >::get();
154 CPPUNIT_ASSERT_EQUAL(+css::uno::TypeClass_DOUBLE, +t.getTypeClass());
155 CPPUNIT_ASSERT_EQUAL(
156 ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("double")),
157 t.getTypeName());
158 t = ::cppu::UnoType< ::cppu::UnoCharType >::get();
159 CPPUNIT_ASSERT_EQUAL(+css::uno::TypeClass_CHAR, +t.getTypeClass());
160 CPPUNIT_ASSERT_EQUAL(
161 ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("char")), t.getTypeName());
162 t = ::cppu::UnoType< ::rtl::OUString >::get();
163 CPPUNIT_ASSERT_EQUAL(+css::uno::TypeClass_STRING, +t.getTypeClass());
164 CPPUNIT_ASSERT_EQUAL(
165 ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("string")),
166 t.getTypeName());
167 t = ::cppu::UnoType< css::uno::Type >::get();
168 CPPUNIT_ASSERT_EQUAL(+css::uno::TypeClass_TYPE, +t.getTypeClass());
169 CPPUNIT_ASSERT_EQUAL(
170 ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("type")), t.getTypeName());
171 t = ::cppu::UnoType< css::uno::Any >::get();
172 CPPUNIT_ASSERT_EQUAL(+css::uno::TypeClass_ANY, +t.getTypeClass());
173 CPPUNIT_ASSERT_EQUAL(
174 ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("any")), t.getTypeName());
175 t = ::cppu::UnoType< ::cppu::UnoSequenceType< ::sal_Int8 > >::get();
176 CPPUNIT_ASSERT_EQUAL(+css::uno::TypeClass_SEQUENCE, +t.getTypeClass());
177 CPPUNIT_ASSERT_EQUAL(
178 ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("[]byte")),
179 t.getTypeName());
180 CPPUNIT_ASSERT(
181 ::cppu::UnoType< css::uno::Sequence< ::sal_Int8 > >::get() == t);
182 t = ::cppu::UnoType<
183 ::cppu::UnoSequenceType< ::cppu::UnoUnsignedShortType > >::get();
184 CPPUNIT_ASSERT_EQUAL(+css::uno::TypeClass_SEQUENCE, +t.getTypeClass());
185 CPPUNIT_ASSERT_EQUAL(
186 ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("[]unsigned short")),
187 t.getTypeName());
188 t = ::cppu::UnoType<
189 ::cppu::UnoSequenceType< ::cppu::UnoCharType > >::get();
190 CPPUNIT_ASSERT_EQUAL(+css::uno::TypeClass_SEQUENCE, +t.getTypeClass());
191 CPPUNIT_ASSERT_EQUAL(
192 ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("[]char")),
193 t.getTypeName());
194 t = ::cppu::UnoType< ::cppu::UnoSequenceType< ::cppu::UnoSequenceType<
195 ::sal_Int8 > > >::get();
196 CPPUNIT_ASSERT_EQUAL(+css::uno::TypeClass_SEQUENCE, +t.getTypeClass());
197 CPPUNIT_ASSERT_EQUAL(
198 ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("[][]byte")),
199 t.getTypeName());
200 CPPUNIT_ASSERT(
201 ::cppu::UnoType<
202 css::uno::Sequence< css::uno::Sequence< ::sal_Int8 > > >::get() == t);
203 t = ::cppu::UnoType< ::cppu::UnoSequenceType< ::cppu::UnoSequenceType<
204 ::cppu::UnoUnsignedShortType > > >::get();
205 CPPUNIT_ASSERT_EQUAL(+css::uno::TypeClass_SEQUENCE, +t.getTypeClass());
206 CPPUNIT_ASSERT_EQUAL(
207 ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("[][]unsigned short")),
208 t.getTypeName());
209 t = ::cppu::UnoType< ::cppu::UnoSequenceType< ::cppu::UnoSequenceType<
210 ::cppu::UnoCharType > > >::get();
211 CPPUNIT_ASSERT_EQUAL(+css::uno::TypeClass_SEQUENCE, +t.getTypeClass());
212 CPPUNIT_ASSERT_EQUAL(
213 ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("[][]char")),
214 t.getTypeName());
215 t = ::cppu::UnoType< css::uno::TypeClass >::get();
216 CPPUNIT_ASSERT_EQUAL(+css::uno::TypeClass_ENUM, +t.getTypeClass());
217 CPPUNIT_ASSERT_EQUAL(
218 ::rtl::OUString(
219 RTL_CONSTASCII_USTRINGPARAM("com.sun.star.uno.TypeClass")),
220 t.getTypeName());
221 t = ::cppu::UnoType< css::lang::EventObject >::get();
222 CPPUNIT_ASSERT_EQUAL(+css::uno::TypeClass_STRUCT, +t.getTypeClass());
223 CPPUNIT_ASSERT_EQUAL(
224 ::rtl::OUString(
225 RTL_CONSTASCII_USTRINGPARAM("com.sun.star.lang.EventObject")),
226 t.getTypeName());
227 CPPUNIT_ASSERT(::cppu::UnoType< DerivedStruct1 >::get() == t);
228 t = ::cppu::UnoType< css::beans::PropertyChangeEvent >::get();
229 CPPUNIT_ASSERT_EQUAL(+css::uno::TypeClass_STRUCT, +t.getTypeClass());
230 CPPUNIT_ASSERT_EQUAL(
231 ::rtl::OUString(
232 RTL_CONSTASCII_USTRINGPARAM(
233 "com.sun.star.beans.PropertyChangeEvent")),
234 t.getTypeName());
235 #if !(defined __SUNPRO_CC && __SUNPRO_CC <= 0x550) // erroneous ambiguity stated
236 CPPUNIT_ASSERT(::cppu::UnoType< DerivedStruct2 >::get() == t);
237 #endif
238 t = ::cppu::UnoType< css::beans::Optional< ::sal_Int8 > >::get();
239 CPPUNIT_ASSERT_EQUAL(+css::uno::TypeClass_STRUCT, +t.getTypeClass());
240 CPPUNIT_ASSERT_EQUAL(
241 ::rtl::OUString(
242 RTL_CONSTASCII_USTRINGPARAM("com.sun.star.beans.Optional<byte>")),
243 t.getTypeName());
244 t = ::cppu::UnoType< css::uno::Exception >::get();
245 CPPUNIT_ASSERT_EQUAL(+css::uno::TypeClass_EXCEPTION, +t.getTypeClass());
246 CPPUNIT_ASSERT_EQUAL(
247 ::rtl::OUString(
248 RTL_CONSTASCII_USTRINGPARAM("com.sun.star.uno.Exception")),
249 t.getTypeName());
250 CPPUNIT_ASSERT(::cppu::UnoType< DerivedException1 >::get() == t);
251 t = ::cppu::UnoType< css::uno::RuntimeException >::get();
252 CPPUNIT_ASSERT_EQUAL(+css::uno::TypeClass_EXCEPTION, +t.getTypeClass());
253 CPPUNIT_ASSERT_EQUAL(
254 ::rtl::OUString(
255 RTL_CONSTASCII_USTRINGPARAM("com.sun.star.uno.RuntimeException")),
256 t.getTypeName());
257 #if !(defined __SUNPRO_CC && __SUNPRO_CC <= 0x550) // erroneous ambiguity stated
258 CPPUNIT_ASSERT(::cppu::UnoType< DerivedException2 >::get() == t);
259 #endif
260 t = ::cppu::UnoType< css::uno::XInterface >::get();
261 CPPUNIT_ASSERT_EQUAL(+css::uno::TypeClass_INTERFACE, +t.getTypeClass());
262 CPPUNIT_ASSERT_EQUAL(
263 ::rtl::OUString(
264 RTL_CONSTASCII_USTRINGPARAM("com.sun.star.uno.XInterface")),
265 t.getTypeName());
266 CPPUNIT_ASSERT(
267 ::cppu::UnoType< css::uno::Reference< css::uno::XInterface > >::get() ==
269 CPPUNIT_ASSERT(::cppu::UnoType< DerivedInterface1 >::get() == t);
270 CPPUNIT_ASSERT(
271 ::cppu::UnoType< css::uno::Reference< DerivedInterface1 > >::get() ==
273 t = ::cppu::UnoType< css::uno::XComponentContext >::get();
274 CPPUNIT_ASSERT_EQUAL(+css::uno::TypeClass_INTERFACE, +t.getTypeClass());
275 CPPUNIT_ASSERT_EQUAL(
276 ::rtl::OUString(
277 RTL_CONSTASCII_USTRINGPARAM("com.sun.star.uno.XComponentContext")),
278 t.getTypeName());
279 CPPUNIT_ASSERT(
280 ::cppu::UnoType<
281 css::uno::Reference< css::uno::XComponentContext > >::get() == t);
282 #if !(defined __SUNPRO_CC && __SUNPRO_CC <= 0x550) // erroneous ambiguity stated
283 CPPUNIT_ASSERT(::cppu::UnoType< DerivedInterface2 >::get() == t);
284 CPPUNIT_ASSERT(
285 ::cppu::UnoType< css::uno::Reference< DerivedInterface2 > >::get() ==
287 #endif
290 void Test::testGetTypeFavourUnsigned() {
291 CPPUNIT_ASSERT(typeid(::sal_Unicode) == typeid(::sal_uInt16));
292 CPPUNIT_ASSERT(
293 ::getCppuType(static_cast< ::sal_Unicode * >(0)) ==
294 ::getCppuType(static_cast< ::sal_uInt16 * >(0)));
295 CPPUNIT_ASSERT(
296 ::cppu::getTypeFavourUnsigned(
297 static_cast< ::cppu::UnoVoidType * >(0)) ==
298 ::cppu::UnoType< ::cppu::UnoVoidType >::get());
299 CPPUNIT_ASSERT(
300 ::cppu::getTypeFavourUnsigned(static_cast< bool * >(0)) ==
301 ::cppu::UnoType< bool >::get());
302 CPPUNIT_ASSERT(
303 ::cppu::getTypeFavourUnsigned(static_cast< bool * >(0)) ==
304 ::getCppuType(static_cast< bool * >(0)));
305 CPPUNIT_ASSERT(
306 ::cppu::getTypeFavourUnsigned(static_cast< ::sal_Bool * >(0)) ==
307 ::cppu::UnoType< bool >::get());
308 CPPUNIT_ASSERT(
309 ::cppu::getTypeFavourUnsigned(static_cast< ::sal_Bool * >(0)) ==
310 ::getCppuType(static_cast< ::sal_Bool * >(0)));
311 CPPUNIT_ASSERT(
312 ::cppu::getTypeFavourUnsigned(static_cast< ::sal_Int8 * >(0)) ==
313 ::cppu::UnoType< ::sal_Int8 >::get());
314 CPPUNIT_ASSERT(
315 ::cppu::getTypeFavourUnsigned(static_cast< ::sal_Int8 * >(0)) ==
316 ::getCppuType(static_cast< ::sal_Int8 * >(0)));
317 CPPUNIT_ASSERT(
318 ::cppu::getTypeFavourUnsigned(static_cast< ::sal_Int16 * >(0)) ==
319 ::cppu::UnoType< ::sal_Int16 >::get());
320 CPPUNIT_ASSERT(
321 ::cppu::getTypeFavourUnsigned(static_cast< ::sal_Int16 * >(0)) ==
322 ::getCppuType(static_cast< ::sal_Int16 * >(0)));
323 CPPUNIT_ASSERT(
324 ::cppu::getTypeFavourUnsigned(
325 static_cast< ::cppu::UnoUnsignedShortType * >(0)) ==
326 ::cppu::UnoType< ::cppu::UnoUnsignedShortType >::get());
327 CPPUNIT_ASSERT(
328 ::cppu::getTypeFavourUnsigned(static_cast< ::sal_uInt16 * >(0)) ==
329 ::cppu::UnoType< ::cppu::UnoUnsignedShortType >::get());
330 CPPUNIT_ASSERT(
331 ::cppu::getTypeFavourUnsigned(static_cast< ::sal_uInt16 * >(0)) ==
332 ::getCppuType(static_cast< ::sal_uInt16 * >(0)));
333 CPPUNIT_ASSERT(
334 ::cppu::getTypeFavourUnsigned(static_cast< ::sal_Int32 * >(0)) ==
335 ::cppu::UnoType< ::sal_Int32 >::get());
336 CPPUNIT_ASSERT(
337 ::cppu::getTypeFavourUnsigned(static_cast< ::sal_Int32 * >(0)) ==
338 ::getCppuType(static_cast< ::sal_Int32 * >(0)));
339 CPPUNIT_ASSERT(
340 ::cppu::getTypeFavourUnsigned(static_cast< ::sal_uInt32 * >(0)) ==
341 ::cppu::UnoType< ::sal_uInt32 >::get());
342 CPPUNIT_ASSERT(
343 ::cppu::getTypeFavourUnsigned(static_cast< ::sal_uInt32 * >(0)) ==
344 ::getCppuType(static_cast< ::sal_uInt32 * >(0)));
345 CPPUNIT_ASSERT(
346 ::cppu::getTypeFavourUnsigned(static_cast< ::sal_Int64 * >(0)) ==
347 ::cppu::UnoType< ::sal_Int64 >::get());
348 CPPUNIT_ASSERT(
349 ::cppu::getTypeFavourUnsigned(static_cast< ::sal_Int64 * >(0)) ==
350 ::getCppuType(static_cast< ::sal_Int64 * >(0)));
351 CPPUNIT_ASSERT(
352 ::cppu::getTypeFavourUnsigned(static_cast< ::sal_uInt64 * >(0)) ==
353 ::cppu::UnoType< ::sal_uInt64 >::get());
354 CPPUNIT_ASSERT(
355 ::cppu::getTypeFavourUnsigned(static_cast< ::sal_uInt64 * >(0)) ==
356 ::getCppuType(static_cast< ::sal_uInt64 * >(0)));
357 CPPUNIT_ASSERT(
358 ::cppu::getTypeFavourUnsigned(static_cast< float * >(0)) ==
359 ::cppu::UnoType< float >::get());
360 CPPUNIT_ASSERT(
361 ::cppu::getTypeFavourUnsigned(static_cast< float * >(0)) ==
362 ::getCppuType(static_cast< float * >(0)));
363 CPPUNIT_ASSERT(
364 ::cppu::getTypeFavourUnsigned(static_cast< double * >(0)) ==
365 ::cppu::UnoType< double >::get());
366 CPPUNIT_ASSERT(
367 ::cppu::getTypeFavourUnsigned(static_cast< double * >(0)) ==
368 ::getCppuType(static_cast< double * >(0)));
369 CPPUNIT_ASSERT(
370 ::cppu::getTypeFavourUnsigned(
371 static_cast< ::cppu::UnoCharType * >(0)) ==
372 ::cppu::UnoType< ::cppu::UnoCharType >::get());
373 CPPUNIT_ASSERT(
374 ::cppu::getTypeFavourUnsigned(static_cast< ::sal_Unicode * >(0)) ==
375 ::cppu::UnoType< ::cppu::UnoUnsignedShortType >::get());
376 CPPUNIT_ASSERT(
377 ::cppu::getTypeFavourUnsigned(static_cast< ::sal_Unicode * >(0)) ==
378 ::getCppuType(static_cast< ::sal_Unicode * >(0)));
379 CPPUNIT_ASSERT(
380 ::cppu::getTypeFavourUnsigned(static_cast< ::rtl::OUString * >(0)) ==
381 ::cppu::UnoType< ::rtl::OUString >::get());
382 CPPUNIT_ASSERT(
383 ::cppu::getTypeFavourUnsigned(static_cast< ::rtl::OUString * >(0)) ==
384 ::getCppuType(static_cast< ::rtl::OUString * >(0)));
385 CPPUNIT_ASSERT(
386 ::cppu::getTypeFavourUnsigned(static_cast< css::uno::Type * >(0)) ==
387 ::cppu::UnoType< css::uno::Type >::get());
388 CPPUNIT_ASSERT(
389 ::cppu::getTypeFavourUnsigned(static_cast< css::uno::Type * >(0)) ==
390 ::getCppuType(static_cast< css::uno::Type * >(0)));
391 CPPUNIT_ASSERT(
392 ::cppu::getTypeFavourUnsigned(static_cast< css::uno::Any * >(0)) ==
393 ::cppu::UnoType< css::uno::Any >::get());
394 CPPUNIT_ASSERT(
395 ::cppu::getTypeFavourUnsigned(static_cast< css::uno::Any * >(0)) ==
396 ::getCppuType(static_cast< css::uno::Any * >(0)));
397 CPPUNIT_ASSERT(
398 ::cppu::getTypeFavourUnsigned(
399 static_cast<
400 ::cppu::UnoSequenceType< ::cppu::UnoUnsignedShortType > * >(0)) ==
401 ::cppu::UnoType<
402 ::cppu::UnoSequenceType< ::cppu::UnoUnsignedShortType > >::get());
403 CPPUNIT_ASSERT(
404 ::cppu::getTypeFavourUnsigned(
405 static_cast< css::uno::Sequence< ::sal_uInt16 > * >(0)) ==
406 ::cppu::UnoType<
407 ::cppu::UnoSequenceType< ::cppu::UnoUnsignedShortType > >::get());
408 CPPUNIT_ASSERT(
409 ::cppu::getTypeFavourUnsigned(
410 static_cast< css::uno::Sequence< ::sal_uInt16 > * >(0)) ==
411 ::getCppuType(static_cast< css::uno::Sequence< ::sal_uInt16 > * >(0)));
412 CPPUNIT_ASSERT(
413 ::cppu::getTypeFavourUnsigned(
414 static_cast< ::cppu::UnoSequenceType< ::cppu::UnoSequenceType<
415 ::cppu::UnoUnsignedShortType > > * >(0)) ==
416 ::cppu::UnoType< ::cppu::UnoSequenceType< ::cppu::UnoSequenceType<
417 ::cppu::UnoUnsignedShortType > > >::get());
418 CPPUNIT_ASSERT(
419 ::cppu::getTypeFavourUnsigned(
420 static_cast< css::uno::Sequence< css::uno::Sequence<
421 ::sal_uInt16 > > * >(0)) ==
422 ::cppu::UnoType< ::cppu::UnoSequenceType< ::cppu::UnoSequenceType<
423 ::cppu::UnoUnsignedShortType > > >::get());
424 CPPUNIT_ASSERT(
425 ::cppu::getTypeFavourUnsigned(
426 static_cast< css::uno::Sequence< css::uno::Sequence<
427 ::sal_uInt16 > > * >(0)) ==
428 ::getCppuType(
429 static_cast< css::uno::Sequence< css::uno::Sequence<
430 ::sal_uInt16 > > * >(0)));
431 CPPUNIT_ASSERT(
432 ::cppu::getTypeFavourUnsigned(
433 static_cast< css::uno::Sequence< ::sal_Unicode > * >(0)) ==
434 ::cppu::UnoType<
435 ::cppu::UnoSequenceType< ::cppu::UnoUnsignedShortType > >::get());
436 CPPUNIT_ASSERT(
437 ::cppu::getTypeFavourUnsigned(
438 static_cast< css::uno::Sequence< ::sal_Unicode > * >(0)) ==
439 ::getCppuType(static_cast< css::uno::Sequence< ::sal_Unicode > * >(0)));
440 CPPUNIT_ASSERT(
441 ::cppu::getTypeFavourUnsigned(
442 static_cast< css::uno::Sequence< css::uno::Sequence<
443 ::sal_Unicode > > * >(0)) ==
444 ::cppu::UnoType< ::cppu::UnoSequenceType< ::cppu::UnoSequenceType<
445 ::cppu::UnoUnsignedShortType > > >::get());
446 CPPUNIT_ASSERT(
447 ::cppu::getTypeFavourUnsigned(
448 static_cast< css::uno::Sequence< css::uno::Sequence<
449 ::sal_Unicode > > * >(0)) ==
450 ::getCppuType(
451 static_cast< css::uno::Sequence< css::uno::Sequence<
452 ::sal_Unicode > > * >(0)));
453 CPPUNIT_ASSERT(
454 ::cppu::getTypeFavourUnsigned(
455 static_cast< css::uno::TypeClass * >(0)) ==
456 ::cppu::UnoType< css::uno::TypeClass >::get());
457 CPPUNIT_ASSERT(
458 ::cppu::getTypeFavourUnsigned(
459 static_cast< css::uno::TypeClass * >(0)) ==
460 ::getCppuType(static_cast< css::uno::TypeClass * >(0)));
461 CPPUNIT_ASSERT(
462 ::cppu::getTypeFavourUnsigned(
463 static_cast< css::lang::EventObject * >(0)) ==
464 ::cppu::UnoType< css::lang::EventObject >::get());
465 CPPUNIT_ASSERT(
466 ::cppu::getTypeFavourUnsigned(
467 static_cast< css::lang::EventObject * >(0)) ==
468 ::getCppuType(static_cast< css::lang::EventObject * >(0)));
469 CPPUNIT_ASSERT(
470 ::cppu::getTypeFavourUnsigned(static_cast< DerivedStruct1 * >(0)) ==
471 ::cppu::UnoType< css::lang::EventObject >::get());
472 CPPUNIT_ASSERT(
473 ::cppu::getTypeFavourUnsigned(static_cast< DerivedStruct1 * >(0)) ==
474 ::getCppuType(static_cast< DerivedStruct1 * >(0)));
475 CPPUNIT_ASSERT(
476 ::cppu::getTypeFavourUnsigned(
477 static_cast< css::beans::PropertyChangeEvent * >(0)) ==
478 ::cppu::UnoType< css::beans::PropertyChangeEvent >::get());
479 CPPUNIT_ASSERT(
480 ::cppu::getTypeFavourUnsigned(
481 static_cast< css::beans::PropertyChangeEvent * >(0)) ==
482 ::getCppuType(static_cast< css::beans::PropertyChangeEvent * >(0)));
483 #if !(defined __SUNPRO_CC && __SUNPRO_CC <= 0x550) // erroneous ambiguity stated
484 CPPUNIT_ASSERT(
485 ::cppu::getTypeFavourUnsigned(static_cast< DerivedStruct2 * >(0)) ==
486 ::cppu::UnoType< css::beans::PropertyChangeEvent >::get());
487 CPPUNIT_ASSERT(
488 ::cppu::getTypeFavourUnsigned(static_cast< DerivedStruct2 * >(0)) ==
489 ::getCppuType(static_cast< DerivedStruct2 * >(0)));
490 #endif
491 CPPUNIT_ASSERT(
492 ::cppu::getTypeFavourUnsigned(
493 static_cast< css::beans::Optional< ::sal_Int8 > * >(0)) ==
494 ::cppu::UnoType< css::beans::Optional< ::sal_Int8 > >::get());
495 CPPUNIT_ASSERT(
496 ::cppu::getTypeFavourUnsigned(
497 static_cast< css::beans::Optional< ::sal_Int8 > * >(0)) ==
498 ::getCppuType(static_cast< css::beans::Optional< ::sal_Int8 > * >(0)));
499 CPPUNIT_ASSERT(
500 ::cppu::getTypeFavourUnsigned(
501 static_cast< css::uno::Exception * >(0)) ==
502 ::cppu::UnoType< css::uno::Exception >::get());
503 CPPUNIT_ASSERT(
504 ::cppu::getTypeFavourUnsigned(
505 static_cast< css::uno::Exception * >(0)) ==
506 ::getCppuType(static_cast< css::uno::Exception * >(0)));
507 CPPUNIT_ASSERT(
508 ::cppu::getTypeFavourUnsigned(static_cast< DerivedException1 * >(0)) ==
509 ::cppu::UnoType< css::uno::Exception >::get());
510 CPPUNIT_ASSERT(
511 ::cppu::getTypeFavourUnsigned(static_cast< DerivedException1 * >(0)) ==
512 ::getCppuType(static_cast< DerivedException1 * >(0)));
513 CPPUNIT_ASSERT(
514 ::cppu::getTypeFavourUnsigned(
515 static_cast< css::uno::RuntimeException * >(0)) ==
516 ::cppu::UnoType< css::uno::RuntimeException >::get());
517 CPPUNIT_ASSERT(
518 ::cppu::getTypeFavourUnsigned(
519 static_cast< css::uno::RuntimeException * >(0)) ==
520 ::getCppuType(static_cast< css::uno::RuntimeException * >(0)));
521 #if !(defined __SUNPRO_CC && __SUNPRO_CC <= 0x550) // erroneous ambiguity stated
522 CPPUNIT_ASSERT(
523 ::cppu::getTypeFavourUnsigned(static_cast< DerivedException2 * >(0)) ==
524 ::cppu::UnoType< css::uno::RuntimeException >::get());
525 CPPUNIT_ASSERT(
526 ::cppu::getTypeFavourUnsigned(static_cast< DerivedException2 * >(0)) ==
527 ::getCppuType(static_cast< DerivedException2 * >(0)));
528 #endif
529 CPPUNIT_ASSERT(
530 ::cppu::getTypeFavourUnsigned(
531 static_cast< css::uno::XInterface * >(0)) ==
532 ::cppu::UnoType< css::uno::XInterface >::get());
533 CPPUNIT_ASSERT(
534 ::cppu::getTypeFavourUnsigned(
535 static_cast< css::uno::Reference< css::uno::XInterface > * >(0)) ==
536 ::cppu::UnoType< css::uno::XInterface >::get());
537 CPPUNIT_ASSERT(
538 ::cppu::getTypeFavourUnsigned(
539 static_cast< css::uno::Reference< css::uno::XInterface > * >(0)) ==
540 ::getCppuType(
541 static_cast< css::uno::Reference< css::uno::XInterface > * >(0)));
542 CPPUNIT_ASSERT(
543 ::cppu::getTypeFavourUnsigned(static_cast< DerivedInterface1 * >(0)) ==
544 ::cppu::UnoType< css::uno::XInterface >::get());
545 CPPUNIT_ASSERT(
546 ::cppu::getTypeFavourUnsigned(
547 static_cast< css::uno::Reference< DerivedInterface1 > * >(0)) ==
548 ::cppu::UnoType< css::uno::XInterface >::get());
549 CPPUNIT_ASSERT(
550 ::cppu::getTypeFavourUnsigned(
551 static_cast< css::uno::XComponentContext * >(0)) ==
552 ::cppu::UnoType< css::uno::XComponentContext >::get());
553 CPPUNIT_ASSERT(
554 ::cppu::getTypeFavourUnsigned(
555 static_cast<
556 css::uno::Reference< css::uno::XComponentContext > * >(0)) ==
557 ::cppu::UnoType< css::uno::XComponentContext >::get());
558 CPPUNIT_ASSERT(
559 ::cppu::getTypeFavourUnsigned(
560 static_cast<
561 css::uno::Reference< css::uno::XComponentContext > * >(0)) ==
562 ::getCppuType(
563 static_cast<
564 css::uno::Reference< css::uno::XComponentContext > * >(0)));
565 #if !(defined __SUNPRO_CC && __SUNPRO_CC <= 0x550) // erroneous ambiguity stated
566 CPPUNIT_ASSERT(
567 ::cppu::getTypeFavourUnsigned(static_cast< DerivedInterface2 * >(0)) ==
568 ::cppu::UnoType< css::uno::XComponentContext >::get());
569 CPPUNIT_ASSERT(
570 ::cppu::getTypeFavourUnsigned(
571 static_cast< css::uno::Reference< DerivedInterface2 > * >(0)) ==
572 ::cppu::UnoType< css::uno::XComponentContext >::get());
573 #endif
576 void Test::testGetTypeFavourChar() {
577 CPPUNIT_ASSERT(typeid(::sal_Unicode) == typeid(::sal_uInt16));
578 CPPUNIT_ASSERT(
579 ::getCppuType< ::sal_Unicode >() == ::getCppuType< ::sal_uInt16 >());
580 CPPUNIT_ASSERT(
581 ::cppu::getTypeFavourChar(static_cast< ::cppu::UnoVoidType * >(0)) ==
582 ::cppu::UnoType< ::cppu::UnoVoidType >::get());
583 CPPUNIT_ASSERT(
584 ::cppu::getTypeFavourChar(static_cast< bool * >(0)) ==
585 ::cppu::UnoType< bool >::get());
586 CPPUNIT_ASSERT(
587 ::cppu::getTypeFavourChar(static_cast< bool * >(0)) ==
588 ::getCppuType< bool >());
589 CPPUNIT_ASSERT(
590 ::cppu::getTypeFavourChar(static_cast< ::sal_Bool * >(0)) ==
591 ::cppu::UnoType< bool >::get());
592 CPPUNIT_ASSERT(
593 ::cppu::getTypeFavourChar(static_cast< ::sal_Bool * >(0)) ==
594 ::getCppuType< ::sal_Bool >());
595 CPPUNIT_ASSERT(
596 ::cppu::getTypeFavourChar(static_cast< ::sal_Int8 * >(0)) ==
597 ::cppu::UnoType< ::sal_Int8 >::get());
598 CPPUNIT_ASSERT(
599 ::cppu::getTypeFavourChar(static_cast< ::sal_Int8 * >(0)) ==
600 ::getCppuType< ::sal_Int8 >());
601 CPPUNIT_ASSERT(
602 ::cppu::getTypeFavourChar(static_cast< ::sal_Int16 * >(0)) ==
603 ::cppu::UnoType< ::sal_Int16 >::get());
604 CPPUNIT_ASSERT(
605 ::cppu::getTypeFavourChar(static_cast< ::sal_Int16 * >(0)) ==
606 ::getCppuType< ::sal_Int16 >());
607 CPPUNIT_ASSERT(
608 ::cppu::getTypeFavourChar(
609 static_cast< ::cppu::UnoUnsignedShortType * >(0)) ==
610 ::cppu::UnoType< ::cppu::UnoUnsignedShortType >::get());
611 CPPUNIT_ASSERT(
612 ::cppu::getTypeFavourChar(static_cast< ::sal_uInt16 * >(0)) ==
613 ::cppu::UnoType< ::cppu::UnoCharType >::get());
614 CPPUNIT_ASSERT(
615 ::cppu::getTypeFavourChar(static_cast< ::sal_Int32 * >(0)) ==
616 ::cppu::UnoType< ::sal_Int32 >::get());
617 CPPUNIT_ASSERT(
618 ::cppu::getTypeFavourChar(static_cast< ::sal_Int32 * >(0)) ==
619 ::getCppuType< ::sal_Int32 >());
620 CPPUNIT_ASSERT(
621 ::cppu::getTypeFavourChar(static_cast< ::sal_uInt32 * >(0)) ==
622 ::cppu::UnoType< ::sal_uInt32 >::get());
623 CPPUNIT_ASSERT(
624 ::cppu::getTypeFavourChar(static_cast< ::sal_uInt32 * >(0)) ==
625 ::getCppuType< ::sal_uInt32 >());
626 CPPUNIT_ASSERT(
627 ::cppu::getTypeFavourChar(static_cast< ::sal_Int64 * >(0)) ==
628 ::cppu::UnoType< ::sal_Int64 >::get());
629 CPPUNIT_ASSERT(
630 ::cppu::getTypeFavourChar(static_cast< ::sal_Int64 * >(0)) ==
631 ::getCppuType< ::sal_Int64 >());
632 CPPUNIT_ASSERT(
633 ::cppu::getTypeFavourChar(static_cast< ::sal_uInt64 * >(0)) ==
634 ::cppu::UnoType< ::sal_uInt64 >::get());
635 CPPUNIT_ASSERT(
636 ::cppu::getTypeFavourChar(static_cast< ::sal_uInt64 * >(0)) ==
637 ::getCppuType< ::sal_uInt64 >());
638 CPPUNIT_ASSERT(
639 ::cppu::getTypeFavourChar(static_cast< float * >(0)) ==
640 ::cppu::UnoType< float >::get());
641 CPPUNIT_ASSERT(
642 ::cppu::getTypeFavourChar(static_cast< float * >(0)) ==
643 ::getCppuType< float >());
644 CPPUNIT_ASSERT(
645 ::cppu::getTypeFavourChar(static_cast< double * >(0)) ==
646 ::cppu::UnoType< double >::get());
647 CPPUNIT_ASSERT(
648 ::cppu::getTypeFavourChar(static_cast< double * >(0)) ==
649 ::getCppuType< double >());
650 CPPUNIT_ASSERT(
651 ::cppu::getTypeFavourChar(static_cast< ::cppu::UnoCharType * >(0)) ==
652 ::cppu::UnoType< ::cppu::UnoCharType >::get());
653 CPPUNIT_ASSERT(
654 ::cppu::getTypeFavourChar(static_cast< ::sal_Unicode * >(0)) ==
655 ::cppu::UnoType< ::cppu::UnoCharType >::get());
656 CPPUNIT_ASSERT(
657 ::cppu::getTypeFavourChar(static_cast< ::sal_Unicode * >(0)) ==
658 ::getCppuType< ::sal_Unicode >());
659 CPPUNIT_ASSERT(
660 ::cppu::getTypeFavourChar(static_cast< ::rtl::OUString * >(0)) ==
661 ::cppu::UnoType< ::rtl::OUString >::get());
662 CPPUNIT_ASSERT(
663 ::cppu::getTypeFavourChar(static_cast< ::rtl::OUString * >(0)) ==
664 ::getCppuType< ::rtl::OUString >());
665 CPPUNIT_ASSERT(
666 ::cppu::getTypeFavourChar(static_cast< css::uno::Type * >(0)) ==
667 ::cppu::UnoType< css::uno::Type >::get());
668 CPPUNIT_ASSERT(
669 ::cppu::getTypeFavourChar(static_cast< css::uno::Type * >(0)) ==
670 ::getCppuType< css::uno::Type >());
671 CPPUNIT_ASSERT(
672 ::cppu::getTypeFavourChar(static_cast< css::uno::Any * >(0)) ==
673 ::cppu::UnoType< css::uno::Any >::get());
674 CPPUNIT_ASSERT(
675 ::cppu::getTypeFavourChar(static_cast< css::uno::Any * >(0)) ==
676 ::getCppuType< css::uno::Any >());
677 CPPUNIT_ASSERT(
678 ::cppu::getTypeFavourChar(
679 static_cast<
680 ::cppu::UnoSequenceType< ::cppu::UnoUnsignedShortType > * >(0)) ==
681 ::cppu::UnoType<
682 ::cppu::UnoSequenceType< ::cppu::UnoUnsignedShortType > >::get());
683 CPPUNIT_ASSERT(
684 ::cppu::getTypeFavourChar(
685 static_cast< css::uno::Sequence< ::sal_uInt16 > * >(0)) ==
686 ::cppu::UnoType<
687 ::cppu::UnoSequenceType< ::cppu::UnoCharType > >::get());
688 CPPUNIT_ASSERT(
689 ::cppu::getTypeFavourChar(
690 static_cast< ::cppu::UnoSequenceType< ::cppu::UnoSequenceType<
691 ::cppu::UnoUnsignedShortType > > * >(0)) ==
692 ::cppu::UnoType< ::cppu::UnoSequenceType< ::cppu::UnoSequenceType<
693 ::cppu::UnoUnsignedShortType > > >::get());
694 CPPUNIT_ASSERT(
695 ::cppu::getTypeFavourChar(
696 static_cast< css::uno::Sequence< css::uno::Sequence<
697 ::sal_uInt16 > > * >(0)) ==
698 ::cppu::UnoType< ::cppu::UnoSequenceType< ::cppu::UnoSequenceType<
699 ::cppu::UnoCharType > > >::get());
700 CPPUNIT_ASSERT(
701 ::cppu::getTypeFavourChar(
702 static_cast< css::uno::Sequence< ::sal_Unicode > * >(0)) ==
703 ::cppu::UnoType<
704 ::cppu::UnoSequenceType< ::cppu::UnoCharType > >::get());
705 CPPUNIT_ASSERT(
706 ::cppu::getTypeFavourChar(
707 static_cast< css::uno::Sequence< css::uno::Sequence<
708 ::sal_Unicode > > * >(0)) ==
709 ::cppu::UnoType< ::cppu::UnoSequenceType< ::cppu::UnoSequenceType<
710 ::cppu::UnoCharType > > >::get());
711 CPPUNIT_ASSERT(
712 ::cppu::getTypeFavourChar(static_cast< css::uno::TypeClass * >(0)) ==
713 ::cppu::UnoType< css::uno::TypeClass >::get());
714 CPPUNIT_ASSERT(
715 ::cppu::getTypeFavourChar(static_cast< css::uno::TypeClass * >(0)) ==
716 ::getCppuType< css::uno::TypeClass >());
717 CPPUNIT_ASSERT(
718 ::cppu::getTypeFavourChar(
719 static_cast< css::lang::EventObject * >(0)) ==
720 ::cppu::UnoType< css::lang::EventObject >::get());
721 CPPUNIT_ASSERT(
722 ::cppu::getTypeFavourChar(
723 static_cast< css::lang::EventObject * >(0)) ==
724 ::getCppuType< css::lang::EventObject >());
725 CPPUNIT_ASSERT(
726 ::cppu::getTypeFavourChar(static_cast< DerivedStruct1 * >(0)) ==
727 ::cppu::UnoType< css::lang::EventObject >::get());
728 CPPUNIT_ASSERT(
729 ::cppu::getTypeFavourChar(static_cast< DerivedStruct1 * >(0)) ==
730 ::getCppuType< DerivedStruct1 >());
731 CPPUNIT_ASSERT(
732 ::cppu::getTypeFavourChar(
733 static_cast< css::beans::PropertyChangeEvent * >(0)) ==
734 ::cppu::UnoType< css::beans::PropertyChangeEvent >::get());
735 CPPUNIT_ASSERT(
736 ::cppu::getTypeFavourChar(
737 static_cast< css::beans::PropertyChangeEvent * >(0)) ==
738 ::getCppuType< css::beans::PropertyChangeEvent >());
739 #if !(defined __SUNPRO_CC && __SUNPRO_CC <= 0x550) // erroneous ambiguity stated
740 CPPUNIT_ASSERT(
741 ::cppu::getTypeFavourChar(static_cast< DerivedStruct2 * >(0)) ==
742 ::cppu::UnoType< css::beans::PropertyChangeEvent >::get());
743 CPPUNIT_ASSERT(
744 ::cppu::getTypeFavourChar(static_cast< DerivedStruct2 * >(0)) ==
745 ::getCppuType< DerivedStruct2 >());
746 #endif
747 CPPUNIT_ASSERT(
748 ::cppu::getTypeFavourChar(
749 static_cast< css::beans::Optional< ::sal_Int8 > * >(0)) ==
750 ::cppu::UnoType< css::beans::Optional< ::sal_Int8 > >::get());
751 CPPUNIT_ASSERT(
752 ::cppu::getTypeFavourChar(
753 static_cast< css::beans::Optional< ::sal_Int8 > * >(0)) ==
754 ::getCppuType< css::beans::Optional< ::sal_Int8 > >());
755 CPPUNIT_ASSERT(
756 ::cppu::getTypeFavourChar(static_cast< css::uno::Exception * >(0)) ==
757 ::cppu::UnoType< css::uno::Exception >::get());
758 CPPUNIT_ASSERT(
759 ::cppu::getTypeFavourChar(static_cast< css::uno::Exception * >(0)) ==
760 ::getCppuType< css::uno::Exception >());
761 CPPUNIT_ASSERT(
762 ::cppu::getTypeFavourChar(static_cast< DerivedException1 * >(0)) ==
763 ::cppu::UnoType< css::uno::Exception >::get());
764 CPPUNIT_ASSERT(
765 ::cppu::getTypeFavourChar(static_cast< DerivedException1 * >(0)) ==
766 ::getCppuType< DerivedException1 >());
767 CPPUNIT_ASSERT(
768 ::cppu::getTypeFavourChar(
769 static_cast< css::uno::RuntimeException * >(0)) ==
770 ::cppu::UnoType< css::uno::RuntimeException >::get());
771 CPPUNIT_ASSERT(
772 ::cppu::getTypeFavourChar(
773 static_cast< css::uno::RuntimeException * >(0)) ==
774 ::getCppuType< css::uno::RuntimeException >());
775 #if !(defined __SUNPRO_CC && __SUNPRO_CC <= 0x550) // erroneous ambiguity stated
776 CPPUNIT_ASSERT(
777 ::cppu::getTypeFavourChar(static_cast< DerivedException2 * >(0)) ==
778 ::cppu::UnoType< css::uno::RuntimeException >::get());
779 CPPUNIT_ASSERT(
780 ::cppu::getTypeFavourChar(static_cast< DerivedException2 * >(0)) ==
781 ::getCppuType< DerivedException2 >());
782 #endif
783 CPPUNIT_ASSERT(
784 ::cppu::getTypeFavourChar(
785 static_cast< css::uno::XInterface * >(0)) ==
786 ::cppu::UnoType< css::uno::XInterface >::get());
787 CPPUNIT_ASSERT(
788 ::cppu::getTypeFavourChar(
789 static_cast< css::uno::Reference< css::uno::XInterface > * >(0)) ==
790 ::cppu::UnoType< css::uno::XInterface >::get());
791 CPPUNIT_ASSERT(
792 ::cppu::getTypeFavourChar(
793 static_cast< css::uno::Reference< css::uno::XInterface > * >(0)) ==
794 ::getCppuType< css::uno::Reference< css::uno::XInterface > >());
795 CPPUNIT_ASSERT(
796 ::cppu::getTypeFavourChar(static_cast< DerivedInterface1 * >(0)) ==
797 ::cppu::UnoType< css::uno::XInterface >::get());
798 CPPUNIT_ASSERT(
799 ::cppu::getTypeFavourChar(
800 static_cast< css::uno::Reference< DerivedInterface1 > * >(0)) ==
801 ::cppu::UnoType< css::uno::XInterface >::get());
802 CPPUNIT_ASSERT(
803 ::cppu::getTypeFavourChar(
804 static_cast< css::uno::XComponentContext * >(0)) ==
805 ::cppu::UnoType< css::uno::XComponentContext >::get());
806 CPPUNIT_ASSERT(
807 ::cppu::getTypeFavourChar(
808 static_cast<
809 css::uno::Reference< css::uno::XComponentContext > * >(0)) ==
810 ::cppu::UnoType< css::uno::XComponentContext >::get());
811 CPPUNIT_ASSERT(
812 ::cppu::getTypeFavourChar(
813 static_cast<
814 css::uno::Reference< css::uno::XComponentContext > * >(0)) ==
815 ::getCppuType< css::uno::Reference< css::uno::XComponentContext > >());
816 #if !(defined __SUNPRO_CC && __SUNPRO_CC <= 0x550) // erroneous ambiguity stated
817 CPPUNIT_ASSERT(
818 ::cppu::getTypeFavourChar(static_cast< DerivedInterface2 * >(0)) ==
819 ::cppu::UnoType< css::uno::XComponentContext >::get());
820 CPPUNIT_ASSERT(
821 ::cppu::getTypeFavourChar(
822 static_cast< css::uno::Reference< DerivedInterface2 > * >(0)) ==
823 ::cppu::UnoType< css::uno::XComponentContext >::get());
824 #endif
827 CPPUNIT_TEST_SUITE_REGISTRATION(Test);
831 CPPUNIT_PLUGIN_IMPLEMENT();
833 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */