2 ' This file is part of the LibreOffice project.
4 ' This Source Code Form is subject to the terms of the Mozilla Public
5 ' License, v. 2.0. If a copy of the MPL was not distributed with this
6 ' file, You can obtain one at http://mozilla.org/MPL/2.0/.
12 Function doUnitTest() As String
15 doUnitTest
= TestUtil
.GetResult()
18 Sub verify_testCVErr()
19 On Error GoTo errorHandler
21 TestUtil
.AssertEqual(CStr(CVErr(3001)), "Error 3001", "CStr(CVErr(3001))")
22 TestUtil
.AssertEqual(CStr(CVErr(xlErrDiv0
)), "Error 2007", "CStr(CVErr(xlErrDiv0))")
23 TestUtil
.AssertEqual(CStr(CVErr(xlErrNA
)), "Error 2042", "CStr(CVErr(xlErrNA))")
24 TestUtil
.AssertEqual(CStr(CVErr(xlErrName
)), "Error 2029", "CStr(CVErr(xlErrName))")
25 TestUtil
.AssertEqual(CStr(CVErr(xlErrNull
)), "Error 2000", "CStr(CVErr(xlErrNull))")
26 TestUtil
.AssertEqual(CStr(CVErr(xlErrNum
)), "Error 2036", "CStr(CVErr(xlErrNum))")
27 TestUtil
.AssertEqual(CStr(CVErr(xlErrRef
)), "Error 2023", "CStr(CVErr(xlErrRef))")
28 TestUtil
.AssertEqual(CStr(CVErr(xlErrValue
)), "Error 2015", "CStr(CVErr(xlErrValue))")
30 ' tdf#79426 - passing an error object to a function
31 TestUtil
.AssertEqual(TestCVErr(CVErr(2)), 2, "TestCVErr(CVErr(2))")
32 ' tdf#79426 - test with Error-Code 448 ( ERRCODE_BASIC_NAMED_NOT_FOUND )
33 TestUtil
.AssertEqual(TestCVErr(CVErr(448)), 448, "TestCVErr(CVErr(448))")
37 TestUtil
.ReportErrorHandler("verify_testCVErr", Err
, Error$, Erl
)
40 Function TestCVErr(vErr
As Variant)