diff options
author | Caolán McNamara <caolanm@redhat.com> | 2010-12-09 11:22:47 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2010-12-09 11:22:47 +0000 |
commit | 2cc93b0ba3f639fbc8f722872b3ed26035784141 (patch) | |
tree | 90f2b9129c9811e452cc48d5747930b4c05f908d /testtools | |
parent | 85cc920f24f6f8e580a5f390d8077bb6bccc0ae9 (diff) |
add three byte structure return test for the MacOSX/BSD quirk
Diffstat (limited to 'testtools')
-rw-r--r-- | testtools/com/sun/star/comp/bridge/TestComponent.java | 5 | ||||
-rw-r--r-- | testtools/source/bridgetest/bridgetest.cxx | 5 | ||||
-rw-r--r-- | testtools/source/bridgetest/cli/cli_cs_testobj.cs | 5 | ||||
-rw-r--r-- | testtools/source/bridgetest/cppobj.cxx | 2 | ||||
-rw-r--r-- | testtools/source/bridgetest/idl/bridgetest.idl | 15 |
5 files changed, 32 insertions, 0 deletions
diff --git a/testtools/com/sun/star/comp/bridge/TestComponent.java b/testtools/com/sun/star/comp/bridge/TestComponent.java index 25e3b3a7099a..6953a4da90da 100644 --- a/testtools/com/sun/star/comp/bridge/TestComponent.java +++ b/testtools/com/sun/star/comp/bridge/TestComponent.java @@ -50,6 +50,7 @@ import test.testtools.bridgetest.BigStruct; import test.testtools.bridgetest.TwoFloats; import test.testtools.bridgetest.FourFloats; import test.testtools.bridgetest.MixedFloatAndInteger; +import test.testtools.bridgetest.ThreeByteStruct; import test.testtools.bridgetest.XBridgeTest; import test.testtools.bridgetest.XBridgeTest2; import test.testtools.bridgetest.XCurrentContextChecker; @@ -502,6 +503,10 @@ public class TestComponent { return i_Struct; } + public ThreeByteStruct echoThreeByteStruct( ThreeByteStruct 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 4168fd3d62a1..74f89469b077 100644 --- a/testtools/source/bridgetest/bridgetest.cxx +++ b/testtools/source/bridgetest/bridgetest.cxx @@ -563,6 +563,11 @@ static sal_Bool performTest( bRet = check( memcmp(&aIn, &aOut, sizeof(MixedFloatAndInteger)) == 0, "mixed float and integer struct test" ) && bRet; } { + ThreeByteStruct aIn(9, 10, 11); + ThreeByteStruct aOut = xLBT->echoThreeByteStruct(aIn); + bRet = check( memcmp(&aIn, &aOut, sizeof(ThreeByteStruct)) == 0, "three byte 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 c88e4d3c4589..246d3e1898a6 100644 --- a/testtools/source/bridgetest/cli/cli_cs_testobj.cs +++ b/testtools/source/bridgetest/cli/cli_cs_testobj.cs @@ -254,6 +254,11 @@ public class BridgeTestObject : WeakBase, XRecursiveCall, XBridgeTest2 return arg; } + public ThreeByteStruct echoThreeByteStruct(/*[in]*/ThreeByteStruct 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 1c8139bfb7fb..d765e14d33d4 100644 --- a/testtools/source/bridgetest/cppobj.cxx +++ b/testtools/source/bridgetest/cppobj.cxx @@ -227,6 +227,8 @@ public: { return rStruct; } virtual MixedFloatAndInteger SAL_CALL echoMixedFloatAndInteger(const MixedFloatAndInteger& rStruct) throw(com::sun::star::uno::RuntimeException) { return rStruct; } + virtual ThreeByteStruct SAL_CALL echoThreeByteStruct(const ThreeByteStruct& 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 e38a2f2e0b7a..82db3207cfd3 100644 --- a/testtools/source/bridgetest/idl/bridgetest.idl +++ b/testtools/source/bridgetest/idl/bridgetest.idl @@ -129,6 +129,16 @@ struct MixedFloatAndInteger long b; }; /** + * Small struct with three bytes. Should *not* return in registers on + * BSDs/MACOSx + */ +struct ThreeByteStruct +{ + byte a; + byte b; + byte c; +}; +/** * complex types adding string, inteface, any */ struct TestElement : TestSimple @@ -295,6 +305,11 @@ interface XBridgeTestBase : com::sun::star::uno::XInterface MixedFloatAndInteger echoMixedFloatAndInteger( [in] MixedFloatAndInteger aStruct ); /** + * register return test 7 + */ + ThreeByteStruct echoThreeByteStruct( [in] ThreeByteStruct aStruct ); + + /** * PPC Alignment test (#i107182#) */ long testPPCAlignment( [in] hyper l1, [in] hyper l2, [in] long i1, [in] hyper l3, [in] long i2 ); |