tdf#154285 Check upper bound of arguments in SbRtl_Minute function
[LibreOffice.git] / basic / qa / basic_coverage / test_tdf160321_gosub_goto.bas
blob79f886fa179d45b49c0e3c5ec8bccd4691578add
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 Explicit
11 Function doUnitTest() As String
12 TestUtil.TestInit
13 verify_GoSub_GoTo
14 doUnitTest = TestUtil.GetResult()
15 End Function
17 Sub verify_GoSub_GoTo
18 On Error GoTo errorHandler
20 Dim iVar As Integer
22 ' tdf#160321 - don't execute the GoSub statement if the expression is 0
23 On 0 GoSub Sub1, Sub2
24 iVar = iVar + 1
25 TestUtil.AssertEqual(iVar, 1, "iVar incremented incorrectly")
27 ' tdf#160321 - check the correct functionality of the GoTo statement
28 On 1 GoTo Sub1, Sub2
29 iVar = iVar + 1
31 Exit Sub
32 Sub1:
33 TestUtil.AssertEqual(iVar, 1, "iVar incremented incorrectly")
34 On 2 GoTo Sub1, Sub2
35 iVar = iVar + 1
36 Exit Sub
37 Sub2:
38 TestUtil.AssertEqual(iVar, 1, "iVar incremented incorrectly")
39 Exit Sub
40 errorHandler:
41 TestUtil.ReportErrorHandler("verify_GoSub_GoTo", Err, Error$, Erl)
42 Exit Sub
43 End Sub