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()
19 On Error GoTo errorHandler
21 TestUtil
.AssertEqual(CDec(""), 0, "CDec("""")")
22 TestUtil
.AssertEqual(CDec("1234"), 1234, "CDec(""1234"")")
23 TestUtil
.AssertEqual(CDec(" 1234 "), 1234, "CDec("" 1234 "")")
24 TestUtil
.AssertEqual(CDec("-1234"), -1234, "CDec(""-1234"")")
25 TestUtil
.AssertEqual(CDec(" - 1234 "), -1234, "CDec("" - 1234 "")")
28 ' Those are erroneous, see i#64348
29 TestUtil
.AssertEqual(CDec("1234-"), -1234, "CDec(""1234-"")")
30 TestUtil
.AssertEqual(CDec(" 1234 -"), -1234, "CDec("" 1234 -"")")
32 'TestUtil.AssertEqual(CDec("79228162514264300000000000001"), 79228162514264300000000000001, "CDec(""79228162514264300000000000001"")")
33 'TestUtil.AssertEqual(CDec("79228162514264300000000000001") + 1, 79228162514264300000000000002, "CDec(""79228162514264300000000000001"") + 1")
35 TestUtil
.AssertEqual(CDec("79228162514264400000000000000"), 62406456049664, "CDec(""79228162514264400000000000000"")")
36 TestUtil
.AssertEqual(CDec("79228162514264340000000000000"), 0, "CDec(""79228162514264340000000000000"")")
40 TestUtil
.ReportErrorHandler("verify_testCDec", Err
, Error$, Erl
)