tdf#132853 - UI: fix different sizes in Image tabs Type & Crop
[LibreOffice.git] / basic / qa / vba_tests / cint.vb
blob42e41e53568ffb6ad0ec0f4ccf8072e6c621a7ff
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_testCInt
15 doUnitTest = TestUtil.GetResult()
16 End Function
18 Sub verify_testCInt()
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)")
26 REM In excel:
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"")")
39 Exit Sub
40 errorHandler:
41 TestUtil.ReportErrorHandler("verify_testCInt", Err, Error$, Erl)
42 End Sub