Kaydet (Commit) 52da3422 authored tarafından Caolán McNamara's avatar Caolán McNamara

#i105680# add struct returning bridge tests and run them during the build

üst d5c2cf42
......@@ -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;
......@@ -474,6 +479,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 {
return _bool;
......
......@@ -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.1, 2.2, 3.3, 4.4);
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();
......
......@@ -217,6 +217,15 @@ public:
TestData& rStruct )
throw(com::sun::star::uno::RuntimeException);
virtual SmallStruct echoSmallStruct(const SmallStruct& rStruct) throw(com::sun::star::uno::RuntimeException)
{ return rStruct; }
virtual MediumStruct echoMediumStruct(const MediumStruct& rStruct) throw(com::sun::star::uno::RuntimeException)
{ return rStruct; }
virtual BigStruct echoBigStruct(const BigStruct& rStruct) throw(com::sun::star::uno::RuntimeException)
{ return rStruct; }
virtual AllFloats 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; }
virtual sal_Int8 SAL_CALL getByte() throw(com::sun::star::uno::RuntimeException)
......
......@@ -71,6 +71,48 @@ struct TestSimple
double Double;
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
*/
......@@ -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;
......
......@@ -134,7 +134,7 @@ JAVATARGETS=\
.INCLUDE : target.mk
.IF "$(L10N_framework)"==""
ALLTAR: \
test \
runtest \
$(DLLDEST)$/uno_types.rdb \
$(DLLDEST)$/uno_services.rdb \
$(DLLDEST)$/bridgetest_inprocess$(BATCH_SUFFIX) \
......@@ -144,8 +144,11 @@ ALLTAR: \
#################################################################
test:
echo $(compcheck)
runtest : $(DLLDEST)$/uno_types.rdb $(DLLDEST)$/uno_services.rdb makefile.mk
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
$(DLLDEST)$/uno_types.rdb : $(SOLARBINDIR)$/udkapi.rdb
echo $(DLLDEST)
......
......@@ -92,7 +92,7 @@ PYCOMPONENTS = \
ALL : \
$(PYFILES) \
$(DLLDEST)$/pyuno_regcomp.rdb \
doc \
runtest \
ALLTAR
.ENDIF # L10N_framework
......@@ -111,11 +111,8 @@ $(DLLDEST)$/pyuno_regcomp.rdb: $(DLLDEST)$/uno_types.rdb $(SOLARBINDIR)$/pyuno_s
-rm -f $@
$(WRAPCMD) $(REGMERGE) $(DLLDEST)$/pyuno_regcomp.rdb / $(DLLDEST)$/uno_types.rdb $(SOLARBINDIR)$/pyuno_services.rdb
doc .PHONY:
@echo start test with dmake runtest
runtest : ALL
cd $(DLLDEST) && $(TEST_ENV) && python main.py
runtest : $(DLLDEST)$/pyuno_regcomp.rdb $(PYFILES)
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 \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment