summaryrefslogtreecommitdiff
path: root/basic/qa/cppunit
AgeCommit message (Collapse)Author
2024-11-04new loplugin:staticconstexprNoel Grandin
Change-Id: Ida1996dfffa106bf95fd064e8191b8033b4002f3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175336 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-09-12Temporarily skip unit tests on native arm64 buildBalazs Varga
which indicating unit test fails. Change-Id: I2689b0dda888e15e52ca60cc18e1705a1aefe968 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173143 Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de> Reviewed-by: Balazs Varga <balazs.varga.extern@allotropia.de> Tested-by: Jenkins
2024-08-18tdf#150458: evaluate for loop's end and step once in VBA support modeMike Kaganski
As required by [MS-VBAL], and actual VBA implementation. It is a question if we also need to change it likewise in other modes (normal, compatible) - see tdf#150460. Change-Id: I1e83d57fe4be3bf264a64fe977909cf7684bc798 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172005 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-08-05VBA QA new unit test for IF THEN statementAlain Romedenne
Intent is to cover: - EndIf / End If equivalence - repeating ElseIf blocks _ nested IF statements - IF THEN one liner Change-Id: I667f0381529afcc82fc44ae461081f7ba84b01d0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171352 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-06-10tdf#160321 - Added missing VB testAndreas Heinisch
Change-Id: I4019599aa9d7803a63e4270b06841915ea428392 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168637 Tested-by: Jenkins Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2024-05-06loplugin:ostr basicNoel Grandin
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-04-22tdf#93727 Syntax Error on # in basicLuv Sharma
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-02-28tdf#149714 BitsPerPixel property of Graphic has Boolean UNO typeAdam Seskunas
- 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>
2023-10-15Repurpose loplugin:stringstatic for O[U]String vars that can be constexprStephan Bergmann
...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-03replace ErrorInfo with simpler mechanismNoel Grandin
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-09-03Revert "tdf#130924 replace '*printf' with 'SAL_*' logging macros."Ilmari Lauhakangas
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-08-31tdf#130924 replace '*printf' with 'SAL_*' logging macros.sahil
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-04Reduce differences between _test_asserts.bas and _test_asserts.vbMike Kaganski
Change-Id: Ic546f6454f2b8581300320e1690644152d44eb83 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155341 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-03-16tdf#152690: Fix "!" behavior when it is not the first in a groupBaole Fang
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-02-24Fix build in a specific VS2022 environmentMike Kaganski
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-23Extend loplugin:cppunitassertequals to more argument typesStephan Bergmann
Change-Id: Ic2990ebc2e4a9a36dcd3f90c5f634ca7dd225d52 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147491 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-06-24tdf#147529 - BASIC MsgBox: Check for missing optional parametersAndreas Heinisch
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-20tdf#149622: also clear return value before calling method from SbxObject::CallMike Kaganski
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-06tdf#149402 - BASIC: Don't extend comment if line ends in a whitespaceAndreas Heinisch
Change-Id: I8adf530e77a0e65329fa59ac2873b99f48befac4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135336 Tested-by: Jenkins Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2022-05-31tdf#149157 - Break multiline continuation in a comment after a new lineAndreas Heinisch
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-07tdf#148358 - Compare Non-ASCII variable names case-insensitiveAndreas Heinisch
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-05Just use Any ctor instead of makeAny in basicStephan Bergmann
Change-Id: I21d9679064c4e68a1492d3550f083c3c91b5b43b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133848 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
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-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-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-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>
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-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-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-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-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-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#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>
2021-03-21tdf#88442 SBasic: Don't double-initialize a Global ... As New ...John
"As New" variables use lazy instantiation, but that should not re-apply each time one re-enters the module. If the object is still there, don't replace it. Change-Id: Ic568a56b93db9bc9139d434d97a4a4deb05840df Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112018 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-03-09Drop "32" from names of SbxArray methods taking 32-bit indicesMike Kaganski
... a leftover from times when there were methods for 16-bit as well as for 32-bit indices. 16-bit indices were removed in commit 62f3f3d92aa204eaaa063b30d7ade44df501b997. Change-Id: Idf8b1160e68e8b303cf75ea79dd7dbb3bd00275d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112187 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-02-17tdf#130677 Write new tests for literalsshubham656
Change-Id: I22607fdcaab840ca1512abf534712d36d4b5ee9b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109964 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de> Tested-by: Jenkins
2020-12-30Fix build after 042033f1e6da22616cb76c8d950c20c9efecbad5Mike Kaganski
Change-Id: Ifca32f434442f7838aae6f47dc2831dfa6a3f5db Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108496 Tested-by: Stephan Bergmann <sbergman@redhat.com> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-12-29loplugin:stringviewparam: operator +Stephan Bergmann
Change-Id: I044dd21b63d7eb03224675584fa143009c6b6008 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108418 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-12-22Related: tdf#84098 Unify testsMike Kaganski
Shorten the tools module name; use TestUtil.AssertEqual where applicable; remove unnecessary variables that only made noise and masked what was actually asserted; add missing licence headers. Change-Id: If891ed8ceb38fed18335aad061b2b09d341264f7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108118 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-12-19tdf#84098 kill copy+paste in VBA testsGeorge Bateman
Move repeated code into _test_asserts.vb Change-Id: Idfe124a8dbab4925309fa5f1322e0cce5f097b7b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107860 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-11-13tdf#123936 Formatting files in module basic with clang-formatPhilipp Hofer
Change-Id: I87736d6f1a1d069c990b4e7b9ca291634ab4fb44 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105646 Tested-by: Jenkins Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2020-11-05tdf#42949 Fix new IWYU warnings in directories [ab]*Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: Ib0008b9bb095f27e5e436d6b507dc709ab7bf01a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105313 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-10-01loplugin:reducevarscope in basctl,basicNoel
Change-Id: I32595921bf5ed26699bced3637302692c407d624 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103760 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>