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