summaryrefslogtreecommitdiff
path: root/basic/qa
AgeCommit message (Collapse)Author
2022-04-21tdf#148651: basic_macros: Add unittestXisco Fauli
Change-Id: Iadbe470de5a33dc633fe8f53083520988e497df0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133255 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-04-17Test StarBasic's native non-ASCII name syntaxMike Kaganski
Change-Id: Ie9f0cd21e59ffc1e3fbe2616e2ae7abbd0169424 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133103 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-03-31Basic Collection class unit testAlain Romedenne
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-31Adapt test to even slower buildsStephan Bergmann
...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-30tdf#114263 tdf#147262 CallByName() function LibO Basic test unitAlain Romedenne
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-02Change the comment of the test cases to clarify the textual representation ↵Andreas Heinisch
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-02-21tdf#147089 - Round Integral Division (IDIV) literals to Integer valuesAndreas Heinisch
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-12Basic compiler undetected typoAlain Romedenne
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-11tdf#147364: fix function signature to account to calling conventionMike Kaganski
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-09tdf#146672 - CDbl: skip spaces and tabs at the end of the scanned stringAndreas Heinisch
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-06tdf#147021 Use std::size() instead of SAL_N_ELEMENTS() macroVaibhavMalik4187
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-01-31Adapt test to slow buildsStephan Bergmann
...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-31Fix format stringMike Kaganski
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-31tdf#132388: add unit testMike Kaganski
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-13Recheck modules [a-c]* with IWYUGabor Kelemen
See tdf#42949 for motivation Change-Id: I74a3c3a67c3639376e2251c3eb917fa4139dfbd0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127808 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-01-08tdf#145693 - Argument name should be 'charcode' instead of 'string'Andreas Heinisch
In addition, changed argument datatype from Int to Long. Change-Id: I702e09b6b8061d7cf00dd403e4681a0ab348d4c5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128100 Tested-by: Andreas Heinisch <andreas.heinisch@yahoo.de> Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2022-01-07tdf#130426 - Rename file for tdf#145693Andreas Heinisch
Change-Id: I1435f3e8c8ecf41ecd6b2766e19009c6b1783326 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128099 Tested-by: Jenkins Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2021-12-28tdf#145960 - Return type of boolean operators should be of type booleanAndreas Heinisch
In addition, added missing vba test to the test routine. Change-Id: I3ee837e1eab30f10e0a4169d11014f9b6574ad1c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127631 Tested-by: Jenkins Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2021-12-09Make the tdf#97983 changes to BASIC optionalTor Lillqvist
If you want to keep the string to floating point conversion semantics in BASIC as they were in LibreOffice 6, you can either set the LIBREOFFICE6FLOATINGPOINTMODE environment variable to some non-empty value, or set the org.openoffice.Office.Scripting/Basic/Compatibility/ UseLibreOffice6FloatingPointConversion flag in the Expert Configuration. (Or use a registry modification file with that effect.) Adapt the relevant unit test accordingly. Thanks to Mike Kaganski for showing how to access the setting in the LibreOffice registry from Basic. Change-Id: I13d6d5d834e1bb81ef8df489db2b1da79f01dfc5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125756 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-11-11Resolves: tdf#110003 tdf#143128 handle lowercase ß vs uppercase ẞ foldingEike Rathke
Change lowercase ß U+00DF LATIN SMALL LETTER SHARP S from LowerToUpper, ToUpper: SS ToTitle: Ss FullFolding: ss to LowerToUpper, ToUpper: ẞ U+1E9E ToTitle: ẞ U+1E9E FullFolding: ss Add uppercase ẞ U+1E9E LATIN CAPITAL LETTER SHARP S UpperToLower, ToLower: ß U+00DF FullFolding: ss Adjust BASIC Collection test to new reality. Change-Id: I198e06985b81a71e5de94bf7fab7a0dbaf10baef Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124988 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2021-10-30tdf#145371 - Delete array variable only before ReDimAndreas Heinisch
Otherwise, global array variables don't maintain their state. Change-Id: I10dafd9e2946630c5476c9858f765d67ef2f6d6c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124368 Tested-by: Jenkins Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2021-10-20tdf#125637 - Correctly hand names ending with an underscoreAndreas Heinisch
If a name is ending with an underscore at the end of the line, it won't be recognized correctly and it will be wrongly interpreted as the respective name without the underscore at the end. Instead of changing the macro source, use a flag in order to correclty identify the line end. Change-Id: I6f933d7382b510bffed3e2692d32c232b7084624 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123833 Tested-by: Jenkins Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2021-10-19Fix Windows buildStephan Bergmann
...after cf3971a9414f52b116c1c21f267128ffa67f171b "Simplify Sequence in b*" Change-Id: If8650faa7a45258729e54b3df37e9084221babfc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123792 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-10-17Simplify Sequence in b*Julien Nabet
Change-Id: I0817d9a35a9c3fc43badb6cc60727de69849b063 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123720 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-10-07tdf#144924 - Change return type of array elements of the split functionAndreas Heinisch
If VBA is not enabled, allow the assignment of variables with different data types to the individual array elements created by the split function. Change-Id: I7bdd432cdebbfded5f7fb3acc0216474eb6b6821 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123122 Tested-by: Andreas Heinisch <andreas.heinisch@yahoo.de> Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2021-09-30tdf#143575, tdf#143974 - Use rtl::math::doubleToUString to convert numbers ↵Andreas Heinisch
to strings Change-Id: I1427dbd49af680a1bf386410977c9cb2b0a3961e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122831 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de> Tested-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2021-09-27tdf#131563 - Add vba color constantsAndreas Heinisch
Change-Id: I59bcd11b5da1450fced77671c2cf6ed44e299a06 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122607 Tested-by: Jenkins Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2021-09-19tdf#123144 - Always translate an error number to a vba error messageAndreas Heinisch
In addition, create a meaningful error message and don't create and artificial error message if there exists a custom one. Change-Id: I682e497ee3fdfe4da80fb17ab41c1b4cf90eb2cb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122206 Tested-by: Jenkins Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2021-09-10tdf#144353 - Handling of missing optional parametersAndreas Heinisch
Don't assign a missing optional variable to a property and don't allow the computation/comparision including missing optional attributes. In the previous cases a ERRCODE_BASIC_NOT_OPTIONAL is raised. Change-Id: Iab391286fcace16c271ae511304075e2a0c5c651 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121794 Tested-by: Jenkins Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2021-09-07Fixed a copy paste error in the test casesAndreas Heinisch
Change-Id: Ib11b6cfe385542664b28de35897caee67099d22c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121792 Tested-by: Jenkins Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2021-09-07tdf#144245 - Added test file to automatic testAndreas Heinisch
Change-Id: I92b71b7e7ac8c2262d36875e4b04ed91e17bc495 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121791 Tested-by: Jenkins Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2021-09-07tdf#144245 - Case-insensitive operation for non-ASCII charactersAndreas Heinisch
Support case-insensitive operation for non-ASCII characters in the Collection object (VBA). Change-Id: Ie17560cb9aac5bfb32aa041744445dd4839681d6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121534 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com> Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2021-08-10tdf#143707 - Change strategy to support suffix type charactersAndreas Heinisch
In order to support the correct data type of numeric constants, booleans, and default values for strings, the strategy to transport the data type character to the runtime has been changed. The type character will be added after the literal and the string termination symbol in order to keep compatibility. This allows to retrieve the correct type in StepLOADNC and in StepPARAM. Any legacy written images are still possible to process, since if there is a suffix type character where the data type character was directly written after the numeric constant, it will be processed in StepLOADNC. Without this fix, an optional parameter of type Variant, would still include the suffixe type character, and will not be converted to the correct type in StepPARAM. Change-Id: I86c8192c6dc28457053fa7b23a073420e45407b2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119945 Tested-by: Jenkins Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2021-07-28tdf#107953 - Extend significant digitsAndreas Heinisch
According to https://randomascii.wordpress.com/2012/03/08/float-precisionfrom-zero-to-100-digits-2/ show at least 9 / 17 significant digits for a single / double data type in order to identify the contained value. Change-Id: Id2833fc51ca005bc78b68d6b4cca28f2d95f5a85 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119526 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2021-07-19tdf#143332 - Use utl::TextSearch to implement the InStrRev functionAndreas Heinisch
Change-Id: I2dae038d061f036b3b7c0fbbcb6a821305d4839e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119094 Tested-by: Jenkins Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2021-07-16tdf#139840 - Use utl::TextSearch to implement the InStr functionAndreas Heinisch
In addtion, fixed a crash if the start position is greater than the length of the string being searched. Change-Id: I9bcda1131324bdfac6957018e91b3a36dd2dc3d6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118996 Tested-by: Jenkins Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2021-07-15tdf#111313: basic_macros: Add unittestXisco Fauli
Change-Id: Id6f8bc0998d4f79434d46017b998917dcc53ac6d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118949 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2021-07-14tdf#98778: basic_macros: Add unittestXisco Fauli
Change-Id: I35468fb35f5c24af2138688d99af0e41ba672334 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118944 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2021-07-14tdf#114011: basic_macros: Add unittestXisco Fauli
Change-Id: Ib9a7e87b4c8159fd5fbaaaa66705cddae138fcdd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118942 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2021-07-12tdf#142487 - use utl::TextSearch in order to implement the replace algorithmAndreas Heinisch
In the old algorithm, some special unicode characters lead to a malfunction of basic's replace function. For instance, replacing a German ß to uppercase in the insensitive case will lead to SS, breaking the replace positions. Change-Id: I4e6f6e5fba3d560b8cfd0786fa2439ed5174a928 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118760 Tested-by: Jenkins Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2021-07-07basic_coverage: use Option Explicit where possibleXisco Fauli
Add missing license headers to a couple of files Change-Id: I7610f922e9ac914ae8fda0d0b6a7ca389401caca Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118489 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2021-07-06tdf#142922 fixes Round to follow half-to-even roundingbaltasarq
The LibreOffice's Basic Round function does not return values that are compatible with VBA's Round. This can be easily fixed using rtl/round, which has a flag parameter called rtl_math_RoundingMode_HalfEven which rounds real numbers exactly in the expected way. Change-Id: I2215f08427e5777fc2d35f054b635dfa6247af8c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118444 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-07-06basic: remove unneeded variable in testXisco Fauli
Kudos to M. Kaganski for spotting it Change-Id: I04ceea4607cf94a5a84af4f171d6f2b204ef8653 Change-Id: Ie9064d3c12da657ecd82fdab6891bc8703ee6f37 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118464 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2021-07-05tdf#117612: basic_macros: Add unittestXisco Fauli
Change-Id: I4189b52be788deafe921c860f807ec5cee8ec667 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118443 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2021-07-05tdf#134692: basic_macros: Add unittestXisco Fauli
Change-Id: I9115eca2fce784cd55a8eb4f1cfd6e614fd3612b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118442 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2021-07-02Move utility code out of test directoriesMike Kaganski
This simplifies iteration over the test files, and avoids relying on file URLs being the same (e.g., having no /./ segments). Change-Id: I227785806e474a3a2dffeb46df21617eae43327e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118329 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins
2021-07-02Rename LibreOffice Basic test files from .vb to .bas: they are not VBAMike Kaganski
Change-Id: I4ff8a8dc855da2c60084318e067d4ec8149d055e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118330 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins
2021-07-02tdf#143081: basic_macros: Add unittestXisco Fauli
Change-Id: I2d9fa23627f40a2398288b1ee7f5bfd4de4a6131 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118326 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2021-07-02tdf#84098 kill copy+paste in basic/qa/basic_coverageXisco Fauli
This also fix the problem of basic_coverage tests not showing the results when they were failing, since doUnitTest returned a Integer Change-Id: I637cd4cfaa34047bc99bfe6e0930f2945f1a9315 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118234 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2021-07-01Purge out rtl::math::setInfBaiXiaochun
Change-Id: I71af8273c672a4cbcbfefafffd0003ab266dcce6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118132 Tested-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>