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(CInt(-1.1), -1, "CInt(-1.1)")
22 TestUtil
.AssertEqual(CInt(-1.1), -1, "CInt(-1.1)")
23 TestUtil
.AssertEqual(CInt(-1.9), -2, "CInt(-1.9)")
24 TestUtil
.AssertEqual(CInt(0.2), 0, "CInt(0.2)")
27 REM If the fraction is less than or equal to .5, the result will round down.
28 REM If the fraction is greater than .5, the result will round up.
30 REM TestUtil.AssertEqual(CInt(0.5), 0, "CInt(0.5)")
31 REM TestUtil.AssertEqual(CInt(1.5), 2, "CInt(1.5)")
32 REM TestUtil.AssertEqual(CInt(2.5), 2, "CInt(2.5)")
34 TestUtil
.AssertEqual(CInt(10.51), 11, "CInt(10.51)")
35 TestUtil
.AssertEqual(CInt("&H75FF"), 30207, "CInt(""&H75FF"")")
36 TestUtil
.AssertEqual(CInt("&H754"), 1876, "CInt(""&H754"")")
37 TestUtil
.AssertEqual(CInt("+21"), 21, "CInt(""+21"")")
41 TestUtil
.ReportErrorHandler("verify_testCInt", Err
, Error$, Erl
)