summaryrefslogtreecommitdiff
path: root/basic/qa/vba_tests/month.vb
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2020-12-21 09:00:03 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2020-12-22 06:18:50 +0100
commit66b135fa80452144baf57e91a6814b172f8174e2 (patch)
treed69170bf4a81c7736ea5a57c00dca55c5a7fb834 /basic/qa/vba_tests/month.vb
parent8beaafcaa27a66841a9d959eba125ec410d0392d (diff)
Related: tdf#84098 Unify tests
Shorten the tools module name; use TestUtil.AssertEqual where applicable; remove unnecessary variables that only made noise and masked what was actually asserted; add missing licence headers. Change-Id: If891ed8ceb38fed18335aad061b2b09d341264f7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108118 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'basic/qa/vba_tests/month.vb')
-rw-r--r--basic/qa/vba_tests/month.vb50
1 files changed, 18 insertions, 32 deletions
diff --git a/basic/qa/vba_tests/month.vb b/basic/qa/vba_tests/month.vb
index faa074560b3d..05222071f478 100644
--- a/basic/qa/vba_tests/month.vb
+++ b/basic/qa/vba_tests/month.vb
@@ -1,46 +1,32 @@
+'
+' 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 VBASupport 1
Option Explicit
Function doUnitTest() As String
-verify_testMonth
-doUnitTest = TestUtilModule.GetResult()
+ TestUtil.TestInit
+ verify_testMonth
+ doUnitTest = TestUtil.GetResult()
End Function
Sub verify_testMonth()
+ On Error GoTo errorHandler
- TestUtilModule.TestInit
-
- Dim testName As String
- Dim date1, date2
Dim ldate As Date
- testName = "Test Month function"
- On Error GoTo errorHandler
ldate = 32616
-
- date2 = 4
- date1 = Month(ldate)
- TestUtilModule.AssertTrue(date1 = date2, "the return Month is: " & date1)
-
- date2 = 2
- date1 = Month("01/02/2007")
- TestUtilModule.AssertTrue(date1 = date2, "the return Month is: " & date1)
-
- date2 = 12
- date1 = Month(1)
- TestUtilModule.AssertTrue(date1 = date2, "the return Month is: " & date1)
-
- date2 = 2
- date1 = Month(60)
- TestUtilModule.AssertTrue(date1 = date2, "the return Month is: " & date1)
-
- date2 = 6
- date1 = Month(2000)
- TestUtilModule.AssertTrue(date1 = date2, "the return Month is: " & date1)
-
- TestUtilModule.TestEnd
+ TestUtil.AssertEqual(Month(ldate), 4, "Month(ldate)")
+ TestUtil.AssertEqual(Month("01/02/2007"), 2, "Month(""01/02/2007"")")
+ TestUtil.AssertEqual(Month(1), 12, "Month(1)")
+ TestUtil.AssertEqual(Month(60), 2, "Month(60)")
+ TestUtil.AssertEqual(Month(2000), 6, "Month(2000)")
Exit Sub
errorHandler:
- TestUtilModule.AssertTrue(False, testName & ": hit error handler")
+ TestUtil.ReportErrorHandler("verify_testMonth", Err, Error$, Erl)
End Sub
-