From 8c423eeb49606087243fb6bbf31c0981c55dc773 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Thu, 21 Apr 2016 17:27:43 +0200 Subject: Use Sequence ctor taking initializer_list needed adapting loplugin:implicitboolconversion to not warn about Sequence arBool({true, false, true}); Change-Id: I971918aab7c958ef8f1e4e0548a84314e95f8325 --- testtools/source/bridgetest/bridgetest.cxx | 47 ++++++++++++------------------ 1 file changed, 18 insertions(+), 29 deletions(-) (limited to 'testtools') diff --git a/testtools/source/bridgetest/bridgetest.cxx b/testtools/source/bridgetest/bridgetest.cxx index bde14924de23..df7e87a3865f 100644 --- a/testtools/source/bridgetest/bridgetest.cxx +++ b/testtools/source/bridgetest/bridgetest.cxx @@ -641,22 +641,8 @@ static bool performTest( } // Perform sequence tests (XBridgeTest2); create the sequence which is // compared with the results: - sal_Bool _arBool[] = { true, false, true }; - sal_Unicode _arChar[] = { 0x0065, 0x0066, 0x0067 }; - sal_Int8 _arByte[] = { 1, 2, -1 }; - sal_Int16 _arShort[] = { -0x8000, 1, 0x7FFF }; - sal_uInt16 _arUShort[] = { 0 , 1, 0xFFFF }; sal_Int32 _arLong[] = { static_cast< sal_Int32 >(0x80000000), 1, 0x7FFFFFFF }; - sal_uInt32 _arULong[] = { 0, 1, 0xFFFFFFFF }; - sal_Int64 _arHyper[] = { - static_cast< sal_Int64 >(SAL_CONST_INT64(0x8000000000000000)), 1, - SAL_CONST_INT64(0x7FFFFFFFFFFFFFFF) }; - sal_uInt64 _arUHyper[] = { 0, 1, SAL_CONST_UINT64(0xFFFFFFFFFFFFFFFF) }; - OUString _arString[] = { - OUString("String 1"), - OUString("String 2"), - OUString("String 3") }; sal_Bool _aBool = true; sal_Int32 _aInt = 0xBABEBABE; float _aFloat = 3.14f; @@ -668,7 +654,6 @@ static bool performTest( _arObj[0] = new OWeakObject(); _arObj[1] = new OWeakObject(); _arObj[2] = new OWeakObject(); - TestEnum _arEnum[] = { TestEnum_ONE, TestEnum_TWO, TestEnum_CHECK }; TestElement _arStruct[3]; assign( _arStruct[0], true, '@', 17, 0x1234, 0xFEDC, 0x12345678, 0xFEDCBA98, @@ -689,23 +674,27 @@ static bool performTest( TestEnum_CHECK, STRING_TEST_CONSTANT, _arObj[2], Any(&_arObj[2], cppu::UnoType::get())); { - float _arFloat[] = { 1.1f, 2.2f, 3.3f }; - double _arDouble[] = { 1.11, 2.22, 3.33 }; - Sequence arBool(_arBool, 3); - Sequence arChar( _arChar, 3); - Sequence arByte(_arByte, 3); - Sequence arShort(_arShort, 3); - Sequence arUShort(_arUShort, 3); + Sequence arBool({true, false, true}); + Sequence arChar({0x0065, 0x0066, 0x0067}); + Sequence arByte({1, 2, -1}); + Sequence arShort({-0x8000, 1, 0x7FFF}); + Sequence arUShort({0 , 1, 0xFFFF}); Sequence arLong(_arLong, 3); - Sequence arULong(_arULong, 3); - Sequence arHyper(_arHyper, 3); - Sequence arUHyper(_arUHyper, 3); - Sequence arFloat(_arFloat, 3); - Sequence arDouble(_arDouble, 3); - Sequence arString(_arString, 3); + Sequence arULong({0, 1, 0xFFFFFFFF}); + Sequence arHyper({ + static_cast(SAL_CONST_INT64(0x8000000000000000)), 1, + SAL_CONST_INT64(0x7FFFFFFFFFFFFFFF)}); + Sequence arUHyper({ + 0, 1, SAL_CONST_UINT64(0xFFFFFFFFFFFFFFFF)}); + Sequence arFloat({1.1f, 2.2f, 3.3f}); + Sequence arDouble({1.11, 2.22, 3.33}); + Sequence arString({ + OUString("String 1"), OUString("String 2"), + OUString("String 3")}); Sequence arAny(_arAny, 3); Sequence > arObject(_arObj, 3); - Sequence arEnum(_arEnum, 3); + Sequence arEnum({ + TestEnum_ONE, TestEnum_TWO, TestEnum_CHECK}); Sequence arStruct(_arStruct, 3); Sequence > _arSeqLong2[3]; for (int j = 0; j != 3; ++j) { -- cgit