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