test_any.cxx (129fa3d1) test_any.cxx (4ad76906)
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 37 unchanged lines hidden (view full) ---

46#include "Struct2b.hpp"
47#include "boost/type_traits/is_same.hpp"
48#include "com/sun/star/uno/Any.hxx"
49#include "com/sun/star/uno/Reference.hxx"
50#include "com/sun/star/uno/RuntimeException.hpp"
51#include "com/sun/star/uno/Sequence.hxx"
52#include "com/sun/star/uno/Type.hxx"
53#include "com/sun/star/uno/XInterface.hpp"
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 37 unchanged lines hidden (view full) ---

46#include "Struct2b.hpp"
47#include "boost/type_traits/is_same.hpp"
48#include "com/sun/star/uno/Any.hxx"
49#include "com/sun/star/uno/Reference.hxx"
50#include "com/sun/star/uno/RuntimeException.hpp"
51#include "com/sun/star/uno/Sequence.hxx"
52#include "com/sun/star/uno/Type.hxx"
53#include "com/sun/star/uno/XInterface.hpp"
54#include "testshl/simpleheader.hxx"
55#include "osl/diagnose.h"
56#include "osl/interlck.h"
57#include "rtl/string.h"
58#include "rtl/ustring.h"
59#include "rtl/ustring.hxx"
60#include "sal/types.h"
54#include "osl/diagnose.h"
55#include "osl/interlck.h"
56#include "rtl/string.h"
57#include "rtl/ustring.h"
58#include "rtl/ustring.hxx"
59#include "sal/types.h"
60#include "gtest/gtest.h"
61
62namespace {
63
64namespace css = com::sun::star;
65
66class Base {
67public:
68 Base(): m_count(0) {}

--- 116 unchanged lines hidden (view full) ---

185 Base::acquire();
186 }
187
188 virtual void SAL_CALL release() throw () {
189 Base::release();
190 }
191};
192
61
62namespace {
63
64namespace css = com::sun::star;
65
66class Base {
67public:
68 Base(): m_count(0) {}

--- 116 unchanged lines hidden (view full) ---

185 Base::acquire();
186 }
187
188 virtual void SAL_CALL release() throw () {
189 Base::release();
190 }
191};
192
193class Test: public CppUnit::TestFixture {
193class Test: public ::testing::Test {
194public:
194public:
195 void testVoid();
196
197 void testBoolean();
198
199 void testByte();
200
201 void testShort();
202
203 void testUnsignedShort();
204
205 void testLong();
206
207 void testUnsignedLong();
208
209 void testHyper();
210
211 void testUnsignedHyper();
212
213 void testFloat();
214
215 void testDouble();
216
217 void testChar();
218
219 void testString();
220
221 void testType();
222
223 void testSequence();
224
225 void testEnum();
226
227 void testStruct();
228
229 void testPoly();
230
231 void testException();
232
233 void testInterface();
234
235 void testNull();
236
237 CPPUNIT_TEST_SUITE(Test);
238 CPPUNIT_TEST(testVoid);
239 CPPUNIT_TEST(testBoolean);
240 CPPUNIT_TEST(testByte);
241 CPPUNIT_TEST(testShort);
242 CPPUNIT_TEST(testUnsignedShort);
243 CPPUNIT_TEST(testLong);
244 CPPUNIT_TEST(testUnsignedLong);
245 CPPUNIT_TEST(testHyper);
246 CPPUNIT_TEST(testUnsignedHyper);
247 CPPUNIT_TEST(testFloat);
248 CPPUNIT_TEST(testDouble);
249 CPPUNIT_TEST(testChar);
250 CPPUNIT_TEST(testString);
251 CPPUNIT_TEST(testType);
252 CPPUNIT_TEST(testSequence);
253 CPPUNIT_TEST(testEnum);
254 CPPUNIT_TEST(testStruct);
255 CPPUNIT_TEST(testPoly);
256 CPPUNIT_TEST(testException);
257 CPPUNIT_TEST(testInterface);
258 CPPUNIT_TEST(testNull);
259 CPPUNIT_TEST_SUITE_END();
260};
261
195};
196
262void Test::testVoid() {
197TEST_F(Test, testVoid) {
263 css::uno::Any a;
198 css::uno::Any a;
264 CPPUNIT_ASSERT(a.getValueType() == getVoidCppuType());
199 ASSERT_TRUE(a.getValueType() == getVoidCppuType());
265 {
266 bool b = true;
200 {
201 bool b = true;
267 CPPUNIT_ASSERT_MESSAGE("bool", !(a >>= b) && b);
202 ASSERT_TRUE(!(a >>= b) && b) << "bool";
268 }
269 {
270 sal_Bool b = true;
203 }
204 {
205 sal_Bool b = true;
271 CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b) && b);
206 ASSERT_TRUE(!(a >>= b) && b) << "sal_Bool";
272 }
273 {
274 sal_Int8 b = 2;
207 }
208 {
209 sal_Int8 b = 2;
275 CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a >>= b) && b == 2);
210 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int8";
276 }
277 {
278 sal_uInt8 b = 2;
211 }
212 {
213 sal_uInt8 b = 2;
279 CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a >>= b) && b == 2);
214 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt8";
280 }
281 {
282 sal_Int16 b = 2;
215 }
216 {
217 sal_Int16 b = 2;
283 CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a >>= b) && b == 2);
218 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int16";
284 }
285 {
286 sal_uInt16 b = 2;
219 }
220 {
221 sal_uInt16 b = 2;
287 CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a >>= b) && b == 2);
222 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt16";
288 }
289 {
290 sal_Int32 b = 2;
223 }
224 {
225 sal_Int32 b = 2;
291 CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a >>= b) && b == 2);
226 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int32";
292 }
293 {
294 sal_uInt32 b = 2;
227 }
228 {
229 sal_uInt32 b = 2;
295 CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a >>= b) && b == 2);
230 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt32";
296 }
297 {
298 sal_Int64 b = 2;
231 }
232 {
233 sal_Int64 b = 2;
299 CPPUNIT_ASSERT_MESSAGE("sal_Int64", !(a >>= b) && b == 2);
234 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int64";
300 }
301 {
302 sal_uInt64 b = 2;
235 }
236 {
237 sal_uInt64 b = 2;
303 CPPUNIT_ASSERT_MESSAGE("sal_uInt64", !(a >>= b) && b == 2);
238 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt64";
304 }
305 {
306 float b = 2;
239 }
240 {
241 float b = 2;
307 CPPUNIT_ASSERT_MESSAGE("float", !(a >>= b) && b == 2);
242 ASSERT_TRUE(!(a >>= b) && b == 2) << "float";
308 }
309 {
310 double b = 2;
243 }
244 {
245 double b = 2;
311 CPPUNIT_ASSERT_MESSAGE("double", !(a >>= b) && b == 2);
246 ASSERT_TRUE(!(a >>= b) && b == 2) << "double";
312 }
313 {
314 sal_Unicode b = '2';
247 }
248 {
249 sal_Unicode b = '2';
315 CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a >>= b) && b == '2');
250 ASSERT_TRUE(!(a >>= b) && b == '2') << "sal_Unicode";
316 }
317 {
318 rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2"));
251 }
252 {
253 rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2"));
319 CPPUNIT_ASSERT_MESSAGE(
320 "rtl::OUString",
321 !(a >>= b) && b.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2")));
254 ASSERT_TRUE(
255 !(a >>= b) && b.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2"))) << "rtl::OUString";
322 }
323 {
324 css::uno::Type b(getCppuType< rtl::OUString >());
256 }
257 {
258 css::uno::Type b(getCppuType< rtl::OUString >());
325 CPPUNIT_ASSERT_MESSAGE(
326 "css::uno::Type",
327 !(a >>= b) && b == getCppuType< rtl::OUString >());
259 ASSERT_TRUE(
260 !(a >>= b) && b == getCppuType< rtl::OUString >()) << "css::uno::Type";
328 }
329 {
330 css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
261 }
262 {
263 css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
331 CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a >>= b) && b == a);
264 ASSERT_TRUE((a >>= b) && b == a) << "css::uno::Any";
332 }
333 {
334 css::uno::Sequence< rtl::OUString > b(2);
265 }
266 {
267 css::uno::Sequence< rtl::OUString > b(2);
335 CPPUNIT_ASSERT_MESSAGE(
336 "css::uno::Sequence<rtl::OUString>", !(a >>= b) && b.getLength() == 2);
268 ASSERT_TRUE(!(a >>= b) && b.getLength() == 2) << "css::uno::Sequence<rtl::OUString>";
337 }
338 {
339 Enum1 b = Enum1_M2;
269 }
270 {
271 Enum1 b = Enum1_M2;
340 CPPUNIT_ASSERT_MESSAGE("Enum1", !(a >>= b) && b == Enum1_M2);
272 ASSERT_TRUE(!(a >>= b) && b == Enum1_M2) << "Enum1";
341 }
342 {
343 Struct1 b(2);
273 }
274 {
275 Struct1 b(2);
344 CPPUNIT_ASSERT_MESSAGE("Struct1", !(a >>= b) && b.member == 2);
276 ASSERT_TRUE(!(a >>= b) && b.member == 2) << "Struct1";
345 }
346 {
347 Exception1 b(
348 rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2);
277 }
278 {
279 Exception1 b(
280 rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2);
349 CPPUNIT_ASSERT_MESSAGE("Exception1", !(a >>= b) && b.member == 2);
281 ASSERT_TRUE(!(a >>= b) && b.member == 2) << "Exception1";
350 }
351 {
352 css::uno::Reference< Interface1 > i(new Impl1);
353 css::uno::Reference< Interface1 > b(i);
282 }
283 {
284 css::uno::Reference< Interface1 > i(new Impl1);
285 css::uno::Reference< Interface1 > b(i);
354 CPPUNIT_ASSERT_MESSAGE("Interface1", !(a >>= b) && b == i);
286 ASSERT_TRUE(!(a >>= b) && b == i) << "Interface1";
355 }
356}
357
287 }
288}
289
358void Test::testBoolean() {
290TEST_F(Test, testBoolean) {
359 css::uno::Any a(false);
291 css::uno::Any a(false);
360 CPPUNIT_ASSERT(a.getValueType() == getCppuType< sal_Bool >());
292 ASSERT_TRUE(a.getValueType() == getCppuType< sal_Bool >());
361 {
362 bool b = true;
293 {
294 bool b = true;
363 CPPUNIT_ASSERT_MESSAGE("bool", (a >>= b) && !b);
295 ASSERT_TRUE((a >>= b) && !b) << "bool";
364 }
365 {
366 sal_Bool b = true;
296 }
297 {
298 sal_Bool b = true;
367 CPPUNIT_ASSERT_MESSAGE("sal_Bool", (a >>= b) && !b);
299 ASSERT_TRUE((a >>= b) && !b) << "sal_Bool";
368 }
369 {
370 sal_Int8 b = 2;
300 }
301 {
302 sal_Int8 b = 2;
371 CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a >>= b) && b == 2);
303 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int8";
372 }
373 {
374 sal_uInt8 b = 2;
375 if (boost::is_same< sal_uInt8, sal_Bool >::value) {
304 }
305 {
306 sal_uInt8 b = 2;
307 if (boost::is_same< sal_uInt8, sal_Bool >::value) {
376 CPPUNIT_ASSERT_MESSAGE("@sal_uInt8", (a >>= b) && b == 0);
308 ASSERT_TRUE((a >>= b) && b == 0) << "@sal_uInt8";
377 } else {
309 } else {
378 CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a >>= b) && b == 2);
310 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt8";
379 }
380 }
381 {
382 sal_Int16 b = 2;
311 }
312 }
313 {
314 sal_Int16 b = 2;
383 CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a >>= b) && b == 2);
315 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int16";
384 }
385 {
386 sal_uInt16 b = 2;
316 }
317 {
318 sal_uInt16 b = 2;
387 CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a >>= b) && b == 2);
319 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt16";
388 }
389 {
390 sal_Int32 b = 2;
320 }
321 {
322 sal_Int32 b = 2;
391 CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a >>= b) && b == 2);
323 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int32";
392 }
393 {
394 sal_uInt32 b = 2;
324 }
325 {
326 sal_uInt32 b = 2;
395 CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a >>= b) && b == 2);
327 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt32";
396 }
397 {
398 sal_Int64 b = 2;
328 }
329 {
330 sal_Int64 b = 2;
399 CPPUNIT_ASSERT_MESSAGE("sal_Int64", !(a >>= b) && b == 2);
331 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int64";
400 }
401 {
402 sal_uInt64 b = 2;
332 }
333 {
334 sal_uInt64 b = 2;
403 CPPUNIT_ASSERT_MESSAGE("sal_uInt64", !(a >>= b) && b == 2);
335 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt64";
404 }
405 {
406 float b = 2;
336 }
337 {
338 float b = 2;
407 CPPUNIT_ASSERT_MESSAGE("float", !(a >>= b) && b == 2);
339 ASSERT_TRUE(!(a >>= b) && b == 2) << "float";
408 }
409 {
410 double b = 2;
340 }
341 {
342 double b = 2;
411 CPPUNIT_ASSERT_MESSAGE("double", !(a >>= b) && b == 2);
343 ASSERT_TRUE(!(a >>= b) && b == 2) << "double";
412 }
413 {
414 sal_Unicode b = '2';
344 }
345 {
346 sal_Unicode b = '2';
415 CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a >>= b) && b == '2');
347 ASSERT_TRUE(!(a >>= b) && b == '2') << "sal_Unicode";
416 }
417 {
418 rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2"));
348 }
349 {
350 rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2"));
419 CPPUNIT_ASSERT_MESSAGE(
420 "rtl::OUString",
421 !(a >>= b) && b.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2")));
351 ASSERT_TRUE(!(a >>= b) && b.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2"))) <<
352 "rtl::OUString";
422 }
423 {
424 css::uno::Type b(getCppuType< rtl::OUString >());
353 }
354 {
355 css::uno::Type b(getCppuType< rtl::OUString >());
425 CPPUNIT_ASSERT_MESSAGE(
426 "css::uno::Type",
427 !(a >>= b) && b == getCppuType< rtl::OUString >());
356 ASSERT_TRUE(!(a >>= b) && b == getCppuType< rtl::OUString >()) <<
357 "css::uno::Type";
428 }
429 {
430 css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
358 }
359 {
360 css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
431 CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a >>= b) && b == a);
361 ASSERT_TRUE((a >>= b) && b == a) << "css::uno::Any";
432 }
433 {
434 css::uno::Sequence< rtl::OUString > b(2);
362 }
363 {
364 css::uno::Sequence< rtl::OUString > b(2);
435 CPPUNIT_ASSERT_MESSAGE(
436 "css::uno::Sequence<rtl::OUString>",
437 !(a >>= b) && b.getLength() == 2);
365 ASSERT_TRUE(!(a >>= b) && b.getLength() == 2) <<
366 "css::uno::Sequence<rtl::OUString>";
438 }
439 {
440 Enum1 b = Enum1_M2;
367 }
368 {
369 Enum1 b = Enum1_M2;
441 CPPUNIT_ASSERT_MESSAGE("Enum1", !(a >>= b) && b == Enum1_M2);
370 ASSERT_TRUE(!(a >>= b) && b == Enum1_M2) << "Enum1";
442 }
443 {
444 Struct1 b(2);
371 }
372 {
373 Struct1 b(2);
445 CPPUNIT_ASSERT_MESSAGE("Struct1", !(a >>= b) && b.member == 2);
374 ASSERT_TRUE(!(a >>= b) && b.member == 2) << "Struct1";
446 }
447 {
448 Exception1 b(
449 rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2);
375 }
376 {
377 Exception1 b(
378 rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2);
450 CPPUNIT_ASSERT_MESSAGE("Exception1", !(a >>= b) && b.member == 2);
379 ASSERT_TRUE(!(a >>= b) && b.member == 2) << "Exception1";
451 }
452 {
453 css::uno::Reference< Interface1 > i(new Impl1);
454 css::uno::Reference< Interface1 > b(i);
380 }
381 {
382 css::uno::Reference< Interface1 > i(new Impl1);
383 css::uno::Reference< Interface1 > b(i);
455 CPPUNIT_ASSERT_MESSAGE("Interface1", !(a >>= b) && b == i);
384 ASSERT_TRUE(!(a >>= b) && b == i) << "Interface1";
456 }
457}
458
385 }
386}
387
459void Test::testByte() {
388TEST_F(Test, testByte) {
460 css::uno::Any a(static_cast< sal_Int8 >(1));
389 css::uno::Any a(static_cast< sal_Int8 >(1));
461 CPPUNIT_ASSERT(a.getValueType() == getCppuType< sal_Int8 >());
390 ASSERT_TRUE(a.getValueType() == getCppuType< sal_Int8 >());
462 {
463 bool b = true;
391 {
392 bool b = true;
464 CPPUNIT_ASSERT_MESSAGE("bool", !(a >>= b) && b);
393 ASSERT_TRUE(!(a >>= b) && b) << "bool";
465 }
466 {
467 sal_Bool b = true;
394 }
395 {
396 sal_Bool b = true;
468 CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b) && b);
397 ASSERT_TRUE(!(a >>= b) && b) << "sal_Bool";
469 }
470 {
471 sal_Int8 b = 2;
398 }
399 {
400 sal_Int8 b = 2;
472 CPPUNIT_ASSERT_MESSAGE("sal_Int8", (a >>= b) && b == 1);
401 ASSERT_TRUE((a >>= b) && b == 1) << "sal_Int8";
473 }
474 {
475 sal_uInt8 b = 2;
402 }
403 {
404 sal_uInt8 b = 2;
476 CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a >>= b) && b == 2);
405 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt8";
477 }
478 {
479 sal_Int16 b = 2;
406 }
407 {
408 sal_Int16 b = 2;
480 CPPUNIT_ASSERT_MESSAGE("sal_Int16", (a >>= b) && b == 1);
409 ASSERT_TRUE((a >>= b) && b == 1) << "sal_Int16";
481 }
482 {
483 sal_uInt16 b = 2;
410 }
411 {
412 sal_uInt16 b = 2;
484 CPPUNIT_ASSERT_MESSAGE("sal_uInt16", (a >>= b) && b == 1);
413 ASSERT_TRUE((a >>= b) && b == 1) << "sal_uInt16";
485 }
486 {
487 sal_Int32 b = 2;
414 }
415 {
416 sal_Int32 b = 2;
488 CPPUNIT_ASSERT_MESSAGE("sal_Int32", (a >>= b) && b == 1);
417 ASSERT_TRUE((a >>= b) && b == 1) << "sal_Int32";
489 }
490 {
491 sal_uInt32 b = 2;
418 }
419 {
420 sal_uInt32 b = 2;
492 CPPUNIT_ASSERT_MESSAGE("sal_uInt32", (a >>= b) && b == 1);
421 ASSERT_TRUE((a >>= b) && b == 1) << "sal_uInt32";
493 }
494 {
495 sal_Int64 b = 2;
422 }
423 {
424 sal_Int64 b = 2;
496 CPPUNIT_ASSERT_MESSAGE("sal_Int64", (a >>= b) && b == 1);
425 ASSERT_TRUE((a >>= b) && b == 1) << "sal_Int64";
497 }
498 {
499 sal_uInt64 b = 2;
426 }
427 {
428 sal_uInt64 b = 2;
500 CPPUNIT_ASSERT_MESSAGE("sal_uInt64", (a >>= b) && b == 1);
429 ASSERT_TRUE((a >>= b) && b == 1) << "sal_uInt64";
501 }
502 {
503 float b = 2;
430 }
431 {
432 float b = 2;
504 CPPUNIT_ASSERT_MESSAGE("float", (a >>= b) && b == 1);
433 ASSERT_TRUE((a >>= b) && b == 1) << "float";
505 }
506 {
507 double b = 2;
434 }
435 {
436 double b = 2;
508 CPPUNIT_ASSERT_MESSAGE("double", (a >>= b) && b == 1);
437 ASSERT_TRUE((a >>= b) && b == 1) << "double";
509 }
510 {
511 sal_Unicode b = '2';
512 if (boost::is_same< sal_Unicode, sal_uInt16 >::value) {
438 }
439 {
440 sal_Unicode b = '2';
441 if (boost::is_same< sal_Unicode, sal_uInt16 >::value) {
513 CPPUNIT_ASSERT_MESSAGE("@sal_Unicode", (a >>= b) && b == 1);
442 ASSERT_TRUE((a >>= b) && b == 1) << "@sal_Unicode";
514 } else {
443 } else {
515 CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a >>= b) && b == '2');
444 ASSERT_TRUE(!(a >>= b) && b == '2') << "sal_Unicode";
516 }
517 }
518 {
519 rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2"));
445 }
446 }
447 {
448 rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2"));
520 CPPUNIT_ASSERT_MESSAGE(
521 "rtl::OUString",
522 !(a >>= b) && b.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2")));
449 ASSERT_TRUE(!(a >>= b) && b.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2"))) <<
450 "rtl::OUString";
523 }
524 {
525 css::uno::Type b(getCppuType< rtl::OUString >());
451 }
452 {
453 css::uno::Type b(getCppuType< rtl::OUString >());
526 CPPUNIT_ASSERT_MESSAGE(
527 "css::uno::Type",
528 !(a >>= b) && b == getCppuType< rtl::OUString >());
454 ASSERT_TRUE(!(a >>= b) && b == getCppuType< rtl::OUString >()) <<
455 "css::uno::Type";
529 }
530 {
531 css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
456 }
457 {
458 css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
532 CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a >>= b) && b == a);
459 ASSERT_TRUE((a >>= b) && b == a) << "css::uno::Any";
533 }
534 {
535 css::uno::Sequence< rtl::OUString > b(2);
460 }
461 {
462 css::uno::Sequence< rtl::OUString > b(2);
536 CPPUNIT_ASSERT_MESSAGE(
537 "css::uno::Sequence<rtl::OUString>",
538 !(a >>= b) && b.getLength() == 2);
463 ASSERT_TRUE(!(a >>= b) && b.getLength() == 2) <<
464 "css::uno::Sequence<rtl::OUString>";
539 }
540 {
541 Enum1 b = Enum1_M2;
465 }
466 {
467 Enum1 b = Enum1_M2;
542 CPPUNIT_ASSERT_MESSAGE("Enum1", !(a >>= b) && b == Enum1_M2);
468 ASSERT_TRUE(!(a >>= b) && b == Enum1_M2) << "Enum1";
543 }
544 {
545 Struct1 b(2);
469 }
470 {
471 Struct1 b(2);
546 CPPUNIT_ASSERT_MESSAGE("Struct1", !(a >>= b) && b.member == 2);
472 ASSERT_TRUE(!(a >>= b) && b.member == 2) << "Struct1";
547 }
548 {
549 Exception1 b(
550 rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2);
473 }
474 {
475 Exception1 b(
476 rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2);
551 CPPUNIT_ASSERT_MESSAGE("Exception1", !(a >>= b) && b.member == 2);
477 ASSERT_TRUE(!(a >>= b) && b.member == 2) << "Exception1";
552 }
553 {
554 css::uno::Reference< Interface1 > i(new Impl1);
555 css::uno::Reference< Interface1 > b(i);
478 }
479 {
480 css::uno::Reference< Interface1 > i(new Impl1);
481 css::uno::Reference< Interface1 > b(i);
556 CPPUNIT_ASSERT_MESSAGE("Interface1", !(a >>= b) && b == i);
482 ASSERT_TRUE(!(a >>= b) && b == i) << "Interface1";
557 }
558}
559
483 }
484}
485
560void Test::testShort() {
486TEST_F(Test, testShort) {
561 css::uno::Any a(static_cast< sal_Int16 >(1));
487 css::uno::Any a(static_cast< sal_Int16 >(1));
562 CPPUNIT_ASSERT(a.getValueType() == getCppuType< sal_Int16 >());
488 ASSERT_TRUE(a.getValueType() == getCppuType< sal_Int16 >());
563 {
564 bool b = true;
489 {
490 bool b = true;
565 CPPUNIT_ASSERT_MESSAGE("bool", !(a >>= b) && b);
491 ASSERT_TRUE(!(a >>= b) && b) << "bool";
566 }
567 {
568 sal_Bool b = true;
492 }
493 {
494 sal_Bool b = true;
569 CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b) && b);
495 ASSERT_TRUE(!(a >>= b) && b) << "sal_Bool";
570 }
571 {
572 sal_Int8 b = 2;
496 }
497 {
498 sal_Int8 b = 2;
573 CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a >>= b) && b == 2);
499 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int8";
574 }
575 {
576 sal_uInt8 b = 2;
500 }
501 {
502 sal_uInt8 b = 2;
577 CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a >>= b) && b == 2);
503 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt8";
578 }
579 {
580 sal_Int16 b = 2;
504 }
505 {
506 sal_Int16 b = 2;
581 CPPUNIT_ASSERT_MESSAGE("sal_Int16", (a >>= b) && b == 1);
507 ASSERT_TRUE((a >>= b) && b == 1) << "sal_Int16";
582 }
583 {
584 sal_uInt16 b = 2;
508 }
509 {
510 sal_uInt16 b = 2;
585 CPPUNIT_ASSERT_MESSAGE("sal_uInt16", (a >>= b) && b == 1);
511 ASSERT_TRUE((a >>= b) && b == 1) << "sal_uInt16";
586 }
587 {
588 sal_Int32 b = 2;
512 }
513 {
514 sal_Int32 b = 2;
589 CPPUNIT_ASSERT_MESSAGE("sal_Int32", (a >>= b) && b == 1);
515 ASSERT_TRUE((a >>= b) && b == 1) << "sal_Int32";
590 }
591 {
592 sal_uInt32 b = 2;
516 }
517 {
518 sal_uInt32 b = 2;
593 CPPUNIT_ASSERT_MESSAGE("sal_uInt32", (a >>= b) && b == 1);
519 ASSERT_TRUE((a >>= b) && b == 1) << "sal_uInt32";
594 }
595 {
596 sal_Int64 b = 2;
520 }
521 {
522 sal_Int64 b = 2;
597 CPPUNIT_ASSERT_MESSAGE("sal_Int64", (a >>= b) && b == 1);
523 ASSERT_TRUE((a >>= b) && b == 1) << "sal_Int64";
598 }
599 {
600 sal_uInt64 b = 2;
524 }
525 {
526 sal_uInt64 b = 2;
601 CPPUNIT_ASSERT_MESSAGE("sal_uInt64", (a >>= b) && b == 1);
527 ASSERT_TRUE((a >>= b) && b == 1) << "sal_uInt64";
602 }
603 {
604 float b = 2;
528 }
529 {
530 float b = 2;
605 CPPUNIT_ASSERT_MESSAGE("float", (a >>= b) && b == 1);
531 ASSERT_TRUE((a >>= b) && b == 1) << "float";
606 }
607 {
608 double b = 2;
532 }
533 {
534 double b = 2;
609 CPPUNIT_ASSERT_MESSAGE("double", (a >>= b) && b == 1);
535 ASSERT_TRUE((a >>= b) && b == 1) << "double";
610 }
611 {
612 sal_Unicode b = '2';
613 if (boost::is_same< sal_Unicode, sal_uInt16 >::value) {
536 }
537 {
538 sal_Unicode b = '2';
539 if (boost::is_same< sal_Unicode, sal_uInt16 >::value) {
614 CPPUNIT_ASSERT_MESSAGE("@sal_Unicode", (a >>= b) && b == 1);
540 ASSERT_TRUE((a >>= b) && b == 1) << "@sal_Unicode";
615 } else {
541 } else {
616 CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a >>= b) && b == '2');
542 ASSERT_TRUE(!(a >>= b) && b == '2') << "sal_Unicode";
617 }
618 }
619 {
620 rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2"));
543 }
544 }
545 {
546 rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2"));
621 CPPUNIT_ASSERT_MESSAGE(
622 "rtl::OUString",
623 !(a >>= b) && b.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2")));
547 ASSERT_TRUE(!(a >>= b) && b.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2"))) <<
548 "rtl::OUString";
624 }
625 {
626 css::uno::Type b(getCppuType< rtl::OUString >());
549 }
550 {
551 css::uno::Type b(getCppuType< rtl::OUString >());
627 CPPUNIT_ASSERT_MESSAGE(
628 "css::uno::Type",
629 !(a >>= b) && b == getCppuType< rtl::OUString >());
552 ASSERT_TRUE(!(a >>= b) && b == getCppuType< rtl::OUString >()) <<
553 "css::uno::Type";
630 }
631 {
632 css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
554 }
555 {
556 css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
633 CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a >>= b) && b == a);
557 ASSERT_TRUE((a >>= b) && b == a) << "css::uno::Any";
634 }
635 {
636 css::uno::Sequence< rtl::OUString > b(2);
558 }
559 {
560 css::uno::Sequence< rtl::OUString > b(2);
637 CPPUNIT_ASSERT_MESSAGE(
638 "css::uno::Sequence<rtl::OUString>",
639 !(a >>= b) && b.getLength() == 2);
561 ASSERT_TRUE(!(a >>= b) && b.getLength() == 2) <<
562 "css::uno::Sequence<rtl::OUString>";
640 }
641 {
642 Enum1 b = Enum1_M2;
563 }
564 {
565 Enum1 b = Enum1_M2;
643 CPPUNIT_ASSERT_MESSAGE("Enum1", !(a >>= b) && b == Enum1_M2);
566 ASSERT_TRUE(!(a >>= b) && b == Enum1_M2) << "Enum1";
644 }
645 {
646 Struct1 b(2);
567 }
568 {
569 Struct1 b(2);
647 CPPUNIT_ASSERT_MESSAGE("Struct1", !(a >>= b) && b.member == 2);
570 ASSERT_TRUE(!(a >>= b) && b.member == 2) << "Struct1";
648 }
649 {
650 Exception1 b(
651 rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2);
571 }
572 {
573 Exception1 b(
574 rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2);
652 CPPUNIT_ASSERT_MESSAGE("Exception1", !(a >>= b) && b.member == 2);
575 ASSERT_TRUE(!(a >>= b) && b.member == 2) << "Exception1";
653 }
654 {
655 css::uno::Reference< Interface1 > i(new Impl1);
656 css::uno::Reference< Interface1 > b(i);
576 }
577 {
578 css::uno::Reference< Interface1 > i(new Impl1);
579 css::uno::Reference< Interface1 > b(i);
657 CPPUNIT_ASSERT_MESSAGE("Interface1", !(a >>= b) && b == i);
580 ASSERT_TRUE(!(a >>= b) && b == i) << "Interface1";
658 }
659}
660
581 }
582}
583
661void Test::testUnsignedShort() {
584TEST_F(Test, testUnsignedShort) {
662 sal_uInt16 n = 1;
663 css::uno::Any a(&n, getCppuType(static_cast< sal_uInt16 const * >(0)));
585 sal_uInt16 n = 1;
586 css::uno::Any a(&n, getCppuType(static_cast< sal_uInt16 const * >(0)));
664 CPPUNIT_ASSERT(
587 ASSERT_TRUE(
665 a.getValueType() == getCppuType(static_cast< sal_uInt16 const * >(0)));
666 {
667 bool b = true;
588 a.getValueType() == getCppuType(static_cast< sal_uInt16 const * >(0)));
589 {
590 bool b = true;
668 CPPUNIT_ASSERT_MESSAGE("bool", !(a >>= b) && b);
591 ASSERT_TRUE(!(a >>= b) && b) << "bool";
669 }
670 {
671 sal_Bool b = true;
592 }
593 {
594 sal_Bool b = true;
672 CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b) && b);
595 ASSERT_TRUE(!(a >>= b) && b) << "sal_Bool";
673 }
674 {
675 sal_Int8 b = 2;
596 }
597 {
598 sal_Int8 b = 2;
676 CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a >>= b) && b == 2);
599 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int8";
677 }
678 {
679 sal_uInt8 b = 2;
600 }
601 {
602 sal_uInt8 b = 2;
680 CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a >>= b) && b == 2);
603 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt8";
681 }
682 {
683 sal_Int16 b = 2;
604 }
605 {
606 sal_Int16 b = 2;
684 CPPUNIT_ASSERT_MESSAGE("sal_Int16", (a >>= b) && b == 1);
607 ASSERT_TRUE((a >>= b) && b == 1) << "sal_Int16";
685 }
686 {
687 sal_uInt16 b = 2;
608 }
609 {
610 sal_uInt16 b = 2;
688 CPPUNIT_ASSERT_MESSAGE("sal_uInt16", (a >>= b) && b == 1);
611 ASSERT_TRUE((a >>= b) && b == 1) << "sal_uInt16";
689 }
690 {
691 sal_Int32 b = 2;
612 }
613 {
614 sal_Int32 b = 2;
692 CPPUNIT_ASSERT_MESSAGE("sal_Int32", (a >>= b) && b == 1);
615 ASSERT_TRUE((a >>= b) && b == 1) << "sal_Int32";
693 }
694 {
695 sal_uInt32 b = 2;
616 }
617 {
618 sal_uInt32 b = 2;
696 CPPUNIT_ASSERT_MESSAGE("sal_uInt32", (a >>= b) && b == 1);
619 ASSERT_TRUE((a >>= b) && b == 1) << "sal_uInt32";
697 }
698 {
699 sal_Int64 b = 2;
620 }
621 {
622 sal_Int64 b = 2;
700 CPPUNIT_ASSERT_MESSAGE("sal_Int64", (a >>= b) && b == 1);
623 ASSERT_TRUE((a >>= b) && b == 1) << "sal_Int64";
701 }
702 {
703 sal_uInt64 b = 2;
624 }
625 {
626 sal_uInt64 b = 2;
704 CPPUNIT_ASSERT_MESSAGE("sal_uInt64", (a >>= b) && b == 1);
627 ASSERT_TRUE((a >>= b) && b == 1) << "sal_uInt64";
705 }
706 {
707 float b = 2;
628 }
629 {
630 float b = 2;
708 CPPUNIT_ASSERT_MESSAGE("float", (a >>= b) && b == 1);
631 ASSERT_TRUE((a >>= b) && b == 1) << "float";
709 }
710 {
711 double b = 2;
632 }
633 {
634 double b = 2;
712 CPPUNIT_ASSERT_MESSAGE("double", (a >>= b) && b == 1);
635 ASSERT_TRUE((a >>= b) && b == 1) << "double";
713 }
714 {
715 sal_Unicode b = '2';
716 if (boost::is_same< sal_Unicode, sal_uInt16 >::value) {
636 }
637 {
638 sal_Unicode b = '2';
639 if (boost::is_same< sal_Unicode, sal_uInt16 >::value) {
717 CPPUNIT_ASSERT_MESSAGE("@sal_Unicode", (a >>= b) && b == 1);
640 ASSERT_TRUE((a >>= b) && b == 1) << "@sal_Unicode";
718 } else {
641 } else {
719 CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a >>= b) && b == '2');
642 ASSERT_TRUE(!(a >>= b) && b == '2') << "sal_Unicode";
720 }
721 }
722 {
723 rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2"));
643 }
644 }
645 {
646 rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2"));
724 CPPUNIT_ASSERT_MESSAGE(
725 "rtl::OUString",
726 !(a >>= b) && b.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2")));
647 ASSERT_TRUE(!(a >>= b) && b.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2"))) <<
648 "rtl::OUString";
727 }
728 {
729 css::uno::Type b(getCppuType< rtl::OUString >());
649 }
650 {
651 css::uno::Type b(getCppuType< rtl::OUString >());
730 CPPUNIT_ASSERT_MESSAGE(
731 "css::uno::Type",
732 !(a >>= b) && b == getCppuType< rtl::OUString >());
652 ASSERT_TRUE(!(a >>= b) && b == getCppuType< rtl::OUString >()) <<
653 "css::uno::Type";
733 }
734 {
735 css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
654 }
655 {
656 css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
736 CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a >>= b) && b == a);
657 ASSERT_TRUE((a >>= b) && b == a) << "css::uno::Any";
737 }
738 {
739 css::uno::Sequence< rtl::OUString > b(2);
658 }
659 {
660 css::uno::Sequence< rtl::OUString > b(2);
740 CPPUNIT_ASSERT_MESSAGE(
741 "css::uno::Sequence<rtl::OUString>",
742 !(a >>= b) && b.getLength() == 2);
661 ASSERT_TRUE(!(a >>= b) && b.getLength() == 2) <<
662 "css::uno::Sequence<rtl::OUString>";
743 }
744 {
745 Enum1 b = Enum1_M2;
663 }
664 {
665 Enum1 b = Enum1_M2;
746 CPPUNIT_ASSERT_MESSAGE("Enum1", !(a >>= b) && b == Enum1_M2);
666 ASSERT_TRUE(!(a >>= b) && b == Enum1_M2) << "Enum1";
747 }
748 {
749 Struct1 b(2);
667 }
668 {
669 Struct1 b(2);
750 CPPUNIT_ASSERT_MESSAGE("Struct1", !(a >>= b) && b.member == 2);
670 ASSERT_TRUE(!(a >>= b) && b.member == 2) << "Struct1";
751 }
752 {
753 Exception1 b(
754 rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2);
671 }
672 {
673 Exception1 b(
674 rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2);
755 CPPUNIT_ASSERT_MESSAGE("Exception1", !(a >>= b) && b.member == 2);
675 ASSERT_TRUE(!(a >>= b) && b.member == 2) << "Exception1";
756 }
757 {
758 css::uno::Reference< Interface1 > i(new Impl1);
759 css::uno::Reference< Interface1 > b(i);
676 }
677 {
678 css::uno::Reference< Interface1 > i(new Impl1);
679 css::uno::Reference< Interface1 > b(i);
760 CPPUNIT_ASSERT_MESSAGE("Interface1", !(a >>= b) && b == i);
680 ASSERT_TRUE(!(a >>= b) && b == i) << "Interface1";
761 }
762}
763
681 }
682}
683
764void Test::testLong() {
684TEST_F(Test, testLong) {
765 css::uno::Any a(static_cast< sal_Int32 >(1));
685 css::uno::Any a(static_cast< sal_Int32 >(1));
766 CPPUNIT_ASSERT(a.getValueType() == getCppuType< sal_Int32 >());
686 ASSERT_TRUE(a.getValueType() == getCppuType< sal_Int32 >());
767 {
768 bool b = true;
687 {
688 bool b = true;
769 CPPUNIT_ASSERT_MESSAGE("bool", !(a >>= b) && b);
689 ASSERT_TRUE(!(a >>= b) && b) << "bool";
770 }
771 {
772 sal_Bool b = true;
690 }
691 {
692 sal_Bool b = true;
773 CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b) && b);
693 ASSERT_TRUE(!(a >>= b) && b) << "sal_Bool";
774 }
775 {
776 sal_Int8 b = 2;
694 }
695 {
696 sal_Int8 b = 2;
777 CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a >>= b) && b == 2);
697 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int8";
778 }
779 {
780 sal_uInt8 b = 2;
698 }
699 {
700 sal_uInt8 b = 2;
781 CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a >>= b) && b == 2);
701 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt8";
782 }
783 {
784 sal_Int16 b = 2;
702 }
703 {
704 sal_Int16 b = 2;
785 CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a >>= b) && b == 2);
705 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int16";
786 }
787 {
788 sal_uInt16 b = 2;
706 }
707 {
708 sal_uInt16 b = 2;
789 CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a >>= b) && b == 2);
709 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt16";
790 }
791 {
792 sal_Int32 b = 2;
710 }
711 {
712 sal_Int32 b = 2;
793 CPPUNIT_ASSERT_MESSAGE("sal_Int32", (a >>= b) && b == 1);
713 ASSERT_TRUE((a >>= b) && b == 1) << "sal_Int32";
794 }
795 {
796 sal_uInt32 b = 2;
714 }
715 {
716 sal_uInt32 b = 2;
797 CPPUNIT_ASSERT_MESSAGE("sal_uInt32", (a >>= b) && b == 1);
717 ASSERT_TRUE((a >>= b) && b == 1) << "sal_uInt32";
798 }
799 {
800 sal_Int64 b = 2;
718 }
719 {
720 sal_Int64 b = 2;
801 CPPUNIT_ASSERT_MESSAGE("sal_Int64", (a >>= b) && b == 1);
721 ASSERT_TRUE((a >>= b) && b == 1) << "sal_Int64";
802 }
803 {
804 sal_uInt64 b = 2;
722 }
723 {
724 sal_uInt64 b = 2;
805 CPPUNIT_ASSERT_MESSAGE("sal_uInt64", (a >>= b) && b == 1);
725 ASSERT_TRUE((a >>= b) && b == 1) << "sal_uInt64";
806 }
807 {
808 float b = 2;
726 }
727 {
728 float b = 2;
809 CPPUNIT_ASSERT_MESSAGE("float", !(a >>= b) && b == 2);
729 ASSERT_TRUE(!(a >>= b) && b == 2) << "float";
810 }
811 {
812 double b = 2;
730 }
731 {
732 double b = 2;
813 CPPUNIT_ASSERT_MESSAGE("double", (a >>= b) && b == 1);
733 ASSERT_TRUE((a >>= b) && b == 1) << "double";
814 }
815 {
816 sal_Unicode b = '2';
734 }
735 {
736 sal_Unicode b = '2';
817 CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a >>= b) && b == '2');
737 ASSERT_TRUE(!(a >>= b) && b == '2') << "sal_Unicode";
818 }
819 {
820 rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2"));
738 }
739 {
740 rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2"));
821 CPPUNIT_ASSERT_MESSAGE(
822 "rtl::OUString",
823 !(a >>= b) && b.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2")));
741 ASSERT_TRUE(!(a >>= b) && b.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2"))) <<
742 "rtl::OUString";
824 }
825 {
826 css::uno::Type b(getCppuType< rtl::OUString >());
743 }
744 {
745 css::uno::Type b(getCppuType< rtl::OUString >());
827 CPPUNIT_ASSERT_MESSAGE(
828 "css::uno::Type",
829 !(a >>= b) && b == getCppuType< rtl::OUString >());
746 ASSERT_TRUE(!(a >>= b) && b == getCppuType< rtl::OUString >()) <<
747 "css::uno::Type";
830 }
831 {
832 css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
748 }
749 {
750 css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
833 CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a >>= b) && b == a);
751 ASSERT_TRUE((a >>= b) && b == a) << "css::uno::Any";
834 }
835 {
836 css::uno::Sequence< rtl::OUString > b(2);
752 }
753 {
754 css::uno::Sequence< rtl::OUString > b(2);
837 CPPUNIT_ASSERT_MESSAGE(
838 "css::uno::Sequence<rtl::OUString>",
839 !(a >>= b) && b.getLength() == 2);
755 ASSERT_TRUE(!(a >>= b) && b.getLength() == 2) <<
756 "css::uno::Sequence<rtl::OUString>";
840 }
841 {
842 Enum1 b = Enum1_M2;
757 }
758 {
759 Enum1 b = Enum1_M2;
843 CPPUNIT_ASSERT_MESSAGE("Enum1", !(a >>= b) && b == Enum1_M2);
760 ASSERT_TRUE(!(a >>= b) && b == Enum1_M2) << "Enum1";
844 }
845 {
846 Struct1 b(2);
761 }
762 {
763 Struct1 b(2);
847 CPPUNIT_ASSERT_MESSAGE("Struct1", !(a >>= b) && b.member == 2);
764 ASSERT_TRUE(!(a >>= b) && b.member == 2) << "Struct1";
848 }
849 {
850 Exception1 b(
851 rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2);
765 }
766 {
767 Exception1 b(
768 rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2);
852 CPPUNIT_ASSERT_MESSAGE("Exception1", !(a >>= b) && b.member == 2);
769 ASSERT_TRUE(!(a >>= b) && b.member == 2) << "Exception1";
853 }
854 {
855 css::uno::Reference< Interface1 > i(new Impl1);
856 css::uno::Reference< Interface1 > b(i);
770 }
771 {
772 css::uno::Reference< Interface1 > i(new Impl1);
773 css::uno::Reference< Interface1 > b(i);
857 CPPUNIT_ASSERT_MESSAGE("Interface1", !(a >>= b) && b == i);
774 ASSERT_TRUE(!(a >>= b) && b == i) << "Interface1";
858 }
859}
860
775 }
776}
777
861void Test::testUnsignedLong() {
778TEST_F(Test, testUnsignedLong) {
862 css::uno::Any a(static_cast< sal_uInt32 >(1));
779 css::uno::Any a(static_cast< sal_uInt32 >(1));
863 CPPUNIT_ASSERT(a.getValueType() == getCppuType< sal_uInt32 >());
780 ASSERT_TRUE(a.getValueType() == getCppuType< sal_uInt32 >());
864 {
865 bool b = true;
781 {
782 bool b = true;
866 CPPUNIT_ASSERT_MESSAGE("bool", !(a >>= b) && b);
783 ASSERT_TRUE(!(a >>= b) && b) << "bool";
867 }
868 {
869 sal_Bool b = true;
784 }
785 {
786 sal_Bool b = true;
870 CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b) && b);
787 ASSERT_TRUE(!(a >>= b) && b) << "sal_Bool";
871 }
872 {
873 sal_Int8 b = 2;
788 }
789 {
790 sal_Int8 b = 2;
874 CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a >>= b) && b == 2);
791 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int8";
875 }
876 {
877 sal_uInt8 b = 2;
792 }
793 {
794 sal_uInt8 b = 2;
878 CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a >>= b) && b == 2);
795 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt8";
879 }
880 {
881 sal_Int16 b = 2;
796 }
797 {
798 sal_Int16 b = 2;
882 CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a >>= b) && b == 2);
799 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int16";
883 }
884 {
885 sal_uInt16 b = 2;
800 }
801 {
802 sal_uInt16 b = 2;
886 CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a >>= b) && b == 2);
803 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt16";
887 }
888 {
889 sal_Int32 b = 2;
804 }
805 {
806 sal_Int32 b = 2;
890 CPPUNIT_ASSERT_MESSAGE("sal_Int32", (a >>= b) && b == 1);
807 ASSERT_TRUE((a >>= b) && b == 1) << "sal_Int32";
891 }
892 {
893 sal_uInt32 b = 2;
808 }
809 {
810 sal_uInt32 b = 2;
894 CPPUNIT_ASSERT_MESSAGE("sal_uInt32", (a >>= b) && b == 1);
811 ASSERT_TRUE((a >>= b) && b == 1) << "sal_uInt32";
895 }
896 {
897 sal_Int64 b = 2;
812 }
813 {
814 sal_Int64 b = 2;
898 CPPUNIT_ASSERT_MESSAGE("sal_Int64", (a >>= b) && b == 1);
815 ASSERT_TRUE((a >>= b) && b == 1) << "sal_Int64";
899 }
900 {
901 sal_uInt64 b = 2;
816 }
817 {
818 sal_uInt64 b = 2;
902 CPPUNIT_ASSERT_MESSAGE("sal_uInt64", (a >>= b) && b == 1);
819 ASSERT_TRUE((a >>= b) && b == 1) << "sal_uInt64";
903 }
904 {
905 float b = 2;
820 }
821 {
822 float b = 2;
906 CPPUNIT_ASSERT_MESSAGE("float", !(a >>= b) && b == 2);
823 ASSERT_TRUE(!(a >>= b) && b == 2) << "float";
907 }
908 {
909 double b = 2;
824 }
825 {
826 double b = 2;
910 CPPUNIT_ASSERT_MESSAGE("double", (a >>= b) && b == 1);
827 ASSERT_TRUE((a >>= b) && b == 1) << "double";
911 }
912 {
913 sal_Unicode b = '2';
828 }
829 {
830 sal_Unicode b = '2';
914 CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a >>= b) && b == '2');
831 ASSERT_TRUE(!(a >>= b) && b == '2') << "sal_Unicode";
915 }
916 {
917 rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2"));
832 }
833 {
834 rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2"));
918 CPPUNIT_ASSERT_MESSAGE(
919 "rtl::OUString",
920 !(a >>= b) && b.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2")));
835 ASSERT_TRUE(!(a >>= b) && b.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2"))) <<
836 "rtl::OUString";
921 }
922 {
923 css::uno::Type b(getCppuType< rtl::OUString >());
837 }
838 {
839 css::uno::Type b(getCppuType< rtl::OUString >());
924 CPPUNIT_ASSERT_MESSAGE(
925 "css::uno::Type",
926 !(a >>= b) && b == getCppuType< rtl::OUString >());
840 ASSERT_TRUE(!(a >>= b) && b == getCppuType< rtl::OUString >()) <<
841 "css::uno::Type";
927 }
928 {
929 css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
842 }
843 {
844 css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
930 CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a >>= b) && b == a);
845 ASSERT_TRUE((a >>= b) && b == a) << "css::uno::Any";
931 }
932 {
933 css::uno::Sequence< rtl::OUString > b(2);
846 }
847 {
848 css::uno::Sequence< rtl::OUString > b(2);
934 CPPUNIT_ASSERT_MESSAGE(
935 "css::uno::Sequence<rtl::OUString>",
936 !(a >>= b) && b.getLength() == 2);
849 ASSERT_TRUE(!(a >>= b) && b.getLength() == 2) <<
850 "css::uno::Sequence<rtl::OUString>";
937 }
938 {
939 Enum1 b = Enum1_M2;
851 }
852 {
853 Enum1 b = Enum1_M2;
940 CPPUNIT_ASSERT_MESSAGE("Enum1", !(a >>= b) && b == Enum1_M2);
854 ASSERT_TRUE(!(a >>= b) && b == Enum1_M2) << "Enum1";
941 }
942 {
943 Struct1 b(2);
855 }
856 {
857 Struct1 b(2);
944 CPPUNIT_ASSERT_MESSAGE("Struct1", !(a >>= b) && b.member == 2);
858 ASSERT_TRUE(!(a >>= b) && b.member == 2) << "Struct1";
945 }
946 {
947 Exception1 b(
948 rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2);
859 }
860 {
861 Exception1 b(
862 rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2);
949 CPPUNIT_ASSERT_MESSAGE("Exception1", !(a >>= b) && b.member == 2);
863 ASSERT_TRUE(!(a >>= b) && b.member == 2) << "Exception1";
950 }
951 {
952 css::uno::Reference< Interface1 > i(new Impl1);
953 css::uno::Reference< Interface1 > b(i);
864 }
865 {
866 css::uno::Reference< Interface1 > i(new Impl1);
867 css::uno::Reference< Interface1 > b(i);
954 CPPUNIT_ASSERT_MESSAGE("Interface1", !(a >>= b) && b == i);
868 ASSERT_TRUE(!(a >>= b) && b == i) << "Interface1";
955 }
956}
957
869 }
870}
871
958void Test::testHyper() {
872TEST_F(Test, testHyper) {
959 css::uno::Any a(static_cast< sal_Int64 >(1));
873 css::uno::Any a(static_cast< sal_Int64 >(1));
960 CPPUNIT_ASSERT(a.getValueType() == getCppuType< sal_Int64 >());
874 ASSERT_TRUE(a.getValueType() == getCppuType< sal_Int64 >());
961 {
962 bool b = true;
875 {
876 bool b = true;
963 CPPUNIT_ASSERT_MESSAGE("bool", !(a >>= b) && b);
877 ASSERT_TRUE(!(a >>= b) && b) << "bool";
964 }
965 {
966 sal_Bool b = true;
878 }
879 {
880 sal_Bool b = true;
967 CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b) && b);
881 ASSERT_TRUE(!(a >>= b) && b) << "sal_Bool";
968 }
969 {
970 sal_Int8 b = 2;
882 }
883 {
884 sal_Int8 b = 2;
971 CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a >>= b) && b == 2);
885 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int8";
972 }
973 {
974 sal_uInt8 b = 2;
886 }
887 {
888 sal_uInt8 b = 2;
975 CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a >>= b) && b == 2);
889 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt8";
976 }
977 {
978 sal_Int16 b = 2;
890 }
891 {
892 sal_Int16 b = 2;
979 CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a >>= b) && b == 2);
893 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int16";
980 }
981 {
982 sal_uInt16 b = 2;
894 }
895 {
896 sal_uInt16 b = 2;
983 CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a >>= b) && b == 2);
897 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt16";
984 }
985 {
986 sal_Int32 b = 2;
898 }
899 {
900 sal_Int32 b = 2;
987 CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a >>= b) && b == 2);
901 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int32";
988 }
989 {
990 sal_uInt32 b = 2;
902 }
903 {
904 sal_uInt32 b = 2;
991 CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a >>= b) && b == 2);
905 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt32";
992 }
993 {
994 sal_Int64 b = 2;
906 }
907 {
908 sal_Int64 b = 2;
995 CPPUNIT_ASSERT_MESSAGE("sal_Int64", (a >>= b) && b == 1);
909 ASSERT_TRUE((a >>= b) && b == 1) << "sal_Int64";
996 }
997 {
998 sal_uInt64 b = 2;
910 }
911 {
912 sal_uInt64 b = 2;
999 CPPUNIT_ASSERT_MESSAGE("sal_uInt64", (a >>= b) && b == 1);
913 ASSERT_TRUE((a >>= b) && b == 1) << "sal_uInt64";
1000 }
1001 {
1002 float b = 2;
914 }
915 {
916 float b = 2;
1003 CPPUNIT_ASSERT_MESSAGE("float", !(a >>= b) && b == 2);
917 ASSERT_TRUE(!(a >>= b) && b == 2) << "float";
1004 }
1005 {
1006 double b = 2;
918 }
919 {
920 double b = 2;
1007 CPPUNIT_ASSERT_MESSAGE("double", !(a >>= b) && b == 2);
921 ASSERT_TRUE(!(a >>= b) && b == 2) << "double";
1008 }
1009 {
1010 sal_Unicode b = '2';
922 }
923 {
924 sal_Unicode b = '2';
1011 CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a >>= b) && b == '2');
925 ASSERT_TRUE(!(a >>= b) && b == '2') << "sal_Unicode";
1012 }
1013 {
1014 rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2"));
926 }
927 {
928 rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2"));
1015 CPPUNIT_ASSERT_MESSAGE(
1016 "rtl::OUString",
1017 !(a >>= b) && b.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2")));
929 ASSERT_TRUE(!(a >>= b) && b.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2"))) <<
930 "rtl::OUString";
1018 }
1019 {
1020 css::uno::Type b(getCppuType< rtl::OUString >());
931 }
932 {
933 css::uno::Type b(getCppuType< rtl::OUString >());
1021 CPPUNIT_ASSERT_MESSAGE(
1022 "css::uno::Type",
1023 !(a >>= b) && b == getCppuType< rtl::OUString >());
934 ASSERT_TRUE(!(a >>= b) && b == getCppuType< rtl::OUString >()) <<
935 "css::uno::Type";
1024 }
1025 {
1026 css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
936 }
937 {
938 css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
1027 CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a >>= b) && b == a);
939 ASSERT_TRUE((a >>= b) && b == a) << "css::uno::Any";
1028 }
1029 {
1030 css::uno::Sequence< rtl::OUString > b(2);
940 }
941 {
942 css::uno::Sequence< rtl::OUString > b(2);
1031 CPPUNIT_ASSERT_MESSAGE(
1032 "css::uno::Sequence<rtl::OUString>",
1033 !(a >>= b) && b.getLength() == 2);
943 ASSERT_TRUE(!(a >>= b) && b.getLength() == 2) <<
944 "css::uno::Sequence<rtl::OUString>";
1034 }
1035 {
1036 Enum1 b = Enum1_M2;
945 }
946 {
947 Enum1 b = Enum1_M2;
1037 CPPUNIT_ASSERT_MESSAGE("Enum1", !(a >>= b) && b == Enum1_M2);
948 ASSERT_TRUE(!(a >>= b) && b == Enum1_M2) << "Enum1";
1038 }
1039 {
1040 Struct1 b(2);
949 }
950 {
951 Struct1 b(2);
1041 CPPUNIT_ASSERT_MESSAGE("Struct1", !(a >>= b) && b.member == 2);
952 ASSERT_TRUE(!(a >>= b) && b.member == 2) << "Struct1";
1042 }
1043 {
1044 Exception1 b(
1045 rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2);
953 }
954 {
955 Exception1 b(
956 rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2);
1046 CPPUNIT_ASSERT_MESSAGE("Exception1", !(a >>= b) && b.member == 2);
957 ASSERT_TRUE(!(a >>= b) && b.member == 2) << "Exception1";
1047 }
1048 {
1049 css::uno::Reference< Interface1 > i(new Impl1);
1050 css::uno::Reference< Interface1 > b(i);
958 }
959 {
960 css::uno::Reference< Interface1 > i(new Impl1);
961 css::uno::Reference< Interface1 > b(i);
1051 CPPUNIT_ASSERT_MESSAGE("Interface1", !(a >>= b) && b == i);
962 ASSERT_TRUE(!(a >>= b) && b == i) << "Interface1";
1052 }
1053}
1054
963 }
964}
965
1055void Test::testUnsignedHyper() {
966TEST_F(Test, testUnsignedHyper) {
1056 css::uno::Any a(static_cast< sal_uInt64 >(1));
967 css::uno::Any a(static_cast< sal_uInt64 >(1));
1057 CPPUNIT_ASSERT(a.getValueType() == getCppuType< sal_uInt64 >());
968 ASSERT_TRUE(a.getValueType() == getCppuType< sal_uInt64 >());
1058 {
1059 bool b = true;
969 {
970 bool b = true;
1060 CPPUNIT_ASSERT_MESSAGE("bool", !(a >>= b) && b);
971 ASSERT_TRUE(!(a >>= b) && b) << "bool";
1061 }
1062 {
1063 sal_Bool b = true;
972 }
973 {
974 sal_Bool b = true;
1064 CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b) && b);
975 ASSERT_TRUE(!(a >>= b) && b) << "sal_Bool";
1065 }
1066 {
1067 sal_Int8 b = 2;
976 }
977 {
978 sal_Int8 b = 2;
1068 CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a >>= b) && b == 2);
979 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int8";
1069 }
1070 {
1071 sal_uInt8 b = 2;
980 }
981 {
982 sal_uInt8 b = 2;
1072 CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a >>= b) && b == 2);
983 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt8";
1073 }
1074 {
1075 sal_Int16 b = 2;
984 }
985 {
986 sal_Int16 b = 2;
1076 CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a >>= b) && b == 2);
987 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int16";
1077 }
1078 {
1079 sal_uInt16 b = 2;
988 }
989 {
990 sal_uInt16 b = 2;
1080 CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a >>= b) && b == 2);
991 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt16";
1081 }
1082 {
1083 sal_Int32 b = 2;
992 }
993 {
994 sal_Int32 b = 2;
1084 CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a >>= b) && b == 2);
995 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int32";
1085 }
1086 {
1087 sal_uInt32 b = 2;
996 }
997 {
998 sal_uInt32 b = 2;
1088 CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a >>= b) && b == 2);
999 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt32";
1089 }
1090 {
1091 sal_Int64 b = 2;
1000 }
1001 {
1002 sal_Int64 b = 2;
1092 CPPUNIT_ASSERT_MESSAGE("sal_Int64", (a >>= b) && b == 1);
1003 ASSERT_TRUE((a >>= b) && b == 1) << "sal_Int64";
1093 }
1094 {
1095 sal_uInt64 b = 2;
1004 }
1005 {
1006 sal_uInt64 b = 2;
1096 CPPUNIT_ASSERT_MESSAGE("sal_uInt64", (a >>= b) && b == 1);
1007 ASSERT_TRUE((a >>= b) && b == 1) << "sal_uInt64";
1097 }
1098 {
1099 float b = 2;
1008 }
1009 {
1010 float b = 2;
1100 CPPUNIT_ASSERT_MESSAGE("float", !(a >>= b) && b == 2);
1011 ASSERT_TRUE(!(a >>= b) && b == 2) << "float";
1101 }
1102 {
1103 double b = 2;
1012 }
1013 {
1014 double b = 2;
1104 CPPUNIT_ASSERT_MESSAGE("double", !(a >>= b) && b == 2);
1015 ASSERT_TRUE(!(a >>= b) && b == 2) << "double";
1105 }
1106 {
1107 sal_Unicode b = '2';
1016 }
1017 {
1018 sal_Unicode b = '2';
1108 CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a >>= b) && b == '2');
1019 ASSERT_TRUE(!(a >>= b) && b == '2') << "sal_Unicode";
1109 }
1110 {
1111 rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2"));
1020 }
1021 {
1022 rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2"));
1112 CPPUNIT_ASSERT_MESSAGE(
1113 "rtl::OUString",
1114 !(a >>= b) && b.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2")));
1023 ASSERT_TRUE(!(a >>= b) && b.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2"))) <<
1024 "rtl::OUString";
1115 }
1116 {
1117 css::uno::Type b(getCppuType< rtl::OUString >());
1025 }
1026 {
1027 css::uno::Type b(getCppuType< rtl::OUString >());
1118 CPPUNIT_ASSERT_MESSAGE(
1119 "css::uno::Type",
1120 !(a >>= b) && b == getCppuType< rtl::OUString >());
1028 ASSERT_TRUE(!(a >>= b) && b == getCppuType< rtl::OUString >()) <<
1029 "css::uno::Type";
1121 }
1122 {
1123 css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
1030 }
1031 {
1032 css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
1124 CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a >>= b) && b == a);
1033 ASSERT_TRUE((a >>= b) && b == a) << "css::uno::Any";
1125 }
1126 {
1127 css::uno::Sequence< rtl::OUString > b(2);
1034 }
1035 {
1036 css::uno::Sequence< rtl::OUString > b(2);
1128 CPPUNIT_ASSERT_MESSAGE(
1129 "css::uno::Sequence<rtl::OUString>",
1130 !(a >>= b) && b.getLength() == 2);
1037 ASSERT_TRUE(!(a >>= b) && b.getLength() == 2) <<
1038 "css::uno::Sequence<rtl::OUString>";
1131 }
1132 {
1133 Enum1 b = Enum1_M2;
1039 }
1040 {
1041 Enum1 b = Enum1_M2;
1134 CPPUNIT_ASSERT_MESSAGE("Enum1", !(a >>= b) && b == Enum1_M2);
1042 ASSERT_TRUE(!(a >>= b) && b == Enum1_M2) << "Enum1";
1135 }
1136 {
1137 Struct1 b(2);
1043 }
1044 {
1045 Struct1 b(2);
1138 CPPUNIT_ASSERT_MESSAGE("Struct1", !(a >>= b) && b.member == 2);
1046 ASSERT_TRUE(!(a >>= b) && b.member == 2) << "Struct1";
1139 }
1140 {
1141 Exception1 b(
1142 rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2);
1047 }
1048 {
1049 Exception1 b(
1050 rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2);
1143 CPPUNIT_ASSERT_MESSAGE("Exception1", !(a >>= b) && b.member == 2);
1051 ASSERT_TRUE(!(a >>= b) && b.member == 2) << "Exception1";
1144 }
1145 {
1146 css::uno::Reference< Interface1 > i(new Impl1);
1147 css::uno::Reference< Interface1 > b(i);
1052 }
1053 {
1054 css::uno::Reference< Interface1 > i(new Impl1);
1055 css::uno::Reference< Interface1 > b(i);
1148 CPPUNIT_ASSERT_MESSAGE("Interface1", !(a >>= b) && b == i);
1056 ASSERT_TRUE(!(a >>= b) && b == i) << "Interface1";
1149 }
1150}
1151
1057 }
1058}
1059
1152void Test::testFloat() {
1060TEST_F(Test, testFloat) {
1153 css::uno::Any a(1.f);
1061 css::uno::Any a(1.f);
1154 CPPUNIT_ASSERT(a.getValueType() == getCppuType< float >());
1062 ASSERT_TRUE(a.getValueType() == getCppuType< float >());
1155 {
1156 bool b = true;
1063 {
1064 bool b = true;
1157 CPPUNIT_ASSERT_MESSAGE("bool", !(a >>= b) && b);
1065 ASSERT_TRUE(!(a >>= b) && b) << "bool";
1158 }
1159 {
1160 sal_Bool b = true;
1066 }
1067 {
1068 sal_Bool b = true;
1161 CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b) && b);
1069 ASSERT_TRUE(!(a >>= b) && b) << "sal_Bool";
1162 }
1163 {
1164 sal_Int8 b = 2;
1070 }
1071 {
1072 sal_Int8 b = 2;
1165 CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a >>= b) && b == 2);
1073 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int8";
1166 }
1167 {
1168 sal_uInt8 b = 2;
1074 }
1075 {
1076 sal_uInt8 b = 2;
1169 CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a >>= b) && b == 2);
1077 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt8";
1170 }
1171 {
1172 sal_Int16 b = 2;
1078 }
1079 {
1080 sal_Int16 b = 2;
1173 CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a >>= b) && b == 2);
1081 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int16";
1174 }
1175 {
1176 sal_uInt16 b = 2;
1082 }
1083 {
1084 sal_uInt16 b = 2;
1177 CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a >>= b) && b == 2);
1085 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt16";
1178 }
1179 {
1180 sal_Int32 b = 2;
1086 }
1087 {
1088 sal_Int32 b = 2;
1181 CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a >>= b) && b == 2);
1089 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int32";
1182 }
1183 {
1184 sal_uInt32 b = 2;
1090 }
1091 {
1092 sal_uInt32 b = 2;
1185 CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a >>= b) && b == 2);
1093 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt32";
1186 }
1187 {
1188 sal_Int64 b = 2;
1094 }
1095 {
1096 sal_Int64 b = 2;
1189 CPPUNIT_ASSERT_MESSAGE("sal_Int64", !(a >>= b) && b == 2);
1097 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int64";
1190 }
1191 {
1192 sal_uInt64 b = 2;
1098 }
1099 {
1100 sal_uInt64 b = 2;
1193 CPPUNIT_ASSERT_MESSAGE("sal_uInt64", !(a >>= b) && b == 2);
1101 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt64";
1194 }
1195 {
1196 float b = 2;
1102 }
1103 {
1104 float b = 2;
1197 CPPUNIT_ASSERT_MESSAGE("float", (a >>= b) && b == 1);
1105 ASSERT_TRUE((a >>= b) && b == 1) << "float";
1198 }
1199 {
1200 double b = 2;
1106 }
1107 {
1108 double b = 2;
1201 CPPUNIT_ASSERT_MESSAGE("double", (a >>= b) && b == 1);
1109 ASSERT_TRUE((a >>= b) && b == 1) << "double";
1202 }
1203 {
1204 sal_Unicode b = '2';
1110 }
1111 {
1112 sal_Unicode b = '2';
1205 CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a >>= b) && b == '2');
1113 ASSERT_TRUE(!(a >>= b) && b == '2') << "sal_Unicode";
1206 }
1207 {
1208 rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2"));
1114 }
1115 {
1116 rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2"));
1209 CPPUNIT_ASSERT_MESSAGE(
1210 "rtl::OUString",
1211 !(a >>= b) && b.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2")));
1117 ASSERT_TRUE(!(a >>= b) && b.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2"))) <<
1118 "rtl::OUString";
1212 }
1213 {
1214 css::uno::Type b(getCppuType< rtl::OUString >());
1119 }
1120 {
1121 css::uno::Type b(getCppuType< rtl::OUString >());
1215 CPPUNIT_ASSERT_MESSAGE(
1216 "css::uno::Type",
1217 !(a >>= b) && b == getCppuType< rtl::OUString >());
1122 ASSERT_TRUE(!(a >>= b) && b == getCppuType< rtl::OUString >()) <<
1123 "css::uno::Type";
1218 }
1219 {
1220 css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
1124 }
1125 {
1126 css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
1221 CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a >>= b) && b == a);
1127 ASSERT_TRUE((a >>= b) && b == a) << "css::uno::Any";
1222 }
1223 {
1224 css::uno::Sequence< rtl::OUString > b(2);
1128 }
1129 {
1130 css::uno::Sequence< rtl::OUString > b(2);
1225 CPPUNIT_ASSERT_MESSAGE(
1226 "css::uno::Sequence<rtl::OUString>",
1227 !(a >>= b) && b.getLength() == 2);
1131 ASSERT_TRUE(!(a >>= b) && b.getLength() == 2) <<
1132 "css::uno::Sequence<rtl::OUString>";
1228 }
1229 {
1230 Enum1 b = Enum1_M2;
1133 }
1134 {
1135 Enum1 b = Enum1_M2;
1231 CPPUNIT_ASSERT_MESSAGE("Enum1", !(a >>= b) && b == Enum1_M2);
1136 ASSERT_TRUE(!(a >>= b) && b == Enum1_M2) << "Enum1";
1232 }
1233 {
1234 Struct1 b(2);
1137 }
1138 {
1139 Struct1 b(2);
1235 CPPUNIT_ASSERT_MESSAGE("Struct1", !(a >>= b) && b.member == 2);
1140 ASSERT_TRUE(!(a >>= b) && b.member == 2) << "Struct1";
1236 }
1237 {
1238 Exception1 b(
1239 rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2);
1141 }
1142 {
1143 Exception1 b(
1144 rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2);
1240 CPPUNIT_ASSERT_MESSAGE("Exception1", !(a >>= b) && b.member == 2);
1145 ASSERT_TRUE(!(a >>= b) && b.member == 2) << "Exception1";
1241 }
1242 {
1243 css::uno::Reference< Interface1 > i(new Impl1);
1244 css::uno::Reference< Interface1 > b(i);
1146 }
1147 {
1148 css::uno::Reference< Interface1 > i(new Impl1);
1149 css::uno::Reference< Interface1 > b(i);
1245 CPPUNIT_ASSERT_MESSAGE("Interface1", !(a >>= b) && b == i);
1150 ASSERT_TRUE(!(a >>= b) && b == i) << "Interface1";
1246 }
1247}
1248
1151 }
1152}
1153
1249void Test::testDouble() {
1154TEST_F(Test, testDouble) {
1250 css::uno::Any a(1.);
1155 css::uno::Any a(1.);
1251 CPPUNIT_ASSERT(a.getValueType() == getCppuType< double >());
1156 ASSERT_TRUE(a.getValueType() == getCppuType< double >());
1252 {
1253 bool b = true;
1157 {
1158 bool b = true;
1254 CPPUNIT_ASSERT_MESSAGE("bool", !(a >>= b) && b);
1159 ASSERT_TRUE(!(a >>= b) && b) << "bool";
1255 }
1256 {
1257 sal_Bool b = true;
1160 }
1161 {
1162 sal_Bool b = true;
1258 CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b) && b);
1163 ASSERT_TRUE(!(a >>= b) && b) << "sal_Bool";
1259 }
1260 {
1261 sal_Int8 b = 2;
1164 }
1165 {
1166 sal_Int8 b = 2;
1262 CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a >>= b) && b == 2);
1167 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int8";
1263 }
1264 {
1265 sal_uInt8 b = 2;
1168 }
1169 {
1170 sal_uInt8 b = 2;
1266 CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a >>= b) && b == 2);
1171 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt8";
1267 }
1268 {
1269 sal_Int16 b = 2;
1172 }
1173 {
1174 sal_Int16 b = 2;
1270 CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a >>= b) && b == 2);
1175 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int16";
1271 }
1272 {
1273 sal_uInt16 b = 2;
1176 }
1177 {
1178 sal_uInt16 b = 2;
1274 CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a >>= b) && b == 2);
1179 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt16";
1275 }
1276 {
1277 sal_Int32 b = 2;
1180 }
1181 {
1182 sal_Int32 b = 2;
1278 CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a >>= b) && b == 2);
1183 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int32";
1279 }
1280 {
1281 sal_uInt32 b = 2;
1184 }
1185 {
1186 sal_uInt32 b = 2;
1282 CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a >>= b) && b == 2);
1187 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt32";
1283 }
1284 {
1285 sal_Int64 b = 2;
1188 }
1189 {
1190 sal_Int64 b = 2;
1286 CPPUNIT_ASSERT_MESSAGE("sal_Int64", !(a >>= b) && b == 2);
1191 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int64";
1287 }
1288 {
1289 sal_uInt64 b = 2;
1192 }
1193 {
1194 sal_uInt64 b = 2;
1290 CPPUNIT_ASSERT_MESSAGE("sal_uInt64", !(a >>= b) && b == 2);
1195 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt64";
1291 }
1292 {
1293 float b = 2;
1196 }
1197 {
1198 float b = 2;
1294 CPPUNIT_ASSERT_MESSAGE("float", !(a >>= b) && b == 2);
1199 ASSERT_TRUE(!(a >>= b) && b == 2) << "float";
1295 }
1296 {
1297 double b = 2;
1200 }
1201 {
1202 double b = 2;
1298 CPPUNIT_ASSERT_MESSAGE("double", (a >>= b) && b == 1);
1203 ASSERT_TRUE((a >>= b) && b == 1) << "double";
1299 }
1300 {
1301 sal_Unicode b = '2';
1204 }
1205 {
1206 sal_Unicode b = '2';
1302 CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a >>= b) && b == '2');
1207 ASSERT_TRUE(!(a >>= b) && b == '2') << "sal_Unicode";
1303 }
1304 {
1305 rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2"));
1208 }
1209 {
1210 rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2"));
1306 CPPUNIT_ASSERT_MESSAGE(
1307 "rtl::OUString",
1308 !(a >>= b) && b.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2")));
1211 ASSERT_TRUE(!(a >>= b) && b.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2"))) <<
1212 "rtl::OUString";
1309 }
1310 {
1311 css::uno::Type b(getCppuType< rtl::OUString >());
1213 }
1214 {
1215 css::uno::Type b(getCppuType< rtl::OUString >());
1312 CPPUNIT_ASSERT_MESSAGE(
1313 "css::uno::Type",
1314 !(a >>= b) && b == getCppuType< rtl::OUString >());
1216 ASSERT_TRUE(!(a >>= b) && b == getCppuType< rtl::OUString >()) <<
1217 "css::uno::Type";
1315 }
1316 {
1317 css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
1218 }
1219 {
1220 css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
1318 CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a >>= b) && b == a);
1221 ASSERT_TRUE((a >>= b) && b == a) << "css::uno::Any";
1319 }
1320 {
1321 css::uno::Sequence< rtl::OUString > b(2);
1222 }
1223 {
1224 css::uno::Sequence< rtl::OUString > b(2);
1322 CPPUNIT_ASSERT_MESSAGE(
1323 "css::uno::Sequence<rtl::OUString>",
1324 !(a >>= b) && b.getLength() == 2);
1225 ASSERT_TRUE(!(a >>= b) && b.getLength() == 2) <<
1226 "css::uno::Sequence<rtl::OUString>";
1325 }
1326 {
1327 Enum1 b = Enum1_M2;
1227 }
1228 {
1229 Enum1 b = Enum1_M2;
1328 CPPUNIT_ASSERT_MESSAGE("Enum1", !(a >>= b) && b == Enum1_M2);
1230 ASSERT_TRUE(!(a >>= b) && b == Enum1_M2) << "Enum1";
1329 }
1330 {
1331 Struct1 b(2);
1231 }
1232 {
1233 Struct1 b(2);
1332 CPPUNIT_ASSERT_MESSAGE("Struct1", !(a >>= b) && b.member == 2);
1234 ASSERT_TRUE(!(a >>= b) && b.member == 2) << "Struct1";
1333 }
1334 {
1335 Exception1 b(
1336 rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2);
1235 }
1236 {
1237 Exception1 b(
1238 rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2);
1337 CPPUNIT_ASSERT_MESSAGE("Exception1", !(a >>= b) && b.member == 2);
1239 ASSERT_TRUE(!(a >>= b) && b.member == 2) << "Exception1";
1338 }
1339 {
1340 css::uno::Reference< Interface1 > i(new Impl1);
1341 css::uno::Reference< Interface1 > b(i);
1240 }
1241 {
1242 css::uno::Reference< Interface1 > i(new Impl1);
1243 css::uno::Reference< Interface1 > b(i);
1342 CPPUNIT_ASSERT_MESSAGE("Interface1", !(a >>= b) && b == i);
1244 ASSERT_TRUE(!(a >>= b) && b == i) << "Interface1";
1343 }
1344}
1345
1245 }
1246}
1247
1346void Test::testChar() {
1248TEST_F(Test, testChar) {
1347 sal_Unicode c = '1';
1348 css::uno::Any a(&c, getCppuType< sal_Unicode >());
1249 sal_Unicode c = '1';
1250 css::uno::Any a(&c, getCppuType< sal_Unicode >());
1349 CPPUNIT_ASSERT(a.getValueType() == getCppuType< sal_Unicode >());
1251 ASSERT_TRUE(a.getValueType() == getCppuType< sal_Unicode >());
1350 {
1351 bool b = true;
1252 {
1253 bool b = true;
1352 CPPUNIT_ASSERT_MESSAGE("bool", !(a >>= b) && b);
1254 ASSERT_TRUE(!(a >>= b) && b) << "bool";
1353 }
1354 {
1355 sal_Bool b = true;
1255 }
1256 {
1257 sal_Bool b = true;
1356 CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b) && b);
1258 ASSERT_TRUE(!(a >>= b) && b) << "sal_Bool";
1357 }
1358 {
1359 sal_Int8 b = 2;
1259 }
1260 {
1261 sal_Int8 b = 2;
1360 CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a >>= b) && b == 2);
1262 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int8";
1361 }
1362 {
1363 sal_uInt8 b = 2;
1263 }
1264 {
1265 sal_uInt8 b = 2;
1364 CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a >>= b) && b == 2);
1266 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt8";
1365 }
1366 {
1367 sal_Int16 b = 2;
1267 }
1268 {
1269 sal_Int16 b = 2;
1368 CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a >>= b) && b == 2);
1270 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int16";
1369 }
1370 {
1371 sal_uInt16 b = 2;
1271 }
1272 {
1273 sal_uInt16 b = 2;
1372 CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a >>= b) && b == 2);
1274 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt16";
1373 }
1374 {
1375 sal_Int32 b = 2;
1275 }
1276 {
1277 sal_Int32 b = 2;
1376 CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a >>= b) && b == 2);
1278 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int32";
1377 }
1378 {
1379 sal_uInt32 b = 2;
1279 }
1280 {
1281 sal_uInt32 b = 2;
1380 CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a >>= b) && b == 2);
1282 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt32";
1381 }
1382 {
1383 sal_Int64 b = 2;
1283 }
1284 {
1285 sal_Int64 b = 2;
1384 CPPUNIT_ASSERT_MESSAGE("sal_Int64", !(a >>= b) && b == 2);
1286 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int64";
1385 }
1386 {
1387 sal_uInt64 b = 2;
1287 }
1288 {
1289 sal_uInt64 b = 2;
1388 CPPUNIT_ASSERT_MESSAGE("sal_uInt64", !(a >>= b) && b == 2);
1290 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt64";
1389 }
1390 {
1391 float b = 2;
1291 }
1292 {
1293 float b = 2;
1392 CPPUNIT_ASSERT_MESSAGE("float", !(a >>= b) && b == 2);
1294 ASSERT_TRUE(!(a >>= b) && b == 2) << "float";
1393 }
1394 {
1395 double b = 2;
1295 }
1296 {
1297 double b = 2;
1396 CPPUNIT_ASSERT_MESSAGE("double", !(a >>= b) && b == 2);
1298 ASSERT_TRUE(!(a >>= b) && b == 2) << "double";
1397 }
1398 {
1399 sal_Unicode b = '2';
1400 if (boost::is_same< sal_Unicode, sal_uInt16 >::value) {
1299 }
1300 {
1301 sal_Unicode b = '2';
1302 if (boost::is_same< sal_Unicode, sal_uInt16 >::value) {
1401 CPPUNIT_ASSERT_MESSAGE("@sal_Unicode", !(a >>= b) && b == '2');
1303 ASSERT_TRUE(!(a >>= b) && b == '2') << "@sal_Unicode";
1402 } else {
1304 } else {
1403 CPPUNIT_ASSERT_MESSAGE("sal_Unicode", (a >>= b) && b == '1');
1305 ASSERT_TRUE((a >>= b) && b == '1') << "sal_Unicode";
1404 }
1405 }
1406 {
1407 rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2"));
1306 }
1307 }
1308 {
1309 rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2"));
1408 CPPUNIT_ASSERT_MESSAGE(
1409 "rtl::OUString",
1410 !(a >>= b) && b.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2")));
1310 ASSERT_TRUE(!(a >>= b) && b.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2"))) <<
1311 "rtl::OUString";
1411 }
1412 {
1413 css::uno::Type b(getCppuType< rtl::OUString >());
1312 }
1313 {
1314 css::uno::Type b(getCppuType< rtl::OUString >());
1414 CPPUNIT_ASSERT_MESSAGE(
1415 "css::uno::Type",
1416 !(a >>= b) && b == getCppuType< rtl::OUString >());
1315 ASSERT_TRUE(!(a >>= b) && b == getCppuType< rtl::OUString >()) <<
1316 "css::uno::Type";
1417 }
1418 {
1419 css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
1317 }
1318 {
1319 css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
1420 CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a >>= b) && b == a);
1320 ASSERT_TRUE((a >>= b) && b == a) << "css::uno::Any";
1421 }
1422 {
1423 css::uno::Sequence< rtl::OUString > b(2);
1321 }
1322 {
1323 css::uno::Sequence< rtl::OUString > b(2);
1424 CPPUNIT_ASSERT_MESSAGE(
1425 "css::uno::Sequence<rtl::OUString>",
1426 !(a >>= b) && b.getLength() == 2);
1324 ASSERT_TRUE(!(a >>= b) && b.getLength() == 2) <<
1325 "css::uno::Sequence<rtl::OUString>";
1427 }
1428 {
1429 Enum1 b = Enum1_M2;
1326 }
1327 {
1328 Enum1 b = Enum1_M2;
1430 CPPUNIT_ASSERT_MESSAGE("Enum1", !(a >>= b) && b == Enum1_M2);
1329 ASSERT_TRUE(!(a >>= b) && b == Enum1_M2) << "Enum1";
1431 }
1432 {
1433 Struct1 b(2);
1330 }
1331 {
1332 Struct1 b(2);
1434 CPPUNIT_ASSERT_MESSAGE("Struct1", !(a >>= b) && b.member == 2);
1333 ASSERT_TRUE(!(a >>= b) && b.member == 2) << "Struct1";
1435 }
1436 {
1437 Exception1 b(
1438 rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2);
1334 }
1335 {
1336 Exception1 b(
1337 rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2);
1439 CPPUNIT_ASSERT_MESSAGE("Exception1", !(a >>= b) && b.member == 2);
1338 ASSERT_TRUE(!(a >>= b) && b.member == 2) << "Exception1";
1440 }
1441 {
1442 css::uno::Reference< Interface1 > i(new Impl1);
1443 css::uno::Reference< Interface1 > b(i);
1339 }
1340 {
1341 css::uno::Reference< Interface1 > i(new Impl1);
1342 css::uno::Reference< Interface1 > b(i);
1444 CPPUNIT_ASSERT_MESSAGE("Interface1", !(a >>= b) && b == i);
1343 ASSERT_TRUE(!(a >>= b) && b == i) << "Interface1";
1445 }
1446}
1447
1344 }
1345}
1346
1448void Test::testString() {
1347TEST_F(Test, testString) {
1449 css::uno::Any a(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("1")));
1348 css::uno::Any a(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("1")));
1450 CPPUNIT_ASSERT(a.getValueType() == getCppuType< rtl::OUString >());
1349 ASSERT_TRUE(a.getValueType() == getCppuType< rtl::OUString >());
1451 {
1452 bool b = true;
1350 {
1351 bool b = true;
1453 CPPUNIT_ASSERT_MESSAGE("bool", !(a >>= b) && b);
1352 ASSERT_TRUE(!(a >>= b) && b) << "bool";
1454 }
1455 {
1456 sal_Bool b = true;
1353 }
1354 {
1355 sal_Bool b = true;
1457 CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b) && b);
1356 ASSERT_TRUE(!(a >>= b) && b) << "sal_Bool";
1458 }
1459 {
1460 sal_Int8 b = 2;
1357 }
1358 {
1359 sal_Int8 b = 2;
1461 CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a >>= b) && b == 2);
1360 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int8";
1462 }
1463 {
1464 sal_uInt8 b = 2;
1361 }
1362 {
1363 sal_uInt8 b = 2;
1465 CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a >>= b) && b == 2);
1364 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt8";
1466 }
1467 {
1468 sal_Int16 b = 2;
1365 }
1366 {
1367 sal_Int16 b = 2;
1469 CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a >>= b) && b == 2);
1368 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int16";
1470 }
1471 {
1472 sal_uInt16 b = 2;
1369 }
1370 {
1371 sal_uInt16 b = 2;
1473 CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a >>= b) && b == 2);
1372 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt16";
1474 }
1475 {
1476 sal_Int32 b = 2;
1373 }
1374 {
1375 sal_Int32 b = 2;
1477 CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a >>= b) && b == 2);
1376 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int32";
1478 }
1479 {
1480 sal_uInt32 b = 2;
1377 }
1378 {
1379 sal_uInt32 b = 2;
1481 CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a >>= b) && b == 2);
1380 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt32";
1482 }
1483 {
1484 sal_Int64 b = 2;
1381 }
1382 {
1383 sal_Int64 b = 2;
1485 CPPUNIT_ASSERT_MESSAGE("sal_Int64", !(a >>= b) && b == 2);
1384 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int64";
1486 }
1487 {
1488 sal_uInt64 b = 2;
1385 }
1386 {
1387 sal_uInt64 b = 2;
1489 CPPUNIT_ASSERT_MESSAGE("sal_uInt64", !(a >>= b) && b == 2);
1388 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt64";
1490 }
1491 {
1492 float b = 2;
1389 }
1390 {
1391 float b = 2;
1493 CPPUNIT_ASSERT_MESSAGE("float", !(a >>= b) && b == 2);
1392 ASSERT_TRUE(!(a >>= b) && b == 2) << "float";
1494 }
1495 {
1496 double b = 2;
1393 }
1394 {
1395 double b = 2;
1497 CPPUNIT_ASSERT_MESSAGE("double", !(a >>= b) && b == 2);
1396 ASSERT_TRUE(!(a >>= b) && b == 2) << "double";
1498 }
1499 {
1500 sal_Unicode b = '2';
1397 }
1398 {
1399 sal_Unicode b = '2';
1501 CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a >>= b) && b == '2');
1400 ASSERT_TRUE(!(a >>= b) && b == '2') << "sal_Unicode";
1502 }
1503 {
1504 rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2"));
1401 }
1402 {
1403 rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2"));
1505 CPPUNIT_ASSERT_MESSAGE(
1506 "rtl::OUString",
1507 (a >>= b) && b.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("1")));
1404 ASSERT_TRUE((a >>= b) && b.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("1"))) <<
1405 "rtl::OUString";
1508 }
1509 {
1510 css::uno::Type b(getCppuType< rtl::OUString >());
1406 }
1407 {
1408 css::uno::Type b(getCppuType< rtl::OUString >());
1511 CPPUNIT_ASSERT_MESSAGE(
1512 "css::uno::Type",
1513 !(a >>= b) && b == getCppuType< rtl::OUString >());
1409 ASSERT_TRUE(!(a >>= b) && b == getCppuType< rtl::OUString >()) <<
1410 "css::uno::Type";
1514 }
1515 {
1516 css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
1411 }
1412 {
1413 css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
1517 CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a >>= b) && b == a);
1414 ASSERT_TRUE((a >>= b) && b == a) << "css::uno::Any";
1518 }
1519 {
1520 css::uno::Sequence< rtl::OUString > b(2);
1415 }
1416 {
1417 css::uno::Sequence< rtl::OUString > b(2);
1521 CPPUNIT_ASSERT_MESSAGE(
1522 "css::uno::Sequence<rtl::OUString>",
1523 !(a >>= b) && b.getLength() == 2);
1418 ASSERT_TRUE(!(a >>= b) && b.getLength() == 2) <<
1419 "css::uno::Sequence<rtl::OUString>";
1524 }
1525 {
1526 Enum1 b = Enum1_M2;
1420 }
1421 {
1422 Enum1 b = Enum1_M2;
1527 CPPUNIT_ASSERT_MESSAGE("Enum1", !(a >>= b) && b == Enum1_M2);
1423 ASSERT_TRUE(!(a >>= b) && b == Enum1_M2) << "Enum1";
1528 }
1529 {
1530 Struct1 b(2);
1424 }
1425 {
1426 Struct1 b(2);
1531 CPPUNIT_ASSERT_MESSAGE("Struct1", !(a >>= b) && b.member == 2);
1427 ASSERT_TRUE(!(a >>= b) && b.member == 2) << "Struct1";
1532 }
1533 {
1534 Exception1 b(
1535 rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2);
1428 }
1429 {
1430 Exception1 b(
1431 rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2);
1536 CPPUNIT_ASSERT_MESSAGE("Exception1", !(a >>= b) && b.member == 2);
1432 ASSERT_TRUE(!(a >>= b) && b.member == 2) << "Exception1";
1537 }
1538 {
1539 css::uno::Reference< Interface1 > i(new Impl1);
1540 css::uno::Reference< Interface1 > b(i);
1433 }
1434 {
1435 css::uno::Reference< Interface1 > i(new Impl1);
1436 css::uno::Reference< Interface1 > b(i);
1541 CPPUNIT_ASSERT_MESSAGE("Interface1", !(a >>= b) && b == i);
1437 ASSERT_TRUE(!(a >>= b) && b == i) << "Interface1";
1542 }
1543}
1544
1438 }
1439}
1440
1545void Test::testType() {
1441TEST_F(Test, testType) {
1546 css::uno::Any a(getCppuType< sal_Int32 >());
1442 css::uno::Any a(getCppuType< sal_Int32 >());
1547 CPPUNIT_ASSERT(a.getValueType() == getCppuType< css::uno::Type >());
1443 ASSERT_TRUE(a.getValueType() == getCppuType< css::uno::Type >());
1548 {
1549 bool b = true;
1444 {
1445 bool b = true;
1550 CPPUNIT_ASSERT_MESSAGE("bool", !(a >>= b) && b);
1446 ASSERT_TRUE(!(a >>= b) && b) << "bool";
1551 }
1552 {
1553 sal_Bool b = true;
1447 }
1448 {
1449 sal_Bool b = true;
1554 CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b) && b);
1450 ASSERT_TRUE(!(a >>= b) && b) << "sal_Bool";
1555 }
1556 {
1557 sal_Int8 b = 2;
1451 }
1452 {
1453 sal_Int8 b = 2;
1558 CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a >>= b) && b == 2);
1454 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int8";
1559 }
1560 {
1561 sal_uInt8 b = 2;
1455 }
1456 {
1457 sal_uInt8 b = 2;
1562 CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a >>= b) && b == 2);
1458 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt8";
1563 }
1564 {
1565 sal_Int16 b = 2;
1459 }
1460 {
1461 sal_Int16 b = 2;
1566 CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a >>= b) && b == 2);
1462 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int16";
1567 }
1568 {
1569 sal_uInt16 b = 2;
1463 }
1464 {
1465 sal_uInt16 b = 2;
1570 CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a >>= b) && b == 2);
1466 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt16";
1571 }
1572 {
1573 sal_Int32 b = 2;
1467 }
1468 {
1469 sal_Int32 b = 2;
1574 CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a >>= b) && b == 2);
1470 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int32";
1575 }
1576 {
1577 sal_uInt32 b = 2;
1471 }
1472 {
1473 sal_uInt32 b = 2;
1578 CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a >>= b) && b == 2);
1474 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt32";
1579 }
1580 {
1581 sal_Int64 b = 2;
1475 }
1476 {
1477 sal_Int64 b = 2;
1582 CPPUNIT_ASSERT_MESSAGE("sal_Int64", !(a >>= b) && b == 2);
1478 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int64";
1583 }
1584 {
1585 sal_uInt64 b = 2;
1479 }
1480 {
1481 sal_uInt64 b = 2;
1586 CPPUNIT_ASSERT_MESSAGE("sal_uInt64", !(a >>= b) && b == 2);
1482 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt64";
1587 }
1588 {
1589 float b = 2;
1483 }
1484 {
1485 float b = 2;
1590 CPPUNIT_ASSERT_MESSAGE("float", !(a >>= b) && b == 2);
1486 ASSERT_TRUE(!(a >>= b) && b == 2) << "float";
1591 }
1592 {
1593 double b = 2;
1487 }
1488 {
1489 double b = 2;
1594 CPPUNIT_ASSERT_MESSAGE("double", !(a >>= b) && b == 2);
1490 ASSERT_TRUE(!(a >>= b) && b == 2) << "double";
1595 }
1596 {
1597 sal_Unicode b = '2';
1491 }
1492 {
1493 sal_Unicode b = '2';
1598 CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a >>= b) && b == '2');
1494 ASSERT_TRUE(!(a >>= b) && b == '2') << "sal_Unicode";
1599 }
1600 {
1601 rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2"));
1495 }
1496 {
1497 rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2"));
1602 CPPUNIT_ASSERT_MESSAGE(
1603 "rtl::OUString",
1604 !(a >>= b) && b.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2")));
1498 ASSERT_TRUE(!(a >>= b) && b.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2"))) <<
1499 "rtl::OUString";
1605 }
1606 {
1607 css::uno::Type b(getCppuType< rtl::OUString >());
1500 }
1501 {
1502 css::uno::Type b(getCppuType< rtl::OUString >());
1608 CPPUNIT_ASSERT_MESSAGE(
1609 "css::uno::Type", (a >>= b) && b == getCppuType< sal_Int32 >());
1503 ASSERT_TRUE((a >>= b) && b == getCppuType< sal_Int32 >()) <<
1504 "css::uno::Type";
1610 }
1611 {
1612 css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
1505 }
1506 {
1507 css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
1613 CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a >>= b) && b == a);
1508 ASSERT_TRUE((a >>= b) && b == a) << "css::uno::Any";
1614 }
1615 {
1616 css::uno::Sequence< rtl::OUString > b(2);
1509 }
1510 {
1511 css::uno::Sequence< rtl::OUString > b(2);
1617 CPPUNIT_ASSERT_MESSAGE(
1618 "css::uno::Sequence<rtl::OUString>",
1619 !(a >>= b) && b.getLength() == 2);
1512 ASSERT_TRUE(!(a >>= b) && b.getLength() == 2) <<
1513 "css::uno::Sequence<rtl::OUString>";
1620 }
1621 {
1622 Enum1 b = Enum1_M2;
1514 }
1515 {
1516 Enum1 b = Enum1_M2;
1623 CPPUNIT_ASSERT_MESSAGE("Enum1", !(a >>= b) && b == Enum1_M2);
1517 ASSERT_TRUE(!(a >>= b) && b == Enum1_M2) << "Enum1";
1624 }
1625 {
1626 Struct1 b(2);
1518 }
1519 {
1520 Struct1 b(2);
1627 CPPUNIT_ASSERT_MESSAGE("Struct1", !(a >>= b) && b.member == 2);
1521 ASSERT_TRUE(!(a >>= b) && b.member == 2) << "Struct1";
1628 }
1629 {
1630 Exception1 b(
1631 rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2);
1522 }
1523 {
1524 Exception1 b(
1525 rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2);
1632 CPPUNIT_ASSERT_MESSAGE("Exception1", !(a >>= b) && b.member == 2);
1526 ASSERT_TRUE(!(a >>= b) && b.member == 2) << "Exception1";
1633 }
1634 {
1635 css::uno::Reference< Interface1 > i(new Impl1);
1636 css::uno::Reference< Interface1 > b(i);
1527 }
1528 {
1529 css::uno::Reference< Interface1 > i(new Impl1);
1530 css::uno::Reference< Interface1 > b(i);
1637 CPPUNIT_ASSERT_MESSAGE("Interface1", !(a >>= b) && b == i);
1531 ASSERT_TRUE(!(a >>= b) && b == i) << "Interface1";
1638 }
1639}
1640
1532 }
1533}
1534
1641void Test::testSequence() {
1535TEST_F(Test, testSequence) {
1642 sal_Int32 n = 1;
1643 css::uno::Any a(css::uno::Sequence< sal_Int32 >(&n, 1));
1536 sal_Int32 n = 1;
1537 css::uno::Any a(css::uno::Sequence< sal_Int32 >(&n, 1));
1644 CPPUNIT_ASSERT(
1538 ASSERT_TRUE(
1645 a.getValueType() == getCppuType< css::uno::Sequence< sal_Int32 > >());
1646 {
1647 bool b = true;
1539 a.getValueType() == getCppuType< css::uno::Sequence< sal_Int32 > >());
1540 {
1541 bool b = true;
1648 CPPUNIT_ASSERT_MESSAGE("bool", !(a >>= b) && b);
1542 ASSERT_TRUE(!(a >>= b) && b) << "bool";
1649 }
1650 {
1651 sal_Bool b = true;
1543 }
1544 {
1545 sal_Bool b = true;
1652 CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b) && b);
1546 ASSERT_TRUE(!(a >>= b) && b) << "sal_Bool";
1653 }
1654 {
1655 sal_Int8 b = 2;
1547 }
1548 {
1549 sal_Int8 b = 2;
1656 CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a >>= b) && b == 2);
1550 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int8";
1657 }
1658 {
1659 sal_uInt8 b = 2;
1551 }
1552 {
1553 sal_uInt8 b = 2;
1660 CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a >>= b) && b == 2);
1554 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt8";
1661 }
1662 {
1663 sal_Int16 b = 2;
1555 }
1556 {
1557 sal_Int16 b = 2;
1664 CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a >>= b) && b == 2);
1558 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int16";
1665 }
1666 {
1667 sal_uInt16 b = 2;
1559 }
1560 {
1561 sal_uInt16 b = 2;
1668 CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a >>= b) && b == 2);
1562 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt16";
1669 }
1670 {
1671 sal_Int32 b = 2;
1563 }
1564 {
1565 sal_Int32 b = 2;
1672 CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a >>= b) && b == 2);
1566 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int32";
1673 }
1674 {
1675 sal_uInt32 b = 2;
1567 }
1568 {
1569 sal_uInt32 b = 2;
1676 CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a >>= b) && b == 2);
1570 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt32";
1677 }
1678 {
1679 sal_Int64 b = 2;
1571 }
1572 {
1573 sal_Int64 b = 2;
1680 CPPUNIT_ASSERT_MESSAGE("sal_Int64", !(a >>= b) && b == 2);
1574 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int64";
1681 }
1682 {
1683 sal_uInt64 b = 2;
1575 }
1576 {
1577 sal_uInt64 b = 2;
1684 CPPUNIT_ASSERT_MESSAGE("sal_uInt64", !(a >>= b) && b == 2);
1578 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt64";
1685 }
1686 {
1687 float b = 2;
1579 }
1580 {
1581 float b = 2;
1688 CPPUNIT_ASSERT_MESSAGE("float", !(a >>= b) && b == 2);
1582 ASSERT_TRUE(!(a >>= b) && b == 2) << "float";
1689 }
1690 {
1691 double b = 2;
1583 }
1584 {
1585 double b = 2;
1692 CPPUNIT_ASSERT_MESSAGE("double", !(a >>= b) && b == 2);
1586 ASSERT_TRUE(!(a >>= b) && b == 2) << "double";
1693 }
1694 {
1695 sal_Unicode b = '2';
1587 }
1588 {
1589 sal_Unicode b = '2';
1696 CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a >>= b) && b == '2');
1590 ASSERT_TRUE(!(a >>= b) && b == '2') << "sal_Unicode";
1697 }
1698 {
1699 rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2"));
1591 }
1592 {
1593 rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2"));
1700 CPPUNIT_ASSERT_MESSAGE(
1701 "rtl::OUString",
1702 !(a >>= b) && b.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2")));
1594 ASSERT_TRUE(!(a >>= b) && b.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2"))) <<
1595 "rtl::OUString";
1703 }
1704 {
1705 css::uno::Type b(getCppuType< rtl::OUString >());
1596 }
1597 {
1598 css::uno::Type b(getCppuType< rtl::OUString >());
1706 CPPUNIT_ASSERT_MESSAGE(
1707 "css::uno::Type",
1708 !(a >>= b) && b == getCppuType< rtl::OUString >());
1599 ASSERT_TRUE(!(a >>= b) && b == getCppuType< rtl::OUString >()) <<
1600 "css::uno::Type";
1709 }
1710 {
1711 css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
1601 }
1602 {
1603 css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
1712 CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a >>= b) && b == a);
1604 ASSERT_TRUE((a >>= b) && b == a) << "css::uno::Any";
1713 }
1714 {
1715 css::uno::Sequence< rtl::OUString > b(2);
1605 }
1606 {
1607 css::uno::Sequence< rtl::OUString > b(2);
1716 CPPUNIT_ASSERT_MESSAGE(
1717 "css::uno::Sequence<rtl::OUString>",
1718 !(a >>= b) && b.getLength() == 2);
1608 ASSERT_TRUE(!(a >>= b) && b.getLength() == 2) <<
1609 "css::uno::Sequence<rtl::OUString>";
1719 }
1720 {
1721 css::uno::Sequence< sal_Int32 > b(2);
1610 }
1611 {
1612 css::uno::Sequence< sal_Int32 > b(2);
1722 CPPUNIT_ASSERT_MESSAGE(
1723 "css::uno::Sequence<sal_Int32>",
1724 (a >>= b) && b.getLength() == 1 && b[0] == 1);
1613 ASSERT_TRUE((a >>= b) && b.getLength() == 1 && b[0] == 1) <<
1614 "css::uno::Sequence<sal_Int32>";
1725 }
1726 {
1727 Enum1 b = Enum1_M2;
1615 }
1616 {
1617 Enum1 b = Enum1_M2;
1728 CPPUNIT_ASSERT_MESSAGE("Enum1", !(a >>= b) && b == Enum1_M2);
1618 ASSERT_TRUE(!(a >>= b) && b == Enum1_M2) << "Enum1";
1729 }
1730 {
1731 Struct1 b(2);
1619 }
1620 {
1621 Struct1 b(2);
1732 CPPUNIT_ASSERT_MESSAGE("Struct1", !(a >>= b) && b.member == 2);
1622 ASSERT_TRUE(!(a >>= b) && b.member == 2) << "Struct1";
1733 }
1734 {
1735 Exception1 b(
1736 rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2);
1623 }
1624 {
1625 Exception1 b(
1626 rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2);
1737 CPPUNIT_ASSERT_MESSAGE("Exception1", !(a >>= b) && b.member == 2);
1627 ASSERT_TRUE(!(a >>= b) && b.member == 2) << "Exception1";
1738 }
1739 {
1740 css::uno::Reference< Interface1 > i(new Impl1);
1741 css::uno::Reference< Interface1 > b(i);
1628 }
1629 {
1630 css::uno::Reference< Interface1 > i(new Impl1);
1631 css::uno::Reference< Interface1 > b(i);
1742 CPPUNIT_ASSERT_MESSAGE("Interface1", !(a >>= b) && b == i);
1632 ASSERT_TRUE(!(a >>= b) && b == i) << "Interface1";
1743 }
1744}
1745
1633 }
1634}
1635
1746void Test::testEnum() {
1636TEST_F(Test, testEnum) {
1747 css::uno::Any a(Enum2_M1);
1637 css::uno::Any a(Enum2_M1);
1748 CPPUNIT_ASSERT(a.getValueType() == getCppuType< Enum2 >());
1638 ASSERT_TRUE(a.getValueType() == getCppuType< Enum2 >());
1749 {
1750 bool b = true;
1639 {
1640 bool b = true;
1751 CPPUNIT_ASSERT_MESSAGE("bool", !(a >>= b) && b);
1641 ASSERT_TRUE(!(a >>= b) && b) << "bool";
1752 }
1753 {
1754 sal_Bool b = true;
1642 }
1643 {
1644 sal_Bool b = true;
1755 CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b) && b);
1645 ASSERT_TRUE(!(a >>= b) && b) << "sal_Bool";
1756 }
1757 {
1758 sal_Int8 b = 2;
1646 }
1647 {
1648 sal_Int8 b = 2;
1759 CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a >>= b) && b == 2);
1649 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int8";
1760 }
1761 {
1762 sal_uInt8 b = 2;
1650 }
1651 {
1652 sal_uInt8 b = 2;
1763 CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a >>= b) && b == 2);
1653 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt8";
1764 }
1765 {
1766 sal_Int16 b = 2;
1654 }
1655 {
1656 sal_Int16 b = 2;
1767 CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a >>= b) && b == 2);
1657 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int16";
1768 }
1769 {
1770 sal_uInt16 b = 2;
1658 }
1659 {
1660 sal_uInt16 b = 2;
1771 CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a >>= b) && b == 2);
1661 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt16";
1772 }
1773 {
1774 sal_Int32 b = 2;
1662 }
1663 {
1664 sal_Int32 b = 2;
1775 CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a >>= b) && b == 2);
1665 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int32";
1776 }
1777 {
1778 sal_uInt32 b = 2;
1666 }
1667 {
1668 sal_uInt32 b = 2;
1779 CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a >>= b) && b == 2);
1669 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt32";
1780 }
1781 {
1782 sal_Int64 b = 2;
1670 }
1671 {
1672 sal_Int64 b = 2;
1783 CPPUNIT_ASSERT_MESSAGE("sal_Int64", !(a >>= b) && b == 2);
1673 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int64";
1784 }
1785 {
1786 sal_uInt64 b = 2;
1674 }
1675 {
1676 sal_uInt64 b = 2;
1787 CPPUNIT_ASSERT_MESSAGE("sal_uInt64", !(a >>= b) && b == 2);
1677 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt64";
1788 }
1789 {
1790 float b = 2;
1678 }
1679 {
1680 float b = 2;
1791 CPPUNIT_ASSERT_MESSAGE("float", !(a >>= b) && b == 2);
1681 ASSERT_TRUE(!(a >>= b) && b == 2) << "float";
1792 }
1793 {
1794 double b = 2;
1682 }
1683 {
1684 double b = 2;
1795 CPPUNIT_ASSERT_MESSAGE("double", !(a >>= b) && b == 2);
1685 ASSERT_TRUE(!(a >>= b) && b == 2) << "double";
1796 }
1797 {
1798 sal_Unicode b = '2';
1686 }
1687 {
1688 sal_Unicode b = '2';
1799 CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a >>= b) && b == '2');
1689 ASSERT_TRUE(!(a >>= b) && b == '2') << "sal_Unicode";
1800 }
1801 {
1802 rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2"));
1690 }
1691 {
1692 rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2"));
1803 CPPUNIT_ASSERT_MESSAGE(
1804 "rtl::OUString",
1805 !(a >>= b) && b.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2")));
1693 ASSERT_TRUE(!(a >>= b) && b.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2"))) <<
1694 "rtl::OUString";
1806 }
1807 {
1808 css::uno::Type b(getCppuType< rtl::OUString >());
1695 }
1696 {
1697 css::uno::Type b(getCppuType< rtl::OUString >());
1809 CPPUNIT_ASSERT_MESSAGE(
1810 "css::uno::Type",
1811 !(a >>= b) && b == getCppuType< rtl::OUString >());
1698 ASSERT_TRUE(!(a >>= b) && b == getCppuType< rtl::OUString >()) <<
1699 "css::uno::Type";
1812 }
1813 {
1814 css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
1700 }
1701 {
1702 css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
1815 CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a >>= b) && b == a);
1703 ASSERT_TRUE((a >>= b) && b == a) << "css::uno::Any";
1816 }
1817 {
1818 css::uno::Sequence< rtl::OUString > b(2);
1704 }
1705 {
1706 css::uno::Sequence< rtl::OUString > b(2);
1819 CPPUNIT_ASSERT_MESSAGE(
1820 "css::uno::Sequence<rtl::OUString>",
1821 !(a >>= b) && b.getLength() == 2);
1707 ASSERT_TRUE(!(a >>= b) && b.getLength() == 2) <<
1708 "css::uno::Sequence<rtl::OUString>";
1822 }
1823 {
1824 Enum1 b = Enum1_M2;
1709 }
1710 {
1711 Enum1 b = Enum1_M2;
1825 CPPUNIT_ASSERT_MESSAGE("Enum1", !(a >>= b) && b == Enum1_M2);
1712 ASSERT_TRUE(!(a >>= b) && b == Enum1_M2) << "Enum1";
1826 }
1827 {
1828 Enum2 b = Enum2_M2;
1713 }
1714 {
1715 Enum2 b = Enum2_M2;
1829 CPPUNIT_ASSERT_MESSAGE("Enum2", (a >>= b) && b == Enum2_M1);
1716 ASSERT_TRUE((a >>= b) && b == Enum2_M1) << "Enum2";
1830 }
1831 {
1832 Struct1 b(2);
1717 }
1718 {
1719 Struct1 b(2);
1833 CPPUNIT_ASSERT_MESSAGE("Struct1", !(a >>= b) && b.member == 2);
1720 ASSERT_TRUE(!(a >>= b) && b.member == 2) << "Struct1";
1834 }
1835 {
1836 Exception1 b(
1837 rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2);
1721 }
1722 {
1723 Exception1 b(
1724 rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2);
1838 CPPUNIT_ASSERT_MESSAGE("Exception1", !(a >>= b) && b.member == 2);
1725 ASSERT_TRUE(!(a >>= b) && b.member == 2) << "Exception1";
1839 }
1840 {
1841 css::uno::Reference< Interface1 > i(new Impl1);
1842 css::uno::Reference< Interface1 > b(i);
1726 }
1727 {
1728 css::uno::Reference< Interface1 > i(new Impl1);
1729 css::uno::Reference< Interface1 > b(i);
1843 CPPUNIT_ASSERT_MESSAGE("Interface1", !(a >>= b) && b == i);
1730 ASSERT_TRUE(!(a >>= b) && b == i) << "Interface1";
1844 }
1845}
1846
1731 }
1732}
1733
1847void Test::testStruct() {
1734TEST_F(Test, testStruct) {
1848 css::uno::Any a(Struct2a(1, 3));
1735 css::uno::Any a(Struct2a(1, 3));
1849 CPPUNIT_ASSERT(a.getValueType() == getCppuType< Struct2a >());
1736 ASSERT_TRUE(a.getValueType() == getCppuType< Struct2a >());
1850 {
1851 bool b = true;
1737 {
1738 bool b = true;
1852 CPPUNIT_ASSERT_MESSAGE("bool", !(a >>= b) && b);
1739 ASSERT_TRUE(!(a >>= b) && b) << "bool";
1853 }
1854 {
1855 sal_Bool b = true;
1740 }
1741 {
1742 sal_Bool b = true;
1856 CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b) && b);
1743 ASSERT_TRUE(!(a >>= b) && b) << "sal_Bool";
1857 }
1858 {
1859 sal_Int8 b = 2;
1744 }
1745 {
1746 sal_Int8 b = 2;
1860 CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a >>= b) && b == 2);
1747 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int8";
1861 }
1862 {
1863 sal_uInt8 b = 2;
1748 }
1749 {
1750 sal_uInt8 b = 2;
1864 CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a >>= b) && b == 2);
1751 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt8";
1865 }
1866 {
1867 sal_Int16 b = 2;
1752 }
1753 {
1754 sal_Int16 b = 2;
1868 CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a >>= b) && b == 2);
1755 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int16";
1869 }
1870 {
1871 sal_uInt16 b = 2;
1756 }
1757 {
1758 sal_uInt16 b = 2;
1872 CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a >>= b) && b == 2);
1759 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt16";
1873 }
1874 {
1875 sal_Int32 b = 2;
1760 }
1761 {
1762 sal_Int32 b = 2;
1876 CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a >>= b) && b == 2);
1763 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int32";
1877 }
1878 {
1879 sal_uInt32 b = 2;
1764 }
1765 {
1766 sal_uInt32 b = 2;
1880 CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a >>= b) && b == 2);
1767 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt32";
1881 }
1882 {
1883 sal_Int64 b = 2;
1768 }
1769 {
1770 sal_Int64 b = 2;
1884 CPPUNIT_ASSERT_MESSAGE("sal_Int64", !(a >>= b) && b == 2);
1771 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int64";
1885 }
1886 {
1887 sal_uInt64 b = 2;
1772 }
1773 {
1774 sal_uInt64 b = 2;
1888 CPPUNIT_ASSERT_MESSAGE("sal_uInt64", !(a >>= b) && b == 2);
1775 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt64";
1889 }
1890 {
1891 float b = 2;
1776 }
1777 {
1778 float b = 2;
1892 CPPUNIT_ASSERT_MESSAGE("float", !(a >>= b) && b == 2);
1779 ASSERT_TRUE(!(a >>= b) && b == 2) << "float";
1893 }
1894 {
1895 double b = 2;
1780 }
1781 {
1782 double b = 2;
1896 CPPUNIT_ASSERT_MESSAGE("double", !(a >>= b) && b == 2);
1783 ASSERT_TRUE(!(a >>= b) && b == 2) << "double";
1897 }
1898 {
1899 sal_Unicode b = '2';
1784 }
1785 {
1786 sal_Unicode b = '2';
1900 CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a >>= b) && b == '2');
1787 ASSERT_TRUE(!(a >>= b) && b == '2') << "sal_Unicode";
1901 }
1902 {
1903 rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2"));
1788 }
1789 {
1790 rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2"));
1904 CPPUNIT_ASSERT_MESSAGE(
1905 "rtl::OUString",
1906 !(a >>= b) && b.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2")));
1791 ASSERT_TRUE(!(a >>= b) && b.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2"))) <<
1792 "rtl::OUString";
1907 }
1908 {
1909 css::uno::Type b(getCppuType< rtl::OUString >());
1793 }
1794 {
1795 css::uno::Type b(getCppuType< rtl::OUString >());
1910 CPPUNIT_ASSERT_MESSAGE(
1911 "css::uno::Type",
1912 !(a >>= b) && b == getCppuType< rtl::OUString >());
1796 ASSERT_TRUE(!(a >>= b) && b == getCppuType< rtl::OUString >()) <<
1797 "css::uno::Type";
1913 }
1914 {
1915 css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
1798 }
1799 {
1800 css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
1916 CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a >>= b) && b == a);
1801 ASSERT_TRUE((a >>= b) && b == a) << "css::uno::Any";
1917 }
1918 {
1919 css::uno::Sequence< rtl::OUString > b(2);
1802 }
1803 {
1804 css::uno::Sequence< rtl::OUString > b(2);
1920 CPPUNIT_ASSERT_MESSAGE(
1921 "css::uno::Sequence<rtl::OUString>",
1922 !(a >>= b) && b.getLength() == 2);
1805 ASSERT_TRUE(!(a >>= b) && b.getLength() == 2) <<
1806 "css::uno::Sequence<rtl::OUString>";
1923 }
1924 {
1925 Enum1 b = Enum1_M2;
1807 }
1808 {
1809 Enum1 b = Enum1_M2;
1926 CPPUNIT_ASSERT_MESSAGE("Enum1", !(a >>= b) && b == Enum1_M2);
1810 ASSERT_TRUE(!(a >>= b) && b == Enum1_M2) << "Enum1";
1927 }
1928 {
1929 Struct1 b(2);
1811 }
1812 {
1813 Struct1 b(2);
1930 CPPUNIT_ASSERT_MESSAGE("Struct1", !(a >>= b) && b.member == 2);
1814 ASSERT_TRUE(!(a >>= b) && b.member == 2) << "Struct1";
1931 }
1932 {
1933 Struct2 b(2);
1815 }
1816 {
1817 Struct2 b(2);
1934 CPPUNIT_ASSERT_MESSAGE("Struct2", (a >>= b) && b.member == 1);
1818 ASSERT_TRUE((a >>= b) && b.member == 1) << "Struct2";
1935 }
1936 {
1937 Struct2a b(2, 2);
1819 }
1820 {
1821 Struct2a b(2, 2);
1938 CPPUNIT_ASSERT_MESSAGE(
1939 "Struct2a", (a >>= b) && b.member == 1 && b.member2 == 3);
1822 ASSERT_TRUE((a >>= b) && b.member == 1 && b.member2 == 3) <<
1823 "Struct2a";
1940 }
1941 {
1942 Struct2b b(2, 2, 2);
1824 }
1825 {
1826 Struct2b b(2, 2, 2);
1943 CPPUNIT_ASSERT_MESSAGE("Struct2b", !(a >>= b) && b.member == 2);
1827 ASSERT_TRUE(!(a >>= b) && b.member == 2) << "Struct2b";
1944 }
1945 {
1946 Exception1 b(
1947 rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2);
1828 }
1829 {
1830 Exception1 b(
1831 rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2);
1948 CPPUNIT_ASSERT_MESSAGE("Exception1", !(a >>= b) && b.member == 2);
1832 ASSERT_TRUE(!(a >>= b) && b.member == 2) << "Exception1";
1949 }
1950 {
1951 css::uno::Reference< Interface1 > i(new Impl1);
1952 css::uno::Reference< Interface1 > b(i);
1833 }
1834 {
1835 css::uno::Reference< Interface1 > i(new Impl1);
1836 css::uno::Reference< Interface1 > b(i);
1953 CPPUNIT_ASSERT_MESSAGE("Interface1", !(a >>= b) && b == i);
1837 ASSERT_TRUE(!(a >>= b) && b == i) << "Interface1";
1954 }
1955}
1956
1838 }
1839}
1840
1957void Test::testPoly() {
1841TEST_F(Test, testPoly) {
1958 css::uno::Any a;
1959 a <<= Poly< css::uno::Sequence< ::sal_Unicode > >();
1842 css::uno::Any a;
1843 a <<= Poly< css::uno::Sequence< ::sal_Unicode > >();
1960 CPPUNIT_ASSERT_MESSAGE(
1961 "type name",
1962 a.getValueType().getTypeName().equalsAsciiL(
1963 RTL_CONSTASCII_STRINGPARAM("Poly<[]char>")));
1964 CPPUNIT_ASSERT_MESSAGE(
1965 "constructor",
1966 a == css::uno::Any(Poly< css::uno::Sequence< ::sal_Unicode > >()));
1844 ASSERT_TRUE(a.getValueType().getTypeName().equalsAsciiL(
1845 RTL_CONSTASCII_STRINGPARAM("Poly<[]char>"))) <<
1846 "type name";
1847 ASSERT_TRUE(a == css::uno::Any(Poly< css::uno::Sequence< ::sal_Unicode > >())) <<
1848 "constructor";
1967}
1968
1849}
1850
1969void Test::testException() {
1851TEST_F(Test, testException) {
1970 css::uno::Any a(
1971 Exception2a(
1972 rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 1,
1973 3));
1852 css::uno::Any a(
1853 Exception2a(
1854 rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 1,
1855 3));
1974 CPPUNIT_ASSERT(a.getValueType() == getCppuType< Exception2a >());
1856 ASSERT_TRUE(a.getValueType() == getCppuType< Exception2a >());
1975 {
1976 bool b = true;
1857 {
1858 bool b = true;
1977 CPPUNIT_ASSERT_MESSAGE("bool", !(a >>= b) && b);
1859 ASSERT_TRUE(!(a >>= b) && b) << "bool";
1978 }
1979 {
1980 sal_Bool b = true;
1860 }
1861 {
1862 sal_Bool b = true;
1981 CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b) && b);
1863 ASSERT_TRUE(!(a >>= b) && b) << "sal_Bool";
1982 }
1983 {
1984 sal_Int8 b = 2;
1864 }
1865 {
1866 sal_Int8 b = 2;
1985 CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a >>= b) && b == 2);
1867 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int8";
1986 }
1987 {
1988 sal_uInt8 b = 2;
1868 }
1869 {
1870 sal_uInt8 b = 2;
1989 CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a >>= b) && b == 2);
1871 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt8";
1990 }
1991 {
1992 sal_Int16 b = 2;
1872 }
1873 {
1874 sal_Int16 b = 2;
1993 CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a >>= b) && b == 2);
1875 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int16";
1994 }
1995 {
1996 sal_uInt16 b = 2;
1876 }
1877 {
1878 sal_uInt16 b = 2;
1997 CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a >>= b) && b == 2);
1879 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt16";
1998 }
1999 {
2000 sal_Int32 b = 2;
1880 }
1881 {
1882 sal_Int32 b = 2;
2001 CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a >>= b) && b == 2);
1883 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int32";
2002 }
2003 {
2004 sal_uInt32 b = 2;
1884 }
1885 {
1886 sal_uInt32 b = 2;
2005 CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a >>= b) && b == 2);
1887 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt32";
2006 }
2007 {
2008 sal_Int64 b = 2;
1888 }
1889 {
1890 sal_Int64 b = 2;
2009 CPPUNIT_ASSERT_MESSAGE("sal_Int64", !(a >>= b) && b == 2);
1891 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int64";
2010 }
2011 {
2012 sal_uInt64 b = 2;
1892 }
1893 {
1894 sal_uInt64 b = 2;
2013 CPPUNIT_ASSERT_MESSAGE("sal_uInt64", !(a >>= b) && b == 2);
1895 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt64";
2014 }
2015 {
2016 float b = 2;
1896 }
1897 {
1898 float b = 2;
2017 CPPUNIT_ASSERT_MESSAGE("float", !(a >>= b) && b == 2);
1899 ASSERT_TRUE(!(a >>= b) && b == 2) << "float";
2018 }
2019 {
2020 double b = 2;
1900 }
1901 {
1902 double b = 2;
2021 CPPUNIT_ASSERT_MESSAGE("double", !(a >>= b) && b == 2);
1903 ASSERT_TRUE(!(a >>= b) && b == 2) << "double";
2022 }
2023 {
2024 sal_Unicode b = '2';
1904 }
1905 {
1906 sal_Unicode b = '2';
2025 CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a >>= b) && b == '2');
1907 ASSERT_TRUE(!(a >>= b) && b == '2') << "sal_Unicode";
2026 }
2027 {
2028 rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2"));
1908 }
1909 {
1910 rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2"));
2029 CPPUNIT_ASSERT_MESSAGE(
2030 "rtl::OUString",
2031 !(a >>= b) && b.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2")));
1911 ASSERT_TRUE(!(a >>= b) && b.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2"))) <<
1912 "rtl::OUString";
2032 }
2033 {
2034 css::uno::Type b(getCppuType< rtl::OUString >());
1913 }
1914 {
1915 css::uno::Type b(getCppuType< rtl::OUString >());
2035 CPPUNIT_ASSERT_MESSAGE(
2036 "css::uno::Type",
2037 !(a >>= b) && b == getCppuType< rtl::OUString >());
1916 ASSERT_TRUE(!(a >>= b) && b == getCppuType< rtl::OUString >()) <<
1917 "css::uno::Type";
2038 }
2039 {
2040 css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
1918 }
1919 {
1920 css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
2041 CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a >>= b) && b == a);
1921 ASSERT_TRUE((a >>= b) && b == a) << "css::uno::Any";
2042 }
2043 {
2044 css::uno::Sequence< rtl::OUString > b(2);
1922 }
1923 {
1924 css::uno::Sequence< rtl::OUString > b(2);
2045 CPPUNIT_ASSERT_MESSAGE(
2046 "css::uno::Sequence<rtl::OUString>",
2047 !(a >>= b) && b.getLength() == 2);
1925 ASSERT_TRUE(!(a >>= b) && b.getLength() == 2) <<
1926 "css::uno::Sequence<rtl::OUString>";
2048 }
2049 {
2050 Enum1 b = Enum1_M2;
1927 }
1928 {
1929 Enum1 b = Enum1_M2;
2051 CPPUNIT_ASSERT_MESSAGE("Enum1", !(a >>= b) && b == Enum1_M2);
1930 ASSERT_TRUE(!(a >>= b) && b == Enum1_M2) << "Enum1";
2052 }
2053 {
2054 Struct1 b(2);
1931 }
1932 {
1933 Struct1 b(2);
2055 CPPUNIT_ASSERT_MESSAGE("Struct1", !(a >>= b) && b.member == 2);
1934 ASSERT_TRUE(!(a >>= b) && b.member == 2) << "Struct1";
2056 }
2057 {
2058 Exception1 b(
2059 rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2);
1935 }
1936 {
1937 Exception1 b(
1938 rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2);
2060 CPPUNIT_ASSERT_MESSAGE("Exception1", !(a >>= b) && b.member == 2);
1939 ASSERT_TRUE(!(a >>= b) && b.member == 2) << "Exception1";
2061 }
2062 {
2063 Exception2 b(
2064 rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2);
1940 }
1941 {
1942 Exception2 b(
1943 rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2);
2065 CPPUNIT_ASSERT_MESSAGE("Exception2", (a >>= b) && b.member == 1);
1944 ASSERT_TRUE((a >>= b) && b.member == 1) << "Exception2";
2066 }
2067 {
2068 Exception2a b(
2069 rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2,
2070 2);
1945 }
1946 {
1947 Exception2a b(
1948 rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2,
1949 2);
2071 CPPUNIT_ASSERT_MESSAGE(
2072 "Exception2a", (a >>= b) && b.member == 1 && b.member2 == 3);
1950 ASSERT_TRUE((a >>= b) && b.member == 1 && b.member2 == 3) <<
1951 "Exception2a";
2073 }
2074 {
2075 Exception2b b(
2076 rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2,
2077 2);
1952 }
1953 {
1954 Exception2b b(
1955 rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2,
1956 2);
2078 CPPUNIT_ASSERT_MESSAGE("Exception2b", !(a >>= b) && b.member == 2);
1957 ASSERT_TRUE(!(a >>= b) && b.member == 2) << "Exception2b";
2079 }
2080 {
2081 css::uno::Reference< Interface1 > i(new Impl1);
2082 css::uno::Reference< Interface1 > b(i);
1958 }
1959 {
1960 css::uno::Reference< Interface1 > i(new Impl1);
1961 css::uno::Reference< Interface1 > b(i);
2083 CPPUNIT_ASSERT_MESSAGE("Interface1", !(a >>= b) && b == i);
1962 ASSERT_TRUE(!(a >>= b) && b == i) << "Interface1";
2084 }
2085}
2086
1963 }
1964}
1965
2087void Test::testInterface() {
1966TEST_F(Test, testInterface) {
2088 css::uno::Reference< Interface2a > i2(new Impl2);
2089 css::uno::Any a(i2);
1967 css::uno::Reference< Interface2a > i2(new Impl2);
1968 css::uno::Any a(i2);
2090 CPPUNIT_ASSERT(
1969 ASSERT_TRUE(
2091 a.getValueType()
2092 == getCppuType< css::uno::Reference< Interface2a > >());
2093 {
2094 bool b = true;
1970 a.getValueType()
1971 == getCppuType< css::uno::Reference< Interface2a > >());
1972 {
1973 bool b = true;
2095 CPPUNIT_ASSERT_MESSAGE("bool", !(a >>= b) && b);
1974 ASSERT_TRUE(!(a >>= b) && b) << "bool";
2096 }
2097 {
2098 sal_Bool b = true;
1975 }
1976 {
1977 sal_Bool b = true;
2099 CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b) && b);
1978 ASSERT_TRUE(!(a >>= b) && b) << "sal_Bool";
2100 }
2101 {
2102 sal_Int8 b = 2;
1979 }
1980 {
1981 sal_Int8 b = 2;
2103 CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a >>= b) && b == 2);
1982 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int8";
2104 }
2105 {
2106 sal_uInt8 b = 2;
1983 }
1984 {
1985 sal_uInt8 b = 2;
2107 CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a >>= b) && b == 2);
1986 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt8";
2108 }
2109 {
2110 sal_Int16 b = 2;
1987 }
1988 {
1989 sal_Int16 b = 2;
2111 CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a >>= b) && b == 2);
1990 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int16";
2112 }
2113 {
2114 sal_uInt16 b = 2;
1991 }
1992 {
1993 sal_uInt16 b = 2;
2115 CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a >>= b) && b == 2);
1994 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt16";
2116 }
2117 {
2118 sal_Int32 b = 2;
1995 }
1996 {
1997 sal_Int32 b = 2;
2119 CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a >>= b) && b == 2);
1998 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int32";
2120 }
2121 {
2122 sal_uInt32 b = 2;
1999 }
2000 {
2001 sal_uInt32 b = 2;
2123 CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a >>= b) && b == 2);
2002 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt32";
2124 }
2125 {
2126 sal_Int64 b = 2;
2003 }
2004 {
2005 sal_Int64 b = 2;
2127 CPPUNIT_ASSERT_MESSAGE("sal_Int64", !(a >>= b) && b == 2);
2006 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int64";
2128 }
2129 {
2130 sal_uInt64 b = 2;
2007 }
2008 {
2009 sal_uInt64 b = 2;
2131 CPPUNIT_ASSERT_MESSAGE("sal_uInt64", !(a >>= b) && b == 2);
2010 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt64";
2132 }
2133 {
2134 float b = 2;
2011 }
2012 {
2013 float b = 2;
2135 CPPUNIT_ASSERT_MESSAGE("float", !(a >>= b) && b == 2);
2014 ASSERT_TRUE(!(a >>= b) && b == 2) << "float";
2136 }
2137 {
2138 double b = 2;
2015 }
2016 {
2017 double b = 2;
2139 CPPUNIT_ASSERT_MESSAGE("double", !(a >>= b) && b == 2);
2018 ASSERT_TRUE(!(a >>= b) && b == 2) << "double";
2140 }
2141 {
2142 sal_Unicode b = '2';
2019 }
2020 {
2021 sal_Unicode b = '2';
2143 CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a >>= b) && b == '2');
2022 ASSERT_TRUE(!(a >>= b) && b == '2') << "sal_Unicode";
2144 }
2145 {
2146 rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2"));
2023 }
2024 {
2025 rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2"));
2147 CPPUNIT_ASSERT_MESSAGE(
2148 "rtl::OUString",
2149 !(a >>= b) && b.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2")));
2026 ASSERT_TRUE(!(a >>= b) && b.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2"))) <<
2027 "rtl::OUString";
2150 }
2151 {
2152 css::uno::Type b(getCppuType< rtl::OUString >());
2028 }
2029 {
2030 css::uno::Type b(getCppuType< rtl::OUString >());
2153 CPPUNIT_ASSERT_MESSAGE(
2154 "css::uno::Type",
2155 !(a >>= b) && b == getCppuType< rtl::OUString >());
2031 ASSERT_TRUE(!(a >>= b) && b == getCppuType< rtl::OUString >()) <<
2032 "css::uno::Type";
2156 }
2157 {
2158 css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
2033 }
2034 {
2035 css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
2159 CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a >>= b) && b == a);
2036 ASSERT_TRUE((a >>= b) && b == a) << "css::uno::Any";
2160 }
2161 {
2162 css::uno::Sequence< rtl::OUString > b(2);
2037 }
2038 {
2039 css::uno::Sequence< rtl::OUString > b(2);
2163 CPPUNIT_ASSERT_MESSAGE(
2164 "css::uno::Sequence<rtl::OUString>",
2165 !(a >>= b) && b.getLength() == 2);
2040 ASSERT_TRUE(!(a >>= b) && b.getLength() == 2) <<
2041 "css::uno::Sequence<rtl::OUString>";
2166 }
2167 {
2168 Enum1 b = Enum1_M2;
2042 }
2043 {
2044 Enum1 b = Enum1_M2;
2169 CPPUNIT_ASSERT_MESSAGE("Enum1", !(a >>= b) && b == Enum1_M2);
2045 ASSERT_TRUE(!(a >>= b) && b == Enum1_M2) << "Enum1";
2170 }
2171 {
2172 Struct1 b(2);
2046 }
2047 {
2048 Struct1 b(2);
2173 CPPUNIT_ASSERT_MESSAGE("Struct1", !(a >>= b) && b.member == 2);
2049 ASSERT_TRUE(!(a >>= b) && b.member == 2) << "Struct1";
2174 }
2175 {
2176 Exception1 b(
2177 rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2);
2050 }
2051 {
2052 Exception1 b(
2053 rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2);
2178 CPPUNIT_ASSERT_MESSAGE("Exception1", !(a >>= b) && b.member == 2);
2054 ASSERT_TRUE(!(a >>= b) && b.member == 2) << "Exception1";
2179 }
2180 {
2181 css::uno::Reference< Interface1 > i(new Impl1);
2182 css::uno::Reference< Interface1 > b(i);
2055 }
2056 {
2057 css::uno::Reference< Interface1 > i(new Impl1);
2058 css::uno::Reference< Interface1 > b(i);
2183 CPPUNIT_ASSERT_MESSAGE("Interface1", !(a >>= b) && b == i);
2059 ASSERT_TRUE(!(a >>= b) && b == i) << "Interface1";
2184 }
2185 {
2186 css::uno::Reference< Interface2 > b(new Impl2);
2060 }
2061 {
2062 css::uno::Reference< Interface2 > b(new Impl2);
2187 CPPUNIT_ASSERT_MESSAGE("Interface2", (a >>= b) && b == i2);
2063 ASSERT_TRUE((a >>= b) && b == i2) << "Interface2";
2188 }
2189 {
2190 css::uno::Reference< Interface2a > b(new Impl2);
2064 }
2065 {
2066 css::uno::Reference< Interface2a > b(new Impl2);
2191 CPPUNIT_ASSERT_MESSAGE("Interface2a", (a >>= b) && b == i2);
2067 ASSERT_TRUE((a >>= b) && b == i2) << "Interface2a";
2192 }
2193 {
2194 css::uno::Reference< Interface2b > i(new Impl2b);
2195 css::uno::Reference< Interface2b > b(i);
2068 }
2069 {
2070 css::uno::Reference< Interface2b > i(new Impl2b);
2071 css::uno::Reference< Interface2b > b(i);
2196 CPPUNIT_ASSERT_MESSAGE("Interface2b", !(a >>= b) && b == i);
2072 ASSERT_TRUE(!(a >>= b) && b == i) << "Interface2b";
2197 }
2198 {
2199 css::uno::Reference< Interface3 > b(new Impl2);
2073 }
2074 {
2075 css::uno::Reference< Interface3 > b(new Impl2);
2200 CPPUNIT_ASSERT_MESSAGE("Interface3", (a >>= b) && b == i2);
2076 ASSERT_TRUE((a >>= b) && b == i2) << "Interface3";
2201 }
2202}
2203
2077 }
2078}
2079
2204void Test::testNull() {
2080TEST_F(Test, testNull) {
2205 css::uno::Any a = css::uno::Any(css::uno::Reference< Interface2a >());
2081 css::uno::Any a = css::uno::Any(css::uno::Reference< Interface2a >());
2206 CPPUNIT_ASSERT(
2082 ASSERT_TRUE(
2207 a.getValueType()
2208 == getCppuType< css::uno::Reference< Interface2a > >());
2209 {
2210 bool b = true;
2083 a.getValueType()
2084 == getCppuType< css::uno::Reference< Interface2a > >());
2085 {
2086 bool b = true;
2211 CPPUNIT_ASSERT_MESSAGE("bool", !(a >>= b) && b);
2087 ASSERT_TRUE(!(a >>= b) && b) << "bool";
2212 }
2213 {
2214 sal_Bool b = true;
2088 }
2089 {
2090 sal_Bool b = true;
2215 CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b) && b);
2091 ASSERT_TRUE(!(a >>= b) && b) << "sal_Bool";
2216 }
2217 {
2218 sal_Int8 b = 2;
2092 }
2093 {
2094 sal_Int8 b = 2;
2219 CPPUNIT_ASSERT_MESSAGE("sal_Int8", !(a >>= b) && b == 2);
2095 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int8";
2220 }
2221 {
2222 sal_uInt8 b = 2;
2096 }
2097 {
2098 sal_uInt8 b = 2;
2223 CPPUNIT_ASSERT_MESSAGE("sal_uInt8", !(a >>= b) && b == 2);
2099 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt8";
2224 }
2225 {
2226 sal_Int16 b = 2;
2100 }
2101 {
2102 sal_Int16 b = 2;
2227 CPPUNIT_ASSERT_MESSAGE("sal_Int16", !(a >>= b) && b == 2);
2103 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int16";
2228 }
2229 {
2230 sal_uInt16 b = 2;
2104 }
2105 {
2106 sal_uInt16 b = 2;
2231 CPPUNIT_ASSERT_MESSAGE("sal_uInt16", !(a >>= b) && b == 2);
2107 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt16";
2232 }
2233 {
2234 sal_Int32 b = 2;
2108 }
2109 {
2110 sal_Int32 b = 2;
2235 CPPUNIT_ASSERT_MESSAGE("sal_Int32", !(a >>= b) && b == 2);
2111 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int32";
2236 }
2237 {
2238 sal_uInt32 b = 2;
2112 }
2113 {
2114 sal_uInt32 b = 2;
2239 CPPUNIT_ASSERT_MESSAGE("sal_uInt32", !(a >>= b) && b == 2);
2115 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt32";
2240 }
2241 {
2242 sal_Int64 b = 2;
2116 }
2117 {
2118 sal_Int64 b = 2;
2243 CPPUNIT_ASSERT_MESSAGE("sal_Int64", !(a >>= b) && b == 2);
2119 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_Int64";
2244 }
2245 {
2246 sal_uInt64 b = 2;
2120 }
2121 {
2122 sal_uInt64 b = 2;
2247 CPPUNIT_ASSERT_MESSAGE("sal_uInt64", !(a >>= b) && b == 2);
2123 ASSERT_TRUE(!(a >>= b) && b == 2) << "sal_uInt64";
2248 }
2249 {
2250 float b = 2;
2124 }
2125 {
2126 float b = 2;
2251 CPPUNIT_ASSERT_MESSAGE("float", !(a >>= b) && b == 2);
2127 ASSERT_TRUE(!(a >>= b) && b == 2) << "float";
2252 }
2253 {
2254 double b = 2;
2128 }
2129 {
2130 double b = 2;
2255 CPPUNIT_ASSERT_MESSAGE("double", !(a >>= b) && b == 2);
2131 ASSERT_TRUE(!(a >>= b) && b == 2) << "double";
2256 }
2257 {
2258 sal_Unicode b = '2';
2132 }
2133 {
2134 sal_Unicode b = '2';
2259 CPPUNIT_ASSERT_MESSAGE("sal_Unicode", !(a >>= b) && b == '2');
2135 ASSERT_TRUE(!(a >>= b) && b == '2') << "sal_Unicode";
2260 }
2261 {
2262 rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2"));
2136 }
2137 {
2138 rtl::OUString b(RTL_CONSTASCII_USTRINGPARAM("2"));
2263 CPPUNIT_ASSERT_MESSAGE(
2264 "rtl::OUString",
2265 !(a >>= b) && b.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2")));
2139 ASSERT_TRUE(!(a >>= b) && b.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2"))) <<
2140 "rtl::OUString";
2266 }
2267 {
2268 css::uno::Type b(getCppuType< rtl::OUString >());
2141 }
2142 {
2143 css::uno::Type b(getCppuType< rtl::OUString >());
2269 CPPUNIT_ASSERT_MESSAGE(
2270 "css::uno::Type",
2271 !(a >>= b) && b == getCppuType< rtl::OUString >());
2144 ASSERT_TRUE(!(a >>= b) && b == getCppuType< rtl::OUString >()) <<
2145 "css::uno::Type";
2272 }
2273 {
2274 css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
2146 }
2147 {
2148 css::uno::Any b(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("2")));
2275 CPPUNIT_ASSERT_MESSAGE("css::uno::Any", (a >>= b) && b == a);
2149 ASSERT_TRUE((a >>= b) && b == a) << "css::uno::Any";
2276 }
2277 {
2278 css::uno::Sequence< rtl::OUString > b(2);
2150 }
2151 {
2152 css::uno::Sequence< rtl::OUString > b(2);
2279 CPPUNIT_ASSERT_MESSAGE(
2280 "css::uno::Sequence<rtl::OUString>",
2281 !(a >>= b) && b.getLength() == 2);
2153 ASSERT_TRUE(!(a >>= b) && b.getLength() == 2) <<
2154 "css::uno::Sequence<rtl::OUString>";
2282 }
2283 {
2284 Enum1 b = Enum1_M2;
2155 }
2156 {
2157 Enum1 b = Enum1_M2;
2285 CPPUNIT_ASSERT_MESSAGE("Enum1", !(a >>= b) && b == Enum1_M2);
2158 ASSERT_TRUE(!(a >>= b) && b == Enum1_M2) << "Enum1";
2286 }
2287 {
2288 Struct1 b(2);
2159 }
2160 {
2161 Struct1 b(2);
2289 CPPUNIT_ASSERT_MESSAGE("Struct1", !(a >>= b) && b.member == 2);
2162 ASSERT_TRUE(!(a >>= b) && b.member == 2) << "Struct1";
2290 }
2291 {
2292 Exception1 b(
2293 rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2);
2163 }
2164 {
2165 Exception1 b(
2166 rtl::OUString(), css::uno::Reference< css::uno::XInterface >(), 2);
2294 CPPUNIT_ASSERT_MESSAGE("Exception1", !(a >>= b) && b.member == 2);
2167 ASSERT_TRUE(!(a >>= b) && b.member == 2) << "Exception1";
2295 }
2296 {
2297 css::uno::Reference< Interface1 > b(new Impl1);
2168 }
2169 {
2170 css::uno::Reference< Interface1 > b(new Impl1);
2298 CPPUNIT_ASSERT_MESSAGE(
2299 "Interface1", (a >>= b) && !b.is());
2171 ASSERT_TRUE((a >>= b) && !b.is()) <<
2172 "Interface1";
2300 }
2301 {
2302 css::uno::Reference< Interface2 > b(new Impl2);
2173 }
2174 {
2175 css::uno::Reference< Interface2 > b(new Impl2);
2303 CPPUNIT_ASSERT_MESSAGE(
2304 "Interface2", (a >>= b) && !b.is());
2176 ASSERT_TRUE((a >>= b) && !b.is()) <<
2177 "Interface2";
2305 }
2306 {
2307 css::uno::Reference< Interface2a > b(new Impl2);
2178 }
2179 {
2180 css::uno::Reference< Interface2a > b(new Impl2);
2308 CPPUNIT_ASSERT_MESSAGE("Interface2a", (a >>= b) && !b.is());
2181 ASSERT_TRUE((a >>= b) && !b.is()) << "Interface2a";
2309 }
2310 {
2311 css::uno::Reference< Interface2b > b(new Impl2b);
2182 }
2183 {
2184 css::uno::Reference< Interface2b > b(new Impl2b);
2312 CPPUNIT_ASSERT_MESSAGE(
2313 "Interface2b", (a >>= b) && !b.is());
2185 ASSERT_TRUE((a >>= b) && !b.is()) <<
2186 "Interface2b";
2314 }
2315 {
2316 css::uno::Reference< Interface3 > b(new Impl2);
2187 }
2188 {
2189 css::uno::Reference< Interface3 > b(new Impl2);
2317 CPPUNIT_ASSERT_MESSAGE(
2318 "Interface3", (a >>= b) && !b.is());
2190 ASSERT_TRUE((a >>= b) && !b.is()) <<
2191 "Interface3";
2319 }
2320}
2321
2192 }
2193}
2194
2322CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(Test, "alltests");
2323
2324}
2195}
2325
2326NOADDITIONAL;