tdf#130857 qt weld: Implement QtInstanceWidget::strip_mnemonic
[LibreOffice.git] / basic / qa / vba_tests / win32compat.vb
blob020c1245ba5953a41ac8ee78b298758cf7b6fbba
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/.
8 ' Test built-in compatibility versions of methods whose absence
9 ' is really felt in VBA, and large numbers of macros import from
10 ' the system.
13 Option VBASupport 1
14 Option Explicit
16 Private Declare Function QueryPerformanceCounter Lib "kernel32" (ByRef lpPerformanceCount As Currency) As Long
17 Private Declare Function QueryPerformanceFrequency Lib "kernel32" (ByRef lpFrequency As Currency) As Long
19 Function doUnitTest() As String
20 TestUtil.TestInit()
21 verify_win32compat
22 doUnitTest = TestUtil.GetResult()
23 End Function
25 Sub verify_win32compat()
26 Dim freq As Currency
27 Dim count_a As Currency
28 Dim count_b As Currency
29 Dim success As Long
31 On Error GoTo errorHandler
33 success = QueryPerformanceFrequency(freq)
34 TestUtil.Assert(success <> 0, "QueryPerformanceFrequency")
35 TestUtil.Assert(freq > 0, "QueryPerformanceFrequency", "perf. frequency is incorrect " & freq)
37 success = QueryPerformanceCounter(count_a)
38 TestUtil.Assert(success <> 0, "QueryPerformanceCounter(count_a)")
40 success = QueryPerformanceCounter(count_b)
41 TestUtil.Assert(success <> 0, "QueryPerformanceCounter(count_b)")
42 TestUtil.Assert(count_a < count_b, "count mismatch " & count_a & " is > " & count_b)
44 Exit Sub
45 errorHandler:
46 TestUtil.ReportErrorHandler("verify_win32compat", Err, Error$, Erl)
47 End Sub