summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--testtools/com/sun/star/comp/bridge/TestComponent.java21
-rw-r--r--testtools/source/bridgetest/bridgetest.cxx22
-rw-r--r--testtools/source/bridgetest/cli/cli_cs_testobj.cs20
-rw-r--r--testtools/source/bridgetest/cli/cli_vb_testobj.vb2
-rw-r--r--testtools/source/bridgetest/cppobj.cxx9
-rw-r--r--testtools/source/bridgetest/idl/bridgetest.idl62
-rw-r--r--testtools/source/bridgetest/makefile.mk31
-rw-r--r--testtools/source/bridgetest/pyuno/makefile.mk15
8 files changed, 160 insertions, 22 deletions
diff --git a/testtools/com/sun/star/comp/bridge/TestComponent.java b/testtools/com/sun/star/comp/bridge/TestComponent.java
index 0834884c4..0ff752f3b 100644
--- a/testtools/com/sun/star/comp/bridge/TestComponent.java
+++ b/testtools/com/sun/star/comp/bridge/TestComponent.java
@@ -47,12 +47,17 @@ import test.testtools.bridgetest.TestEnum;
import test.testtools.bridgetest.TestPolyStruct;
import test.testtools.bridgetest.TestPolyStruct2;
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.XBridgeTest;
import test.testtools.bridgetest.XBridgeTest2;
import test.testtools.bridgetest.XCurrentContextChecker;
import test.testtools.bridgetest.XMulti;
import test.testtools.bridgetest.XRecursiveCall;
+
import com.sun.star.lang.IllegalArgumentException;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.lang.XSingleServiceFactory;
@@ -473,6 +478,22 @@ public class TestComponent {
return _testDataElements;
}
+
+ public SmallStruct echoSmallStruct( SmallStruct i_Struct) throws com.sun.star.uno.RuntimeException {
+ return i_Struct;
+ }
+
+ public MediumStruct echoMediumStruct( MediumStruct i_Struct) throws com.sun.star.uno.RuntimeException {
+ return i_Struct;
+ }
+
+ public BigStruct echoBigStruct( BigStruct i_Struct) throws com.sun.star.uno.RuntimeException {
+ return i_Struct;
+ }
+
+ public AllFloats echoAllFloats( AllFloats i_Struct) throws com.sun.star.uno.RuntimeException {
+ return i_Struct;
+ }
// Attributes
public boolean getBool() throws com.sun.star.uno.RuntimeException {
diff --git a/testtools/source/bridgetest/bridgetest.cxx b/testtools/source/bridgetest/bridgetest.cxx
index ae7e9bcbd..7381fed08 100644
--- a/testtools/source/bridgetest/bridgetest.cxx
+++ b/testtools/source/bridgetest/bridgetest.cxx
@@ -32,6 +32,7 @@
#include "precompiled_testtools.hxx"
#include <stdio.h>
+#include <string.h>
#include <osl/diagnose.h>
#include "osl/diagnose.hxx"
#include <osl/time.h>
@@ -533,6 +534,27 @@ static sal_Bool performTest(
bRet = check( equals( aData, aRet ) && equals( aData, aRet2 ) , "struct comparison test") && bRet;
+ {
+ SmallStruct aIn(1, 2);
+ SmallStruct aOut = xLBT->echoSmallStruct(aIn);
+ bRet = check( memcmp(&aIn, &aOut, sizeof(SmallStruct)) == 0, "small struct test" ) && bRet;
+ }
+ {
+ MediumStruct aIn(1, 2, 3, 4);
+ MediumStruct aOut = xLBT->echoMediumStruct(aIn);
+ bRet = check( memcmp(&aIn, &aOut, sizeof(MediumStruct)) == 0, "medium struct test" ) && bRet;
+ }
+ {
+ BigStruct aIn(1, 2, 3, 4, 5, 6, 7, 8);
+ BigStruct aOut = xLBT->echoBigStruct(aIn);
+ 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;
+ }
+
// Test extended attributes that raise exceptions:
try {
xLBT->getRaiseAttr1();
diff --git a/testtools/source/bridgetest/cli/cli_cs_testobj.cs b/testtools/source/bridgetest/cli/cli_cs_testobj.cs
index 5cff3c9d5..2f1c9dde7 100644
--- a/testtools/source/bridgetest/cli/cli_cs_testobj.cs
+++ b/testtools/source/bridgetest/cli/cli_cs_testobj.cs
@@ -227,6 +227,26 @@ public class BridgeTestObject : WeakBase, XRecursiveCall, XBridgeTest2
return _testDataElements;
}
+ public SmallStruct echoSmallStruct(/*[in]*/SmallStruct arg)
+ {
+ return arg;
+ }
+
+ public MediumStruct echoMediumStruct(/*[in]*/MediumStruct arg)
+ {
+ return arg;
+ }
+
+ public BigStruct echoBigStruct(/*[in]*/BigStruct arg)
+ {
+ return arg;
+ }
+
+ public AllFloats echoAllFloats(/*[in]*/AllFloats arg)
+ {
+ return arg;
+ }
+
// Attributes
public bool Bool
{
diff --git a/testtools/source/bridgetest/cli/cli_vb_testobj.vb b/testtools/source/bridgetest/cli/cli_vb_testobj.vb
index 1d9482a07..a03291f66 100644
--- a/testtools/source/bridgetest/cli/cli_vb_testobj.vb
+++ b/testtools/source/bridgetest/cli/cli_vb_testobj.vb
@@ -200,7 +200,7 @@ Public Class VBBridgeTestObject
Return m_testDataElements
End Function
-
+
' Attributes ---------------------------------------------------------
Public Overridable Property Bool As Boolean _
Implements XBridgeTest2.Bool
diff --git a/testtools/source/bridgetest/cppobj.cxx b/testtools/source/bridgetest/cppobj.cxx
index 6fa8e48e7..24e878835 100644
--- a/testtools/source/bridgetest/cppobj.cxx
+++ b/testtools/source/bridgetest/cppobj.cxx
@@ -216,6 +216,15 @@ public:
::com::sun::star::uno::Sequence< TestElement >& rSequence,
TestData& rStruct )
throw(com::sun::star::uno::RuntimeException);
+
+ virtual SmallStruct SAL_CALL echoSmallStruct(const SmallStruct& rStruct) throw(com::sun::star::uno::RuntimeException)
+ { return rStruct; }
+ virtual MediumStruct SAL_CALL echoMediumStruct(const MediumStruct& rStruct) throw(com::sun::star::uno::RuntimeException)
+ { 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)
+ { return rStruct; }
virtual sal_Bool SAL_CALL getBool() throw(com::sun::star::uno::RuntimeException)
{ return _aData.Bool; }
diff --git a/testtools/source/bridgetest/idl/bridgetest.idl b/testtools/source/bridgetest/idl/bridgetest.idl
index eba8d1747..0b2fc6263 100644
--- a/testtools/source/bridgetest/idl/bridgetest.idl
+++ b/testtools/source/bridgetest/idl/bridgetest.idl
@@ -72,6 +72,48 @@ struct TestSimple
TestEnum Enum;
};
/**
+ * equal to max size returned in registers on x86_64
+ */
+struct SmallStruct
+{
+ hyper a;
+ hyper b;
+};
+/**
+ * equal to max size returned in registers on ia64
+ */
+struct MediumStruct
+{
+ hyper a;
+ hyper b;
+ hyper c;
+ hyper d;
+};
+/**
+ * bigger than max size returned in registers on ia64
+ */
+struct BigStruct
+{
+ hyper a;
+ hyper b;
+ hyper c;
+ hyper d;
+ hyper e;
+ hyper f;
+ hyper g;
+ hyper h;
+};
+/**
+ * all floats, ia64 handles them specially
+ */
+struct AllFloats
+{
+ float a;
+ float b;
+ float c;
+ float d;
+};
+/**
* complex types adding string, inteface, any
*/
struct TestElement : TestSimple
@@ -207,6 +249,26 @@ interface XBridgeTestBase : com::sun::star::uno::XInterface
[out] sequence< TestElement > aSequence,
[out] TestData aStruct );
+ /**
+ * register return test 1
+ */
+ SmallStruct echoSmallStruct( [in] SmallStruct aStruct );
+
+ /**
+ * register return test 2
+ */
+ MediumStruct echoMediumStruct( [in] MediumStruct aStruct );
+
+ /**
+ * register return test 3
+ */
+ BigStruct echoBigStruct( [in] BigStruct aStruct );
+
+ /**
+ * register return test 4
+ */
+ AllFloats echoAllFloats( [in] AllFloats aStruct );
+
[attribute] boolean Bool;
[attribute] byte Byte;
[attribute] char Char;
diff --git a/testtools/source/bridgetest/makefile.mk b/testtools/source/bridgetest/makefile.mk
index 3dfb18c7d..f9c952d4d 100644
--- a/testtools/source/bridgetest/makefile.mk
+++ b/testtools/source/bridgetest/makefile.mk
@@ -52,7 +52,6 @@ GIVE_EXEC_RIGHTS=@echo
MY_URE_INTERNAL_JAVA_DIR=$(strip $(subst,\,/ file:///$(shell @$(WRAPCMD) echo $(SOLARBINDIR))))
MY_LOCAL_CLASSDIR=$(strip $(subst,\,/ file:///$(shell $(WRAPCMD) echo $(PWD)$/$(CLASSDIR))))
.ELSE
-BATCH_INPROCESS=bridgetest_inprocess
GIVE_EXEC_RIGHTS=chmod +x
MY_URE_INTERNAL_JAVA_DIR=file://$(SOLARBINDIR)
MY_LOCAL_CLASSDIR=file://$(PWD)$/$(CLASSDIR)
@@ -134,37 +133,33 @@ JAVATARGETS=\
.INCLUDE : target.mk
.IF "$(L10N_framework)"==""
ALLTAR: \
- test \
+ runtest \
$(DLLDEST)$/uno_types.rdb \
$(DLLDEST)$/uno_services.rdb \
- $(DLLDEST)$/bridgetest_inprocess$(BATCH_SUFFIX) \
$(DLLDEST)$/bridgetest_server$(BATCH_SUFFIX) \
$(DLLDEST)$/bridgetest_client$(BATCH_SUFFIX) \
$(JAVATARGETS)
#################################################################
-test:
- echo $(compcheck)
+runtest : $(DLLDEST)$/uno_types.rdb $(DLLDEST)$/uno_services.rdb makefile.mk
+.IF "$(COM)$(OS)$(CPU)" == "GCCMACOSXP"
+ @echo "Mac OSX PPC GCC fails this test!, likely broken UNO bridge. Fix me."
+.ELSE
+ cd $(DLLDEST) && $(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/uno \
+ -ro uno_services.rdb -ro uno_types.rdb \
+ -s com.sun.star.test.bridge.BridgeTest -- \
+ com.sun.star.test.bridge.CppTestObject
+.ENDIF
$(DLLDEST)$/uno_types.rdb : $(SOLARBINDIR)$/udkapi.rdb
echo $(DLLDEST)
$(GNUCOPY) $? $@
$(REGMERGE) $@ / $(BIN)$/bridgetest.rdb
-$(DLLDEST)$/bridgetest_inprocess$(BATCH_SUFFIX) .ERRREMOVE: makefile.mk
-.IF "$(USE_SHELL)" == "bash"
- echo '$(AUGMENT_LIBRARY_PATH)' uno -ro uno_services.rdb -ro uno_types.rdb \
- -s com.sun.star.test.bridge.BridgeTest -- \
- com.sun.star.test.bridge.CppTestObject > $@
-.ELSE
- echo ERROR: this script can only be created properly for USE_SHELL=bash > $@
-.ENDIF
- $(GIVE_EXEC_RIGHTS) $@
-
$(DLLDEST)$/bridgetest_client$(BATCH_SUFFIX) .ERRREMOVE: makefile.mk
.IF "$(USE_SHELL)" == "bash"
- echo '$(AUGMENT_LIBRARY_PATH)' uno -ro uno_services.rdb -ro uno_types.rdb \
+ echo '$(AUGMENT_LIBRARY_PATH)' '$(SOLARBINDIR)'/uno -ro uno_services.rdb -ro uno_types.rdb \
-s com.sun.star.test.bridge.BridgeTest -- \
-u \''uno:socket,host=127.0.0.1,port=2002;urp;test'\' > $@
.ELSE
@@ -174,7 +169,7 @@ $(DLLDEST)$/bridgetest_client$(BATCH_SUFFIX) .ERRREMOVE: makefile.mk
$(DLLDEST)$/bridgetest_server$(BATCH_SUFFIX) .ERRREMOVE: makefile.mk
.IF "$(USE_SHELL)" == "bash"
- echo '$(AUGMENT_LIBRARY_PATH)' uno -ro uno_services.rdb -ro uno_types.rdb \
+ echo '$(AUGMENT_LIBRARY_PATH)' '$(SOLARBINDIR)'/uno -ro uno_services.rdb -ro uno_types.rdb \
-s com.sun.star.test.bridge.CppTestObject \
-u \''uno:socket,host=127.0.0.1,port=2002;urp;test'\' --singleaccept \
> $@
@@ -201,7 +196,7 @@ $(DLLDEST)$/bridgetest_javaserver$(BATCH_SUFFIX) : makefile.mk
$(DLLDEST)$/bridgetest_inprocess_java$(BATCH_SUFFIX) .ERRREMOVE: makefile.mk
.IF "$(USE_SHELL)" == "bash"
- echo '$(AUGMENT_LIBRARY_PATH)' uno -ro uno_services.rdb -ro uno_types.rdb \
+ echo '$(AUGMENT_LIBRARY_PATH)' '$(SOLARBINDIR)'/uno -ro uno_services.rdb -ro uno_types.rdb \
-s com.sun.star.test.bridge.BridgeTest \
-env:URE_INTERNAL_JAVA_DIR=$(MY_URE_INTERNAL_JAVA_DIR) \
-- com.sun.star.test.bridge.JavaTestObject noCurrentContext > $@
diff --git a/testtools/source/bridgetest/pyuno/makefile.mk b/testtools/source/bridgetest/pyuno/makefile.mk
index 44b9f9860..bffce7689 100644
--- a/testtools/source/bridgetest/pyuno/makefile.mk
+++ b/testtools/source/bridgetest/pyuno/makefile.mk
@@ -50,8 +50,17 @@ DOLLAR_SIGN=\$$
DOLLAR_SIGN=$$
.ENDIF
-#these are temporary
-PYTHON=$(WRAPCMD) python
+.IF "$(SYSTEM_PYTHON)"!="YES"
+PYTHON=$(AUGMENT_LIBRARY_PATH) $(WRAPCMD) $(SOLARBINDIR)/python
+.ELSE # "$(SYSTEM_PYTHON)"!="YES"
+PYTHON=$(AUGMENT_LIBRARY_PATH) $(WRAPCMD) python
+.ENDIF # "$(SYSTEM_PYTHON)"!="YES"
+.IF "$(GUI)"=="WNT"
+PYTHONPATH:=$(SOLARLIBDIR)$/pyuno;$(PWD);$(SOLARLIBDIR);$(SOLARLIBDIR)$/python;$(SOLARLIBDIR)$/python$/lib-dynload
+.ELSE # "$(GUI)"=="WNT"
+PYTHONPATH:=$(SOLARLIBDIR)$/pyuno:$(PWD):$(SOLARLIBDIR):$(SOLARLIBDIR)$/python:$(SOLARLIBDIR)$/python$/lib-dynload
+.ENDIF # "$(GUI)"=="WNT"
+.EXPORT: PYTHONPATH
.IF "$(GUI)"!="WNT" && "$(GUI)"!="OS2"
.IF "$(USE_SHELL)"=="bash"
@@ -111,7 +120,7 @@ doc .PHONY:
@echo start test with dmake runtest
runtest : ALL
- cd $(DLLDEST) && $(TEST_ENV) && python main.py
+ cd $(DLLDEST) && $(TEST_ENV) && $(PYTHON) main.py
cd $(DLLDEST) && $(TEST_ENV) && $(WRAPCMD) $(REGCOMP) -register -br pyuno_regcomp.rdb -r dummy.rdb \
-l com.sun.star.loader.Python $(foreach,i,$(PYCOMPONENTS) -c vnd.openoffice.pymodule:$(i))
cd $(DLLDEST) && $(TEST_ENV) && $(WRAPCMD) $(REGCOMP) -register -br pyuno_regcomp.rdb -r dummy2.rdb \