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