tdf#154285 Check upper bound of arguments in SbRtl_Minute function
[LibreOffice.git] / basic / qa / basic_coverage / test_numeric_constant_parameter.bas
blob4f93f3f45c9cc4da6c90fb1ffb81605d2ea88f76
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/.
10 Option Explicit
12 ' assigns a numeric constant (integer) to a parameter of type variant
13 Function assignInteger( numericConstant ) As String
14 numericConstant = 1
15 assignInteger = TypeName( numericConstant )
16 End Function
18 ' assigns a numeric constant (long) to a parameter of type variant
19 Function assignLong( numericConstant ) As String
20 numericConstant = 32768
21 assignLong = TypeName( numericConstant )
22 End Function
24 Function doUnitTest() As String
25 ' tdf#133913 - check if numeric constants are converted correctly to
26 ' their respective types, if they are passed as arguments to a function
27 ' with variant parameter types.
28 On Error GoTo errorHandler
29 If (assignInteger( 1 ) = "Integer" And assignLong( 1 ) = "Long") Then
30 doUnitTest = "OK"
31 Else
32 doUnitTest = "FAIL"
33 End If
34 Exit Function
35 errorHandler:
36 doUnitTest = "FAIL"
37 End Function