Commit Graph

349 Commits

Author SHA1 Message Date
2b6caa40d6 tdf#160321 - Added missing VB test
Change-Id: I4019599aa9d7803a63e4270b06841915ea428392
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168637
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2024-06-10 17:50:33 +02:00
84e8758d42 tdf#160321 - Don't execute jump statement if the expression is out of range
Don't execute On expression GoSub Statement; On expression GoTo
Statement if the expression lies out of range.

Change-Id: I5c1de25918b5e812d7ec82034f8d56351374d56a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165960
Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
Tested-by: Jenkins
2024-06-10 13:52:00 +02:00
7d6e751faa loplugin:ostr basic
Change-Id: Ie5fc4676bd1cab2c0417b479bf08dda00936469a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167191
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-05-06 13:56:49 +02:00
a400c865a6 tdf#93727 Syntax Error on # in basic
Change-Id: I400a4061de580a5c91b0e4763cad40ae88a9f738
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162639
Tested-by: Jenkins
Tested-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2024-04-22 16:05:53 +02:00
9071cd6e59 tdf#149714 BitsPerPixel property of Graphic has Boolean UNO type
- vcl change UNO type of UnoGraphicProperty::BitsPerPixel to sal_Int8 instead of sal_uInt8 which maps to BOOLEAN causing Basic to convert
non-0 values to True

- basic add CppUnitTest since thats where the problem was occuring

Change-Id: I0111199151fb5e001b6362e1359ad90bb039f064
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163899
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-02-28 05:00:46 +01:00
5378ce372a tdf#158890 Replace '?' with figure blank
...instead of regular blank
Do not modify other blanks (thousand separator, fraction separator)

Change-Id: I82f8023a4e55d8091545191dee55a88aba25dbdd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161737
Tested-by: Jenkins
Reviewed-by: Laurent Balland <laurent.balland@mailo.fr>
2024-02-17 08:59:22 +01:00
9cc8457abc tdf#128122 Updated BASIC CCur to reuse SvNumberFormatter
Previously, BASIC CCur used a custom, single-purpose currency string
parser which did not properly accommodate the user's locale setting.
This change replaces the custom parser with SvNumberFormatter, which
does correctly respect system locale.

Change-Id: I179915eb080e876e5e550dd350fdb86d7fa2bf4c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160848
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2023-12-23 09:12:24 +01:00
443027cd71 tdf#156449 Preserve '0' or '?' in exponent
Exponent in scientific number may use '?' as blank like in format "0.00E+?0"
This change:
- adds interpreatation of '0' and '?' in exponent
- adds "blank-exponent-digits" attribute to scientific number for import
  and export to ODF
- prevents using exponent with only '?'. There must be at least one '0'
  in exponent
- adds QA test of such format and test import/export/import to ODF and OOXML
- corrects one basic test

Change-Id: If52edc632a161f842270bb2fd77af535e2b978d4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154986
Tested-by: Jenkins
Reviewed-by: Laurent Balland <laurent.balland@mailo.fr>
2023-11-01 11:43:54 +01:00
b4844c310b Repurpose loplugin:stringstatic for O[U]String vars that can be constexpr
...now that warning about O[U]String vars that could be O[U]StringLiteral is no
longer useful

Change-Id: I389e72038171f28482049b41f6224257dd11f452
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157992
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-15 21:15:49 +02:00
d9e322d60f replace ErrorInfo with simpler mechanism
Instead of returning ErrCode class everywhere, return a new
class ErrrCodeMsg, which combines an ErrCode with the other
parameters that are used to control the error reporting.

I do not change everything that uses ErrCode here, I started
from SfxBaseController/SfxMedium and worked outwards.

This change serves two purposes

(1) Replace the extremely whacky ErrorInfo mechanism we were
using to smuggle information into the error handler reporting
mechanism with a very straightforward approach of just combining it
into the error class.
(2) Allow us to capture the source location that produced the error,
which makes debugging the source of a problem soooo much easier.

Change-Id: I978b8f00c9851b41a216c7ebdef2ef94251d5519
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157440
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-10-03 10:12:41 +02:00
115c8b42b8 Revert "tdf#130924 replace '*printf' with 'SAL_*' logging macros."
My mistake, did not notice
https://bugs.documentfoundation.org/show_bug.cgi?id=130924#c5

We shouldn't hide test output.

This reverts commit df0db4132428e95d276e923d8d5fb603dbb7f7bb.

