testtools/source/bridgetest/bridgetest.cxx | 85 +++++++-- testtools/source/bridgetest/cli/cli_cpp_bridgetest.cxx | 82 +++++++-- testtools/source/bridgetest/cppobj.cxx | 148 ++++++++++------- testtools/source/bridgetest/idl/bridgetest.idl | 70 +++++--- 4 files changed, 277 insertions(+), 108 deletions(-)
New commits: commit f228db3e47bbb18f1560e4d118d57d00e46eaf6f Author: Tor Lillqvist <t...@collabora.com> AuthorDate: Thu Nov 12 11:35:57 2020 +0200 Commit: Tor Lillqvist <t...@collabora.com> CommitDate: Sun Nov 15 10:46:01 2020 +0100 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 <t...@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105887 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> diff --git a/testtools/source/bridgetest/bridgetest.cxx b/testtools/source/bridgetest/bridgetest.cxx index 535d8e1fa73c..ab4ac91bc96d 100644 --- a/testtools/source/bridgetest/bridgetest.cxx +++ b/testtools/source/bridgetest/bridgetest.cxx @@ -375,28 +375,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]); @@ -431,10 +469,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 abb082e3fd24..cec2a2a4038d 100644 --- a/testtools/source/bridgetest/cli/cli_cpp_bridgetest.cxx +++ b/testtools/source/bridgetest/cli/cli_cpp_bridgetest.cxx @@ -412,27 +412,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 @@ -448,10 +488,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 2a5a58be34bb..b719cdd6db15 100644 --- a/testtools/source/bridgetest/cppobj.cxx +++ b/testtools/source/bridgetest/cppobj.cxx @@ -168,38 +168,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; } @@ -533,12 +554,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, @@ -550,16 +578,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, @@ -573,16 +608,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 ); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits