[Libreoffice-commits] .: 5 commits - testtools/com testtools/source

Caolán McNamara caolan at kemper.freedesktop.org
Thu Dec 9 03:58:34 PST 2010


 testtools/com/sun/star/comp/bridge/TestComponent.java |   19 ++++++
 testtools/source/bridgetest/bridgetest.cxx            |   21 ++++++-
 testtools/source/bridgetest/cli/cli_cs_testobj.cs     |   17 +++++-
 testtools/source/bridgetest/cppobj.cxx                |    8 ++
 testtools/source/bridgetest/idl/bridgetest.idl        |   49 ++++++++++++++++--
 testtools/source/bridgetest/makefile.mk               |    4 -
 6 files changed, 106 insertions(+), 12 deletions(-)

New commits:
commit 2b7146f6c265cf3debf5c88cecfb428d4dbbdd59
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Dec 9 11:22:47 2010 +0000

    add three byte structure return test for the MacOSX/BSD quirk

diff --git a/testtools/com/sun/star/comp/bridge/TestComponent.java b/testtools/com/sun/star/comp/bridge/TestComponent.java
index 0be741e..b3ef14c 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 c141d4a..b84e6c4 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 c88e4d3..246d3e1 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 e69aa23..516d024 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 d16e5cb..1e0f069 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 );
commit b810edd5ff126cc13cf290ed6ab3143fd59aeff4
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Dec 9 11:19:10 2010 +0000

    add a Mixed Float And Integer struct return test

