tdf#130857 qt weld: Implement QtInstanceWidget::strip_mnemonic
[LibreOffice.git] / basic / qa / basic_coverage / test_ismissing_cascade.bas
blob3c6d9a71c09a9b42abc764ad25812440cf811d8a
1 ' This file is part of the LibreOffice project.
3 ' This Source Code Form is subject to the terms of the Mozilla Public
4 ' License, v. 2.0. If a copy of the MPL was not distributed with this
5 ' file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 Option Explicit
10 Function doUnitTest() As String
11 TestUtil.TestInit
12 verify_testIsMissingCascade
13 doUnitTest = TestUtil.GetResult()
14 End Function
16 Sub verify_testIsMissingCascade()
18 On Error GoTo errorHandler
20 ' tdf#136143 - test cascading optionals in order to prevent type conversion errors, because
21 ' optional arguments are of type SbxERROR and set to not fixed.
22 TestUtil.AssertEqual(TestOpt(), 2, "Cascading optionals")
24 Exit Sub
25 errorHandler:
26 TestUtil.ReportErrorHandler("verify_testIsMissingCascade", Err, Error$, Erl)
27 End Sub
29 Function TestOpt(Optional A)
30 TestOpt = TestOptCascade(A)
31 End Function
33 Function TestOptCascade(Optional A)
34 If IsMissing(A) Then A = 2
35 TestOptCascade = A
36 End Function