Change-Id: Ieac40effb57333322f8db8ead093a83765d17a09
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156479
Tested-by: Jenkins
Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2023-09-03 13:22:55 +02:00
df0db41324 tdf#130924 replace '*printf' with 'SAL_*' logging macros.
Change-Id: I5bb4052ded82c355f7d71e4f38ebdefe3fcc25da
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156283
Tested-by: Jenkins
Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2023-08-31 19:50:23 +02:00
c9e8638015 tdf#150137 fastparser: don't crash on undeclared namespace
Change-Id: Icc8bbb391c7e34754b7274d67d73ff509827a3d0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155381
Tested-by: Aron Budea <aron.budea@collabora.com>
Reviewed-by: Aron Budea <aron.budea@collabora.com>
2023-08-07 17:38:30 +02:00
e59780c1e0 Reduce differences between _test_asserts.bas and _test_asserts.vb
Change-Id: Ic546f6454f2b8581300320e1690644152d44eb83
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155341
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-08-04 15:34:24 +02:00
fa0a1f6462 tdf#153543 - Add vba shell constants
Change-Id: Ifa73050f6892ce8ce95d16dedc166e68d1809491
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151567
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2023-05-09 14:12:54 +02:00
458f2b8f69 Refactor and fix VBA StrConv
This properly handles null bytes that are expected
when converting between byte strings and Unicode.

It properly handles TransliterationFlags, which are
not a bitset.

In vbProperCase, it uses the correct method to
lowercase the string, working not only with ASCII.

Change-Id: I04e8cdca66ef9863a6516b15205a2a543ed97680
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149224
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-03-22 04:31:07 +00:00
e12fff12b6 tdf#152690: Fix "!" behavior when it is not the first in a group
Fix "!" behavior when it is not the first in a group.
Add testcases for "!" and Like.

Change-Id: Ia76fa26722b6546d08dd8842d83f55bb0c0ea5ac
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148720
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-03-16 21:14:20 +00:00
fd19bc83cf tdf#141474 tdf#151901 BASIC functions argument names do not match that of VBA
Basic function argument names can be used either by position either by name, keyword arguments ae called 'named arguments' in VBA
- VBA doc:
https://learn.microsoft.com/en-us/office/vba/language/concepts/getting-started/understanding-named-arguments-and-optional-arguments
- libO Basic function signatures:
https://help.libreoffice.org/latest/en-US/text/sbasic/shared/03090401.html?DbPAR=BASIC#bm_id3154422

This patch attempts to correct - all in one - malformed keyword names in BASIC function signatures.

It reflects keyword arguments usage inside QA BASIC unit tests.

In the end Online help pages may incorporate such practice.

Change-Id: Iab0c92b2c152d2564662e51e68f1f736b8deefd0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145720
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2023-02-26 16:14:47 +00:00
1786ddbde4 Fix build in a specific VS2022 environment
Building CppunitTest_basic_macros using VS2022 failed for me reproducibly
for some time, with

  make[1]: *** [C:/lo/src/core/solenv/gbuild/LinkTarget.mk:841: C:/lo/src/build/workdir/LinkTarget/CppunitTest/test_basic_macros.dll] Error 139

It is caused by linking odbccp32, and legacy_stdio_definitions required
by the latter with current versions of UCRT.

It seems to work OK for others; but being unable to find what's different
on my system, I have this workaround, using run-time loading instead.

Change-Id: Ic4094398f7510bc281dfa96f980f29f12f09d7ba
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147626
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-02-24 17:05:43 +00:00
dc96de7c62 Extend loplugin:cppunitassertequals to more argument types
Change-Id: Ic2990ebc2e4a9a36dcd3f90c5f634ca7dd225d52
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147491
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-02-23 07:04:09 +00:00
263c15ee23 Delete extra whitespaces inserted by the editor
Change-Id: I89ef4d04e27e52f5ee6168f368e23f96e112a8be
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146085
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2023-01-26 07:45:25 +00:00
3c7cba927b tdf#152917: basic_macros: Add unittest
Change-Id: I69050ae0e6607ed4a1d1da0e89b45125e2c06e3b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145190
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-01-09 19:08:03 +00:00
4f09c5f925 basic: remove tabs from test file
Introduced in c6dc676306d2e507bf57369d02dcaf2408d43eb0
"tdf#152520: basic_macros: Add unittest"

Change-Id: Ieef7177b3eb1c7c4ab1aaa11cc343ace3f26601f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144581
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-12-20 12:56:52 +00:00
a179da299a basic: add missing license statement in .vb test files
Change-Id: I304615540edad3d3486bcdb17d7d6ae12fc084b4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144584
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-12-20 12:50:41 +00:00
5f0cf6e7aa basic: add missing license statement in test files
While at it, convert test_optional_paramter_type.bas
to Unix format

