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