summaryrefslogtreecommitdiff
path: root/extensions/test
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2004-03-17 12:16:05 +0000
committerOliver Bolte <obo@openoffice.org>2004-03-17 12:16:05 +0000
commit69f61b4a1df51134ab4f9284455d7c6fd7d844f9 (patch)
tree09c43447a7a735a27cfdd032c09113047b6ea8c0 /extensions/test
parentccd404688d4ac15ea5dd00a034c097475a340d4d (diff)
INTEGRATION: CWS jl5vba (1.3.128); FILE MERGED
2004/02/05 15:23:22 jl 1.3.128.3: #112560# 2004/02/05 15:19:52 jl 1.3.128.2: #112560# 2004/01/19 12:11:50 jl 1.3.128.1: #114374# #112367# #112889# #112560# #112053# 112509# #111748# join cws ab02vba
Diffstat (limited to 'extensions/test')
-rw-r--r--extensions/test/ole/StarBasic_OleClient/oleclient.bas775
1 files changed, 587 insertions, 188 deletions
diff --git a/extensions/test/ole/StarBasic_OleClient/oleclient.bas b/extensions/test/ole/StarBasic_OleClient/oleclient.bas
index 17b75e3c94e0..2fdd1db67859 100644
--- a/extensions/test/ole/StarBasic_OleClient/oleclient.bas
+++ b/extensions/test/ole/StarBasic_OleClient/oleclient.bas
@@ -1,209 +1,608 @@
REM ***** BASIC *****
+OPTION EXPLICIT
+OPTION COMPATIBLE
+
Sub Main
-factory= createUnoService("com.sun.star.bridge.OleObjectFactory")
-obj= factory.createInstance("AxTestComponents.Basic")
+COMPATIBILITYMODE(true)
+If runtest = -1 Then
+ MsgBox "Test Failed!!!"
+Else
+ MsgBox "Test Succeeded"
+End If
-obj.prpObject= obj
-prpObject= obj.prpObject
-'identity of objects, mapped from COM to UNO, is not given currently
-if NOT equalUnoObjects(obj,prpObject) then
- MsgBox "error"
-end if
+End Sub
-'properties -------------------------------------------------------------------------
-Dim ar1(1)
-ar1(0)= "1"
-ar1(1)= "2"
-obj.prpArray= ar1()
-prpArray= obj.prpArray
-if (prpArray(0) <> "1") OR (prpArray(1) <> "2") then
- MsgBox "error"
-end if
-
-obj.prpVariant="string"
-prpVariant= obj.prpVariant
-if prpVariant <> "string" then
- MsgBox "error"
-end if
-
-obj.prpDouble=3.145
-prpDouble= obj.prpDouble
-if NOT ((prpDouble >3.144) AND (prpDouble < 3.146)) then
- MsgBox "error"
-end if
-
-
-obj.prpFloat= 3.14
-prpFloat= obj.prpFloat
-if NOT ((prpFloat >3.13) AND (prpFloat < 3.15)) then
- MsgBox "error"
-end if
-
-obj.prpString= "string"
-prpString= obj.prpString
-if prpString <> "string" then
- MsgBox "error"
-end if
-
-obj.prpLong= 1000
-prpLong= obj.prpLong
-if prpLong <> 1000 then
- MsgBox "error"
-end if
-
-obj.prpShort= 127
-prpShort= obj.prpShort
-if prpShort <> 127 then
- MsgBox "error"
-end if
-
-obj.prpByte= 11
-prpByte= obj.prpByte
-if prpByte <> 11 then
- MsgBox "error"
-end if
+Function runtest() As Integer
+Dim inBool As Boolean, inBool2 As Boolean, outBool As Boolean
+Dim inByte As Integer, inByte2 As Integer
+Dim inShort As Integer, inShort2 As Integer
+Dim inLong As Long, inLong2 As Long, inLong3 As Long, inLong4 As Long
+Dim inString As String, inString2 As String
+Dim inFloat As Single, inFloat2 As Single
+Dim inDouble As Double, inDouble2 As Double
+Dim inVariant, inVariant2
+Dim inAr, inAr2
+Dim inDate As Date,inDate2 As Date, outDate As Date
+Dim inCurrency As Currency, inCurrency2 As Currency, outCurrency As Currency
+Dim inSCode As New com.sun.star.bridge.oleautomation.SCode
+Dim inSCode2 As New com.sun.star.bridge.oleautomation.SCode
+Dim inDecimal As Variant, inDecimal2 As Variant, outDecimal As Variant
+Dim inrefDecimal As Variant, outrefDecimal As Variant
+Dim outSCode As New com.sun.star.bridge.oleautomation.SCode
+Dim outByte As Integer
+Dim outShort As Integer
+Dim outLong, outLong2 As Long
+Dim outString As String
+Dim outFloat As Single
+Dim outDouble As Double
+Dim outVariant
+'bug #109936 causes an errOr when outObject is used As out param
+Dim inObject As Object, inObject2 As Object, outObject As Object
+Dim objNOTHING As Object
+Dim inUnknown As Object, inUnknown2 As Object, outUnknown As Object
+
+Dim inArray, outArray, outArray2
+Dim len1, len2
+Dim arString(1) As String
+arString(0)= "String one"
+arString(1)= "String two"
+Dim factory As Object
+factory= createUnoService("com.sun.star.bridge.OleObjectFactory")
+Dim obj As Object
+obj= factory.createInstance("AxTestComponents.Basic")
-'out parameter -------------------------------------------------------------------------
-Dim outObject
-obj.outObject(outObject)
-if outObject.prpString <> "out" then
- MsgBox "error"
-end if
+Dim objFoo As Object
+objFoo = factory.createInstance("AxTestComponents.Foo")
-Dim outArray
-obj.outArray(outArray)
-if (outArray(0) <> "out1") OR (outArray(1) <> "out2") OR (outArray(2) <> "out3")then
- MsgBox "error"
-end if
-Dim outVariant
-obj.outVariant(outVariant)
-if outVariant <> "out" then
- MsgBox "error"
-end if
-Dim outDouble
-obj.outDouble(outDouble)
-if NOT ((outDouble >3.144) AND (outDouble < 3.146)) then
- MsgBox "error"
-end if
+'in parameter -------------------------------------------------------------------
+inBool = true
+inByte = 10
+inShort = 11
+inLong = 111
+inString = "Hello World"
+inFloat = 3.14
+inDouble = 3.145
+inVariant = "bla"
+inDate = NOW()
+inCurrency = 12345.6789
+inSCode.Value = &h80020004
+inDecimal = CDec("-9223372036854775808") 'lowest int64
+
+obj.inBool(inBool)
+obj.inByte(inByte)
+obj.inShort(inShort)
+obj.inLong(inLong)
+obj.inString(inString)
+obj.inFloat(inFloat)
+obj.inDouble(inDouble)
+obj.inVariant(inVariant)
+'obj.prpString= "a string property"
+obj.inObject(obj)
+obj.inArray(arString())
+obj.inDate(inDate)
+obj.inCurrency(inCurrency)
+obj.inSCode(inSCode)
+obj.inUnknown(objFoo)
+obj.inDecimal(inDecimal)
-Dim outFloat
+'out parameter -------------------------------------------------------------------------
+outBool = false
+obj.outBool(outBool)
+outByte = 0
+obj.outByte(outByte)
+outShort = 0
+obj.outShort(outShort)
+outLong = 0
+obj.outLong(outLong)
+outFloat = 0
obj.outFloat(outFloat)
-if NOT ((outFloat >3.13) AND (outFloat < 3.15)) then
- MsgBox "error"
-end if
-
-Dim outString
+outDouble = 0
+obj.outDouble(outDouble)
+outString = ""
obj.outString(outString)
-if outString <> "out" then
- MsgBox "error"
-end if
-Dim outLong
-obj.outLong(outLong)
-if outLong <> 111111 then
- MsgBox "error"
-end if
+outVariant = 0
+obj.outVariant(outVariant)
+outObject = NOTHING
+obj.outObject(outObject)
+outArray = 0
+obj.outArray(outArray)
+obj.outDate(outDate)
+obj.outCurrency(outCurrency)
+obj.outSCode(outSCode)
+obj.outUnknown(outUnknown)
+obj.outDecimal(outDecimal)
-Dim outShort
-obj.outShort(outShort)
-if outShort <> 1111 then
- MsgBox "error"
-end if
-Dim outByte
-obj.outByte(outByte)
-if outByte <> 111 then
- MsgBox "error"
-end if
+If inBool <> outBool Or inByte <> outByte Or inShort <> outShort Or inLong <> outLong Or _
+ inFloat <> outFloat Or inDouble <> outDouble Or inString <> outString Or _
+ inVariant <> outVariant Or NOT equalUnoObjects(obj, outObject) Or NOT _
+ equalArrays(arString(), outArray()) Or inDate <> outDate Or inCurrency <> outCurrency Or _
+ inSCode.Value <> outSCode.Value Or Not equalUnoObjects(objFoo, outUnknown) Or _
+ inDecimal <> outDecimal Then
+ runtest = -1
+ exit Function
+End If
'in-out parameter -------------------------------------------------------------
-obj2= factory.createInstance("AxTestComponents.Basic")
-inoutObj= obj2
-inoutObj.prpString="in"
-obj.inoutObject(inoutObj)
-if equalUnoObjects(inoutObj,obj) then
- MsgBox "error"
-end if
-
-if inoutObj.prpString <> "out" then
- MsgBox "error"
-end if
-
-
-Dim inoutAr(2)
-inoutAr(0)="1"
-inoutAr(1)="2"
-inoutAr(2)="3"
-obj.inoutArray(inoutAr())
-
-if (inoutAr(0) <> "1out") OR (inoutAr(1) <> "2out") OR (inoutAr(2) <> "3out") then
- MsgBox "error"
-end if
-
-inoutVar= "in"
-obj.inoutVariant(inoutVar)
-if inoutVar <> "inout" then
- MsgBox "error"
-end if
-
-inoutDouble= 3.14
-obj.inoutDouble(inoutDouble)
-if NOT ((inoutDouble >4.13) AND (inoutDouble < 4.15)) then
- MsgBox "error"
-end if
-
-inoutFloat= 3.14
-obj.inoutFloat(inoutFloat)
-if NOT ((inoutFloat >4.13) AND (inoutFloat < 4.15)) then
- MsgBox "error"
-end if
-
-inoutString= "in"
-obj.inoutString(inoutString)
-if inoutString <> "inout" then
- MsgBox "error"
-end if
-
-
-inoutLong= 10
-obj.inoutLong(inoutLong)
-if inoutLong <> 11 then
- MsgBox "error"
-end if
-
-inoutShort= 10
-obj.inoutShort(inoutShort)
-if inoutShort <> 11 then
- MsgBox "error"
-end if
-
-
-inoutByte= 10
-obj.inoutByte(inoutByte)
-if inoutByte <> 11 then
- MsgBox "error"
-end if
+'implementation of inout methods returns the previously set value in out param
+inBool = true
+inBool2 = inBool
+obj.inoutBool(inBool2)
+outBool = false
+obj.inoutBool(outBool)
+inByte = 10
+inByte2 = inByte
+obj.inoutByte(inByte2)
+outByte = 0
+obj.inoutByte(outByte)
+inShort = 10
+inShort2 = inShort
+obj.inShort(inShort2)
+outShort = 0
+obj.inoutShort(outShort)
+inLong = 10
+inLong2 = inLong
+obj.inoutLong(inLong2)
+outLong = 0
+obj.inoutLong(outLong)
+inFloat = 3.14
+inFloat2 = inFloat
+obj.inoutFloat(inFloat2)
+outFloat = 0
+obj.inoutFloat(outFloat)
+inDouble= 3.14
+inDouble2 = inDouble
+obj.inoutDouble(inDouble2)
+outDouble = 0
+obj.inoutDouble(outDouble)
+inString = "in"
+inString2 = inString
+obj.inoutString(inString2)
+outString = ""
+obj.inoutString(outString)
+inVariant = "in"
+inVariant2 = inVariant
+obj.inoutVariant(inVariant2)
+outVariant = 0
+obj.inoutVariant(outVariant)
+inObject = factory.createInstance("AxTestComponents.Basic")
+inObject2 = inObject
+obj.inoutObject(inObject2)
+outObject = NOTHING
+obj.inoutObject(outObject)
+inAr = arString()
+inAr2 = inAr
+obj.inoutArray(inAr2)
+outArray = 0
+obj.outArray(outArray())
+inDate = NOW()
+inDate2 = inDate
+obj.inoutDate(inDate2)
+outDate = 0
+obj.inoutDate(outDate)
+inCurrency = 1234.5678
+inCurrency2 = inCurrency
+obj.inoutCurrency(inCurrency2)
+outCurrency = 0
+obj.inoutCurrency(outCurrency)
+inSCode.Value = &h80020004
+inSCode2 = inSCode
+obj.inoutSCode(inSCode2)
+outSCode.Value = 0
+obj.inoutSCode(outSCode)
+inUnknown = objFoo
+inUnknown2 = inUnknown
+obj.inoutUnknown(inUnknown2)
+outUnknown = Nothing
+obj.inoutUnknown(outUnknown)
+inDecimal = CDec("18446744073709551615") 'highest positiv value of unsigne int64
+inDecimal2 = inDecimal
+obj.inoutDecimal(inDecimal2)
+outDecimal = 0
+obj.inoutDecimal(outDecimal)
+
+If inBool <> outBool Or inByte <> outByte Or inShort <> outShort Or inLong <> outLong Or _
+ inFloat <> outFloat Or inDouble <> outDouble Or inString <> outString Or _
+ inVariant <> outVariant Or NOT equalUnoObjects(inObject, outObject) Or _
+ NOT equalArrays(inAr, outArray) Or inDate <> outDate Or inCurrency <> outCurrency Or _
+ inSCode.Value <> outSCode.Value Or Not equalUnoObjects(inUnknown, outUnknown) Or _
+ inDecimal <> outDecimal Then
+ runtest = -1
+ Exit Function
+End If
+'properties -------------------------------------------------------------------------
+inBool = false
+outBool = true
+obj.prpBool = inBool
+outBool = obj.prpBool
+inByte = 11
+outByte = 0
+obj.prpByte = inByte
+outByte= obj.prpByte
+inShort = 127
+outShort = 0
+obj.prpShort= inShort
+outShort= obj.prpShort
+inLong = 1000
+outLong = 0
+obj.prpLong = inLong
+outLong= obj.prpLong
+inFloat = 3.14
+outFloat = 0
+obj.prpFloat = inFloat
+outFloat= obj.prpFloat
+inDouble = 3.123
+outDouble = 0
+obj.prpDouble = inDouble
+outDouble= obj.prpDouble
+inString = "bla"
+outString = ""
+obj.prpString = inString
+outString = obj.prpString
+inObject = obj
+outObject = objNOTHING
+obj.prpObject = inObject
+outObject = obj.prpObject
+inVariant = "bla"
+outVariant = 0
+obj.prpVariant = inVariant
+outVariant= obj.prpVariant
+inArray = arString()
+outArray = 0
+obj.prpArray = inArray()
+outArray= obj.prpArray
+inDate = NOW()
+outDate = 0
+obj.prpDate = inDate
+outDate = obj.prpDate
+inCurrency = 1234.5678
+outCurrency = 0
+obj.prpCurrency = inCurrency
+outCurrency = obj.prpCurrency
+inSCode.Value = &h80020004
+outSCode.Value = 0
+obj.prpSCode = inSCode
+outSCode = obj.prpSCode
+inUnknown = objFoo
+outUnknown= Nothing
+obj.prpUnknown = inUnknown
+outUnknown = obj.prpUnknown
+inDecimal = CDec("18446744073709551615")' highest unsigned int64
+outDecimal = 0
+obj.prpDecimal = inDecimal
+outDecimal = obj.prpDecimal
+
+If inBool <> outBool Or inByte <> outByte Or inShort <> outShort Or inLong <> outLong Or _
+ inFloat <> outFloat Or inDouble <> outDouble Or inString <> outString Or _
+ inVariant <> outVariant Or NOT equalUnoObjects(inObject, outObject) Or _
+ NOT equalArrays(inArray, outArray) Or inDate <> outDate Or inCurrency <> outCurrency Or _
+ inSCode.Value <> outSCode.Value Or Not equalUnoObjects(inUnknown, outUnknown) Or _
+ inDecimal <> outDecimal Then
+ runtest = -1
+ Exit Function
+End If
+
+' ref parameter ------------------------------------------------------------------------
+obj.inLong(0)
+inLong = 123
+outLong = 0
+obj.inLong(0)
+obj.inrefLong(inLong)
+obj.outLong(outLong)
+inVariant = "bla"
+outVariant = 0
+obj.inVariant(0)
+obj.inrefVariant(inVariant)
+obj.outVariant(outVariant)
+If inLong <> outLong Or inVariant <> outVariant Then
+ runtest = -1
+ Exit Function
+End If
+
+outLong = 0
+obj.prprefLong = inLong
+outLong = obj.prprefLong
+outVariant = 0
+obj.prprefVariant = inVariant
+outVariant = obj.prprefVariant
+If inLong <> outLong Or inVariant <> outVariant Then
+ runtest = -1
+ Exit Function
+End If
+
+
+'vararg --------------------------------------------------------------------------------
+inLong=1
+inLong2 = 2
+inLong3 = 3
+obj.varargfunc1(inLong)
+outArray = 0
+outLong = 0
+obj.varargfunc2(outLong, outArray)
+If inLong <> outLong Then
+ runtest = -1
+ Exit Function
+End If
+len1 = UBound(outArray) - LBound(outArray) +1
+If len1 <> 0 Then
+ runtest = -1
+ Exit Function
+End If
+outArray = 0
+obj.varargfunc1(inLong, inLong2, inLong3)
+obj.varargfunc2(outLong, outArray)
+len1 = UBound(outArray) - LBound(outArray) +1
+If len1 <> 2 Or outArray(0) <> inLong2 Or outArray(1) <> inLong3 Then
+ runtest = -1
+ Exit Function
+End If
+
+
+'defaultvalue ---------------------------------------------------------------------------
+inLong = 0
+inFloat = 0
+inVariant = 0
+inVariant2 = 0
+'defaults are: 1, 2. , 3, 4
+obj.defaultvalue1()
+obj.defaultvalue2(inLong, inFloat, inVariant)
+If inLong <> 1 Or inFloat <> 2 Or inVariant <> 3 Then
+ runtest = -1
+ Exit Function
+End If
+inLong = 10
+inFloat = 11
+inLong2 = inLong
+inFloat2 = inFloat
+inVariant = 0
+inVariant = 0
+obj.defaultvalue1(inLong, inFloat)
+obj.defaultvalue2(inLong, inFloat, inVariant)
+If inLong <> inLong2 Or inFloat <> inFloat2 Or inVariant <> 3 Then
+ runtest = -1
+ Exit Function
+End If
+
+'optional parameters ----------------------------------------------------------------
+inLong = 100
+outLong = 0
+obj.optional1(inLong)
+obj.optional2(outLong)
+If inLong <> outLong Then
+ runtest = -1
+ Exit Function
+End If
+
+inLong2 = 101
+outLong2 = 0
+obj.optional1(inLong, inLong2)
+obj.optional2(outLong, outLong2)
+If inLong <> outLong AND inLong2 <> outLong2 Then
+ runtest = -1
+ Exit Function
+End If
+
+inLong2 = 101
+outLong2 = 0
+obj.optional1(inLong, inLong2)
+obj.optional1(inLong)
+obj.optional2(outLong, outLong2)
+If inLong <> outLong AND inLong2 <> outLong2 Then
+ runtest = -1
+ Exit Function
+End If
+
+inLong = 10
+inLong2 = 100
+outLong = 5
+outLong2 = 6
+obj.optional3()
+obj.optional3(inLong, inLong2)
+obj.optional4(outLong, outLong2) 'outLong = 10, outLong2 = 100
+If inLong <> outLong AND inLong2 <> outLong2 Then
+ runtest = -1
+ Exit Function
+End If
+inLong = 10
+inLong2 = 100
+inLong3 = inLong
+inLong4 = inLong2
+obj.optional4(inLong, inLong)
+outLong = 0
+outLong2 = 0
+obj.optional5(outLong, outLong2)
+If inLong3 <> outLong AND inLong4 <> outLong2 Then
+ runtest = -1
+ Exit Function
+End If
+
+inLong = 10
+outLong = 5
+obj.optional3(inLong)
+obj.optional4(outLong)
+If inLong <> outLong Then
+ runtest = -1
+ Exit Function
+End If
+inLong = 10
+inLong2 = inLong
+outLong = 0
+obj.optional4(inLong)
+obj.optional5(outLong)
+If inLong2 <> outLong Then
+ runtest = -1
+ Exit Function
+End If
+
+'named arguments-------------------------------------------------------------------------
+'all args As named args, different order
+obj.optional6(0, 0, 0, 0)
+inLong = 1
+inLong2 = 2
+inLong3 = 3
+inLong4 = 4
+obj.optional6(val4:= inLong4, val3:=inLong3, val2:=inLong2, val1:= inLong)
+Dim outLong3 As Long
+Dim outLong4 As Long
+outLong = 0
+outLong2 = 0
+outLong3 = 0
+outLong4 = 0
+obj.optional7(outLong, outLong2, outLong3, outLong4)
+If inLong <> outLong Or inLong2 <> outLong2 _
+ Or inLong3 <> outLong3 Or inLong4 <> outLong4 Then
+ runtest = -1
+ Exit Function
+End If
+
+'mixed positional and named args with omitted args
+Dim scode_paramNotFound As New com.sun.star.bridge.oleautomation.SCode
+scode_paramNotFound.Value = &h80020004
+
+obj.optional6(0, 0, 0, 0)
+'val1 and val3 will be DISP_E_PARAMNOTFOUND
+obj.optional6(, inLong2, val4:=inLong4)
+Dim outSCode1, outSCode2
+obj.optional7(outSCode, outLong2, outSCode2, outLong4)
+If outSCode.Value <> scode_paramNotFound.Value Or inLong2 <> outLong2 _
+ Or outSCode2.Value <> scode_paramNotFound.Value Or inLong4 <> outLong4 Then
+ runtest = -1
+ Exit Function
+End If
+
+'mixed positional and named args with ommitted args as out -args
+inLong = 1
+inLong2 = 2
+inLong3 = 3
+inLong4 = 4
+obj.optional6(inLong, inLong2, inLong3, inLong4)
+outLong2 = 0
+outLong3 = 0
+obj.optional7(,outLong2, val3:= outLong3)
+If inLong2 <> outLong2 Or inLong3 <> outLong3 Then
+ runtest = -1
+ Exit Function
+End If
+
+'test properties with additional arguments ------------------------------------
+inLong = 10
+inLong2 = 20
+inLong3 = 30
+outLong = 0
+outLong2 = 0
+outLong3 = 0
+obj.prpMultiArg1(0,0) = 0
+'obj.prpMultiArg1 = 0
+obj.prpMultiArg1(inLong,inLong2) = inLong3
+outLong3 = obj.prpMultiArg1(outLong, outLong2)
+If outLong <> 10 Or outLong2 <> 02 Or outLong3 <> 30 Then
+ runtest = -1
+ Exit Function
+End If
+
+outLong = 0
+outLong2 = 0
+obj.prpMultiArg1(0,0) = 0
+obj.prpMultiArg1(1) = 3
+outLong2 = obj.prpMultiArg1(outLong)
+If outLong <> 1 Or outLong2 <> 3 Then
+ runtest = -1
+ Exit Function
+End If
+
+outLong = 0
+outLong2 = 0
+obj.prpMultiArg1(0,0) = 0
+obj.prpMultiArg1(val2:= 1) = 3
+outLong2 = obj.prpMultiArg1(val2:=outLong)
+If outLong <> 1 Or outLong2 <> 3 Then
+ runtest = -1
+ Exit Function
+End If
+
+outLong = -1
+outLong2 = -1
+obj.prpMultiArg2(0) = 0
+outLong = obj.prpMultiArg2GetValues(outLong, outLong2)
+If outLong <> 0 Or outLong2 <> 0 Then
+ runtest = -1
+ Exit Function
+End If
+
+
+outLong = 0
+outLong2 = 0
+obj.prpMultiArg2(1) = 2
+obj.prpMultiArg2GetValues(outLong, outLong2)
+If outLong <> 1 Or outLong2 <> 2 Then
+ runtest = -1
+ Exit Function
+End If
+
+
+
+' other tests ------------------------------------------------------------------
+obj.inObject(NOTHING)
+outObject = NOTHING
+'bridge should return an XInterface any with null pointer
+'A basic errOr should occur if this is not the case
+obj.outObject(outObject)
-'in parameter -------------------------------------------------------------------
-obj.inByte(11)
-obj.inShort(111)
-obj.inLong(11111)
-obj.inString("I am a string")
-obj.inFloat(3.14)
-obj.inDouble(3.145)
-obj.inVariant("I am a string in a variant")
-obj.prpString= "a string property"
-obj.inObject(obj)
-
-Dim arString(1) as String
-arString(0)= "String one"
-arString(1)= "String two"
-obj.inArray(arString())
-
-End Sub
+If Not IsNull(outObject) Then
+ runtest = -1
+ Exit Function
+End If
+'Decimal passed by reference
+inrefDecimal = CDec("9223372036854775807") 'highest positiv value of int64
+obj.inrefDecimal(inrefDecimal)
+outrefDecimal = 0
+obj.outDecimal(outrefDecimal)
+If inrefDecimal <> outrefDecimal Then
+ runtest = -1
+ Exit Function
+End If
+
+' Test Automation object with dual interfaces ------------------------------------
+dim dispatcher as object
+dim oExplorer as object
+dispatcher = createUnoService("com.sun.star.bridge.OleObjectFactory")
+oExplorer = dispatcher.createInstance("InternetExplorer.Application")
+If Not IsNull(oExplorer) Then
+ oExplorer.visible = true
+ oExplorer.Navigate2("http://www.openoffice.org")
+Else
+ MsgBox("Could not perform test with Internet Explorer!")
+End If
+
+
+End Function
+
+'One dimensional arrays with simple types.
+'lower bound must be 0
+Function equalArrays(ar1, ar2)
+Dim len1
+Dim len2
+len1 = UBound(ar1) - LBound(ar1) + 1
+len2 = UBound(ar2) - LBound(ar2) + 1
+If len1 <> len2 Then
+ equalArrays = false
+ Exit Function
+End If
+Dim counter
+FOr counter = 0 To len1 - 1
+ If ar1(counter) <> ar2(counter) Then
+ equalArrays = false
+ Exit Function
+ End If
+Next
+equalArrays = true
+End Function
+
+