Change-Id: I141fa0a00d6b6784c3a84c8b3041086d51e5cdbc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144540
Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-12-20 08:41:11 +00:00
c6dc676306 tdf#152520: basic_macros: Add unittest
Change-Id: I30f6badc620f3932cacff07bd37ef4da96f1bafd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144539
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-12-20 07:47:34 +00:00
bdfcad586d tdf#151503 - Do not evaluate a missing optional variable to a boolean
Change-Id: I671f857344f91de63612eabcbbdb2cab9b94cc0d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141296
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2022-10-14 10:06:38 +02:00
6f3532f6aa tdf#151012 - Initialize optional parameters with their default values
Change-Id: I3ed3eb904b50892e5946abe684e801819ba296e6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140128
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2022-09-25 11:39:33 +02:00
d477d2eb37 Removed executable bits on files
Change-Id: I8508d26067084ff7bb15bbf2326a1ff7bc61a6ae
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136521
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-06-28 20:55:42 +02:00
120daca419 tdf#149447: use proper UNO types for marshalling unsigned Basic types
cppu::UnoType<sal_uInt8> corresponds to UNO boolean, so its use made the
unsigned values be converted to a true/false in Any; and additionally,
using such a boolean Any, even having a 'true' value, as a parameter to
a double argument would make operator >>=(const Any &, double &) return
false, giving the resulting double equal to 0.

The wrong conversion of UShorts and ULongs to cppu::UnoType<sal_uInt8>
(aka TypeClass_BOOLEAN) was introduced in commit
11f9aa4fcb2ad0a5fada8561c7041e7f25a059fc
  Author Andreas Bregas <ab@openoffice.org>
  Date   Thu May 10 14:22:42 2001 +0000
    #79615# sbxToUnoValue(): Choose smallest possible type for numeric values

Treating of unsigned Basic Byte as a signed cppu::UnoType<sal_Int8> (aka
TypeClass_BYTE) was already introduced in
commit c25ec0608a167bcf1d891043f02273761c351701
  Author Jens-Heiner Rechtien <hr@openoffice.org>
  Date   Mon Sep 18 15:18:56 2000 +0000
    initial import

Then, in commit 553cf2a834fcca17be6f7712c53e190e90e260eb
  Author Andreas Bregas <ab@openoffice.org>
  Date   Fri Jun 08 14:59:57 2001 +0000
    #87927# Map TypeClass_BYTE to SbxINTEGER instead of SbxBYTE because of signed/unsigned problem

an attempt was made to handle obviously this same problem, changing the
corresponding UNO type to TypeClass_SHORT. But it seems that it created
problems when passing arrays of Byte through UNO to COM, where it needed
to convert to a safearray, so this decision was reverted in commit
dd6ba6b64aec20d37a402bee233e742e29285e88
  Author Mikhail Voytenko <mav@openoffice.org>
  Date   Thu Jul 08 21:33:48 2010 +0200
    mib17: #162917# let basic byte use one byte, let olebridge convert sequence to safearray correctly

This change tries to avoid the problem that caused the latter revert,
by only treating Bytes as UNO shorts in getUnoTypeForSbxValue, where
scalar Byte values are considered, keeping old handling for arrays.

Change-Id: I805108743376e2fc27dd21a27c31759b76dc0d09
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136526
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-06-28 15:15:48 +02:00
522f5ad4d8 tdf#147529 - BASIC MsgBox: Check for missing optional parameters
Change-Id: Iecb47e0005c609ee1117d6fb141e810c0166806a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136339
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2022-06-24 09:20:45 +02:00
f4ff0ed557 tdf#149622: also clear return value before calling method from SbxObject::Call
Moves the custom cleanup logic to overridden SbxMethod::Clear, to simplify
the cleanup code and make sure it restores empty Variant correctly.

