2 ' This file is part of the LibreOffice project.
4 ' This Source Code Form is subject to the terms of the Mozilla Public
5 ' License, v. 2.0. If a copy of the MPL was not distributed with this
6 ' file, You can obtain one at http://mozilla.org/MPL/2.0/.
12 Function doUnitTest() As String
15 doUnitTest
= TestUtil
.GetResult()
18 Sub verify_testVarType()
19 Dim TestDateTime
As Date
21 Dim TestInt
As Integer
23 Dim TestDouble
As Double
24 Dim TestBoo
As Boolean
25 Dim TestSingle
As Single
26 Dim TestCurr
As Currency
34 On Error GoTo errorHandler
36 TestUtil
.AssertEqual(vbInteger
, 2, "vbInteger")
37 TestUtil
.AssertEqual(vbLong
, 3, "vbLong")
38 TestUtil
.AssertEqual(vbSingle
, 4, "vbSingle")
39 TestUtil
.AssertEqual(vbDouble
, 5, "vbDouble")
40 TestUtil
.AssertEqual(vbCurrency
, 6, "vbCurrency")
41 TestUtil
.AssertEqual(vbDate
, 7, "vbDate")
42 TestUtil
.AssertEqual(vbString
, 8, "vbString")
43 TestUtil
.AssertEqual(vbBoolean
, 11, "vbBoolean")
45 TestUtil
.AssertEqual(VarType(varname
:=TestStr
), vbString
, "VarType(varname:=TestStr)")
47 TestUtil
.AssertEqual(VarType(TestStr
), vbString
, "VarType(TestStr)")
48 TestUtil
.AssertEqual(VarType(TestBoo
), vbBoolean
, "VarType(TestBoo)")
49 TestUtil
.AssertEqual(VarType(TestDouble
), vbDouble
, "VarType(TestDouble)")
50 TestUtil
.AssertEqual(VarType(TestLong
), vbLong
, "VarType(TestLong)")
51 TestUtil
.AssertEqual(VarType(TestInt
), vbInteger
, "VarType(TestInt)")
52 TestUtil
.AssertEqual(VarType(TestDateTime
), vbDate
, "VarType(TestDateTime)")
53 TestUtil
.AssertEqual(VarType(TestSingle
), vbSingle
, "VarType(TestSingle)")
54 TestUtil
.AssertEqual(VarType(TestCurr
), vbCurrency
, "VarType(TestCurr)")
56 TestUtil
.AssertEqual(VarType(TestIntSign
), vbInteger
, "VarType(TestIntSign)")
57 TestUtil
.AssertEqual(VarType(TestLongSign
), vbLong
, "VarType(TestLongSign)")
58 TestUtil
.AssertEqual(VarType(TestSingleSign
), vbSingle
, "VarType(TestSingleSign)")
59 TestUtil
.AssertEqual(VarType(TestDoubleSign
), vbDouble
, "VarType(TestDoubleSign)")
60 TestUtil
.AssertEqual(VarType(TestCurrSign
), vbCurrency
, "VarType(TestCurrSign)")
64 TestUtil
.ReportErrorHandler("verify_testVarType", Err
, Error$, Erl
)