summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2020-11-12 11:35:57 +0200
committerCaolán McNamara <caolanm@redhat.com>2020-11-24 10:10:19 +0100
commit6b3f94245a49945626c4546a213c8ce52db7f790 (patch)
tree069895479d42014f2d4873543db59cc1ee8155cc
parent8a6f8333ebc1daba068ca474140c03342c861150 (diff)
Cosmetic change to make it easier to see which parameter is the nth
Consequently put each parameter/argument on a separate line for the get/setValues methods. Will make it easier to add more parameters of such types and at such positions that they catch errors in the C++/UNO bridge on more platforms (specifically, the one for macOS on Apple Silicon). Change-Id: I68578d0401358317f3baf913ef4d53009c8f5f2f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105633 Tested-by: Jenkins Reviewed-by: Tor Lillqvist <tml@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105887 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106469 Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--testtools/source/bridgetest/bridgetest.cxx85
-rw-r--r--testtools/source/bridgetest/cli/cli_cpp_bridgetest.cxx82
-rw-r--r--testtools/source/bridgetest/cppobj.cxx148
-rw-r--r--testtools/source/bridgetest/idl/bridgetest.idl70
4 files changed, 277 insertions, 108 deletions
diff --git a/testtools/source/bridgetest/bridgetest.cxx b/testtools/source/bridgetest/bridgetest.cxx
index 5ce8a687d5f8..08d896566d90 100644
--- a/testtools/source/bridgetest/bridgetest.cxx
+++ b/testtools/source/bridgetest/bridgetest.cxx
@@ -383,28 +383,66 @@ static bool performTest(
aSetData.Sequence[0] = *static_cast<TestElement const *>(&aSetData);
// aSetData.Sequence[1] is empty
xLBT->setValues(
- aSetData.Bool, aSetData.Char, aSetData.Byte, aSetData.Short,
- aSetData.UShort, aSetData.Long, aSetData.ULong, aSetData.Hyper,
- aSetData.UHyper, aSetData.Float, aSetData.Double, aSetData.Enum,
- aSetData.String, aSetData.Interface, aSetData.Any,
- aSetData.Sequence, aSetData);
+ aSetData.Bool,
+ aSetData.Char,
+ aSetData.Byte,
+ aSetData.Short,
+ aSetData.UShort,
+ aSetData.Long,
+ aSetData.ULong,
+ aSetData.Hyper,
+ aSetData.UHyper,
+ aSetData.Float,
+ aSetData.Double,
+ aSetData.Enum,
+ aSetData.String,
+ aSetData.Interface,
+ aSetData.Any,
+ aSetData.Sequence,
+ aSetData);
{
TestData aRet;
TestData aRet2;
xLBT->getValues(
- aRet.Bool, aRet.Char, aRet.Byte, aRet.Short, aRet.UShort,
- aRet.Long, aRet.ULong, aRet.Hyper, aRet.UHyper, aRet.Float,
- aRet.Double, aRet.Enum, aRet.String, aRet.Interface, aRet.Any,
- aRet.Sequence, aRet2);
+ aRet.Bool,
+ aRet.Char,
+ aRet.Byte,
+ aRet.Short,
+ aRet.UShort,
+ aRet.Long,
+ aRet.ULong,
+ aRet.Hyper,
+ aRet.UHyper,
+ aRet.Float,
+ aRet.Double,
+ aRet.Enum,
+ aRet.String,
+ aRet.Interface,
+ aRet.Any,
+ aRet.Sequence,
+ aRet2);
bRet &= check(
equals(aData, aRet) && equals(aData, aRet2), "getValues test");
// Set last retrieved values:
TestData aSV2ret(
xLBT->setValues2(
- aRet.Bool, aRet.Char, aRet.Byte, aRet.Short, aRet.UShort,
- aRet.Long, aRet.ULong, aRet.Hyper, aRet.UHyper, aRet.Float,
- aRet.Double, aRet.Enum, aRet.String, aRet.Interface,
- aRet.Any, aRet.Sequence, aRet2));
+ aRet.Bool,
+ aRet.Char,
+ aRet.Byte,
+ aRet.Short,
+ aRet.UShort,
+ aRet.Long,
+ aRet.ULong,
+ aRet.Hyper,
+ aRet.UHyper,
+ aRet.Float,
+ aRet.Double,
+ aRet.Enum,
+ aRet.String,
+ aRet.Interface,
+ aRet.Any,
+ aRet.Sequence,
+ aRet2));
// Check inout sequence order (=> inout sequence parameter was
// switched by test objects):
TestElement temp(aRet.Sequence[0]);
@@ -439,10 +477,23 @@ static bool performTest(
TestData aRet2;
TestData aGVret(
xLBT->getValues(
- aRet.Bool, aRet.Char, aRet.Byte, aRet.Short, aRet.UShort,
- aRet.Long, aRet.ULong, aRet.Hyper, aRet.UHyper, aRet.Float,
- aRet.Double, aRet.Enum, aRet.String, aRet.Interface,
- aRet.Any, aRet.Sequence, aRet2));
+ aRet.Bool,
+ aRet.Char,
+ aRet.Byte,
+ aRet.Short,
+ aRet.UShort,
+ aRet.Long,
+ aRet.ULong,
+ aRet.Hyper,
+ aRet.UHyper,
+ aRet.Float,
+ aRet.Double,
+ aRet.Enum,
+ aRet.String,
+ aRet.Interface,
+ aRet.Any,
+ aRet.Sequence,
+ aRet2));
bRet &= check(
(equals(aData, aRet) && equals(aData, aRet2) &&
equals(aData, aGVret)),
diff --git a/testtools/source/bridgetest/cli/cli_cpp_bridgetest.cxx b/testtools/source/bridgetest/cli/cli_cpp_bridgetest.cxx
index 5deddf4005fb..10db81a5027d 100644
--- a/testtools/source/bridgetest/cli/cli_cpp_bridgetest.cxx
+++ b/testtools/source/bridgetest/cli/cli_cpp_bridgetest.cxx
@@ -408,27 +408,67 @@ static bool performTest(XBridgeTest* xLBT)
aSetData->Sequence[1] = new TestElement(); // empty struct
xLBT->setValues(
- aSetData->Bool, aSetData->Char, aSetData->Byte, aSetData->Short, aSetData->UShort,
- aSetData->Long, aSetData->ULong, aSetData->Hyper, aSetData->UHyper, aSetData->Float, aSetData->Double,
- aSetData->Enum, aSetData->String, aSetData->Interface, aSetData->Any, aSetData->Sequence, aSetData );
+ aSetData->Bool,
+ aSetData->Char,
+ aSetData->Byte,
+ aSetData->Short,
+ aSetData->UShort,
+ aSetData->Long,
+ aSetData->ULong,
+ aSetData->Hyper,
+ aSetData->UHyper,
+ aSetData->Float,
+ aSetData->Double,
+ aSetData->Enum,
+ aSetData->String,
+ aSetData->Interface,
+ aSetData->Any,
+ aSetData->Sequence,
+ aSetData );
{
TestDataElements* aRet = new TestDataElements();
TestDataElements* aRet2 = new TestDataElements();
xLBT->getValues(
- & aRet->Bool, & aRet->Char, & aRet->Byte, & aRet->Short, & aRet->UShort,
- & aRet->Long, & aRet->ULong, & aRet->Hyper, & aRet->UHyper,
- & aRet->Float, & aRet->Double, & aRet->Enum, & aRet->String,
- & aRet->Interface, & aRet->Any, & aRet->Sequence, & aRet2 );
+ & aRet->Bool,
+ & aRet->Char,
+ & aRet->Byte,
+ & aRet->Short,
+ & aRet->UShort,
+ & aRet->Long,
+ & aRet->ULong,
+ & aRet->Hyper,
+ & aRet->UHyper,
+ & aRet->Float,
+ & aRet->Double,
+ & aRet->Enum,
+ & aRet->String,
+ & aRet->Interface,
+ & aRet->Any,
+ & aRet->Sequence,
+ & aRet2 );
bRet = check( compareData( aData, aRet ) && compareData( aData, aRet2 ) , "getValues test") && bRet;
// set last retrieved values
TestDataElements* aSV2ret = xLBT->setValues2(
- & aRet->Bool, & aRet->Char, & aRet->Byte, & aRet->Short, & aRet->UShort,
- & aRet->Long, & aRet->ULong, & aRet->Hyper, & aRet->UHyper, & aRet->Float,
- & aRet->Double, & aRet->Enum, & aRet->String, & aRet->Interface, & aRet->Any,
- & aRet->Sequence, & aRet2 );
+ & aRet->Bool,
+ & aRet->Char,
+ & aRet->Byte,
+ & aRet->Short,
+ & aRet->UShort,
+ & aRet->Long,
+ & aRet->ULong,
+ & aRet->Hyper,
+ & aRet->UHyper,
+ & aRet->Float,
+ & aRet->Double,
+ & aRet->Enum,
+ & aRet->String,
+ & aRet->Interface,
+ & aRet->Any,
+ & aRet->Sequence,
+ & aRet2 );
// check inout sequence order
// => inout sequence parameter was switched by test objects
@@ -444,10 +484,22 @@ static bool performTest(XBridgeTest* xLBT)
TestDataElements* aRet = new TestDataElements();
TestDataElements* aRet2 = new TestDataElements();
TestDataElements* aGVret = xLBT->getValues(
- & aRet->Bool, & aRet->Char, & aRet->Byte, & aRet->Short,
- & aRet->UShort, & aRet->Long, & aRet->ULong, & aRet->Hyper,
- & aRet->UHyper, & aRet->Float, & aRet->Double, & aRet->Enum,
- & aRet->String, & aRet->Interface, & aRet->Any, & aRet->Sequence,
+ & aRet->Bool,
+ & aRet->Char,
+ & aRet->Byte,
+ & aRet->Short,
+ & aRet->UShort,
+ & aRet->Long,
+ & aRet->ULong,
+ & aRet->Hyper,
+ & aRet->UHyper,
+ & aRet->Float,
+ & aRet->Double,
+ & aRet->Enum,
+ & aRet->String,
+ & aRet->Interface,
+ & aRet->Any,
+ & aRet->Sequence,
& aRet2 );
bRet = check( compareData( aData, aRet ) && compareData( aData, aRet2 ) && compareData( aData, aGVret ), "getValues test" ) && bRet;
diff --git a/testtools/source/bridgetest/cppobj.cxx b/testtools/source/bridgetest/cppobj.cxx
index 1a0e1bfdf214..ddd213c83bd0 100644
--- a/testtools/source/bridgetest/cppobj.cxx
+++ b/testtools/source/bridgetest/cppobj.cxx
@@ -169,38 +169,59 @@ public:
virtual Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
// XLBTestBase
- virtual void SAL_CALL setValues( sal_Bool bBool, sal_Unicode cChar, sal_Int8 nByte,
- sal_Int16 nShort, sal_uInt16 nUShort,
- sal_Int32 nLong, sal_uInt32 nULong,
- sal_Int64 nHyper, sal_uInt64 nUHyper,
- float fFloat, double fDouble,
- TestEnum eEnum, const OUString& rStr,
+ virtual void SAL_CALL setValues( sal_Bool bBool,
+ sal_Unicode cChar,
+ sal_Int8 nByte,
+ sal_Int16 nShort,
+ sal_uInt16 nUShort,
+ sal_Int32 nLong,
+ sal_uInt32 nULong,
+ sal_Int64 nHyper,
+ sal_uInt64 nUHyper,
+ float fFloat,
+ double fDouble,
+ TestEnum eEnum,
+ const OUString& rStr,
const css::uno::Reference< css::uno::XInterface >& xTest,
const css::uno::Any& rAny,
const css::uno::Sequence<TestElement >& rSequence,
const ::test::testtools::bridgetest::TestDataElements& rStruct ) override;
- virtual ::test::testtools::bridgetest::TestDataElements SAL_CALL setValues2( sal_Bool& bBool, sal_Unicode& cChar, sal_Int8& nByte,
- sal_Int16& nShort, sal_uInt16& nUShort,
- sal_Int32& nLong, sal_uInt32& nULong,
- sal_Int64& nHyper, sal_uInt64& nUHyper,
- float& fFloat, double& fDouble,
- TestEnum& eEnum, OUString& rStr,
- css::uno::Reference< css::uno::XInterface >& xTest,
- css::uno::Any& rAny,
- css::uno::Sequence<TestElement >& rSequence,
- ::test::testtools::bridgetest::TestDataElements& rStruct ) override;
-
- virtual ::test::testtools::bridgetest::TestDataElements SAL_CALL getValues( sal_Bool& bBool, sal_Unicode& cChar, sal_Int8& nByte,
- sal_Int16& nShort, sal_uInt16& nUShort,
- sal_Int32& nLong, sal_uInt32& nULong,
- sal_Int64& nHyper, sal_uInt64& nUHyper,
- float& fFloat, double& fDouble,
- TestEnum& eEnum, OUString& rStr,
- css::uno::Reference< css::uno::XInterface >& xTest,
- css::uno::Any& rAny,
- css::uno::Sequence< TestElement >& rSequence,
- ::test::testtools::bridgetest::TestDataElements& rStruct ) override;
+ virtual ::test::testtools::bridgetest::TestDataElements SAL_CALL setValues2( sal_Bool& bBool,
+ sal_Unicode& cChar,
+ sal_Int8& nByte,
+ sal_Int16& nShort,
+ sal_uInt16& nUShort,
+ sal_Int32& nLong,
+ sal_uInt32& nULong,
+ sal_Int64& nHyper,
+ sal_uInt64& nUHyper,
+ float& fFloat,
+ double& fDouble,
+ TestEnum& eEnum,
+ OUString& rStr,
+ css::uno::Reference< css::uno::XInterface >& xTest,
+ css::uno::Any& rAny,
+ css::uno::Sequence<TestElement >& rSequence,
+ ::test::testtools::bridgetest::TestDataElements& rStruct ) override;
+
+ virtual ::test::testtools::bridgetest::TestDataElements SAL_CALL getValues( sal_Bool& bBool,
+ sal_Unicode& cChar,
+ sal_Int8& nByte,
+ sal_Int16& nShort,
+ sal_uInt16& nUShort,
+ sal_Int32& nLong,
+ sal_uInt32& nULong,
+ sal_Int64& nHyper,
+ sal_uInt64& nUHyper,
+ float& fFloat,
+ double& fDouble,
+ TestEnum& eEnum,
+ OUString& rStr,
+ css::uno::Reference< css::uno::XInterface >& xTest,
+ css::uno::Any& rAny,
+ css::uno::Sequence< TestElement >& rSequence,
+ ::test::testtools::bridgetest::TestDataElements& rStruct ) override;
virtual SmallStruct SAL_CALL echoSmallStruct(const SmallStruct& rStruct) override
{ return rStruct; }
@@ -536,12 +557,19 @@ OUString Test_Impl::testMulti(Reference< XMulti > const & multi)
}
-void Test_Impl::setValues( sal_Bool bBool, sal_Unicode cChar, sal_Int8 nByte,
- sal_Int16 nShort, sal_uInt16 nUShort,
- sal_Int32 nLong, sal_uInt32 nULong,
- sal_Int64 nHyper, sal_uInt64 nUHyper,
- float fFloat, double fDouble,
- TestEnum eEnum, const OUString& rStr,
+void Test_Impl::setValues( sal_Bool bBool,
+ sal_Unicode cChar,
+ sal_Int8 nByte,
+ sal_Int16 nShort,
+ sal_uInt16 nUShort,
+ sal_Int32 nLong,
+ sal_uInt32 nULong,
+ sal_Int64 nHyper,
+ sal_uInt64 nUHyper,
+ float fFloat,
+ double fDouble,
+ TestEnum eEnum,
+ const OUString& rStr,
const css::uno::Reference< css::uno::XInterface >& xTest,
const css::uno::Any& rAny,
const css::uno::Sequence<TestElement >& rSequence,
@@ -553,16 +581,23 @@ void Test_Impl::setValues( sal_Bool bBool, sal_Unicode cChar, sal_Int8 nByte,
_aStructData = rStruct;
}
-::test::testtools::bridgetest::TestDataElements Test_Impl::setValues2( sal_Bool& bBool, sal_Unicode& cChar, sal_Int8& nByte,
- sal_Int16& nShort, sal_uInt16& nUShort,
- sal_Int32& nLong, sal_uInt32& nULong,
- sal_Int64& nHyper, sal_uInt64& nUHyper,
- float& fFloat, double& fDouble,
- TestEnum& eEnum, OUString& rStr,
- css::uno::Reference< css::uno::XInterface >& xTest,
- css::uno::Any& rAny,
- css::uno::Sequence<TestElement >& rSequence,
- ::test::testtools::bridgetest::TestDataElements& rStruct )
+::test::testtools::bridgetest::TestDataElements Test_Impl::setValues2( sal_Bool& bBool,
+ sal_Unicode& cChar,
+ sal_Int8& nByte,
+ sal_Int16& nShort,
+ sal_uInt16& nUShort,
+ sal_Int32& nLong,
+ sal_uInt32& nULong,
+ sal_Int64& nHyper,
+ sal_uInt64& nUHyper,
+ float& fFloat,
+ double& fDouble,
+ TestEnum& eEnum,
+ OUString& rStr,
+ css::uno::Reference< css::uno::XInterface >& xTest,
+ css::uno::Any& rAny,
+ css::uno::Sequence<TestElement >& rSequence,
+ ::test::testtools::bridgetest::TestDataElements& rStruct )
{
assign( _aData,
bBool, cChar, nByte, nShort, nUShort, nLong, nULong, nHyper, nUHyper, fFloat, fDouble,
@@ -576,16 +611,23 @@ void Test_Impl::setValues( sal_Bool bBool, sal_Unicode cChar, sal_Int8 nByte,
return _aStructData;
}
-::test::testtools::bridgetest::TestDataElements Test_Impl::getValues( sal_Bool& bBool, sal_Unicode& cChar, sal_Int8& nByte,
- sal_Int16& nShort, sal_uInt16& nUShort,
- sal_Int32& nLong, sal_uInt32& nULong,
- sal_Int64& nHyper, sal_uInt64& nUHyper,
- float& fFloat, double& fDouble,
- TestEnum& eEnum, OUString& rStr,
- css::uno::Reference< css::uno::XInterface >& xTest,
- css::uno::Any& rAny,
- css::uno::Sequence<TestElement >& rSequence,
- ::test::testtools::bridgetest::TestDataElements& rStruct )
+::test::testtools::bridgetest::TestDataElements Test_Impl::getValues( sal_Bool& bBool,
+ sal_Unicode& cChar,
+ sal_Int8& nByte,
+ sal_Int16& nShort,
+ sal_uInt16& nUShort,
+ sal_Int32& nLong,
+ sal_uInt32& nULong,
+ sal_Int64& nHyper,
+ sal_uInt64& nUHyper,
+ float& fFloat,
+ double& fDouble,
+ TestEnum& eEnum,
+ OUString& rStr,
+ css::uno::Reference< css::uno::XInterface >& xTest,
+ css::uno::Any& rAny,
+ css::uno::Sequence<TestElement >& rSequence,
+ ::test::testtools::bridgetest::TestDataElements& rStruct )
{
bBool = _aData.Bool;
cChar = _aData.Char;
diff --git a/testtools/source/bridgetest/idl/bridgetest.idl b/testtools/source/bridgetest/idl/bridgetest.idl
index 4e99101807c9..0649867ae29a 100644
--- a/testtools/source/bridgetest/idl/bridgetest.idl
+++ b/testtools/source/bridgetest/idl/bridgetest.idl
@@ -227,15 +227,23 @@ interface XBridgeTestBase : com::sun::star::uno::XInterface
/**
* in parameter test, tests by calls reference also (complex types)
*/
- void setValues( [in] boolean bBool, [in] char cChar, [in] byte nByte,
- [in] short nShort, [in] unsigned short nUShort,
- [in] long nLong, [in] unsigned long nULong,
- [in] hyper nHyper, [in] unsigned hyper nUHyper,
- [in] float fFloat, [in] double fDouble,
- [in] TestEnum eEnum, [in] string aString,
- [in] com::sun::star::uno::XInterface xInterface, [in] any aAny,
- [in] sequence< TestElement > aSequence,
- [in] TestData aStruct );
+ void setValues( [in] boolean bBool,
+ [in] char cChar,
+ [in] byte nByte,
+ [in] short nShort,
+ [in] unsigned short nUShort,
+ [in] long nLong,
+ [in] unsigned long nULong,
+ [in] hyper nHyper,
+ [in] unsigned hyper nUHyper,
+ [in] float fFloat,
+ [in] double fDouble,
+ [in] TestEnum eEnum,
+ [in] string aString,
+ [in] com::sun::star::uno::XInterface xInterface,
+ [in] any aAny,
+ [in] sequence< TestElement > aSequence,
+ [in] TestData aStruct );
/**
* inout parameter test
*
@@ -243,26 +251,42 @@ interface XBridgeTestBase : com::sun::star::uno::XInterface
* by setValues or (if not called before) default constructed values.
*
*/
- TestData setValues2( [inout] boolean bBool, [inout] char cChar, [inout] byte nByte,
- [inout] short nShort, [inout] unsigned short nUShort,
- [inout] long nLong, [inout] unsigned long nULong,
- [inout] hyper nHyper, [inout] unsigned hyper nUHyper,
- [inout] float fFloat, [inout] double fDouble,
- [inout] TestEnum eEnum, [inout] string aString,
- [inout] com::sun::star::uno::XInterface xInterface, [inout] any aAny,
+ TestData setValues2( [inout] boolean bBool,
+ [inout] char cChar,
+ [inout] byte nByte,
+ [inout] short nShort,
+ [inout] unsigned short nUShort,
+ [inout] long nLong,
+ [inout] unsigned long nULong,
+ [inout] hyper nHyper,
+ [inout] unsigned hyper nUHyper,
+ [inout] float fFloat,
+ [inout] double fDouble,
+ [inout] TestEnum eEnum,
+ [inout] string aString,
+ [inout] com::sun::star::uno::XInterface xInterface,
+ [inout] any aAny,
[inout] sequence< TestElement > aSequence,
[inout] TestData aStruct );
/**
* out parameter test
*/
- TestData getValues( [out] boolean bBool, [out] char cChar, [out] byte nByte,
- [out] short nShort, [out] unsigned short nUShort,
- [out] long nLong, [out] unsigned long nULong,
- [out] hyper nHyper, [out] unsigned hyper nUHyper,
- [out] float fFloat, [out] double fDouble,
- [out] TestEnum eEnum, [out] string aString,
- [out] com::sun::star::uno::XInterface xInterface, [out] any aAny,
+ TestData getValues( [out] boolean bBool,
+ [out] char cChar,
+ [out] byte nByte,
+ [out] short nShort,
+ [out] unsigned short nUShort,
+ [out] long nLong,
+ [out] unsigned long nULong,
+ [out] hyper nHyper,
+ [out] unsigned hyper nUHyper,
+ [out] float fFloat,
+ [out] double fDouble,
+ [out] TestEnum eEnum,
+ [out] string aString,
+ [out] com::sun::star::uno::XInterface xInterface,
+ [out] any aAny,
[out] sequence< TestElement > aSequence,
[out] TestData aStruct );