Change-Id: I01fa0529acd9ac787ffcda60fd6836ade4afdcb1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136108
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-06-20 12:46:27 +02:00
fbce18558a tdf#149402 - BASIC: Don't extend comment if line ends in a whitespace
Change-Id: I8adf530e77a0e65329fa59ac2873b99f48befac4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135336
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2022-06-06 10:24:20 +02:00
b94275f6d2 tdf#149157 - Break multiline continuation in a comment after a new line
Change-Id: I3dd875152a6f2cfafb67f13f597c36f01a4759b4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135018
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2022-05-31 12:30:21 +02:00
90d33f5945 tdf#148358 - Compare Non-ASCII variable names case-insensitive
Change-Id: I761eb27b16c92d58df1be8e6011fc9b94db2a59c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133774
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2022-05-07 16:00:50 +02:00
b5ab864096 Just use Any ctor instead of makeAny in basic
Change-Id: I21d9679064c4e68a1492d3550f083c3c91b5b43b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133848
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-05-05 07:13:54 +02:00
07bf0ce4e7 tdf#148651: basic_macros: Add unittest
Change-Id: Iadbe470de5a33dc633fe8f53083520988e497df0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133255
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-04-21 19:52:16 +02:00
fe597a3379 Test StarBasic's native non-ASCII name syntax
Change-Id: Ie9f0cd21e59ffc1e3fbe2616e2ae7abbd0169424
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133103
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-04-17 10:08:08 +02:00
da27693800 Basic Collection class unit test
Change-Id: I7b67727ab8c3f7f67c2038500434ab44fa7d1949
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128544
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-03-31 17:26:55 +02:00
e2ba33336f Adapt test to even slower builds
...like my local ASan+UBSan build, which now happened to fail once with

>  Failed: TestReplacePerformance (t = 60 s)
> Tests passed: 0
> Tests failed: 1

when the machine was under load during a parallelizing `make check`, following
up on 3564b5c6e93b2bf5881b359015efae351dbe8342 "Adapt test to slow builds"

Change-Id: I8f0c8f7e6e145b6d5009f48d2af865ea5caab375
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132335
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-03-31 14:06:56 +02:00
b9b9b3afde tdf#114263 tdf#147262 CallByName() function LibO Basic test unit
Change-Id: Ia9bd38c0da4d3f94b824ebb1f98ac912758e8d38
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129610
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-03-30 09:04:38 +02:00
aa54ea2323 Change the comment of the test cases to clarify the textual representation of the calculated string
Change-Id: I98478297a577f723864b37514bbd432a6224350d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129844
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2022-03-02 21:42:09 +01:00
3ba8b56b32 tdf#147089 - Round Integral Division (IDIV) literals to Integer values
Change-Id: Ia243c6117a437d0c6efb33a4e76c5e9ee539fbdc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130302
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2022-02-21 23:10:46 +01:00
9654c8e4bd Basic compiler undetected typo
Change-Id: I53add0bbb14e084978e3582083978924d1c11c88
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129434
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-02-12 10:00:15 +01:00
5276177877 tdf#147364: fix function signature to account to calling convention
First, the integer function result is returned in a 64-bit register (RAX),
and truncation it to sal_Int32 breaks any pointer return value.

Second, using explicit (not vararg) first function double argument would
pass it through XMM0, without also copying it to RCX (which is guaranteed
for varargs).

Ref: https://docs.microsoft.com/en-us/cpp/build/x64-calling-convention
Change-Id: I08212c44d8690d6910068b13c16af2ce899c94f2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129808
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-02-11 12:56:03 +01:00
a79e7dc9e8 tdf#146672 - CDbl: skip spaces and tabs at the end of the scanned string
Change-Id: Ib7a4e8c7145b549a5327de23549d39d11f8590cf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129648
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2022-02-09 11:09:01 +01:00
8b327cd86d tdf#147021 Use std::size() instead of SAL_N_ELEMENTS() macro
Change-Id: I4f5258ca5b37e9b1b4237c5d29e4a9e5362fa855
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129116
Reviewed-by: Arkadiy Illarionov <qarkai@gmail.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
2022-02-06 21:38:32 +01:00
3564b5c6e9 Adapt test to slow builds
...like my local ASan+UBSan build, which kept failing with

>  Failed: TestReplacePerformance (t = 35 s)
> Tests passed: 0
> Tests failed: 1

when the machine was under load during a parallelizing `make check`

Change-Id: I59c81a61a29df7165f6fad33e3fe3da975f05ed2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129237
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-01-31 23:34:32 +01:00
24afbaab3a Fix format string
Change-Id: I18952bf6641175d25128b512ddfb56fd51767038
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129083
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-01-31 14:08:17 +01:00
81a3d9b4bf tdf#132388: add unit test
I hope that this performance test is OK. I chose 20 s threshold, as
it works much faster on my system (under 4 s); it shouldn't be much
slower elsewhere; and both the original bug, and the regression that
followed the initial fix, made it execute orders of magnitute slower
(I expect hours on fast systems).

Change-Id: I75ee4c60e562473fe70a203faa94b48c5fbfb4fe
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129203
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-01-31 11:24:00 +01:00