From 85cc920f24f6f8e580a5f390d8077bb6bccc0ae9 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 9 Dec 2010 11:19:10 +0000 Subject: add a Mixed Float And Integer struct return test --- testtools/com/sun/star/comp/bridge/TestComponent.java | 5 +++++ testtools/source/bridgetest/bridgetest.cxx | 5 +++++ testtools/source/bridgetest/cli/cli_cs_testobj.cs | 5 +++++ testtools/source/bridgetest/cppobj.cxx | 2 ++ testtools/source/bridgetest/idl/bridgetest.idl | 14 ++++++++++++++ 5 files changed, 31 insertions(+) diff --git a/testtools/com/sun/star/comp/bridge/TestComponent.java b/testtools/com/sun/star/comp/bridge/TestComponent.java index ed91f4c9cb11..25e3b3a7099a 100644 --- a/testtools/com/sun/star/comp/bridge/TestComponent.java +++ b/testtools/com/sun/star/comp/bridge/TestComponent.java @@ -49,6 +49,7 @@ import test.testtools.bridgetest.MediumStruct; import test.testtools.bridgetest.BigStruct; import test.testtools.bridgetest.TwoFloats; import test.testtools.bridgetest.FourFloats; +import test.testtools.bridgetest.MixedFloatAndInteger; import test.testtools.bridgetest.XBridgeTest; import test.testtools.bridgetest.XBridgeTest2; import test.testtools.bridgetest.XCurrentContextChecker; @@ -497,6 +498,10 @@ public class TestComponent { return i_Struct; } + public MixedFloatAndInteger echoMixedFloatAndInteger( MixedFloatAndInteger i_Struct) throws com.sun.star.uno.RuntimeException { + return i_Struct; + } + public int testPPCAlignment( long l1, long l2, int i1, long l3, int i2 ) throws com.sun.star.uno.RuntimeException { return i2; } diff --git a/testtools/source/bridgetest/bridgetest.cxx b/testtools/source/bridgetest/bridgetest.cxx index 1e1e85a52ac2..4168fd3d62a1 100644 --- a/testtools/source/bridgetest/bridgetest.cxx +++ b/testtools/source/bridgetest/bridgetest.cxx @@ -557,6 +557,11 @@ static sal_Bool performTest( FourFloats aOut = xLBT->echoFourFloats(aIn); bRet = check( memcmp(&aIn, &aOut, sizeof(FourFloats)) == 0, "four floats struct test" ) && bRet; } + { + MixedFloatAndInteger aIn(7.7f, 8); + MixedFloatAndInteger aOut = xLBT->echoMixedFloatAndInteger(aIn); + bRet = check( memcmp(&aIn, &aOut, sizeof(MixedFloatAndInteger)) == 0, "mixed float and integer struct test" ) && bRet; + } { sal_Int32 i2 = xLBT->testPPCAlignment( 0, 0, 0, 0, 0xbeaf ); bRet = check( i2 == 0xbeaf, "ppc-style alignment test" ) && bRet; diff --git a/testtools/source/bridgetest/cli/cli_cs_testobj.cs b/testtools/source/bridgetest/cli/cli_cs_testobj.cs index 5cd6de15cf16..c88e4d3c4589 100644 --- a/testtools/source/bridgetest/cli/cli_cs_testobj.cs +++ b/testtools/source/bridgetest/cli/cli_cs_testobj.cs @@ -249,6 +249,11 @@ public class BridgeTestObject : WeakBase, XRecursiveCall, XBridgeTest2 return arg; } + public MixedFloatAndInteger echoMixedFloatAndInteger(/*[in]*/MixedFloatAndInteger arg) + { + return arg; + } + public int testPPCAlignment( long l1, long l2, int i1, long l3, int i2 ) { return i2; diff --git a/testtools/source/bridgetest/cppobj.cxx b/testtools/source/bridgetest/cppobj.cxx index eb1dbb5d8cdc..1c8139bfb7fb 100644 --- a/testtools/source/bridgetest/cppobj.cxx +++ b/testtools/source/bridgetest/cppobj.cxx @@ -225,6 +225,8 @@ public: { return rStruct; } virtual FourFloats SAL_CALL echoFourFloats(const FourFloats& rStruct) throw(com::sun::star::uno::RuntimeException) { return rStruct; } + virtual MixedFloatAndInteger SAL_CALL echoMixedFloatAndInteger(const MixedFloatAndInteger& rStruct) throw(com::sun::star::uno::RuntimeException) + { return rStruct; } virtual sal_Int32 SAL_CALL testPPCAlignment( sal_Int64, sal_Int64, sal_Int32, sal_Int64, sal_Int32 i2 ) throw(com::sun::star::uno::RuntimeException) { return i2; } diff --git a/testtools/source/bridgetest/idl/bridgetest.idl b/testtools/source/bridgetest/idl/bridgetest.idl index 906854768d2d..e38a2f2e0b7a 100644 --- a/testtools/source/bridgetest/idl/bridgetest.idl +++ b/testtools/source/bridgetest/idl/bridgetest.idl @@ -119,6 +119,15 @@ struct FourFloats float c; float d; }; +/** + * Small struct with mixed float and integers. + * Should return in registers on BSDs/MACOSx + */ +struct MixedFloatAndInteger +{ + float a; + long b; +}; /** * complex types adding string, inteface, any */ @@ -280,6 +289,11 @@ interface XBridgeTestBase : com::sun::star::uno::XInterface */ FourFloats echoFourFloats( [in] FourFloats aStruct ); + /** + * register return test 6 + */ + MixedFloatAndInteger echoMixedFloatAndInteger( [in] MixedFloatAndInteger aStruct ); + /** * PPC Alignment test (#i107182#) */ -- cgit