VBA tests repair (2) - don't pass the test when all tests fail

Change-Id: I2519fc54e2ce74ec3c6777aa002971548a21c3c6
Reviewed-on: https://gerrit.libreoffice.org/45715
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Zdenek Crhonek <zcrhonek@gmail.com>
This commit is contained in:
Zdeněk Crhonek
2017-12-02 15:55:07 +01:00
committed by Zdenek Crhonek
parent bd7776f963
commit 2bfbe3492d
4 changed files with 14 additions and 14 deletions

View File

@@ -6,7 +6,7 @@ Dim result As String
Function doUnitTest() As String
result = verify_testDatePart()
If failCount <> 0 And passCount > 0 Then
If failCount <> 0 or passCount = 0 Then
doUnitTest = result
Else
doUnitTest = "OK"
@@ -29,39 +29,39 @@ Function verify_testDatePart() As String
On Error GoTo errorHandler
date2 = 1969
date1 = DatePart("yyyy", "12.2.1969")
date1 = DatePart("yyyy", "1969-02-12")
TestLog_ASSERT date1 = date2, "the return DatePart is: " & date1
date2 = 1
date1 = DatePart("q", "12.2.1969")
date1 = DatePart("q", "1969-02-12")
TestLog_ASSERT date1 = date2, "the return DatePart is: " & date1
date2 = 43
date1 = DatePart("y", "12.2.1969")
date1 = DatePart("y", "1969-02-12")
TestLog_ASSERT date1 = date2, "the return DatePart is: " & date1
date2 = 12
date1 = DatePart("d", "12.2.1969")
date1 = DatePart("d", "1969-02-12")
TestLog_ASSERT date1 = date2, "the return DatePart is: " & date1
date2 = 4
date1 = DatePart("w", "12.2.1969")
date1 = DatePart("w", "1969-02-12")
TestLog_ASSERT date1 = date2, "the return DatePart is: " & date1
date2 = 7
date1 = DatePart("ww", "12.2.1969")
date1 = DatePart("ww", "1969-02-12")
TestLog_ASSERT date1 = date2, "the return DatePart is: " & date1
date2 = 16
date1 = DatePart("h", "12.2.1969 16:32:00")
date1 = DatePart("h", "1969-02-12 16:32:00")
TestLog_ASSERT date1 = date2, "the return DatePart is: " & date1
date2 = 32
date1 = DatePart("n", "12.2.1969 16:32:00")
date1 = DatePart("n", "1969-02-12 16:32:00")
TestLog_ASSERT date1 = date2, "the return DatePart is: " & date1
date2 = 0
date1 = DatePart("s", "12.2.1969 16:32:00")
date1 = DatePart("s", "1969-02-12 16:32:00")
TestLog_ASSERT date1 = date2, "the return DatePart is: " & date1

View File

@@ -6,7 +6,7 @@ Dim result As String
Function doUnitTest() As String
result = verify_testday()
If failCount <> 0 And passCount > 0 Then
If failCount <> 0 or passCount = 0 Then
doUnitTest = result
Else
doUnitTest = "OK"
@@ -28,7 +28,7 @@ Function verify_testday() As String
On Error GoTo errorHandler
date2 = 12
date1 = Day("12.2.1969") '2/12/1969
date1 = Day("1969-02-12") '2/12/1969
TestLog_ASSERT date1 = date2, "the return day is: " & date1
result = result & Chr$(10) & "Tests passed: " & passCount & Chr$(10) & "Tests failed: " & failCount & Chr$(10)

View File

@@ -6,7 +6,7 @@ Dim result As String
Function doUnitTest() As String
result = verify_testExp()
If failCount <> 0 And passCount > 0 Then
If failCount <> 0 or passCount = 0 Then
doUnitTest = result
Else
doUnitTest = "OK"

View File

@@ -6,7 +6,7 @@ Dim result As String
Function doUnitTest() As String
result = verify_testInStrRev()
If failCount <> 0 And passCount > 0 Then
If failCount <> 0 or passCount = 0 Then
doUnitTest = result
Else
doUnitTest = "OK"