Date: prev next · Thread: first prev next last
2014 Archives by date, by thread · List index


On 05/17/2014 01:42 AM, julien2412 [via Document Foundation Mail 
Archive] wrote:
I noticed that if I did this:
diff --git a/cppu/qa/test_unotype.cxx b/cppu/qa/test_unotype.cxx
index bbea200..f0d2b03 100644
--- a/cppu/qa/test_unotype.cxx
+++ b/cppu/qa/test_unotype.cxx
@@ -271,8 +271,8 @@ void Test::testUnoType() {
  void Test::testGetTypeFavourUnsigned() {
      CPPUNIT_ASSERT(typeid(::sal_Unicode) == typeid(::sal_uInt16));
      CPPUNIT_ASSERT(
-        ::getCppuType(static_cast< ::sal_Unicode * >(0)) ==
-        ::getCppuType(static_cast< ::sal_uInt16 * >(0)));
+        cppu::UnoType<cppu::UnoCharType>::get() ==
+        cppu::UnoType<cppu::UnoUnsignedShortType>::get() );

make cppu gives this:
/home/julien/compile-libreoffice/libreoffice/cppu/qa/test_unotype.cxx:275:(anonymous
namespace)::Test::testGetTypeFavourUnsigned
assertion failed
- Expression: cppu::UnoType<cppu::UnoCharType>::get() ==
cppu::UnoType<cppu::UnoUnsignedShortType>::get()

test_unotype.cxx:275:Assertion
Test name: (anonymous namespace)::Test::testGetTypeFavourUnsigned
assertion failed
- Expression: cppu::UnoType<cppu::UnoCharType>::get() ==
cppu::UnoType<cppu::UnoUnsignedShortType>::get()

Failures !!!
Run: 3   Failure total: 1   Failures: 1   Errors: 0

I don't understand why it's failing in this case.
Any idea?

That code is a test that getCppuType (mis-)behaves as advertised, and 
conflates sal_Unicode/sal_uInt16.  Do not change code testing 
getCppuType/getTypeFavourUnsigned/getTypeFavourChar to use UnoType instead.

Stephan




--
View this message in context: 
http://nabble.documentfoundation.org/Questions-about-getCppuType-tp4106361p4109307.html
Sent from the Dev mailing list archive at Nabble.com.

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.