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_testConstants()
19 On Error GoTo errorHandler
21 ' vbNewLine is the same as vbCrLf on Windows, and the same as vbLf on other OSes
22 If GetGuiType() = 1 Then
23 TestUtil
.AssertEqual(vbNewline
, vbCrLf
, "vbNewline")
25 TestUtil
.AssertEqual(vbNewLine
, vbLf
, "vbNewline")
28 ' tdf#153543 - check for vba shell constants
29 ' See https://learn.microsoft.com/en-us/office/vba/language/reference/user-interface-help/shell-constants
30 TestUtil
.AssertEqual(vbHide
, 0, "vbHide")
31 TestUtil
.AssertEqual(vbNormalFocus
, 1, "vbNormalFocus")
32 TestUtil
.AssertEqual(vbMinimizedFocus
, 2, "vbMinimizedFocus")
33 TestUtil
.AssertEqual(vbMaximizedFocus
, 3, "vbMaximizedFocus")
34 TestUtil
.AssertEqual(vbNormalNoFocus
, 4, "vbNormalNoFocus")
35 TestUtil
.AssertEqual(vbMinimizedNoFocus
, 6, "vbMinimizedNoFocus")
37 ' tdf#131563 - check for vba color constants
38 ' See https://docs.microsoft.com/en-us/office/vba/language/reference/user-interface-help/color-constants
39 TestUtil
.AssertEqual(vbBlack
, RGB(0, 0, 0), "vbBlack")
40 TestUtil
.AssertEqual(vbRed
, RGB(255, 0, 0), "vbRed")
41 TestUtil
.AssertEqual(vbGreen
, RGB(0, 255, 0), "vbGreen")
42 TestUtil
.AssertEqual(vbYellow
, RGB(255, 255, 0), "vbYellow")
43 TestUtil
.AssertEqual(vbBlue
, RGB(0, 0, 255), "vbBlue")
44 TestUtil
.AssertEqual(vbMagenta
, RGB(255, 0, 255), "vbMagenta")
45 TestUtil
.AssertEqual(vbCyan
, RGB(0, 255, 255), "vbCyan")
46 TestUtil
.AssertEqual(vbWhite
, RGB(255, 255, 255), "vbWhite")
50 TestUtil
.ReportErrorHandler("verify_testConstants", Err
, Error$, Erl
)