summaryrefslogtreecommitdiff
path: root/basic/qa
diff options
context:
space:
mode:
authorTomoyuki Kubota <himajin100000@gmail.com>2019-09-17 21:24:50 +0900
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-09-17 16:33:33 +0200
commitff6383face219970a0435b008a0439643a61043e (patch)
tree6f8f9ae8f1736b477015b624b9901380f11cfa7b /basic/qa
parentd52010013b9cacdd8f71e62fef18c1e679e807f2 (diff)
tdf#118544 set correct type for optional parameter
Change-Id: Id8840431b9dc1f1e97882c675ebfc6456e33d953 Reviewed-on: https://gerrit.libreoffice.org/77684 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'basic/qa')
-rwxr-xr-xbasic/qa/basic_coverage/test_optional_paramter_type.vb33
1 files changed, 33 insertions, 0 deletions
diff --git a/basic/qa/basic_coverage/test_optional_paramter_type.vb b/basic/qa/basic_coverage/test_optional_paramter_type.vb
new file mode 100755
index 000000000000..37198ea38244
--- /dev/null
+++ b/basic/qa/basic_coverage/test_optional_paramter_type.vb
@@ -0,0 +1,33 @@
+REM ***** BASIC *****
+Option Compatible
+
+Function doUnitTest() As Integer
+ doUnitTest = 0
+ If CheckType1(32) = 0 Then
+ Exit Function
+ End If
+ If CheckType2(32) = 0 Then
+ Exit Function
+ End If
+ If CheckType2() = 0 Then
+ Exit Function
+ End If
+ doUnitTest = 1
+End Function
+
+Function CheckType1(x As Integer) As Integer
+ If TypeName(x) = "Integer" Then
+ CheckType1 = 1
+ Else
+ CheckType1 = 0
+ End If
+End Function
+
+
+Function CheckType2(Optional y As Integer = 32 ) As Integer
+ If TypeName(y) = "Integer" Then
+ CheckType2 = 1
+ Else
+ CheckType2 = 0
+ End If
+End Function \ No newline at end of file