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 Function doUnitTest
as String
11 TestReplacePerformance()
12 doUnitTest
= TestUtil
.GetResult()
15 Sub TestReplacePerformance()
16 On Error GoTo errorHandler
17 ' Assume the normal case to be much faster than 60 s even on slow boxes, and the test string
18 ' is long enough to cause serious performance regressions make it perform much longer
22 s
= Replace(s
, " ", "*", 1, -1, 1)
24 TestUtil
.Assert(t
<= TimeSerial(0, 1, 0), "TestReplacePerformance", Format(t
, """t = ""[s]"" s"""))
27 TestUtil
.ReportErrorHandler("TestReplacePerformance", Err
, Error$, Erl
)