diff --git a/testtools/com/sun/star/comp/bridge/TestComponent.java b/testtools/com/sun/star/comp/bridge/TestComponent.java
index 2cf16f5..0be741e 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 9b47ce5..c141d4a 100644
--- a/testtools/source/bridgetest/bridgetest.cxx
+++ b/testtools/source/bridgetest/bridgetest.cxx
@@ -558,6 +558,11 @@ static sal_Bool performTest(
             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 5cd6de1..c88e4d3 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 89f44fc..e69aa23 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 c9bce0b..d16e5cb 100644
--- a/testtools/source/bridgetest/idl/bridgetest.idl
+++ b/testtools/source/bridgetest/idl/bridgetest.idl
@@ -120,6 +120,15 @@ struct FourFloats
     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
  */
 struct TestElement : TestSimple
@@ -281,6 +290,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#)
      */
     long testPPCAlignment( [in] hyper l1, [in] hyper l2, [in] long i1, [in] hyper l3, [in] long i2 );
commit 5dcb680a82c39fb296a42a4e4d2a423de6eec9cb
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Dec 9 11:13:27 2010 +0000

    add a twoFloats return test

diff --git a/testtools/com/sun/star/comp/bridge/TestComponent.java b/testtools/com/sun/star/comp/bridge/TestComponent.java
index 2ca871e..2cf16f5 100644
--- a/testtools/com/sun/star/comp/bridge/TestComponent.java
+++ b/testtools/com/sun/star/comp/bridge/TestComponent.java
@@ -47,6 +47,7 @@ import test.testtools.bridgetest.TestStruct;
 import test.testtools.bridgetest.SmallStruct;
 import test.testtools.bridgetest.MediumStruct;
 import test.testtools.bridgetest.BigStruct;
+import test.testtools.bridgetest.TwoFloats;
 import test.testtools.bridgetest.FourFloats;
 import test.testtools.bridgetest.XBridgeTest;
 import test.testtools.bridgetest.XBridgeTest2;
@@ -488,6 +489,10 @@ public class TestComponent {
             return i_Struct;
         }
 
+        public TwoFloats echoTwoFloats( TwoFloats i_Struct) throws com.sun.star.uno.RuntimeException {
+            return i_Struct;
+        }
+
         public FourFloats echoFourFloats( FourFloats i_Struct) throws com.sun.star.uno.RuntimeException {
             return i_Struct;
         }
diff --git a/testtools/source/bridgetest/bridgetest.cxx b/testtools/source/bridgetest/bridgetest.cxx
index 81674ba..9b47ce5 100644
--- a/testtools/source/bridgetest/bridgetest.cxx
+++ b/testtools/source/bridgetest/bridgetest.cxx
@@ -548,6 +548,11 @@ static sal_Bool performTest(
             bRet = check( memcmp(&aIn, &aOut, sizeof(BigStruct)) == 0, "big struct test" ) && bRet;
         }
         {
+            TwoFloats aIn(1.1f, 2.2f);
+            TwoFloats aOut = xLBT->echoTwoFloats(aIn);
+            bRet = check( memcmp(&aIn, &aOut, sizeof(TwoFloats)) == 0, "two floats struct test" ) && bRet;
+        }
+        {
             FourFloats aIn(3.3f, 4.4f, 5.5f, 6.6f);
             FourFloats aOut = xLBT->echoFourFloats(aIn);
             bRet = check( memcmp(&aIn, &aOut, sizeof(FourFloats)) == 0, "four floats struct test" ) && bRet;
diff --git a/testtools/source/bridgetest/cli/cli_cs_testobj.cs b/testtools/source/bridgetest/cli/cli_cs_testobj.cs
index a1064d8..5cd6de1 100644
--- a/testtools/source/bridgetest/cli/cli_cs_testobj.cs
+++ b/testtools/source/bridgetest/cli/cli_cs_testobj.cs
@@ -239,6 +239,11 @@ public class BridgeTestObject : WeakBase, XRecursiveCall, XBridgeTest2
         return arg;
     }
 
+    public TwoFloats echoTwoFloats(/*[in]*/TwoFloats arg)
+    {
+        return arg;
+    }
+
     public FourFloats echoFourFloats(/*[in]*/FourFloats arg)
     {
         return arg;
diff --git a/testtools/source/bridgetest/cppobj.cxx b/testtools/source/bridgetest/cppobj.cxx
index 9f917bf..89f44fc 100644
--- a/testtools/source/bridgetest/cppobj.cxx
+++ b/testtools/source/bridgetest/cppobj.cxx
@@ -221,6 +221,8 @@ public:
         { return rStruct; }
     virtual BigStruct SAL_CALL echoBigStruct(const BigStruct& rStruct) throw(com::sun::star::uno::RuntimeException)
         { return rStruct; }
+    virtual TwoFloats SAL_CALL echoTwoFloats(const TwoFloats& rStruct) throw(com::sun::star::uno::RuntimeException)
+        { return rStruct; }
     virtual FourFloats SAL_CALL echoFourFloats(const FourFloats& 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)
diff --git a/testtools/source/bridgetest/idl/bridgetest.idl b/testtools/source/bridgetest/idl/bridgetest.idl
index c5a62e1..c9bce0b 100644
--- a/testtools/source/bridgetest/idl/bridgetest.idl
+++ b/testtools/source/bridgetest/idl/bridgetest.idl
@@ -101,6 +101,15 @@ struct BigStruct
     hyper                      h;
 };
 /**
+ * two floats, BSDs/MacOSX on intel handle returning small
+ * structs differently than Linux
+ */
+struct TwoFloats
+{
+    float                      a;
+    float                      b;
+};
+/**
  * all floats, ia64 handles them specially
  */
 struct FourFloats
@@ -264,10 +273,15 @@ interface XBridgeTestBase : com::sun::star::uno::XInterface
     /**
      * register return test 4
      */
+    TwoFloats echoTwoFloats( [in] TwoFloats aStruct );
+
+    /**
+     * register return test 5
+     */
     FourFloats echoFourFloats( [in] FourFloats aStruct );
 
     /**
-     * register return test 4 (i107182)
+     * PPC Alignment test (#i107182#)
      */
     long testPPCAlignment( [in] hyper l1, [in] hyper l2, [in] long i1, [in] hyper l3, [in] long i2 );
 
commit 335baeec72eeb66b7c3c1cb46b44d2a1783a3727
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Dec 9 11:12:38 2010 +0000

    fix the dependencies so that the uno_types is regenerated if the .idl changes

diff --git a/testtools/source/bridgetest/makefile.mk b/testtools/source/bridgetest/makefile.mk
index 9b75a1a..e7a2b5f 100644
--- a/testtools/source/bridgetest/makefile.mk
+++ b/testtools/source/bridgetest/makefile.mk
@@ -140,9 +140,9 @@ runtest : $(DLLDEST)$/uno_types.rdb $(DLLDEST)$/uno_services.rdb makefile.mk
         com.sun.star.test.bridge.CppTestObject
 .ENDIF
     
-$(DLLDEST)$/uno_types.rdb : $(SOLARBINDIR)$/udkapi.rdb
+$(DLLDEST)$/uno_types.rdb : $(SOLARBINDIR)$/udkapi.rdb $(BIN)$/bridgetest.rdb
     echo $(DLLDEST)
-    $(GNUCOPY) $? $@
+    $(GNUCOPY) $(SOLARBINDIR)$/udkapi.rdb $@
     $(REGMERGE) $@ / $(BIN)$/bridgetest.rdb
 
 $(DLLDEST)$/bridgetest_client$(BATCH_SUFFIX) .ERRREMOVE: makefile.mk
commit 203474a91fff2b72feb7043a66d26b719879b454
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Dec 9 10:40:52 2010 +0000

    rename AllFloats test to FourFloats

diff --git a/testtools/com/sun/star/comp/bridge/TestComponent.java b/testtools/com/sun/star/comp/bridge/TestComponent.java
index e6a4dfa..2ca871e 100644
--- a/testtools/com/sun/star/comp/bridge/TestComponent.java
+++ b/testtools/com/sun/star/comp/bridge/TestComponent.java
@@ -47,7 +47,7 @@ import test.testtools.bridgetest.TestStruct;
 import test.testtools.bridgetest.SmallStruct;
 import test.testtools.bridgetest.MediumStruct;
 import test.testtools.bridgetest.BigStruct;
-import test.testtools.bridgetest.AllFloats;
+import test.testtools.bridgetest.FourFloats;
 import test.testtools.bridgetest.XBridgeTest;
 import test.testtools.bridgetest.XBridgeTest2;
 import test.testtools.bridgetest.XCurrentContextChecker;
@@ -488,7 +488,7 @@ public class TestComponent {
             return i_Struct;
         }
 
-        public AllFloats echoAllFloats( AllFloats i_Struct) throws com.sun.star.uno.RuntimeException {
+        public FourFloats echoFourFloats( FourFloats i_Struct) throws com.sun.star.uno.RuntimeException {
             return i_Struct;
         }
 
diff --git a/testtools/source/bridgetest/bridgetest.cxx b/testtools/source/bridgetest/bridgetest.cxx
index 095da1b..81674ba 100644
--- a/testtools/source/bridgetest/bridgetest.cxx
+++ b/testtools/source/bridgetest/bridgetest.cxx
@@ -548,9 +548,9 @@ static sal_Bool performTest(
             bRet = check( memcmp(&aIn, &aOut, sizeof(BigStruct)) == 0, "big struct test" ) && bRet;
         }
         {
-            AllFloats aIn(1.1f, 2.2f, 3.3f, 4.4f);
-            AllFloats aOut = xLBT->echoAllFloats(aIn);
-            bRet = check( memcmp(&aIn, &aOut, sizeof(AllFloats)) == 0, "all floats struct test" ) && bRet;
+            FourFloats aIn(3.3f, 4.4f, 5.5f, 6.6f);
+            FourFloats aOut = xLBT->echoFourFloats(aIn);
+            bRet = check( memcmp(&aIn, &aOut, sizeof(FourFloats)) == 0, "four floats struct test" ) && bRet;
         }
         {
             sal_Int32 i2 = xLBT->testPPCAlignment( 0, 0, 0, 0, 0xbeaf );
diff --git a/testtools/source/bridgetest/cli/cli_cs_testobj.cs b/testtools/source/bridgetest/cli/cli_cs_testobj.cs
index 258445e..a1064d8 100644
--- a/testtools/source/bridgetest/cli/cli_cs_testobj.cs
+++ b/testtools/source/bridgetest/cli/cli_cs_testobj.cs
@@ -239,7 +239,7 @@ public class BridgeTestObject : WeakBase, XRecursiveCall, XBridgeTest2
         return arg;
     }
 
-    public AllFloats echoAllFloats(/*[in]*/AllFloats arg)
+    public FourFloats echoFourFloats(/*[in]*/FourFloats arg)
     {
         return arg;
     }
diff --git a/testtools/source/bridgetest/cppobj.cxx b/testtools/source/bridgetest/cppobj.cxx
index e41c5ad..9f917bf 100644
--- a/testtools/source/bridgetest/cppobj.cxx
+++ b/testtools/source/bridgetest/cppobj.cxx
@@ -221,7 +221,7 @@ public:
         { return rStruct; }
     virtual BigStruct SAL_CALL echoBigStruct(const BigStruct& rStruct) throw(com::sun::star::uno::RuntimeException)
         { return rStruct; }
-    virtual AllFloats SAL_CALL echoAllFloats(const AllFloats& rStruct) throw(com::sun::star::uno::RuntimeException)
+    virtual FourFloats SAL_CALL echoFourFloats(const FourFloats& 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 71e82c5..c5a62e1 100644
--- a/testtools/source/bridgetest/idl/bridgetest.idl
+++ b/testtools/source/bridgetest/idl/bridgetest.idl
@@ -103,7 +103,7 @@ struct BigStruct
 /**
  * all floats, ia64 handles them specially
  */
-struct AllFloats
+struct FourFloats
 {
     float                      a;
     float                      b;
@@ -264,7 +264,7 @@ interface XBridgeTestBase : com::sun::star::uno::XInterface
     /**
      * register return test 4
      */
-    AllFloats echoAllFloats( [in] AllFloats aStruct );
+    FourFloats echoFourFloats( [in] FourFloats aStruct );
 
     /**
      * register return test 4 (i107182)


More information about the Libreoffice-commits mailing list