tdf#161411 - UI: Add Better wording for ASCII-only characters
[LibreOffice.git] / basic / qa / vba_tests / enum.vb
blob72f0c4fb8fe254bf95ea68b903e22ba157deaa07
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/.
9 Option VBASupport 1
10 Option Explicit
12 Enum CountDown ' Values get ROUNDED to Int32
13 FIVE = 4.11
14 FOUR = -4.25
15 THREE = 5
16 TWO = -.315E1
17 ONE = 286.0E-2 ' equals 3
18 LIFT_OFF = 7
19 End Enum ' CountDown
21 Function doUnitTest()
22 ''' test_vba.cxx main entry point '''
23 TestUtil.TestInit
24 Call ENUM_TestCases
25 doUnitTest = TestUtil.GetResult()
26 End Function
28 Sub ENUM_TestCases()
29 try:
30 On Error Goto catch
32 With CountDown
34 a: TestUtil.AssertEqual(.ONE, 3, ".ONE")
36 b: TestUtil.AssertEqual(.TWO, -3, ".TWO")
38 c: TestUtil.AssertEqual(TypeName(.FOUR), "Long", "TypeName(.FOUR)")
40 d: Dim sum As Double
41 sum = .FIVE + .FOUR + .THREE + .TWO + .ONE + .LIFT_OFF
42 TestUtil.AssertEqual(sum, 12, "sum")
44 End With
46 finally:
47 Exit Sub
49 catch:
50 TestUtil.ReportErrorHandler("ENUM_TestCases", Err, Error$, Erl)
51 Resume Next
52 End Sub