Revert "tdf#158280 Replace usage of InputDialog with SvxNameDialog"
[LibreOffice.git] / basic / qa / vba_tests / cdec.vb
blob043625683557371ca9fa074f4ca8d43fe1d31731
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/.
9 Option VBASupport 1
10 Option Explicit
12 Function doUnitTest() As String
13 TestUtil.TestInit
14 verify_testCDec
15 doUnitTest = TestUtil.GetResult()
16 End Function
18 Sub verify_testCDec()
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 "")")
27 '''''''''''''''
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"")")
38 Exit Sub
39 errorHandler:
40 TestUtil.ReportErrorHandler("verify_testCDec", Err, Error$, Erl)
41 End Sub