[Libreoffice-commits] core.git: basic/qa
Xisco Fauli (via logerrit)
logerrit at kemper.freedesktop.org
Fri Jul 2 15:50:56 UTC 2021
basic/qa/basic_coverage/_test_asserts.vb | 57 ++++
basic/qa/basic_coverage/da-DK/cdbl-2.vb | 6
basic/qa/basic_coverage/da-DK/cdbl.vb | 6
basic/qa/basic_coverage/string_left_01.vb | 6
basic/qa/basic_coverage/string_right_01.vb | 6
basic/qa/basic_coverage/test_Date.vb | 6
basic/qa/basic_coverage/test_Property.GetLet.vb | 6
basic/qa/basic_coverage/test_Property.GetSet.vb | 6
basic/qa/basic_coverage/test_abs_method.vb | 8
basic/qa/basic_coverage/test_array_method.vb | 8
basic/qa/basic_coverage/test_asc_method.vb | 6
basic/qa/basic_coverage/test_atn_method.vb | 6
basic/qa/basic_coverage/test_beep_method.vb | 4
basic/qa/basic_coverage/test_cbool_method.vb | 6
basic/qa/basic_coverage/test_cbyte_method.vb | 6
basic/qa/basic_coverage/test_ccur_method.vb | 6
basic/qa/basic_coverage/test_cdate_method.vb | 6
basic/qa/basic_coverage/test_cdatetofromiso_methods.vb | 30 +-
basic/qa/basic_coverage/test_cdatetounodatecdatefromunodate_methods.vb | 6
basic/qa/basic_coverage/test_cdatetounodatetimecdatefromunodatetime_methods.vb | 6
basic/qa/basic_coverage/test_cdatetounotimecdatefromunotime_methods.vb | 6
basic/qa/basic_coverage/test_cdbl_method.vb | 6
basic/qa/basic_coverage/test_chdircurdir_methods.vb | 4
basic/qa/basic_coverage/test_choose_method.vb | 6
basic/qa/basic_coverage/test_chr_method.vb | 10
basic/qa/basic_coverage/test_cint_method.vb | 6
basic/qa/basic_coverage/test_compatibilitymode_method.vb | 6
basic/qa/basic_coverage/test_converttofromurl_methods.vb | 6
basic/qa/basic_coverage/test_cossin_methods.vb | 6
basic/qa/basic_coverage/test_createobject_method.vb | 6
basic/qa/basic_coverage/test_createunolistener_method.vb | 4
basic/qa/basic_coverage/test_createunoservice_method.vb | 4
basic/qa/basic_coverage/test_createunostruct_method.vb | 4
basic/qa/basic_coverage/test_createunovalue_method.vb | 4
basic/qa/basic_coverage/test_csng_method.vb | 6
basic/qa/basic_coverage/test_cstr_method.vb | 6
basic/qa/basic_coverage/test_cvar_method.vb | 6
basic/qa/basic_coverage/test_cverr_method.vb | 6
basic/qa/basic_coverage/test_date_literal.vb | 6
basic/qa/basic_coverage/test_datedateadddatediff_methods.vb | 6
basic/qa/basic_coverage/test_datedatepartday_methods.vb | 6
basic/qa/basic_coverage/test_dimarray_method.vb | 6
basic/qa/basic_coverage/test_empty_parameter.vb | 6
basic/qa/basic_coverage/test_environ_method.vb | 4
basic/qa/basic_coverage/test_equalunoobjects_method.vb | 8
basic/qa/basic_coverage/test_erl_method.vb | 8
basic/qa/basic_coverage/test_err_method.vb | 8
basic/qa/basic_coverage/test_falsetrue_method.vb | 6
basic/qa/basic_coverage/test_filedatetime_nonexistent.vb | 8
basic/qa/basic_coverage/test_filedatetime_nonexistent2.vb | 8
basic/qa/basic_coverage/test_fix_method.vb | 6
basic/qa/basic_coverage/test_for_each.vb | 4
basic/qa/basic_coverage/test_frac_method.vb | 6
basic/qa/basic_coverage/test_freefile_method.vb | 6
basic/qa/basic_coverage/test_freelibrary_method.vb | 4
basic/qa/basic_coverage/test_getdefaultcontext_method.vb | 4
basic/qa/basic_coverage/test_getdialogzoomfactorx_method.vb | 6
basic/qa/basic_coverage/test_getdialogzoomfactory_method.vb | 6
basic/qa/basic_coverage/test_getguitype_method.vb | 6
basic/qa/basic_coverage/test_getguiversion_method.vb | 6
basic/qa/basic_coverage/test_getpathseparator_method.vb | 6
basic/qa/basic_coverage/test_getprocessservicemanager_method.vb | 4
basic/qa/basic_coverage/test_getsolarversion_method.vb | 6
basic/qa/basic_coverage/test_getsystemtype_method.vb | 6
basic/qa/basic_coverage/test_hasunointerfaces_method.vb | 6
basic/qa/basic_coverage/test_hex_method.vb | 6
basic/qa/basic_coverage/test_hour_method.vb | 6
basic/qa/basic_coverage/test_iif_method.vb | 6
basic/qa/basic_coverage/test_instr_method.vb | 6
basic/qa/basic_coverage/test_int_method.vb | 6
basic/qa/basic_coverage/test_isarray_method.vb | 6
basic/qa/basic_coverage/test_isdate_method.vb | 6
basic/qa/basic_coverage/test_isempty_method.vb | 6
basic/qa/basic_coverage/test_iserror_method.vb | 6
basic/qa/basic_coverage/test_ismissing_basic.vb | 134 ++++-----
basic/qa/basic_coverage/test_ismissing_cascade.vb | 40 --
basic/qa/basic_coverage/test_ismissing_compatible.vb | 135 ++++------
basic/qa/basic_coverage/test_isnull_method.vb | 6
basic/qa/basic_coverage/test_isnumeric_method.vb | 6
basic/qa/basic_coverage/test_isobject_method.vb | 6
basic/qa/basic_coverage/test_isunostruct_method.vb | 6
basic/qa/basic_coverage/test_join_method.vb | 6
basic/qa/basic_coverage/test_lbound_method.vb | 6
basic/qa/basic_coverage/test_lcase_method.vb | 6
basic/qa/basic_coverage/test_len_method.vb | 6
basic/qa/basic_coverage/test_lenb_method.vb | 6
basic/qa/basic_coverage/test_logexp_methods.vb | 6
basic/qa/basic_coverage/test_ltrim_method.vb | 6
basic/qa/basic_coverage/test_method_name_variable.vb | 6
basic/qa/basic_coverage/test_mid_CountNegative_3args.vb | 6
basic/qa/basic_coverage/test_mid_EndOutOfBounds_3args.vb | 6
basic/qa/basic_coverage/test_mid_StartOutOfBounds_2args.vb | 6
basic/qa/basic_coverage/test_mid_StartOutOfBounds_3args.vb | 6
basic/qa/basic_coverage/test_mid_firstletter_3args.vb | 6
basic/qa/basic_coverage/test_mid_replace_less.vb | 6
basic/qa/basic_coverage/test_mid_replace_more.vb | 6
basic/qa/basic_coverage/test_mid_replace_more_end.vb | 6
basic/qa/basic_coverage/test_mid_sub2letters_2args.vb | 6
basic/qa/basic_coverage/test_minute_method.vb | 6
basic/qa/basic_coverage/test_mod_operator.vb | 6
basic/qa/basic_coverage/test_month_method.vb | 6
basic/qa/basic_coverage/test_nowtimevalue_methods.vb | 6
basic/qa/basic_coverage/test_numeric_constant_parameter.vb | 10
basic/qa/basic_coverage/test_oct_method.vb | 6
basic/qa/basic_coverage/test_option_base.vb | 62 +---
basic/qa/basic_coverage/test_option_base_compatible.vb | 61 +---
basic/qa/basic_coverage/test_optional_paramter_type.vb | 6
basic/qa/basic_coverage/test_optional_paramters_basic.vb | 135 ++++------
basic/qa/basic_coverage/test_optional_paramters_compatible.vb | 134 ++++-----
basic/qa/basic_coverage/test_qbcolor_method.vb | 6
basic/qa/basic_coverage/test_random_methods.vb | 6
basic/qa/basic_coverage/test_redim_objects.vb | 6
basic/qa/basic_coverage/test_resolvepath_method.vb | 6
basic/qa/basic_coverage/test_rgb_method.vb | 6
basic/qa/basic_coverage/test_rtrim_method.vb | 6
basic/qa/basic_coverage/test_second_method.vb | 6
basic/qa/basic_coverage/test_sgn_method.vb | 6
basic/qa/basic_coverage/test_space_method.vb | 6
basic/qa/basic_coverage/test_spc_method.vb | 6
basic/qa/basic_coverage/test_split_method.vb | 6
basic/qa/basic_coverage/test_sqr_method.vb | 6
basic/qa/basic_coverage/test_strcomp_method.vb | 6
basic/qa/basic_coverage/test_string_literal_comparison.vb | 6
basic/qa/basic_coverage/test_string_method.vb | 6
basic/qa/basic_coverage/test_string_overflow_safe.vb | 8
basic/qa/basic_coverage/test_string_replace.vb | 41 ---
basic/qa/basic_coverage/test_strtrim_methods.vb | 6
basic/qa/basic_coverage/test_switch_method.vb | 6
basic/qa/basic_coverage/test_tab_method.vb | 6
basic/qa/basic_coverage/test_tan_method.vb | 6
basic/qa/basic_coverage/test_timer_method.vb | 6
basic/qa/basic_coverage/test_timeserialtimevalue_methods.vb | 6
basic/qa/basic_coverage/test_twipsperpixelx_method.vb | 6
basic/qa/basic_coverage/test_twipsperpixely_method.vb | 6
basic/qa/basic_coverage/test_typelen_method.vb | 2
basic/qa/basic_coverage/test_typename_method.vb | 2
basic/qa/basic_coverage/test_types_conversion.vb | 6
basic/qa/basic_coverage/test_ucase_method.vb | 6
basic/qa/basic_coverage/test_val_method.vb | 6
basic/qa/basic_coverage/test_vartype_method.vb | 117 ++++----
basic/qa/basic_coverage/test_wait_method.vb | 4
basic/qa/basic_coverage/test_weekday_method.vb | 6
basic/qa/basic_coverage/test_year_method.vb | 6
basic/qa/basic_coverage/uno_struct_assign.vb | 4
basic/qa/cppunit/basic_coverage.cxx | 67 +---
145 files changed, 821 insertions(+), 980 deletions(-)
New commits:
commit a6178d172ebc47c623b1c1435d4c2e24966fce56
Author: Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Thu Jul 1 18:23:08 2021 +0200
Commit: Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Fri Jul 2 17:50:10 2021 +0200
tdf#84098 kill copy+paste in basic/qa/basic_coverage
This also fix the problem of basic_coverage tests not showing
the results when they were failing, since doUnitTest
returned a Integer
Change-Id: I637cd4cfaa34047bc99bfe6e0930f2945f1a9315
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118234
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>
diff --git a/basic/qa/basic_coverage/_test_asserts.vb b/basic/qa/basic_coverage/_test_asserts.vb
new file mode 100644
index 000000000000..0ecbf6828bcd
--- /dev/null
+++ b/basic/qa/basic_coverage/_test_asserts.vb
@@ -0,0 +1,57 @@
+'
+' This file is part of the LibreOffice project.
+'
+' This Source Code Form is subject to the terms of the Mozilla Public
+' License, v. 2.0. If a copy of the MPL was not distributed with this
+' file, You can obtain one at http://mozilla.org/MPL/2.0/.
+'
+
+Option Explicit
+
+Dim passCount As Integer
+Dim failCount As Integer
+Dim result As String
+
+Function GetResult()
+ If passCount <> 0 and failCount = 0 Then
+ GetResult = "OK"
+ Else
+ GetResult = result & Chr$(10) & "Tests passed: " & passCount & Chr$(10) & "Tests failed: " & failCount & Chr$(10)
+ End If
+End Function
+
+Sub TestInit()
+ passCount = 0
+ failCount = 0
+ result = result & "Test Results" & Chr$(10) & "============" & Chr$(10)
+End Sub
+
+Sub Assert(Assertion As Boolean, Optional testId As String, Optional testComment As String)
+ If Assertion = True Then
+ passCount = passCount + 1
+ Else
+ Dim testMsg As String
+ If Not IsMissing(testId) Then
+ testMsg = " " + testId
+ End If
+ If Not IsMissing(testComment) And Not (testComment = "") Then
+ testMsg = testMsg + " (" + testComment + ")"
+ End If
+
+ result = result & Chr$(10) & " Failed:" & testMsg
+ failCount = failCount + 1
+ End If
+End Sub
+
+Sub AssertEqual(actual As Variant, expected As Variant, testName As String)
+ If expected = actual Then
+ passCount = passCount + 1
+ Else
+ result = result & Chr$(10) & " Failed: " & testName & " returned " & actual & ", expected " & expected
+ failCount = failCount + 1
+ End If
+End Sub
+
+Sub ReportErrorHandler(testName As String, aErr, sError, nErl)
+ Assert False, testName, "hit error handler - " & aErr & ": " & sError & " line : " & nErl
+End Sub
diff --git a/basic/qa/basic_coverage/da-DK/cdbl-2.vb b/basic/qa/basic_coverage/da-DK/cdbl-2.vb
index a219304d4230..46468ac63f31 100644
--- a/basic/qa/basic_coverage/da-DK/cdbl-2.vb
+++ b/basic/qa/basic_coverage/da-DK/cdbl-2.vb
@@ -1,4 +1,4 @@
-Function doUnitTest() as Integer
+Function doUnitTest() as String
Dim A As String
Dim B As Double
Dim Expected As Double
@@ -7,8 +7,8 @@ Function doUnitTest() as Integer
Expected = 222.222
B = Cdbl(A)
If B <> Expected Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
Else
- doUnitTest = 1
+ doUnitTest = "OK"
End If
End Function
diff --git a/basic/qa/basic_coverage/da-DK/cdbl.vb b/basic/qa/basic_coverage/da-DK/cdbl.vb
index 128cfcc9903d..9b849d094724 100644
--- a/basic/qa/basic_coverage/da-DK/cdbl.vb
+++ b/basic/qa/basic_coverage/da-DK/cdbl.vb
@@ -1,4 +1,4 @@
-Function doUnitTest() as Integer
+Function doUnitTest() as String
Dim A As String
Dim B As Double
Dim Expected As String
@@ -7,8 +7,8 @@ Function doUnitTest() as Integer
Expected = "222222"
B = Cdbl(A)
If B <> Expected Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
Else
- doUnitTest = 1
+ doUnitTest = "OK"
End If
End Function
diff --git a/basic/qa/basic_coverage/string_left_01.vb b/basic/qa/basic_coverage/string_left_01.vb
index ef896bef1009..a17522979d36 100644
--- a/basic/qa/basic_coverage/string_left_01.vb
+++ b/basic/qa/basic_coverage/string_left_01.vb
@@ -7,7 +7,7 @@
'
-Function doUnitTest as Integer
+Function doUnitTest as String
Dim s1 As String
Dim s2 As String
@@ -17,9 +17,9 @@ Dim s2 As String
s2 = Left(s1, 2)
If s2 = "ab" Then
- doUnitTest = 1
+ doUnitTest = "OK"
Else
- doUnitTest = 0
+ doUnitTest = "FAIL"
End If
End Function
diff --git a/basic/qa/basic_coverage/string_right_01.vb b/basic/qa/basic_coverage/string_right_01.vb
index 65b16c6a8762..9189b8846776 100644
--- a/basic/qa/basic_coverage/string_right_01.vb
+++ b/basic/qa/basic_coverage/string_right_01.vb
@@ -6,7 +6,7 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
Dim s1 As String
Dim s2 As String
@@ -16,9 +16,9 @@ Dim s2 As String
s2 = Right(s1, 2)
If s2 = "bc" Then
- doUnitTest = 1
+ doUnitTest = "OK"
Else
- doUnitTest = 0
+ doUnitTest = "FAIL"
End If
End Function
diff --git a/basic/qa/basic_coverage/test_Date.vb b/basic/qa/basic_coverage/test_Date.vb
index c21d8cc05910..3056040a41f0 100644
--- a/basic/qa/basic_coverage/test_Date.vb
+++ b/basic/qa/basic_coverage/test_Date.vb
@@ -6,13 +6,13 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
''' Return 'text' OR 'date' variable '''
If ( TypeName(Date$)<>"String" Or Vartype(Date())<>V_DATE) Then
- doUnitTest = 0 ' not successful
+ doUnitTest = "FAIL" ' not successful
Else
- doUnitTest = 1 ' Ok
+ doUnitTest = "OK" ' Ok
End If
End Function
diff --git a/basic/qa/basic_coverage/test_Property.GetLet.vb b/basic/qa/basic_coverage/test_Property.GetLet.vb
index 992496a21015..97e377cc3448 100644
--- a/basic/qa/basic_coverage/test_Property.GetLet.vb
+++ b/basic/qa/basic_coverage/test_Property.GetLet.vb
@@ -8,13 +8,13 @@
Option Compatible
-Function doUnitTest as Integer
+Function doUnitTest as String
' PROPERTY GET/LET
aString = "Office"
If ( aString <> "LibreOffice") Then
- doUnitTest = 0 ' Ko
+ doUnitTest = "FAIL" ' Ko
Else
- doUnitTest = 1 ' Ok
+ doUnitTest = "OK" ' Ok
End If
End Function
diff --git a/basic/qa/basic_coverage/test_Property.GetSet.vb b/basic/qa/basic_coverage/test_Property.GetSet.vb
index 4a23867c2cfa..339ffe214227 100644
--- a/basic/qa/basic_coverage/test_Property.GetSet.vb
+++ b/basic/qa/basic_coverage/test_Property.GetSet.vb
@@ -8,14 +8,14 @@
Option Compatible
-Function doUnitTest as Integer
+Function doUnitTest as String
' PROPERTY GET/SET for classes or UNO services
Set objSetter = New Collection ' OR objLetter = New Collection
If ( objGetter.Count <> 3 ) Then
- doUnitTest = 0 ' not Ok
+ doUnitTest = "FAIL" ' not Ok
Else
- doUnitTest = 1 ' Ok
+ doUnitTest = "OK" ' Ok
End If
End Function
diff --git a/basic/qa/basic_coverage/test_abs_method.vb b/basic/qa/basic_coverage/test_abs_method.vb
index b79b9bcbb562..fb1ed22af42a 100644
--- a/basic/qa/basic_coverage/test_abs_method.vb
+++ b/basic/qa/basic_coverage/test_abs_method.vb
@@ -5,13 +5,13 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
' ABS
If (Abs(-3.5) <> 3.5) Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
ElseIf (Abs(3.5) <> 3.5) Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
Else
- doUnitTest = 1
+ doUnitTest = "OK"
End If
End Function
diff --git a/basic/qa/basic_coverage/test_array_method.vb b/basic/qa/basic_coverage/test_array_method.vb
index 42f10a25ae8a..7d9c65522803 100644
--- a/basic/qa/basic_coverage/test_array_method.vb
+++ b/basic/qa/basic_coverage/test_array_method.vb
@@ -6,15 +6,15 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
dim aVector as Variant
' ARRAY
aVector = Array( "Hello", -3.14)
If (aVector(0) <> "Hello") Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
ElseIf ( aVector(1) <> -3.14 ) Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
Else
- doUnitTest = 1
+ doUnitTest = "OK"
End If
End Function
diff --git a/basic/qa/basic_coverage/test_asc_method.vb b/basic/qa/basic_coverage/test_asc_method.vb
index 48b88933f9ac..982df81d1dc1 100644
--- a/basic/qa/basic_coverage/test_asc_method.vb
+++ b/basic/qa/basic_coverage/test_asc_method.vb
@@ -5,11 +5,11 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
' ASC
If (Asc("€a") <> 8364) Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
Else
- doUnitTest = 1
+ doUnitTest = "OK"
End If
End Function
diff --git a/basic/qa/basic_coverage/test_atn_method.vb b/basic/qa/basic_coverage/test_atn_method.vb
index 771714134fcc..08318eae007f 100644
--- a/basic/qa/basic_coverage/test_atn_method.vb
+++ b/basic/qa/basic_coverage/test_atn_method.vb
@@ -5,11 +5,11 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
' ATN (arc tan)
If (Atn(1) <> PI/4) Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
Else
- doUnitTest = 1
+ doUnitTest = "OK"
End If
End Function
diff --git a/basic/qa/basic_coverage/test_beep_method.vb b/basic/qa/basic_coverage/test_beep_method.vb
index 28eed61a6c1d..2952436df111 100644
--- a/basic/qa/basic_coverage/test_beep_method.vb
+++ b/basic/qa/basic_coverage/test_beep_method.vb
@@ -5,8 +5,8 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
' BEEP
Beep
- doUnitTest = 1
+ doUnitTest = "OK"
End Function
diff --git a/basic/qa/basic_coverage/test_cbool_method.vb b/basic/qa/basic_coverage/test_cbool_method.vb
index d1d995f19db3..11b88193896a 100644
--- a/basic/qa/basic_coverage/test_cbool_method.vb
+++ b/basic/qa/basic_coverage/test_cbool_method.vb
@@ -6,11 +6,11 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
' CBOOL
If (CBool(3) <> True) Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
Else
- doUnitTest = 1
+ doUnitTest = "OK"
End If
End Function
diff --git a/basic/qa/basic_coverage/test_cbyte_method.vb b/basic/qa/basic_coverage/test_cbyte_method.vb
index 35bb1654c63e..bdcfd1f798cd 100644
--- a/basic/qa/basic_coverage/test_cbyte_method.vb
+++ b/basic/qa/basic_coverage/test_cbyte_method.vb
@@ -6,11 +6,11 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
' CBYTE
If (CByte("3") <> 3) Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
Else
- doUnitTest = 1
+ doUnitTest = "OK"
End If
End Function
diff --git a/basic/qa/basic_coverage/test_ccur_method.vb b/basic/qa/basic_coverage/test_ccur_method.vb
index e4eef652441f..da6688500a2e 100644
--- a/basic/qa/basic_coverage/test_ccur_method.vb
+++ b/basic/qa/basic_coverage/test_ccur_method.vb
@@ -6,9 +6,9 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
- doUnitTest = 0
+ doUnitTest = "FAIL"
' CCUR
if (CCur("100") <> 100) Then Exit Function
@@ -17,6 +17,6 @@ Function doUnitTest as Integer
' tdf#141050 - passing a number with - sign
if (CCur("-100") <> -100) Then Exit Function
- doUnitTest = 1
+ doUnitTest = "OK"
End Function
diff --git a/basic/qa/basic_coverage/test_cdate_method.vb b/basic/qa/basic_coverage/test_cdate_method.vb
index c26287b1f013..9f2e357b8f39 100644
--- a/basic/qa/basic_coverage/test_cdate_method.vb
+++ b/basic/qa/basic_coverage/test_cdate_method.vb
@@ -6,11 +6,11 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
' CDATE
If (CDate(100) <> 100) Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
Else
- doUnitTest = 1
+ doUnitTest = "OK"
End If
End Function
diff --git a/basic/qa/basic_coverage/test_cdatetofromiso_methods.vb b/basic/qa/basic_coverage/test_cdatetofromiso_methods.vb
index d2f4ce9c7816..9d53cca3a3d5 100644
--- a/basic/qa/basic_coverage/test_cdatetofromiso_methods.vb
+++ b/basic/qa/basic_coverage/test_cdatetofromiso_methods.vb
@@ -6,36 +6,36 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
' CDateFromIso CDateToIso
If ( CDateToIso( CDateFromIso("20161016") ) <> "20161016" ) Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
ElseIf ( CDateToIso( CDateFromIso("2016-10-16") ) <> "20161016" ) Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
ElseIf ( CDateToIso( CDateFromIso("-2016-10-16") ) <> "-20161016" ) Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
ElseIf ( CDateToIso( CDateFromIso("-20161016") ) <> "-20161016" ) Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
ElseIf ( CDateToIso( CDateFromIso("12016-10-16") ) <> "120161016" ) Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
ElseIf ( CDateToIso( CDateFromIso("120161016") ) <> "120161016" ) Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
ElseIf ( CDateToIso( CDateFromIso("-12016-10-16") ) <> "-120161016" ) Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
ElseIf ( CDateToIso( CDateFromIso("-120161016") ) <> "-120161016" ) Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
ElseIf ( CDateToIso( CDateFromIso("0001-01-01") ) <> "00010101" ) Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
ElseIf ( CDateToIso( CDateFromIso("00010101") ) <> "00010101" ) Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
ElseIf ( CDateToIso( CDateFromIso("-0001-12-31") ) <> "-00011231" ) Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
ElseIf ( CDateToIso( CDateFromIso("-00011231") ) <> "-00011231" ) Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
ElseIf ( CDateToIso( CDateFromIso("991231") ) <> "19991231" ) Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
Else
- doUnitTest = 1
+ doUnitTest = "OK"
End If
' TODO: add some failure tests for misformed input, On Error whatever?
End Function
diff --git a/basic/qa/basic_coverage/test_cdatetounodatecdatefromunodate_methods.vb b/basic/qa/basic_coverage/test_cdatetounodatecdatefromunodate_methods.vb
index 2aa735c54d17..e5da681c837b 100644
--- a/basic/qa/basic_coverage/test_cdatetounodatecdatefromunodate_methods.vb
+++ b/basic/qa/basic_coverage/test_cdatetounodatecdatefromunodate_methods.vb
@@ -6,13 +6,13 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
dim aDate as Date
aDate = Date()
' CDateToUnoDate CDateFromUnoDate
If ( CDateFromUnoDate( CDateToUnoDate( aDate ) ) <> aDate ) Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
Else
- doUnitTest = 1
+ doUnitTest = "OK"
End If
End Function
diff --git a/basic/qa/basic_coverage/test_cdatetounodatetimecdatefromunodatetime_methods.vb b/basic/qa/basic_coverage/test_cdatetounodatetimecdatefromunodatetime_methods.vb
index 9aa5680b1f8c..82bbb49ddcff 100644
--- a/basic/qa/basic_coverage/test_cdatetounodatetimecdatefromunodatetime_methods.vb
+++ b/basic/qa/basic_coverage/test_cdatetounodatetimecdatefromunodatetime_methods.vb
@@ -6,13 +6,13 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
dim aDate as Date
aDate = Now()
' CDateToUnoDateTime CDateFromUnoDateTime
If ( CDateFromUnoDateTime( CDateToUnoDateTime( aDate ) ) <> aDate ) Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
Else
- doUnitTest = 1
+ doUnitTest = "OK"
End If
End Function
diff --git a/basic/qa/basic_coverage/test_cdatetounotimecdatefromunotime_methods.vb b/basic/qa/basic_coverage/test_cdatetounotimecdatefromunotime_methods.vb
index 38fd9da45f47..b84ee48f2263 100644
--- a/basic/qa/basic_coverage/test_cdatetounotimecdatefromunotime_methods.vb
+++ b/basic/qa/basic_coverage/test_cdatetounotimecdatefromunotime_methods.vb
@@ -6,13 +6,13 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
dim aDate as Date
aDate = Time()
' CDateToUnoTime CDateFromUnoTime
If ( CDateFromUnoTime( CDateToUnoTime( aDate ) ) <> aDate ) Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
Else
- doUnitTest = 1
+ doUnitTest = "OK"
End If
End Function
diff --git a/basic/qa/basic_coverage/test_cdbl_method.vb b/basic/qa/basic_coverage/test_cdbl_method.vb
index a0ba8f0298c8..bed575c07fbd 100644
--- a/basic/qa/basic_coverage/test_cdbl_method.vb
+++ b/basic/qa/basic_coverage/test_cdbl_method.vb
@@ -6,11 +6,11 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
' CDBL
If (CDbl("100") <> 100) Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
Else
- doUnitTest = 1
+ doUnitTest = "OK"
End If
End Function
diff --git a/basic/qa/basic_coverage/test_chdircurdir_methods.vb b/basic/qa/basic_coverage/test_chdircurdir_methods.vb
index dadd65b100e5..414ab60dd565 100644
--- a/basic/qa/basic_coverage/test_chdircurdir_methods.vb
+++ b/basic/qa/basic_coverage/test_chdircurdir_methods.vb
@@ -5,8 +5,8 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
' CHDIR CURDIR
ChDir( CurDir )
- doUnitTest = 1
+ doUnitTest = "OK"
End Function
diff --git a/basic/qa/basic_coverage/test_choose_method.vb b/basic/qa/basic_coverage/test_choose_method.vb
index 6ab2aea80f09..4f072f608f4e 100644
--- a/basic/qa/basic_coverage/test_choose_method.vb
+++ b/basic/qa/basic_coverage/test_choose_method.vb
@@ -6,11 +6,11 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
' CHOOSE
If (Choose(2, 1, 100, 3) <> 100) Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
Else
- doUnitTest = 1
+ doUnitTest = "OK"
End If
End Function
diff --git a/basic/qa/basic_coverage/test_chr_method.vb b/basic/qa/basic_coverage/test_chr_method.vb
index 8e8179463535..a927873f5322 100644
--- a/basic/qa/basic_coverage/test_chr_method.vb
+++ b/basic/qa/basic_coverage/test_chr_method.vb
@@ -43,22 +43,22 @@ handler:
overflow3 = 1
End Function
-Function doUnitTest as Integer
+Function doUnitTest as String
Chr(-32768)
Chr(65535)
Chr(&H8000)
Chr(&HFFFF)
if (overflow1 = 0) Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
Exit Function
Endif
if (overflow2 = 0) Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
Exit Function
Endif
if (overflow3 = 0) Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
Exit Function
Endif
- doUnitTest = 1
+ doUnitTest = "OK"
End Function
diff --git a/basic/qa/basic_coverage/test_cint_method.vb b/basic/qa/basic_coverage/test_cint_method.vb
index b84af04d74fe..4f4692ca5752 100644
--- a/basic/qa/basic_coverage/test_cint_method.vb
+++ b/basic/qa/basic_coverage/test_cint_method.vb
@@ -6,11 +6,11 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
' CINT
If (CInt("100") <> 100) Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
Else
- doUnitTest = 1
+ doUnitTest = "OK"
End If
End Function
diff --git a/basic/qa/basic_coverage/test_compatibilitymode_method.vb b/basic/qa/basic_coverage/test_compatibilitymode_method.vb
index 599adb963f66..0a6adaae1284 100644
--- a/basic/qa/basic_coverage/test_compatibilitymode_method.vb
+++ b/basic/qa/basic_coverage/test_compatibilitymode_method.vb
@@ -5,11 +5,11 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
' CompatibilityMode
If (CompatibilityMode(True) <> True) Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
Else
- doUnitTest = 1
+ doUnitTest = "OK"
End If
End Function
diff --git a/basic/qa/basic_coverage/test_converttofromurl_methods.vb b/basic/qa/basic_coverage/test_converttofromurl_methods.vb
index 40c6494bd314..0bcaf4cac48f 100644
--- a/basic/qa/basic_coverage/test_converttofromurl_methods.vb
+++ b/basic/qa/basic_coverage/test_converttofromurl_methods.vb
@@ -5,11 +5,11 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
' ConvertFromUrl ConvertToUrl
If ( ConvertToUrl( ConvertFromUrl("") ) <> "") Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
Else
- doUnitTest = 1
+ doUnitTest = "OK"
End If
End Function
diff --git a/basic/qa/basic_coverage/test_cossin_methods.vb b/basic/qa/basic_coverage/test_cossin_methods.vb
index c4a5cc5e537b..3bbdd95f0fd4 100644
--- a/basic/qa/basic_coverage/test_cossin_methods.vb
+++ b/basic/qa/basic_coverage/test_cossin_methods.vb
@@ -5,11 +5,11 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
' COS SIN
If ( Abs(Cos(PI/3) - Sin(PI/6)) > 1E-6 ) Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
Else
- doUnitTest = 1
+ doUnitTest = "OK"
End If
End Function
diff --git a/basic/qa/basic_coverage/test_createobject_method.vb b/basic/qa/basic_coverage/test_createobject_method.vb
index 6ae316b5795f..50fa536f9ad2 100644
--- a/basic/qa/basic_coverage/test_createobject_method.vb
+++ b/basic/qa/basic_coverage/test_createobject_method.vb
@@ -11,11 +11,11 @@ Type address
City As String
End Type
-Function doUnitTest as Integer
+Function doUnitTest as String
' CREATEOBJECT
If ( IsObject( CreateObject("address") ) = False ) Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
Else
- doUnitTest = 1
+ doUnitTest = "OK"
End If
End Function
diff --git a/basic/qa/basic_coverage/test_createunolistener_method.vb b/basic/qa/basic_coverage/test_createunolistener_method.vb
index 08c71fd8aaa0..dca9c9a1fc30 100644
--- a/basic/qa/basic_coverage/test_createunolistener_method.vb
+++ b/basic/qa/basic_coverage/test_createunolistener_method.vb
@@ -5,9 +5,9 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
' CreateUnoListener
Dim oListener
oListener = CreateUnoListener( "ContListener_","com.sun.star.container.XContainerListener" )
- doUnitTest = 1
+ doUnitTest = "OK"
End Function
diff --git a/basic/qa/basic_coverage/test_createunoservice_method.vb b/basic/qa/basic_coverage/test_createunoservice_method.vb
index 8fc043fd3e1d..90cc3affd993 100644
--- a/basic/qa/basic_coverage/test_createunoservice_method.vb
+++ b/basic/qa/basic_coverage/test_createunoservice_method.vb
@@ -5,9 +5,9 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
' CreateUnoService
Dim filepicker
filepicker = CreateUnoService("com.sun.star.ui.dialogs.FilePicker")
- doUnitTest = 1
+ doUnitTest = "OK"
End Function
diff --git a/basic/qa/basic_coverage/test_createunostruct_method.vb b/basic/qa/basic_coverage/test_createunostruct_method.vb
index f08368fed219..e8eb72061b9c 100644
--- a/basic/qa/basic_coverage/test_createunostruct_method.vb
+++ b/basic/qa/basic_coverage/test_createunostruct_method.vb
@@ -5,9 +5,9 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
' CreateUnoStruct
Dim oStruct
oStruct = CreateUnoStruct( "com.sun.star.beans.Property" )
- doUnitTest = 1
+ doUnitTest = "OK"
End Function
diff --git a/basic/qa/basic_coverage/test_createunovalue_method.vb b/basic/qa/basic_coverage/test_createunovalue_method.vb
index e640354acba9..40268ef90639 100644
--- a/basic/qa/basic_coverage/test_createunovalue_method.vb
+++ b/basic/qa/basic_coverage/test_createunovalue_method.vb
@@ -5,11 +5,11 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
' CreateUnoValue
Dim oUnoValue as Variant
Dim aValue as Variant
aValue = Array ( 1, 1 )
oUnoValue = CreateUnoValue( "[]byte", aValue )
- doUnitTest = 1
+ doUnitTest = "OK"
End Function
diff --git a/basic/qa/basic_coverage/test_csng_method.vb b/basic/qa/basic_coverage/test_csng_method.vb
index 87704ec1d431..64ad3ce80196 100644
--- a/basic/qa/basic_coverage/test_csng_method.vb
+++ b/basic/qa/basic_coverage/test_csng_method.vb
@@ -6,11 +6,11 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
' CSNG
If (CSng("100") <> 100) Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
Else
- doUnitTest = 1
+ doUnitTest = "OK"
End If
End Function
diff --git a/basic/qa/basic_coverage/test_cstr_method.vb b/basic/qa/basic_coverage/test_cstr_method.vb
index 53484b06fe17..d7f25a3887b4 100644
--- a/basic/qa/basic_coverage/test_cstr_method.vb
+++ b/basic/qa/basic_coverage/test_cstr_method.vb
@@ -6,11 +6,11 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
' CSTR
If (CStr(100) <> "100") Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
Else
- doUnitTest = 1
+ doUnitTest = "OK"
End If
End Function
diff --git a/basic/qa/basic_coverage/test_cvar_method.vb b/basic/qa/basic_coverage/test_cvar_method.vb
index cc13bef6c8f9..65dd8292574b 100644
--- a/basic/qa/basic_coverage/test_cvar_method.vb
+++ b/basic/qa/basic_coverage/test_cvar_method.vb
@@ -6,11 +6,11 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
' CVAR
If (CVar(100) <> 100) Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
Else
- doUnitTest = 1
+ doUnitTest = "OK"
End If
End Function
diff --git a/basic/qa/basic_coverage/test_cverr_method.vb b/basic/qa/basic_coverage/test_cverr_method.vb
index 9bc8b4f953f1..cc7ee4fe0825 100644
--- a/basic/qa/basic_coverage/test_cverr_method.vb
+++ b/basic/qa/basic_coverage/test_cverr_method.vb
@@ -6,9 +6,9 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
- doUnitTest = 0
+ doUnitTest = "FAIL"
' CVERR
If (CVerr(100) <> 100) Then Exit Function
@@ -17,7 +17,7 @@ Function doUnitTest as Integer
' tdf#79426 - test with Error-Code 448 ( ERRCODE_BASIC_NAMED_NOT_FOUND )
If (TestCVErr(CVErr(448)) <> 448) Then Exit Function
- doUnitTest = 1
+ doUnitTest = "OK"
End Function
diff --git a/basic/qa/basic_coverage/test_date_literal.vb b/basic/qa/basic_coverage/test_date_literal.vb
index a175368f3598..4042809ca22e 100644
--- a/basic/qa/basic_coverage/test_date_literal.vb
+++ b/basic/qa/basic_coverage/test_date_literal.vb
@@ -7,10 +7,10 @@
'
-Function doUnitTest as Integer
+Function doUnitTest as String
If #07/28/1977# = 28334 And #1977-07-28# = 28334 Then
- doUnitTest = 1
+ doUnitTest = "OK"
Else
- doUnitTest = 0
+ doUnitTest = "FAIL"
End If
End Function
diff --git a/basic/qa/basic_coverage/test_datedateadddatediff_methods.vb b/basic/qa/basic_coverage/test_datedateadddatediff_methods.vb
index 4ba40f8ebe29..edf000647535 100644
--- a/basic/qa/basic_coverage/test_datedateadddatediff_methods.vb
+++ b/basic/qa/basic_coverage/test_datedateadddatediff_methods.vb
@@ -6,13 +6,13 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
dim aDate as Date
aDate = Date()
' DATE DATEDIFF DATEADD
If ( DateDiff( "d", aDate, DateAdd("d", 1, aDate) ) <> 1 ) Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
Else
- doUnitTest = 1
+ doUnitTest = "OK"
End If
End Function
diff --git a/basic/qa/basic_coverage/test_datedatepartday_methods.vb b/basic/qa/basic_coverage/test_datedatepartday_methods.vb
index 04cc326f7d52..babdffbf1c8b 100644
--- a/basic/qa/basic_coverage/test_datedatepartday_methods.vb
+++ b/basic/qa/basic_coverage/test_datedatepartday_methods.vb
@@ -6,13 +6,13 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
dim aDate as Date
aDate = Date()
' DATEPART DAY
If ( DatePart( "d", aDate ) <> Day( aDate ) ) Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
Else
- doUnitTest = 1
+ doUnitTest = "OK"
End If
End Function
diff --git a/basic/qa/basic_coverage/test_dimarray_method.vb b/basic/qa/basic_coverage/test_dimarray_method.vb
index f92c7459dbe7..fde2a5b57191 100644
--- a/basic/qa/basic_coverage/test_dimarray_method.vb
+++ b/basic/qa/basic_coverage/test_dimarray_method.vb
@@ -5,14 +5,14 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
Dim aValue as variant
aValue = DimArray( 1, 2, 4 )
aValue( 1, 2, 4 ) = 3
' DIMARRAY
If ( aValue( 1, 2, 4 ) <> 3 ) Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
Else
- doUnitTest = 1
+ doUnitTest = "OK"
End If
End Function
diff --git a/basic/qa/basic_coverage/test_empty_parameter.vb b/basic/qa/basic_coverage/test_empty_parameter.vb
index fe6e2651c094..913f8e0cc42e 100644
--- a/basic/qa/basic_coverage/test_empty_parameter.vb
+++ b/basic/qa/basic_coverage/test_empty_parameter.vb
@@ -10,13 +10,13 @@ Sub assignVar(v As Variant)
v = 1
End Sub
-Function doUnitTest() As Integer
+Function doUnitTest() As String
' tdf#132563 - check if empty parameters are converted to their respective types
anEmptyVar = Empty
assignVar(anEmptyVar)
If (anEmptyVar = 1 And TypeName(anEmptyVar) = "Integer") Then
- doUnitTest = 1
+ doUnitTest = "OK"
Else
- doUnitTest = 0
+ doUnitTest = "FAIL"
End If
End Function
diff --git a/basic/qa/basic_coverage/test_environ_method.vb b/basic/qa/basic_coverage/test_environ_method.vb
index 63b6f360aa61..091b0edfea5d 100644
--- a/basic/qa/basic_coverage/test_environ_method.vb
+++ b/basic/qa/basic_coverage/test_environ_method.vb
@@ -5,8 +5,8 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
' ENVIRON
Environ ("TMP")
- doUnitTest = 1
+ doUnitTest = "OK"
End Function
diff --git a/basic/qa/basic_coverage/test_equalunoobjects_method.vb b/basic/qa/basic_coverage/test_equalunoobjects_method.vb
index b48111546cb3..9e7666ae5b74 100644
--- a/basic/qa/basic_coverage/test_equalunoobjects_method.vb
+++ b/basic/qa/basic_coverage/test_equalunoobjects_method.vb
@@ -5,21 +5,21 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
' EqualUnoObjects
' Copy of objects -> same instance
oIntrospection = CreateUnoService( "com.sun.star.beans.Introspection" )
oIntro2 = oIntrospection
If ( EqualUnoObjects( oIntrospection, oIntro2 ) = False ) Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
Else
' Copy of structs as value -> new instance
Dim Struct1 as new com.sun.star.beans.Property
Struct2 = Struct1
If ( EqualUnoObjects( Struct1, Struct2 ) ) Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
Else
- doUnitTest = 1
+ doUnitTest = "OK"
End If
End If
End Function
diff --git a/basic/qa/basic_coverage/test_erl_method.vb b/basic/qa/basic_coverage/test_erl_method.vb
index b541b15faf9f..ab834650c998 100644
--- a/basic/qa/basic_coverage/test_erl_method.vb
+++ b/basic/qa/basic_coverage/test_erl_method.vb
@@ -5,18 +5,18 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
' ERL
On Error GoTo ErrorHandler ' Set up error handler
Dim nVar As Integer
nVar = 0
nVar = 1/nVar
- doUnitTest = 0
+ doUnitTest = "FAIL"
Exit Function
ErrorHandler:
If ( Erl <> 13 ) Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
Else
- doUnitTest = 1
+ doUnitTest = "OK"
Endif
End Function
diff --git a/basic/qa/basic_coverage/test_err_method.vb b/basic/qa/basic_coverage/test_err_method.vb
index c21b417b4200..36d49ee843ce 100644
--- a/basic/qa/basic_coverage/test_err_method.vb
+++ b/basic/qa/basic_coverage/test_err_method.vb
@@ -5,18 +5,18 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
' ERR
On Error GoTo ErrorHandler ' Set up error handler
Dim nVar As Integer
nVar = 0
nVar = 1/nVar
- doUnitTest = 0
+ doUnitTest = "FAIL"
Exit Function
ErrorHandler:
If ( Err <> 11 ) Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
Else
- doUnitTest = 1
+ doUnitTest = "OK"
Endif
End Function
diff --git a/basic/qa/basic_coverage/test_falsetrue_method.vb b/basic/qa/basic_coverage/test_falsetrue_method.vb
index f99b8032b4eb..ae8e5ff5fd35 100644
--- a/basic/qa/basic_coverage/test_falsetrue_method.vb
+++ b/basic/qa/basic_coverage/test_falsetrue_method.vb
@@ -6,11 +6,11 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
' FALSE TRUE
If (False = True) Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
Else
- doUnitTest = 1
+ doUnitTest = "OK"
End If
End Function
diff --git a/basic/qa/basic_coverage/test_filedatetime_nonexistent.vb b/basic/qa/basic_coverage/test_filedatetime_nonexistent.vb
index 53a72549c846..2aac2fe0338e 100644
--- a/basic/qa/basic_coverage/test_filedatetime_nonexistent.vb
+++ b/basic/qa/basic_coverage/test_filedatetime_nonexistent.vb
@@ -5,16 +5,16 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
'Bug 121337 - FileDateTime("\\nonexistent\smb\path") returns bogus result rather than throwing error
-Function doUnitTest as Integer
+Function doUnitTest as String
On Error GoTo ErrorHandler ' Set up error handler
Dim result
result = FileDateTime("/bogus/unix/path")
- doUnitTest = 0
+ doUnitTest = "FAIL"
Exit Function
ErrorHandler:
If ( Err <> 0 ) Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
Else
- doUnitTest = 1
+ doUnitTest = "OK"
Endif
End Function
diff --git a/basic/qa/basic_coverage/test_filedatetime_nonexistent2.vb b/basic/qa/basic_coverage/test_filedatetime_nonexistent2.vb
index 2135b25d27ec..ffce5b1f2732 100644
--- a/basic/qa/basic_coverage/test_filedatetime_nonexistent2.vb
+++ b/basic/qa/basic_coverage/test_filedatetime_nonexistent2.vb
@@ -5,16 +5,16 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
'Bug 121337 - FileDateTime("\\nonexistent\smb\path") returns bogus result rather than throwing error
-Function doUnitTest as Integer
+Function doUnitTest as String
On Error GoTo ErrorHandler ' Set up error handler
Dim result
result = FileDateTime("\\bogus\smb\path")
- doUnitTest = 0
+ doUnitTest = "FAIL"
Exit Function
ErrorHandler:
If ( Err <> 0 ) Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
Else
- doUnitTest = 1
+ doUnitTest = "OK"
Endif
End Function
diff --git a/basic/qa/basic_coverage/test_fix_method.vb b/basic/qa/basic_coverage/test_fix_method.vb
index 91d2f01fc433..e91a464b14bc 100644
--- a/basic/qa/basic_coverage/test_fix_method.vb
+++ b/basic/qa/basic_coverage/test_fix_method.vb
@@ -5,11 +5,11 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
' FIX
If (Fix(PI) <> 3) Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
Else
- doUnitTest = 1
+ doUnitTest = "OK"
End If
End Function
diff --git a/basic/qa/basic_coverage/test_for_each.vb b/basic/qa/basic_coverage/test_for_each.vb
index 654513e88332..3d9b74c273c9 100644
--- a/basic/qa/basic_coverage/test_for_each.vb
+++ b/basic/qa/basic_coverage/test_for_each.vb
@@ -6,7 +6,7 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
Dim n As Integer, i
Dim a(3)
n = 0
@@ -23,7 +23,7 @@ Function doUnitTest as Integer
Exit Function
End If
- doUnitTest = 1
+ doUnitTest = "OK"
End Function
Function TestInvalidForEachWithErrorHandler
diff --git a/basic/qa/basic_coverage/test_frac_method.vb b/basic/qa/basic_coverage/test_frac_method.vb
index 14d6863dbe40..1e86afc43534 100644
--- a/basic/qa/basic_coverage/test_frac_method.vb
+++ b/basic/qa/basic_coverage/test_frac_method.vb
@@ -5,11 +5,11 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
' FRAC
If ( 3+Frac(PI) <> PI) Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
Else
- doUnitTest = 1
+ doUnitTest = "OK"
End If
End Function
diff --git a/basic/qa/basic_coverage/test_freefile_method.vb b/basic/qa/basic_coverage/test_freefile_method.vb
index d2a5cb93bae9..78ee24ab4ff5 100644
--- a/basic/qa/basic_coverage/test_freefile_method.vb
+++ b/basic/qa/basic_coverage/test_freefile_method.vb
@@ -5,11 +5,11 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
' FREEFILE
If ( FreeFile < 0 ) Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
Else
- doUnitTest = 1
+ doUnitTest = "OK"
End If
End Function
diff --git a/basic/qa/basic_coverage/test_freelibrary_method.vb b/basic/qa/basic_coverage/test_freelibrary_method.vb
index 4f6f9cd2d866..e30f2e64f009 100644
--- a/basic/qa/basic_coverage/test_freelibrary_method.vb
+++ b/basic/qa/basic_coverage/test_freelibrary_method.vb
@@ -5,8 +5,8 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
' FREELIBRARY
FreeLibrary("")
- doUnitTest = 1
+ doUnitTest = "OK"
End Function
diff --git a/basic/qa/basic_coverage/test_getdefaultcontext_method.vb b/basic/qa/basic_coverage/test_getdefaultcontext_method.vb
index 8a90d6e96453..9d6efd4fcd8b 100644
--- a/basic/qa/basic_coverage/test_getdefaultcontext_method.vb
+++ b/basic/qa/basic_coverage/test_getdefaultcontext_method.vb
@@ -5,8 +5,8 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
' GetDefaultContext
GetDefaultContext()
- doUnitTest = 1
+ doUnitTest = "OK"
End Function
diff --git a/basic/qa/basic_coverage/test_getdialogzoomfactorx_method.vb b/basic/qa/basic_coverage/test_getdialogzoomfactorx_method.vb
index 279fc005d731..d2d032c54a82 100644
--- a/basic/qa/basic_coverage/test_getdialogzoomfactorx_method.vb
+++ b/basic/qa/basic_coverage/test_getdialogzoomfactorx_method.vb
@@ -5,11 +5,11 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
' GETDIALOGFACTORX
If ( GetDialogZoomFactorX(100) < 0 ) Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
Else
- doUnitTest = 1
+ doUnitTest = "OK"
End If
End Function
diff --git a/basic/qa/basic_coverage/test_getdialogzoomfactory_method.vb b/basic/qa/basic_coverage/test_getdialogzoomfactory_method.vb
index f4139bed591c..fdc8ce43d09a 100644
--- a/basic/qa/basic_coverage/test_getdialogzoomfactory_method.vb
+++ b/basic/qa/basic_coverage/test_getdialogzoomfactory_method.vb
@@ -5,11 +5,11 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
' GETDIALOGFACTORY
If ( GetDialogZoomFactorY(100) < 0 ) Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
Else
- doUnitTest = 1
+ doUnitTest = "OK"
End If
End Function
diff --git a/basic/qa/basic_coverage/test_getguitype_method.vb b/basic/qa/basic_coverage/test_getguitype_method.vb
index c1606da10339..5a3d345b71b9 100644
--- a/basic/qa/basic_coverage/test_getguitype_method.vb
+++ b/basic/qa/basic_coverage/test_getguitype_method.vb
@@ -5,11 +5,11 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
' GETGUITYPE
If ( GetGuiType = 0 ) Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
Else
- doUnitTest = 1
+ doUnitTest = "OK"
End If
End Function
diff --git a/basic/qa/basic_coverage/test_getguiversion_method.vb b/basic/qa/basic_coverage/test_getguiversion_method.vb
index a70ff07e6d88..37cd852bcd44 100644
--- a/basic/qa/basic_coverage/test_getguiversion_method.vb
+++ b/basic/qa/basic_coverage/test_getguiversion_method.vb
@@ -5,11 +5,11 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
' GETGUIVERSION
If ( GetGuiVersion = 0 ) Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
Else
- doUnitTest = 1
+ doUnitTest = "OK"
End If
End Function
diff --git a/basic/qa/basic_coverage/test_getpathseparator_method.vb b/basic/qa/basic_coverage/test_getpathseparator_method.vb
index 63a7b6737b92..f3e2915e99ea 100644
--- a/basic/qa/basic_coverage/test_getpathseparator_method.vb
+++ b/basic/qa/basic_coverage/test_getpathseparator_method.vb
@@ -5,11 +5,11 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
' GETPATHSEPARATOR
If ( GetPathSeparator = "" ) Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
Else
- doUnitTest = 1
+ doUnitTest = "OK"
End If
End Function
diff --git a/basic/qa/basic_coverage/test_getprocessservicemanager_method.vb b/basic/qa/basic_coverage/test_getprocessservicemanager_method.vb
index 90e2012d698d..68a112b910d7 100644
--- a/basic/qa/basic_coverage/test_getprocessservicemanager_method.vb
+++ b/basic/qa/basic_coverage/test_getprocessservicemanager_method.vb
@@ -5,8 +5,8 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
' GetProcessServiceManager
GetProcessServiceManager()
- doUnitTest = 1
+ doUnitTest = "OK"
End Function
diff --git a/basic/qa/basic_coverage/test_getsolarversion_method.vb b/basic/qa/basic_coverage/test_getsolarversion_method.vb
index c2a75d11d44e..12a4eb1b855d 100644
--- a/basic/qa/basic_coverage/test_getsolarversion_method.vb
+++ b/basic/qa/basic_coverage/test_getsolarversion_method.vb
@@ -5,11 +5,11 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
' GetSolarVersion
If ( GetSolarVersion() < 50000) Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
Else
- doUnitTest = 1
+ doUnitTest = "OK"
End If
End Function
diff --git a/basic/qa/basic_coverage/test_getsystemtype_method.vb b/basic/qa/basic_coverage/test_getsystemtype_method.vb
index eced70204891..b5289dd2569f 100644
--- a/basic/qa/basic_coverage/test_getsystemtype_method.vb
+++ b/basic/qa/basic_coverage/test_getsystemtype_method.vb
@@ -5,11 +5,11 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
' GETSYSTEMTYPE
If ( GetSystemType <> -1 ) Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
Else
- doUnitTest = 1
+ doUnitTest = "OK"
End If
End Function
diff --git a/basic/qa/basic_coverage/test_hasunointerfaces_method.vb b/basic/qa/basic_coverage/test_hasunointerfaces_method.vb
index 06472d847200..d3313c2b2272 100644
--- a/basic/qa/basic_coverage/test_hasunointerfaces_method.vb
+++ b/basic/qa/basic_coverage/test_hasunointerfaces_method.vb
@@ -5,12 +5,12 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
' HASUNOINTERFACES
dim aObject as Object
If ( HasUnoInterfaces( aObject, "com.sun.star.beans.XIntrospection" ) ) Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
Else
- doUnitTest = 1
+ doUnitTest = "OK"
End If
End Function
diff --git a/basic/qa/basic_coverage/test_hex_method.vb b/basic/qa/basic_coverage/test_hex_method.vb
index 72edd9d8e573..56fa257c5a3c 100644
--- a/basic/qa/basic_coverage/test_hex_method.vb
+++ b/basic/qa/basic_coverage/test_hex_method.vb
@@ -5,11 +5,11 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
' HEX
If ( Hex(100) <> "64") Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
Else
- doUnitTest = 1
+ doUnitTest = "OK"
End If
End Function
diff --git a/basic/qa/basic_coverage/test_hour_method.vb b/basic/qa/basic_coverage/test_hour_method.vb
index e132775f8473..7b40e09ca704 100644
--- a/basic/qa/basic_coverage/test_hour_method.vb
+++ b/basic/qa/basic_coverage/test_hour_method.vb
@@ -6,11 +6,11 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
' HOUR
If ( Hour(TimeSerial(12,30,41)) <> 12 ) Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
Else
- doUnitTest = 1
+ doUnitTest = "OK"
End If
End Function
diff --git a/basic/qa/basic_coverage/test_iif_method.vb b/basic/qa/basic_coverage/test_iif_method.vb
index 502cadcb35c1..fce0620ad584 100644
--- a/basic/qa/basic_coverage/test_iif_method.vb
+++ b/basic/qa/basic_coverage/test_iif_method.vb
@@ -6,11 +6,11 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
' IIF
If ( IIF(True, 10, 12) <> 10 ) Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
Else
- doUnitTest = 1
+ doUnitTest = "OK"
End If
End Function
diff --git a/basic/qa/basic_coverage/test_instr_method.vb b/basic/qa/basic_coverage/test_instr_method.vb
index 47fa7a94ede1..435e48a31c96 100644
--- a/basic/qa/basic_coverage/test_instr_method.vb
+++ b/basic/qa/basic_coverage/test_instr_method.vb
@@ -5,9 +5,9 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
- doUnitTest = 0
+ doUnitTest = "FAIL"
Dim aString As Variant
aString = "Hello"
@@ -17,6 +17,6 @@ Function doUnitTest as Integer
' tdf#139840 - case-insensitive operation for non-ASCII characters
If (InStr(1, "α", "Α", 1) <> 1) Then Exit Function
- doUnitTest = 1
+ doUnitTest = "OK"
End Function
diff --git a/basic/qa/basic_coverage/test_int_method.vb b/basic/qa/basic_coverage/test_int_method.vb
index 69e811648d1d..7108e4bbb709 100644
--- a/basic/qa/basic_coverage/test_int_method.vb
+++ b/basic/qa/basic_coverage/test_int_method.vb
@@ -5,11 +5,11 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
' INT
If ( Int(PI) <> 3 ) Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
Else
- doUnitTest = 1
+ doUnitTest = "OK"
End If
End Function
diff --git a/basic/qa/basic_coverage/test_isarray_method.vb b/basic/qa/basic_coverage/test_isarray_method.vb
index 9d73984b5f59..ec8c1c520560 100644
--- a/basic/qa/basic_coverage/test_isarray_method.vb
+++ b/basic/qa/basic_coverage/test_isarray_method.vb
@@ -6,13 +6,13 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
dim aVector as Variant
aVector = Array( 123, "Hello", -3.14)
' ISARRAY
If ( IsArray( aVector ) = False ) Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
Else
- doUnitTest = 1
+ doUnitTest = "OK"
End If
End Function
diff --git a/basic/qa/basic_coverage/test_isdate_method.vb b/basic/qa/basic_coverage/test_isdate_method.vb
index 5ce72f87b146..c2a4c342cfcf 100644
--- a/basic/qa/basic_coverage/test_isdate_method.vb
+++ b/basic/qa/basic_coverage/test_isdate_method.vb
@@ -6,13 +6,13 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
dim aDate as Date
aDate = Date( )
' ISDATE
If ( IsDate( aDate ) = False ) Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
Else
- doUnitTest = 1
+ doUnitTest = "OK"
End If
End Function
diff --git a/basic/qa/basic_coverage/test_isempty_method.vb b/basic/qa/basic_coverage/test_isempty_method.vb
index 6ca2fae6d498..3a8a508b00dc 100644
--- a/basic/qa/basic_coverage/test_isempty_method.vb
+++ b/basic/qa/basic_coverage/test_isempty_method.vb
@@ -6,13 +6,13 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
dim aVariant as Variant
aVariant = Date( )
' ISEMPTY
If ( IsEmpty( aVariant ) ) Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
Else
- doUnitTest = 1
+ doUnitTest = "OK"
End If
End Function
diff --git a/basic/qa/basic_coverage/test_iserror_method.vb b/basic/qa/basic_coverage/test_iserror_method.vb
index fb12abe6a257..ab33f2b9a130 100644
--- a/basic/qa/basic_coverage/test_iserror_method.vb
+++ b/basic/qa/basic_coverage/test_iserror_method.vb
@@ -10,13 +10,13 @@ Type MyType
tName as String
End Type
-Function doUnitTest as Integer
+Function doUnitTest as String
dim aVariant as MyType
aVariant.tName = "A string"
' ISERROR
If ( IsError( aVariant ) ) Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
Else
- doUnitTest = 1
+ doUnitTest = "OK"
End If
End Function
diff --git a/basic/qa/basic_coverage/test_ismissing_basic.vb b/basic/qa/basic_coverage/test_ismissing_basic.vb
index b838ce718c36..85efb401274b 100644
--- a/basic/qa/basic_coverage/test_ismissing_basic.vb
+++ b/basic/qa/basic_coverage/test_ismissing_basic.vb
@@ -1,80 +1,68 @@
-Dim passCount As Integer
-Dim failCount As Integer
-Dim result As String
-
Const IsMissingNone = -1
Const IsMissingA = 0
Const IsMissingB = 1
Const IsMissingAB = 2
Function doUnitTest() As String
- result = verify_testIsMissingBasic()
- If failCount <> 0 Or passCount = 0 Then
- doUnitTest = 0
- Else
- doUnitTest = 1
- End If
+ TestUtil.TestInit
+ verify_testIsMissingBasic
+ doUnitTest = TestUtil.GetResult()
End Function
' tdf#36737 - Test optionals with different datatypes. In LO Basic, optional
' parameters are allowed, but without any default values. Missing optional parameters
' will not be initialized to their respective default values of its datatype, either.
-Function verify_testIsMissingBasic() As String
+Sub verify_testIsMissingBasic()
- passCount = 0
- failCount = 0
-
- result = "Test Results" & Chr$(10) & "============" & Chr$(10)
- testName = "Test missing (Basic)"
On Error GoTo errorHandler
' optionals with variant datatypes
- TestLog_ASSERT TestOptVariant(), IsMissingAB, "TestOptVariant()"
- TestLog_ASSERT TestOptVariant(123), IsMissingB, "TestOptVariant(123)"
- TestLog_ASSERT TestOptVariant(, 456), IsMissingA, "TestOptVariant(, 456)"
- TestLog_ASSERT TestOptVariant(123, 456), IsMissingNone, "TestOptVariant(123, 456)"
+ TestUtil.AssertEqual(TestOptVariant(), IsMissingAB, "TestOptVariant()")
+ TestUtil.AssertEqual(TestOptVariant(123), IsMissingB, "TestOptVariant(123)")
+ TestUtil.AssertEqual(TestOptVariant(, 456), IsMissingA, "TestOptVariant(, 456)")
+ TestUtil.AssertEqual(TestOptVariant(123, 456), IsMissingNone, "TestOptVariant(123, 456)")
' optionals with variant datatypes (ByRef and ByVal)
- TestLog_ASSERT TestOptVariantByRefByVal(), IsMissingAB, "TestOptVariantByRefByVal()"
- TestLog_ASSERT TestOptVariantByRefByVal(123), IsMissingB, "TestOptVariantByRefByVal(123)"
- TestLog_ASSERT TestOptVariantByRefByVal(, 456), IsMissingA, "TestOptVariantByRefByVal(, 456)"
- TestLog_ASSERT TestOptVariantByRefByVal(123, 456), IsMissingNone, "TestOptVariantByRefByVal(123, 456)"
+ TestUtil.AssertEqual(TestOptVariantByRefByVal(), IsMissingAB, "TestOptVariantByRefByVal()")
+ TestUtil.AssertEqual(TestOptVariantByRefByVal(123), IsMissingB, "TestOptVariantByRefByVal(123)")
+ TestUtil.AssertEqual(TestOptVariantByRefByVal(, 456), IsMissingA, "TestOptVariantByRefByVal(, 456)")
+ TestUtil.AssertEqual(TestOptVariantByRefByVal(123, 456), IsMissingNone, "TestOptVariantByRefByVal(123, 456)")
' optionals with double datatypes
- TestLog_ASSERT TestOptDouble(), IsMissingAB, "TestOptDouble()"
- TestLog_ASSERT TestOptDouble(123.4), IsMissingB, "TestOptDouble(123.4)"
- TestLog_ASSERT TestOptDouble(, 567.8), IsMissingA, "TestOptDouble(, 567.8)"
- TestLog_ASSERT TestOptDouble(123.4, 567.8), IsMissingNone, "TestOptDouble(123.4, 567.8)"
+ TestUtil.AssertEqual(TestOptDouble(), IsMissingAB, "TestOptDouble()")
+ TestUtil.AssertEqual(TestOptDouble(123.4), IsMissingB, "TestOptDouble(123.4)")
+ TestUtil.AssertEqual(TestOptDouble(, 567.8), IsMissingA, "TestOptDouble(, 567.8)")
+ TestUtil.AssertEqual(TestOptDouble(123.4, 567.8), IsMissingNone, "TestOptDouble(123.4, 567.8)")
' optionals with double datatypes (ByRef and ByVal)
- TestLog_ASSERT TestOptDoubleByRefByVal(), IsMissingAB, "TestOptDouble()"
- TestLog_ASSERT TestOptDoubleByRefByVal(123.4), IsMissingB, "TestOptDouble(123.4)"
- TestLog_ASSERT TestOptDoubleByRefByVal(, 567.8), IsMissingA, "TestOptDoubleByRefByVal(, 567.8)"
- TestLog_ASSERT TestOptDoubleByRefByVal(123.4, 567.8), IsMissingNone, "TestOptDoubleByRefByVal(123.4, 567.8)"
+ TestUtil.AssertEqual(TestOptDoubleByRefByVal(), IsMissingAB, "TestOptDouble()")
+ TestUtil.AssertEqual(TestOptDoubleByRefByVal(123.4), IsMissingB, "TestOptDouble(123.4)")
+ TestUtil.AssertEqual(TestOptDoubleByRefByVal(, 567.8), IsMissingA, "TestOptDoubleByRefByVal(, 567.8)")
+ TestUtil.AssertEqual(TestOptDoubleByRefByVal(123.4, 567.8), IsMissingNone, "TestOptDoubleByRefByVal(123.4, 567.8)")
' optionals with integer datatypes
- TestLog_ASSERT TestOptInteger(), IsMissingAB, "TestOptInteger()"
- TestLog_ASSERT TestOptInteger(123), IsMissingB, "TestOptInteger(123)"
- TestLog_ASSERT TestOptInteger(, 456), IsMissingA, "TestOptInteger(, 456)"
- TestLog_ASSERT TestOptInteger(123, 456), IsMissingNone, "TestOptInteger(123, 456)"
+ TestUtil.AssertEqual(TestOptInteger(), IsMissingAB, "TestOptInteger()")
+ TestUtil.AssertEqual(TestOptInteger(123), IsMissingB, "TestOptInteger(123)")
+ TestUtil.AssertEqual(TestOptInteger(, 456), IsMissingA, "TestOptInteger(, 456)")
+ TestUtil.AssertEqual(TestOptInteger(123, 456), IsMissingNone, "TestOptInteger(123, 456)")
' optionals with integer datatypes (ByRef and ByVal)
- TestLog_ASSERT TestOptIntegerByRefByVal(), IsMissingAB, "TestOptIntegerByRefByVal()"
- TestLog_ASSERT TestOptIntegerByRefByVal(123), IsMissingB, "TestOptIntegerByRefByVal(123)"
- TestLog_ASSERT TestOptIntegerByRefByVal(, 456), IsMissingA, "TestOptIntegerByRefByVal(, 456)"
- TestLog_ASSERT TestOptIntegerByRefByVal(123, 456), IsMissingNone, "TestOptIntegerByRefByVal(123, 456)"
+ TestUtil.AssertEqual(TestOptIntegerByRefByVal(), IsMissingAB, "TestOptIntegerByRefByVal()")
+ TestUtil.AssertEqual(TestOptIntegerByRefByVal(123), IsMissingB, "TestOptIntegerByRefByVal(123)")
+ TestUtil.AssertEqual(TestOptIntegerByRefByVal(, 456), IsMissingA, "TestOptIntegerByRefByVal(, 456)")
+ TestUtil.AssertEqual(TestOptIntegerByRefByVal(123, 456), IsMissingNone, "TestOptIntegerByRefByVal(123, 456)")
' optionals with string datatypes
- TestLog_ASSERT TestOptString(), IsMissingAB, "TestOptString()"
- TestLog_ASSERT TestOptString("123"), IsMissingB, "TestOptString(""123"")"
- TestLog_ASSERT TestOptString(, "456"), IsMissingA, "TestOptString(, ""456"")"
- TestLog_ASSERT TestOptString("123", "456"), IsMissingNone, "TestOptString(""123"", ""456"")"
+ TestUtil.AssertEqual(TestOptString(), IsMissingAB, "TestOptString()")
+ TestUtil.AssertEqual(TestOptString("123"), IsMissingB, "TestOptString(""123"")")
+ TestUtil.AssertEqual(TestOptString(, "456"), IsMissingA, "TestOptString(, ""456"")")
+ TestUtil.AssertEqual(TestOptString("123", "456"), IsMissingNone, "TestOptString(""123"", ""456"")")
' optionals with string datatypes (ByRef and ByVal)
- TestLog_ASSERT TestOptStringByRefByVal(), IsMissingAB, "TestOptStringByRefByVal()"
- TestLog_ASSERT TestOptStringByRefByVal("123"), IsMissingB, "TestOptStringByRefByVal(""123"")"
- TestLog_ASSERT TestOptStringByRefByVal(, "456"), IsMissingA, "TestOptStringByRefByVal(, ""456"")"
- TestLog_ASSERT TestOptStringByRefByVal("123", "456"), IsMissingNone, "TestOptStringByRefByVal(""123"", ""456"")"
+ TestUtil.AssertEqual(TestOptStringByRefByVal(), IsMissingAB, "TestOptStringByRefByVal()")
+ TestUtil.AssertEqual(TestOptStringByRefByVal("123"), IsMissingB, "TestOptStringByRefByVal(""123"")")
+ TestUtil.AssertEqual(TestOptStringByRefByVal(, "456"), IsMissingA, "TestOptStringByRefByVal(, ""456"")")
+ TestUtil.AssertEqual(TestOptStringByRefByVal("123", "456"), IsMissingNone, "TestOptStringByRefByVal(""123"", ""456"")")
' optionals with object datatypes
Dim cA As New Collection
@@ -83,16 +71,16 @@ Function verify_testIsMissingBasic() As String
Dim cB As New Collection
cB.Add (123.4)
cB.Add (567.8)
- TestLog_ASSERT TestOptObject(), IsMissingAB, "TestOptObject()"
- TestLog_ASSERT TestOptObject(cA), IsMissingB, "TestOptObject(A)"
- TestLog_ASSERT TestOptObject(, cB), IsMissingA, "TestOptObject(, B)"
- TestLog_ASSERT TestOptObject(cA, cB), IsMissingNone, "TestOptObject(A, B)"
+ TestUtil.AssertEqual(TestOptObject(), IsMissingAB, "TestOptObject()")
+ TestUtil.AssertEqual(TestOptObject(cA), IsMissingB, "TestOptObject(A)")
+ TestUtil.AssertEqual(TestOptObject(, cB), IsMissingA, "TestOptObject(, B)")
+ TestUtil.AssertEqual(TestOptObject(cA, cB), IsMissingNone, "TestOptObject(A, B)")
' optionals with object datatypes (ByRef and ByVal)
- TestLog_ASSERT TestOptObjectByRefByVal(), IsMissingAB, "TestOptObjectByRefByVal()"
- TestLog_ASSERT TestOptObjectByRefByVal(cA), IsMissingB, "TestOptObjectByRefByVal(A)"
- TestLog_ASSERT TestOptObjectByRefByVal(, cB), IsMissingA, "TestOptObjectByRefByVal(, B)"
- TestLog_ASSERT TestOptObjectByRefByVal(cA, cB), IsMissingNone, "TestOptObjectByRefByVal(A, B)"
+ TestUtil.AssertEqual(TestOptObjectByRefByVal(), IsMissingAB, "TestOptObjectByRefByVal()")
+ TestUtil.AssertEqual(TestOptObjectByRefByVal(cA), IsMissingB, "TestOptObjectByRefByVal(A)")
+ TestUtil.AssertEqual(TestOptObjectByRefByVal(, cB), IsMissingA, "TestOptObjectByRefByVal(, B)")
+ TestUtil.AssertEqual(TestOptObjectByRefByVal(cA, cB), IsMissingNone, "TestOptObjectByRefByVal(A, B)")
' optionals with array datatypes
Dim aA(0 To 1) As Integer
@@ -101,24 +89,21 @@ Function verify_testIsMissingBasic() As String
Dim aB(0 To 1) As Variant
aB(0) = 123.4
aB(1) = 567.8
- TestLog_ASSERT TestOptArray(), IsMissingAB, "TestOptArray()"
- TestLog_ASSERT TestOptArray(aA), IsMissingB, "TestOptArray(A)"
- TestLog_ASSERT TestOptArray(, aB), IsMissingA, "TestOptArray(, B)"
- TestLog_ASSERT TestOptArray(aA, aB), IsMissingNone, "TestOptArray(A, B)"
+ TestUtil.AssertEqual(TestOptArray(), IsMissingAB, "TestOptArray()")
+ TestUtil.AssertEqual(TestOptArray(aA), IsMissingB, "TestOptArray(A)")
+ TestUtil.AssertEqual(TestOptArray(, aB), IsMissingA, "TestOptArray(, B)")
+ TestUtil.AssertEqual(TestOptArray(aA, aB), IsMissingNone, "TestOptArray(A, B)")
' optionals with array datatypes (ByRef and ByVal)
- TestLog_ASSERT TestOptArrayByRefByVal(), IsMissingAB, "TestOptArrayByRefByVal()"
- TestLog_ASSERT TestOptArrayByRefByVal(aA), IsMissingB, "TestOptArrayByRefByVal(A)"
- TestLog_ASSERT TestOptArrayByRefByVal(, aB), IsMissingA, "TestOptArrayByRefByVal(, B)"
- TestLog_ASSERT TestOptArrayByRefByVal(aA, aB), IsMissingNone, "TestOptArrayByRefByVal(A, B)"
-
- result = result & Chr$(10) & "Tests passed: " & passCount & Chr$(10) & "Tests failed: " & failCount & Chr$(10)
- verify_testIsMissingBasic = result
+ TestUtil.AssertEqual(TestOptArrayByRefByVal(), IsMissingAB, "TestOptArrayByRefByVal()")
+ TestUtil.AssertEqual(TestOptArrayByRefByVal(aA), IsMissingB, "TestOptArrayByRefByVal(A)")
+ TestUtil.AssertEqual(TestOptArrayByRefByVal(, aB), IsMissingA, "TestOptArrayByRefByVal(, B)")
+ TestUtil.AssertEqual(TestOptArrayByRefByVal(aA, aB), IsMissingNone, "TestOptArrayByRefByVal(A, B)")
- Exit Function
+ Exit Sub
errorHandler:
- TestLog_ASSERT False, True, Err.Description
-End Function
+ TestUtil.ReportErrorHandler("verify_testIsMissingBasic", Err, Error$, Erl)
+End Sub
Function TestOptVariant(Optional A, Optional B As Variant)
TestOptVariant = WhatIsMissing(IsMissing(A), IsMissing(B))
@@ -179,12 +164,3 @@ Function WhatIsMissing(is_missingA, is_missingB)
WhatIsMissing = IsMissingNone
End If
End Function
-
-Sub TestLog_ASSERT(actual As Variant, expected As Integer, testName As String)
- If expected = actual Then
- passCount = passCount + 1
- Else
- result = result & Chr$(10) & " Failed: " & testName & " returned " & actual & ", expected " & expected
- failCount = failCount + 1
- End If
-End Sub
\ No newline at end of file
diff --git a/basic/qa/basic_coverage/test_ismissing_cascade.vb b/basic/qa/basic_coverage/test_ismissing_cascade.vb
index ad967c7bbd81..eadce0b2b00c 100644
--- a/basic/qa/basic_coverage/test_ismissing_cascade.vb
+++ b/basic/qa/basic_coverage/test_ismissing_cascade.vb
@@ -1,36 +1,21 @@
-Dim passCount As Integer
-Dim failCount As Integer
-Dim result As String
-
Function doUnitTest() As String
- result = verify_testIsMissingCascade()
- If failCount <> 0 Or passCount = 0 Then
- doUnitTest = 0
- Else
- doUnitTest = 1
- End If
+ TestUtil.TestInit
+ verify_testIsMissingCascade
+ doUnitTest = TestUtil.GetResult()
End Function
-Function verify_testIsMissingCascade() As String
-
- passCount = 0
- failCount = 0
+Sub verify_testIsMissingCascade()
- result = "Test Results" & Chr$(10) & "============" & Chr$(10)
- testName = "Test missing (IsMissing with cascading optionals)"
On Error GoTo errorHandler
' tdf#136143 - test cascading optionals in order to prevent type conversion errors, because
' optional arguments are of type SbxERROR and set to not fixed.
- TestLog_ASSERT TestOpt(), 2, "Cascading optionals"
-
- result = result & Chr$(10) & "Tests passed: " & passCount & Chr$(10) & "Tests failed: " & failCount & Chr$(10)
- verify_testIsMissingCascade = result
+ TestUtil.AssertEqual(TestOpt(), 2, "Cascading optionals")
- Exit Function
+ Exit Sub
errorHandler:
- TestLog_ASSERT False, True, Err.Description
-End Function
+ TestUtil.ReportErrorHandler("verify_testIsMissingCascade", Err, Error$, Erl)
+End Sub
Function TestOpt(Optional A)
TestOpt = TestOptCascade(A)
@@ -40,12 +25,3 @@ Function TestOptCascade(Optional A)
If IsMissing(A) Then A = 2
TestOptCascade = A
End Function
-
-Sub TestLog_ASSERT(actual As Variant, expected As Integer, testName As String)
- If expected = actual Then
- passCount = passCount + 1
- Else
- result = result & Chr$(10) & " Failed: " & testName & " returned " & actual & ", expected " & expected
- failCount = failCount + 1
- End If
-End Sub
\ No newline at end of file
diff --git a/basic/qa/basic_coverage/test_ismissing_compatible.vb b/basic/qa/basic_coverage/test_ismissing_compatible.vb
index dbe2a815d25d..5acc0712eb0a 100644
--- a/basic/qa/basic_coverage/test_ismissing_compatible.vb
+++ b/basic/qa/basic_coverage/test_ismissing_compatible.vb
@@ -1,83 +1,70 @@
Option Compatible
-Dim passCount As Integer
-Dim failCount As Integer
-Dim result As String
-
Const IsMissingNone = -1
Const IsMissingA = 0
Const IsMissingB = 1
Const IsMissingAB = 2
Function doUnitTest() As String
- result = verify_testIsMissingCompatible()
- If failCount <> 0 Or passCount = 0 Then
- doUnitTest = 0
- Else
- doUnitTest = 1
- End If
+ TestUtil.TestInit
+ verify_testIsMissingCompatible
+ doUnitTest = TestUtil.GetResult()
End Function
' tdf#36737 - Test isMissing function with different datatypes. In LO Basic
' with option Compatible, optional parameters are allowed with default values.
' Missing optional parameters that don't have explicit default values will
' not be initialized to their default values of its datatype.
-Function verify_testIsMissingCompatible() As String
-
- passCount = 0
- failCount = 0
-
- result = "Test Results" & Chr$(10) & "============" & Chr$(10)
- testName = "Test missing (Compatible)"
+Sub verify_testIsMissingCompatible()
On Error GoTo errorHandler
' optionals with variant datatypes
- TestLog_ASSERT TestOptVariant(), IsMissingA, "TestOptVariant()"
- TestLog_ASSERT TestOptVariant(123), IsMissingNone, "TestOptVariant(123)"
- TestLog_ASSERT TestOptVariant(, 456), IsMissingA, "TestOptVariant(, 456)"
- TestLog_ASSERT TestOptVariant(123, 456), IsMissingNone, "TestOptVariant(123, 456)"
+ TestUtil.AssertEqual(TestOptVariant(), IsMissingA, "TestOptVariant()")
+ TestUtil.AssertEqual(TestOptVariant(123), IsMissingNone, "TestOptVariant(123)")
+ TestUtil.AssertEqual(TestOptVariant(, 456), IsMissingA, "TestOptVariant(, 456)")
+ TestUtil.AssertEqual(TestOptVariant(123, 456), IsMissingNone, "TestOptVariant(123, 456)")
' optionals with variant datatypes (ByRef and ByVal)
- TestLog_ASSERT TestOptVariantByRefByVal(), IsMissingA, "TestOptVariantByRefByVal()"
- TestLog_ASSERT TestOptVariantByRefByVal(123), IsMissingNone, "TestOptVariantByRefByVal(123)"
- TestLog_ASSERT TestOptVariantByRefByVal(, 456), IsMissingA, "TestOptVariantByRefByVal(, 456)"
- TestLog_ASSERT TestOptVariantByRefByVal(123, 456), IsMissingNone, "TestOptVariantByRefByVal(123, 456)"
+ TestUtil.AssertEqual(TestOptVariantByRefByVal(), IsMissingA, "TestOptVariantByRefByVal()")
+ TestUtil.AssertEqual(TestOptVariantByRefByVal(123), IsMissingNone, "TestOptVariantByRefByVal(123)")
+ TestUtil.AssertEqual(TestOptVariantByRefByVal(, 456), IsMissingA, "TestOptVariantByRefByVal(, 456)")
+ TestUtil.AssertEqual(TestOptVariantByRefByVal(123, 456), IsMissingNone, "TestOptVariantByRefByVal(123, 456)")
' optionals with double datatypes
- TestLog_ASSERT TestOptDouble(), IsMissingA, "TestOptDouble()"
- TestLog_ASSERT TestOptDouble(123.4), IsMissingNone, "TestOptDouble(123.4)"
- TestLog_ASSERT TestOptDouble(, 567.8), IsMissingA, "TestOptDouble(, 567.8)"
- TestLog_ASSERT TestOptDouble(123.4, 567.8), IsMissingNone, "TestOptDouble(123.4, 567.8)"
+ TestUtil.AssertEqual(TestOptDouble(), IsMissingA, "TestOptDouble()")
+ TestUtil.AssertEqual(TestOptDouble(123.4), IsMissingNone, "TestOptDouble(123.4)")
+ TestUtil.AssertEqual(TestOptDouble(, 567.8), IsMissingA, "TestOptDouble(, 567.8)")
+ TestUtil.AssertEqual(TestOptDouble(123.4, 567.8), IsMissingNone, "TestOptDouble(123.4, 567.8)")
' optionals with double datatypes (ByRef and ByVal)
- TestLog_ASSERT TestOptDoubleByRefByVal(), IsMissingA, "TestOptDouble()"
- TestLog_ASSERT TestOptDoubleByRefByVal(123.4), IsMissingNone, "TestOptDouble(123.4)"
- TestLog_ASSERT TestOptDoubleByRefByVal(, 567.8), IsMissingA, "TestOptDoubleByRefByVal(, 567.8)"
- TestLog_ASSERT TestOptDoubleByRefByVal(123.4, 567.8), IsMissingNone, "TestOptDoubleByRefByVal(123.4, 567.8)"
+ TestUtil.AssertEqual(TestOptDoubleByRefByVal(), IsMissingA, "TestOptDouble()")
+ TestUtil.AssertEqual(TestOptDoubleByRefByVal(123.4), IsMissingNone, "TestOptDouble(123.4)")
+ TestUtil.AssertEqual(TestOptDoubleByRefByVal(, 567.8), IsMissingA, "TestOptDoubleByRefByVal(, 567.8)")
+ TestUtil.AssertEqual(TestOptDoubleByRefByVal(123.4, 567.8), IsMissingNone, "TestOptDoubleByRefByVal(123.4, 567.8)")
' optionals with integer datatypes
- TestLog_ASSERT TestOptInteger(), IsMissingA, "TestOptInteger()"
- TestLog_ASSERT TestOptInteger(123), IsMissingNone, "TestOptInteger(123)"
- TestLog_ASSERT TestOptInteger(, 456), IsMissingA, "TestOptInteger(, 456)"
- TestLog_ASSERT TestOptInteger(123, 456), IsMissingNone, "TestOptInteger(123, 456)"
+ TestUtil.AssertEqual(TestOptInteger(), IsMissingA, "TestOptInteger()")
+ TestUtil.AssertEqual(TestOptInteger(123), IsMissingNone, "TestOptInteger(123)")
+ TestUtil.AssertEqual(TestOptInteger(, 456), IsMissingA, "TestOptInteger(, 456)")
+ TestUtil.AssertEqual(TestOptInteger(123, 456), IsMissingNone, "TestOptInteger(123, 456)")
' optionals with integer datatypes (ByRef and ByVal)
- TestLog_ASSERT TestOptIntegerByRefByVal(), IsMissingA, "TestOptIntegerByRefByVal()"
- TestLog_ASSERT TestOptIntegerByRefByVal(123), IsMissingNone, "TestOptIntegerByRefByVal(123)"
- TestLog_ASSERT TestOptIntegerByRefByVal(, 456), IsMissingA, "TestOptIntegerByRefByVal(, 456)"
- TestLog_ASSERT TestOptIntegerByRefByVal(123, 456), IsMissingNone, "TestOptIntegerByRefByVal(123, 456)"
+ TestUtil.AssertEqual(TestOptIntegerByRefByVal(), IsMissingA, "TestOptIntegerByRefByVal()")
+ TestUtil.AssertEqual(TestOptIntegerByRefByVal(123), IsMissingNone, "TestOptIntegerByRefByVal(123)")
+ TestUtil.AssertEqual(TestOptIntegerByRefByVal(, 456), IsMissingA, "TestOptIntegerByRefByVal(, 456)")
+ TestUtil.AssertEqual(TestOptIntegerByRefByVal(123, 456), IsMissingNone, "TestOptIntegerByRefByVal(123, 456)")
' optionals with string datatypes
- TestLog_ASSERT TestOptString(), IsMissingA, "TestOptString()"
- TestLog_ASSERT TestOptString("123"), IsMissingNone, "TestOptString(""123"")"
- TestLog_ASSERT TestOptString(, "456"), IsMissingA, "TestOptString(, ""456"")"
- TestLog_ASSERT TestOptString("123", "456"), IsMissingNone, "TestOptString(""123"", ""456"")"
+ TestUtil.AssertEqual(TestOptString(), IsMissingA, "TestOptString()")
+ TestUtil.AssertEqual(TestOptString("123"), IsMissingNone, "TestOptString(""123"")")
+ TestUtil.AssertEqual(TestOptString(, "456"), IsMissingA, "TestOptString(, ""456"")")
+ TestUtil.AssertEqual(TestOptString("123", "456"), IsMissingNone, "TestOptString(""123"", ""456"")")
' optionals with string datatypes (ByRef and ByVal)
- TestLog_ASSERT TestOptStringByRefByVal(), IsMissingA, "TestOptStringByRefByVal()"
- TestLog_ASSERT TestOptStringByRefByVal("123"), IsMissingNone, "TestOptStringByRefByVal(""123"")"
- TestLog_ASSERT TestOptStringByRefByVal(, "456"), IsMissingA, "TestOptStringByRefByVal(, ""456"")"
- TestLog_ASSERT TestOptStringByRefByVal("123", "456"), IsMissingNone, "TestOptStringByRefByVal(""123"", ""456"")"
+ TestUtil.AssertEqual(TestOptStringByRefByVal(), IsMissingA, "TestOptStringByRefByVal()")
+ TestUtil.AssertEqual(TestOptStringByRefByVal("123"), IsMissingNone, "TestOptStringByRefByVal(""123"")")
+ TestUtil.AssertEqual(TestOptStringByRefByVal(, "456"), IsMissingA, "TestOptStringByRefByVal(, ""456"")")
+ TestUtil.AssertEqual(TestOptStringByRefByVal("123", "456"), IsMissingNone, "TestOptStringByRefByVal(""123"", ""456"")")
' optionals with object datatypes
Dim cA As New Collection
@@ -86,16 +73,16 @@ Function verify_testIsMissingCompatible() As String
Dim cB As New Collection
cB.Add (123.4)
cB.Add (567.8)
- TestLog_ASSERT TestOptObject(), IsMissingAB, "TestOptObject()"
- TestLog_ASSERT TestOptObject(cA), IsMissingB, "TestOptObject(A)"
- TestLog_ASSERT TestOptObject(, cB), IsMissingA, "TestOptObject(, B)"
- TestLog_ASSERT TestOptObject(cA, cB), IsMissingNone, "TestOptObject(A, B)"
+ TestUtil.AssertEqual(TestOptObject(), IsMissingAB, "TestOptObject()")
+ TestUtil.AssertEqual(TestOptObject(cA), IsMissingB, "TestOptObject(A)")
+ TestUtil.AssertEqual(TestOptObject(, cB), IsMissingA, "TestOptObject(, B)")
+ TestUtil.AssertEqual(TestOptObject(cA, cB), IsMissingNone, "TestOptObject(A, B)")
' optionals with object datatypes (ByRef and ByVal)
- TestLog_ASSERT TestOptObjectByRefByVal(), IsMissingAB, "TestOptObjectByRefByVal()"
- TestLog_ASSERT TestOptObjectByRefByVal(cA), IsMissingB, "TestOptObjectByRefByVal(A)"
- TestLog_ASSERT TestOptObjectByRefByVal(, cB), IsMissingA, "TestOptObjectByRefByVal(, B)"
- TestLog_ASSERT TestOptObjectByRefByVal(cA, cB), IsMissingNone, "TestOptObjectByRefByVal(A, B)"
+ TestUtil.AssertEqual(TestOptObjectByRefByVal(), IsMissingAB, "TestOptObjectByRefByVal()")
+ TestUtil.AssertEqual(TestOptObjectByRefByVal(cA), IsMissingB, "TestOptObjectByRefByVal(A)")
+ TestUtil.AssertEqual(TestOptObjectByRefByVal(, cB), IsMissingA, "TestOptObjectByRefByVal(, B)")
+ TestUtil.AssertEqual(TestOptObjectByRefByVal(cA, cB), IsMissingNone, "TestOptObjectByRefByVal(A, B)")
' optionals with array datatypes
Dim aA(0 To 1) As Integer
@@ -104,24 +91,21 @@ Function verify_testIsMissingCompatible() As String
Dim aB(0 To 1) As Variant
aB(0) = 123.4
aB(1) = 567.8
- TestLog_ASSERT TestOptArray(), IsMissingAB, "TestOptArray()"
- TestLog_ASSERT TestOptArray(aA), IsMissingB, "TestOptArray(A)"
- TestLog_ASSERT TestOptArray(, aB), IsMissingA, "TestOptArray(, B)"
- TestLog_ASSERT TestOptArray(aA, aB), IsMissingNone, "TestOptArray(A, B)"
+ TestUtil.AssertEqual(TestOptArray(), IsMissingAB, "TestOptArray()")
+ TestUtil.AssertEqual(TestOptArray(aA), IsMissingB, "TestOptArray(A)")
+ TestUtil.AssertEqual(TestOptArray(, aB), IsMissingA, "TestOptArray(, B)")
+ TestUtil.AssertEqual(TestOptArray(aA, aB), IsMissingNone, "TestOptArray(A, B)")
' optionals with array datatypes (ByRef and ByVal)
- TestLog_ASSERT TestOptArrayByRefByVal(), IsMissingAB, "TestOptArrayByRefByVal()"
- TestLog_ASSERT TestOptArrayByRefByVal(aA), IsMissingB, "TestOptArrayByRefByVal(A)"
- TestLog_ASSERT TestOptArrayByRefByVal(, aB), IsMissingA, "TestOptArrayByRefByVal(, B)"
- TestLog_ASSERT TestOptArrayByRefByVal(aA, aB), IsMissingNone, "TestOptArrayByRefByVal(A, B)"
+ TestUtil.AssertEqual(TestOptArrayByRefByVal(), IsMissingAB, "TestOptArrayByRefByVal()")
+ TestUtil.AssertEqual(TestOptArrayByRefByVal(aA), IsMissingB, "TestOptArrayByRefByVal(A)")
+ TestUtil.AssertEqual(TestOptArrayByRefByVal(, aB), IsMissingA, "TestOptArrayByRefByVal(, B)")
+ TestUtil.AssertEqual(TestOptArrayByRefByVal(aA, aB), IsMissingNone, "TestOptArrayByRefByVal(A, B)")
- result = result & Chr$(10) & "Tests passed: " & passCount & Chr$(10) & "Tests failed: " & failCount & Chr$(10)
- verify_testIsMissingCompatible = result
-
- Exit Function
+ Exit Sub
errorHandler:
- TestLog_ASSERT False, True, Err.Description
-End Function
+ TestUtil.ReportErrorHandler("verify_testIsMissingCompatible", Err, Error$, Erl)
+End Sub
Function TestOptVariant(Optional A, Optional B As Variant = 123)
TestOptVariant = WhatIsMissing(IsMissing(A), IsMissing(B))
@@ -182,12 +166,3 @@ Function WhatIsMissing(is_missingA, is_missingB)
WhatIsMissing = IsMissingNone
End If
End Function
-
-Sub TestLog_ASSERT(actual As Variant, expected As Variant, testName As String)
- If expected = actual Then
- passCount = passCount + 1
- Else
- result = result & Chr$(10) & " Failed: " & testName & " returned " & actual & ", expected " & expected
- failCount = failCount + 1
- End If
-End Sub
\ No newline at end of file
diff --git a/basic/qa/basic_coverage/test_isnull_method.vb b/basic/qa/basic_coverage/test_isnull_method.vb
index 0d9044d8f0d4..8378f9691ac1 100644
--- a/basic/qa/basic_coverage/test_isnull_method.vb
+++ b/basic/qa/basic_coverage/test_isnull_method.vb
@@ -6,13 +6,13 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
dim aVariant as Variant
aVariant = Null
' ISNULL
If ( IsNull( aVariant ) = False ) Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
Else
- doUnitTest = 1
+ doUnitTest = "OK"
End If
End Function
diff --git a/basic/qa/basic_coverage/test_isnumeric_method.vb b/basic/qa/basic_coverage/test_isnumeric_method.vb
index d3b614f564bd..db947dbe7044 100644
--- a/basic/qa/basic_coverage/test_isnumeric_method.vb
+++ b/basic/qa/basic_coverage/test_isnumeric_method.vb
@@ -6,13 +6,13 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
dim aVariant as Variant
aVariant = 3
' ISNUMERIC
If ( IsNumeric( aVariant ) = False ) Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
Else
- doUnitTest = 1
+ doUnitTest = "OK"
End If
End Function
diff --git a/basic/qa/basic_coverage/test_isobject_method.vb b/basic/qa/basic_coverage/test_isobject_method.vb
index bb5e270b3dfb..f9690722cb6d 100644
--- a/basic/qa/basic_coverage/test_isobject_method.vb
+++ b/basic/qa/basic_coverage/test_isobject_method.vb
@@ -6,12 +6,12 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
dim aVariant as Object
' ISOBJECT
If ( IsObject( aVariant ) = False ) Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
Else
- doUnitTest = 1
+ doUnitTest = "OK"
End If
End Function
diff --git a/basic/qa/basic_coverage/test_isunostruct_method.vb b/basic/qa/basic_coverage/test_isunostruct_method.vb
index ac45f1961f7e..44d5a5079834 100644
--- a/basic/qa/basic_coverage/test_isunostruct_method.vb
+++ b/basic/qa/basic_coverage/test_isunostruct_method.vb
@@ -6,12 +6,12 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
dim aVariant as Object
' ISUNOSTRUCT
If ( IsUnoStruct( aVariant ) ) Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
Else
- doUnitTest = 1
+ doUnitTest = "OK"
End If
End Function
diff --git a/basic/qa/basic_coverage/test_join_method.vb b/basic/qa/basic_coverage/test_join_method.vb
index 236062516826..9554d12e8cf0 100644
--- a/basic/qa/basic_coverage/test_join_method.vb
+++ b/basic/qa/basic_coverage/test_join_method.vb
@@ -5,14 +5,14 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
' Join
Dim aStrings(2) as String
aStrings(0) = "Hello"
aStrings(1) = "world"
If ( Join( aStrings, " " ) <> "Hello world " ) Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
Else
- doUnitTest = 1
+ doUnitTest = "OK"
End If
End Function
diff --git a/basic/qa/basic_coverage/test_lbound_method.vb b/basic/qa/basic_coverage/test_lbound_method.vb
index b7a91fd3f106..954fa94e4f60 100644
--- a/basic/qa/basic_coverage/test_lbound_method.vb
+++ b/basic/qa/basic_coverage/test_lbound_method.vb
@@ -6,14 +6,14 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
dim aVector as Variant
' ARRAY
aVector = Array( "Hello", -3.14)
' LBOUND
If ( LBound( aVector() ) <> 0 ) Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
Else
- doUnitTest = 1
+ doUnitTest = "OK"
End If
End Function
diff --git a/basic/qa/basic_coverage/test_lcase_method.vb b/basic/qa/basic_coverage/test_lcase_method.vb
index 65df764ef6d5..ec0ab07d2956 100644
--- a/basic/qa/basic_coverage/test_lcase_method.vb
+++ b/basic/qa/basic_coverage/test_lcase_method.vb
@@ -5,13 +5,13 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
dim aString as Variant
aString = "Hello"
' LCASE
If ( LCase( aString ) <> "hello" ) Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
Else
- doUnitTest = 1
+ doUnitTest = "OK"
End If
End Function
diff --git a/basic/qa/basic_coverage/test_len_method.vb b/basic/qa/basic_coverage/test_len_method.vb
index 0a7e1abf2ceb..988510add0c2 100644
--- a/basic/qa/basic_coverage/test_len_method.vb
+++ b/basic/qa/basic_coverage/test_len_method.vb
@@ -5,13 +5,13 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
dim aString as Variant
aString = "Hello"
' LEN
If ( Len( aString ) <> 5 ) Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
Else
- doUnitTest = 1
+ doUnitTest = "OK"
End If
End Function
diff --git a/basic/qa/basic_coverage/test_lenb_method.vb b/basic/qa/basic_coverage/test_lenb_method.vb
index 550b8313afec..a3096c819f7b 100644
--- a/basic/qa/basic_coverage/test_lenb_method.vb
+++ b/basic/qa/basic_coverage/test_lenb_method.vb
@@ -5,13 +5,13 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
dim aString as Variant
aString = "Hello"
' LENB
If ( LenB( aString ) <> 5 ) Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
Else
- doUnitTest = 1
+ doUnitTest = "OK"
End If
End Function
diff --git a/basic/qa/basic_coverage/test_logexp_methods.vb b/basic/qa/basic_coverage/test_logexp_methods.vb
index 00db9983754a..45ddeb16855b 100644
--- a/basic/qa/basic_coverage/test_logexp_methods.vb
+++ b/basic/qa/basic_coverage/test_logexp_methods.vb
@@ -5,11 +5,11 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
' EXP LOG
If ( Log( Exp(1) ) <> 1 ) Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
Else
- doUnitTest = 1
+ doUnitTest = "OK"
End If
End Function
diff --git a/basic/qa/basic_coverage/test_ltrim_method.vb b/basic/qa/basic_coverage/test_ltrim_method.vb
index 562193c8b036..f3be267dbeb1 100644
--- a/basic/qa/basic_coverage/test_ltrim_method.vb
+++ b/basic/qa/basic_coverage/test_ltrim_method.vb
@@ -5,13 +5,13 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
dim aString as Variant
aString = "Hello"
' LTRIM
If ( LTrim( " Hello" ) <> aString ) Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
Else
- doUnitTest = 1
+ doUnitTest = "OK"
End If
End Function
diff --git a/basic/qa/basic_coverage/test_method_name_variable.vb b/basic/qa/basic_coverage/test_method_name_variable.vb
index ea45366c0f7d..5f3689ad8752 100644
--- a/basic/qa/basic_coverage/test_method_name_variable.vb
+++ b/basic/qa/basic_coverage/test_method_name_variable.vb
@@ -20,9 +20,9 @@ Function assignVarToMethod() As Integer
End Function
-Function doUnitTest() As Integer
+Function doUnitTest() As String
- doUnitTest = 0
+ doUnitTest = "FAIL"
' tdf#85371 - check if the name of the method can be used as a variable in certain statements
If (assignVarToMethod() <> 6) Then Exit Function
@@ -30,6 +30,6 @@ Function doUnitTest() As Integer
assignVarToMethod = 0
If (assignVarToMethod() <> 6) Then Exit Function
- doUnitTest = 1
+ doUnitTest = "OK"
End Function
diff --git a/basic/qa/basic_coverage/test_mid_CountNegative_3args.vb b/basic/qa/basic_coverage/test_mid_CountNegative_3args.vb
index d67370626165..01d1cd998217 100644
--- a/basic/qa/basic_coverage/test_mid_CountNegative_3args.vb
+++ b/basic/qa/basic_coverage/test_mid_CountNegative_3args.vb
@@ -6,10 +6,10 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
If (Mid("abc", 5, -3) = "") Then
- doUnitTest = 1
+ doUnitTest = "OK"
Else
- doUnitTest = 0
+ doUnitTest = "FAIL"
End If
End Function
diff --git a/basic/qa/basic_coverage/test_mid_EndOutOfBounds_3args.vb b/basic/qa/basic_coverage/test_mid_EndOutOfBounds_3args.vb
index f54ee9444f30..04bf521a9f68 100644
--- a/basic/qa/basic_coverage/test_mid_EndOutOfBounds_3args.vb
+++ b/basic/qa/basic_coverage/test_mid_EndOutOfBounds_3args.vb
@@ -6,10 +6,10 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
If (Mid("abc", 1, 4) = "abc") Then
- doUnitTest = 1
+ doUnitTest = "OK"
Else
- doUnitTest = 0
+ doUnitTest = "FAIL"
End If
End Function
diff --git a/basic/qa/basic_coverage/test_mid_StartOutOfBounds_2args.vb b/basic/qa/basic_coverage/test_mid_StartOutOfBounds_2args.vb
index 5ab01f987bc7..29f489981e45 100644
--- a/basic/qa/basic_coverage/test_mid_StartOutOfBounds_2args.vb
+++ b/basic/qa/basic_coverage/test_mid_StartOutOfBounds_2args.vb
@@ -6,10 +6,10 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
If (Mid("abc", 5) = "") Then
- doUnitTest = 1
+ doUnitTest = "OK"
Else
- doUnitTest = 0
+ doUnitTest = "FAIL"
End If
End Function
diff --git a/basic/qa/basic_coverage/test_mid_StartOutOfBounds_3args.vb b/basic/qa/basic_coverage/test_mid_StartOutOfBounds_3args.vb
index 9c623ce5106f..a38c73153574 100644
--- a/basic/qa/basic_coverage/test_mid_StartOutOfBounds_3args.vb
+++ b/basic/qa/basic_coverage/test_mid_StartOutOfBounds_3args.vb
@@ -6,10 +6,10 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
If (Mid("abc", 5, 1) = "") Then
- doUnitTest = 1
+ doUnitTest = "OK"
Else
- doUnitTest = 0
+ doUnitTest = "FAIL"
End If
End Function
diff --git a/basic/qa/basic_coverage/test_mid_firstletter_3args.vb b/basic/qa/basic_coverage/test_mid_firstletter_3args.vb
index 72c65099f7fa..bdc3ea687961 100644
--- a/basic/qa/basic_coverage/test_mid_firstletter_3args.vb
+++ b/basic/qa/basic_coverage/test_mid_firstletter_3args.vb
@@ -6,10 +6,10 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
If (Mid("abc", 1, 1) = "a") Then
- doUnitTest = 1
+ doUnitTest = "OK"
Else
- doUnitTest = 0
+ doUnitTest = "FAIL"
End If
End Function
diff --git a/basic/qa/basic_coverage/test_mid_replace_less.vb b/basic/qa/basic_coverage/test_mid_replace_less.vb
index 27a02382c3fd..00885638871f 100644
--- a/basic/qa/basic_coverage/test_mid_replace_less.vb
+++ b/basic/qa/basic_coverage/test_mid_replace_less.vb
@@ -8,12 +8,12 @@
' cf. <https://bugs.documentfoundation.org/show_bug.cgi?id=62090> "Mid statement doesn't work as
' expected":
-Function doUnitTest as Integer
+Function doUnitTest as String
s = "The lightbrown fox"
Mid(s, 5, 10, "lazy")
If (s = "The lazy fox") Then
- doUnitTest = 1
+ doUnitTest = "OK"
Else
- doUnitTest = 0
+ doUnitTest = "FAIL"
End If
End Function
diff --git a/basic/qa/basic_coverage/test_mid_replace_more.vb b/basic/qa/basic_coverage/test_mid_replace_more.vb
index 880a3f2008de..40b9ac33792a 100644
--- a/basic/qa/basic_coverage/test_mid_replace_more.vb
+++ b/basic/qa/basic_coverage/test_mid_replace_more.vb
@@ -8,12 +8,12 @@
' cf. examples at <https://docs.microsoft.com/en-us/dotnet/visual-basic/language-reference/
' statements/mid-statement>:
-Function doUnitTest as Integer
+Function doUnitTest as String
s = "The fox jumps"
Mid(s, 5, 3, "duck")
If (s = "The duc jumps") Then
- doUnitTest = 1
+ doUnitTest = "OK"
Else
- doUnitTest = 0
+ doUnitTest = "FAIL"
End If
End Function
diff --git a/basic/qa/basic_coverage/test_mid_replace_more_end.vb b/basic/qa/basic_coverage/test_mid_replace_more_end.vb
index c5d26a46a8db..593cf1abb0fc 100644
--- a/basic/qa/basic_coverage/test_mid_replace_more_end.vb
+++ b/basic/qa/basic_coverage/test_mid_replace_more_end.vb
@@ -8,12 +8,12 @@
' cf. examples at <https://docs.microsoft.com/en-us/dotnet/visual-basic/language-reference/
' statements/mid-statement>:
-Function doUnitTest as Integer
+Function doUnitTest as String
s = "The fox jumps"
Mid(s, 5, 100, "cow jumped over")
If (s = "The cow jumpe") Then
- doUnitTest = 1
+ doUnitTest = "OK"
Else
- doUnitTest = 0
+ doUnitTest = "FAIL"
End If
End Function
diff --git a/basic/qa/basic_coverage/test_mid_sub2letters_2args.vb b/basic/qa/basic_coverage/test_mid_sub2letters_2args.vb
index 76c5360d8bc8..88ec1a8f2b3e 100644
--- a/basic/qa/basic_coverage/test_mid_sub2letters_2args.vb
+++ b/basic/qa/basic_coverage/test_mid_sub2letters_2args.vb
@@ -6,10 +6,10 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
If (Mid("abc", 2) = "bc") Then
- doUnitTest = 1
+ doUnitTest = "OK"
Else
- doUnitTest = 0
+ doUnitTest = "FAIL"
End If
End Function
diff --git a/basic/qa/basic_coverage/test_minute_method.vb b/basic/qa/basic_coverage/test_minute_method.vb
index 0f1230462242..5c4f7d5ceba1 100644
--- a/basic/qa/basic_coverage/test_minute_method.vb
+++ b/basic/qa/basic_coverage/test_minute_method.vb
@@ -6,11 +6,11 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
' MINUTE
If ( Minute(TimeSerial(12,30,41)) <> 30 ) Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
Else
- doUnitTest = 1
+ doUnitTest = "OK"
End If
End Function
diff --git a/basic/qa/basic_coverage/test_mod_operator.vb b/basic/qa/basic_coverage/test_mod_operator.vb
index 006d97558052..5692e7bb50fc 100644
--- a/basic/qa/basic_coverage/test_mod_operator.vb
+++ b/basic/qa/basic_coverage/test_mod_operator.vb
@@ -6,9 +6,9 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
- doUnitTest = 0
+ doUnitTest = "FAIL"
Dim a As Double, b as Double
a = 16.4
@@ -20,6 +20,6 @@ Function doUnitTest as Integer
if (15.9 MOD 6.4 <> 4) Then Exit Function
if (2147483647.4 MOD 4 <> 3) Then Exit Function
- doUnitTest = 1
+ doUnitTest = "OK"
End Function
diff --git a/basic/qa/basic_coverage/test_month_method.vb b/basic/qa/basic_coverage/test_month_method.vb
index 38d8ae4062a2..876015598e6e 100644
--- a/basic/qa/basic_coverage/test_month_method.vb
+++ b/basic/qa/basic_coverage/test_month_method.vb
@@ -6,13 +6,13 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
dim aDate as Date
aDate = Date()
' MONTH
If ( DatePart( "m", aDate ) <> Month( aDate ) ) Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
Else
- doUnitTest = 1
+ doUnitTest = "OK"
End If
End Function
diff --git a/basic/qa/basic_coverage/test_nowtimevalue_methods.vb b/basic/qa/basic_coverage/test_nowtimevalue_methods.vb
index 42dce2fc66fb..e01c697165a6 100644
--- a/basic/qa/basic_coverage/test_nowtimevalue_methods.vb
+++ b/basic/qa/basic_coverage/test_nowtimevalue_methods.vb
@@ -6,15 +6,15 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
dim aDate as Date
dim aTime as Date
aDate = Date()
aTime = Time()
' NOW TIMEVALUE
If ( Now() < aDate + TimeValue(aTime) ) Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
Else
- doUnitTest = 1
+ doUnitTest = "OK"
End If
End Function
diff --git a/basic/qa/basic_coverage/test_numeric_constant_parameter.vb b/basic/qa/basic_coverage/test_numeric_constant_parameter.vb
index 96a7e8f9c4fd..f183936de09d 100644
--- a/basic/qa/basic_coverage/test_numeric_constant_parameter.vb
+++ b/basic/qa/basic_coverage/test_numeric_constant_parameter.vb
@@ -18,17 +18,17 @@ Function assignLong( numericConstant ) As String
assignLong = TypeName( numericConstant )
End Function
-Function doUnitTest() As Integer
+Function doUnitTest() As String
' tdf#133913 - check if numeric constants are converted correctly to
' their respective types, if they are passed as arguments to a function
' with variant parameter types.
On Error GoTo errorHandler
If (assignInteger( 1 ) = "Integer" And assignLong( 1 ) = "Long") Then
- doUnitTest = 1
+ doUnitTest = "OK"
Else
- doUnitTest = 0
+ doUnitTest = "FAIL"
End If
Exit Function
errorHandler:
- doUnitTest = 0
-End Function
\ No newline at end of file
+ doUnitTest = "FAIL"
+End Function
diff --git a/basic/qa/basic_coverage/test_oct_method.vb b/basic/qa/basic_coverage/test_oct_method.vb
index 4c610539de3e..d6d69d7edc5d 100644
--- a/basic/qa/basic_coverage/test_oct_method.vb
+++ b/basic/qa/basic_coverage/test_oct_method.vb
@@ -5,11 +5,11 @@
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
-Function doUnitTest as Integer
+Function doUnitTest as String
' OCT
If ( Oct(100) <> "144" ) Then
- doUnitTest = 0
+ doUnitTest = "FAIL"
Else
- doUnitTest = 1
+ doUnitTest = "OK"
End If
End Function
diff --git a/basic/qa/basic_coverage/test_option_base.vb b/basic/qa/basic_coverage/test_option_base.vb
index fff5858a4ee6..3195908ca18a 100644
--- a/basic/qa/basic_coverage/test_option_base.vb
+++ b/basic/qa/basic_coverage/test_option_base.vb
@@ -1,60 +1,42 @@
Option Base 1
-Dim passCount As Integer
-Dim failCount As Integer
-Dim result As String
-
Function doUnitTest() As String
- result = verify_optionBase()
- If failCount <> 0 Or passCount = 0 Then
- doUnitTest = 0
- Else
- doUnitTest = 1
- End If
+ TestUtil.TestInit
+ verify_optionBase
+ doUnitTest = TestUtil.GetResult()
End Function
-Function verify_optionBase() As String
- passCount = 0
- failCount = 0
-
- result = "Test Results" & Chr$(10) & "============" & Chr$(10)
+Sub verify_optionBase() As String
+ On Error GoTo errorHandler
' tdf#54912 - with option base arrays should start at index 1.
' Without option compatible the upper bound is changed as well (#109275).
Dim strArray(2) As String
- TestLog_ASSERT LBound(strArray), 1, "Lower bound of a string array (before assignment): " & LBound(strArray)
- TestLog_ASSERT UBound(strArray), 3, "Upper bound of a string array (before assignment): " & UBound(strArray)
+ TestUtil.AssertEqual(LBound(strArray), 1, "Lower bound of a string array (before assignment): " & LBound(strArray))
+ TestUtil.AssertEqual(UBound(strArray), 3, "Upper bound of a string array (before assignment): " & UBound(strArray))
strArray = Array("a", "b")
- TestLog_ASSERT LBound(strArray), 1, "Lower bound of a string array (after assignment): " & LBound(strArray)
- TestLog_ASSERT UBound(strArray), 2, "Upper bound of a string array (after assignment): " & UBound(strArray)
+ TestUtil.AssertEqual(LBound(strArray), 1, "Lower bound of a string array (after assignment): " & LBound(strArray))
+ TestUtil.AssertEqual(UBound(strArray), 2, "Upper bound of a string array (after assignment): " & UBound(strArray))
Dim intArray(2) As Integer
- TestLog_ASSERT LBound(intArray), 1, "Lower bound of an integer array (before assignment): " & LBound(intArray)
- TestLog_ASSERT UBound(intArray), 3, "Upper bound of an integer array (before assignment): " & UBound(intArray)
+ TestUtil.AssertEqual(LBound(intArray), 1, "Lower bound of an integer array (before assignment): " & LBound(intArray))
+ TestUtil.AssertEqual(UBound(intArray), 3, "Upper bound of an integer array (before assignment): " & UBound(intArray))
intArray = Array(1, 2)
- TestLog_ASSERT LBound(intArray), 1, "Lower bound of an integer array (after assignment): " & LBound(intArray)
- TestLog_ASSERT UBound(intArray), 2, "Upper bound of an integer array (after assignment): " & UBound(intArray)
+ TestUtil.AssertEqual(LBound(intArray), 1, "Lower bound of an integer array (after assignment): " & LBound(intArray))
+ TestUtil.AssertEqual(UBound(intArray), 2, "Upper bound of an integer array (after assignment): " & UBound(intArray))
Dim byteArray(2) As Byte
- TestLog_ASSERT LBound(byteArray), 1, "Lower bound of a byte array (before assignment): " & LBound(byteArray)
- TestLog_ASSERT UBound(byteArray), 3, "Upper bound of a byte array (before assignment): " & UBound(byteArray)
+ TestUtil.AssertEqual(LBound(byteArray), 1, "Lower bound of a byte array (before assignment): " & LBound(byteArray))
+ TestUtil.AssertEqual(UBound(byteArray), 3, "Upper bound of a byte array (before assignment): " & UBound(byteArray))
byteArray = StrConv("ab", 128)
- TestLog_ASSERT LBound(byteArray), 1, "Lower bound of a byte array (StrConv): " & LBound(byteArray)
- TestLog_ASSERT UBound(byteArray), 2, "Upper bound of a byte array (StrConv): " & UBound(byteArray)
+ TestUtil.AssertEqual(LBound(byteArray), 1, "Lower bound of a byte array (StrConv): " & LBound(byteArray))
+ TestUtil.AssertEqual(UBound(byteArray), 2, "Upper bound of a byte array (StrConv): " & UBound(byteArray))
ReDim byteArray(3)
- TestLog_ASSERT LBound(byteArray), 1, "Lower bound of a byte array (ReDim): " & LBound(byteArray)
- TestLog_ASSERT UBound(byteArray), 4, "Upper bound of a byte array (ReDim): " & UBound(byteArray)
-
- result = result & Chr$(10) & "Tests passed: " & passCount & Chr$(10) & "Tests failed: " & failCount & Chr$(10)
- verify_optionBase = result
-End Function
+ TestUtil.AssertEqual(LBound(byteArray), 1, "Lower bound of a byte array (ReDim): " & LBound(byteArray))
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list