summaryrefslogtreecommitdiff
path: root/basic/qa
AgeCommit message (Collapse)Author
2018-02-24Use for range loops in basegfx and basicJulien Nabet
Change-Id: I5b2086c245695aeb30630150b3c5ccf61fbd6a56 Reviewed-on: https://gerrit.libreoffice.org/50280 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2018-01-19new loplugin:emptyifNoel Grandin
Change-Id: I1092115a0ceb3a5e6680a4b724b129f98a892c42 Reviewed-on: https://gerrit.libreoffice.org/48128 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-12More loplugin:cstylecast: basicStephan Bergmann
auto-rewrite with <https://gerrit.libreoffice.org/#/c/47798/> "Enable loplugin:cstylecast for some more cases" plus solenv/clang-format/reformat-formatted-files Change-Id: I20b38196ee1b6a34384dc46d9de1b6e1b44947ae
2017-12-23VBA tests (4) - don't pass when all tests failZdeněk Crhonek
Change-Id: Ib4f9b5df1cffe104ba27be95183d075f24f28bb3 Reviewed-on: https://gerrit.libreoffice.org/45774 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Zdenek Crhonek <zcrhonek@gmail.com>
2017-12-22VB tests (3)-don't pass whe all tests failZdeněk Crhonek
Change-Id: I7dd99a43a3d41c8ca31a070028a19bd032d06435 Reviewed-on: https://gerrit.libreoffice.org/45739 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Zdenek Crhonek <zcrhonek@gmail.com>
2017-12-07VBA test - error() functionZdeněk Crhonek
Change-Id: Ia667342f9112932c71df593f08371d3c35255b19 Reviewed-on: https://gerrit.libreoffice.org/45917 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com>
2017-12-06VBA test - iserror function test repair, tdf#114232Zdeněk Crhonek
Change-Id: I924713f360a41fa5b269468fdf771df6a50df44b Reviewed-on: https://gerrit.libreoffice.org/45923 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Zdenek Crhonek <zcrhonek@gmail.com>
2017-12-02VBA tests repair (2) - don't pass the test when all tests failZdeněk Crhonek
Change-Id: I2519fc54e2ce74ec3c6777aa002971548a21c3c6 Reviewed-on: https://gerrit.libreoffice.org/45715 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Zdenek Crhonek <zcrhonek@gmail.com>
2017-12-02VBA tests - repair tests (Don't pass when all tests fail)Zdeněk Crhonek
Change-Id: I70bfb8b909f9f7033cd1eb374db0fe710fd2a0c3 Reviewed-on: https://gerrit.libreoffice.org/45260 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Zdenek Crhonek <zcrhonek@gmail.com>
2017-11-24Don't pass the test when all tests failEike Rathke
Due to the locale dependent date format used here in strings that neither matches en-US nor en-GB (in which the tests seem to be executed) all tests failed, and then with passCount==0 the check was If failCount <> 0 And passCount > 0 Then instead of If failCount <> 0 Or passCount = 0 Then so the end result was OK. Also fixed the one case that was commented with Rem why this fails in excel? It actually also failed for us, just that because all tests failed (see above) it never seemed to fail.. Problem seems to be the accuracy of the underlying date+time double for this specific calculation. Good to know it happens in Excel as well ;-) As a workaround, conversion to string does the necessary rounding internally. Change-Id: If0302b2feab9e1233d66da4eccff732f61542a69 Reviewed-on: https://gerrit.libreoffice.org/45196 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins <ci@libreoffice.org>
2017-10-17Seems that testMiscOLEStuff() works only as 64-bit on a current Windows 10Tor Lillqvist
Change-Id: Ib43f8c185d2a2e9e93f34d918d6f9461586cf6a6
2017-10-10basic: consistently use "" and <> in include directivesMike Kaganski
Change-Id: I147c0e9b9b1e09af593f54799e45e1348cd40716 Reviewed-on: https://gerrit.libreoffice.org/43298 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2017-10-05Rename and move SAL_U/W to o3tl::toU/WMike Kaganski
Previosly (since commit 9ac98e6e3488e434bf4864ecfb13a121784f640b) it was expected to gradually remove SAL_U/W usage in Windows code by replacing with reinterpret_cast or changing to some bettertypes. But as it's useful to make use of fact that LibreOffice and Windows use compatible representation of strings, this commit puts these functions to a better-suited o3tl, and recommends that the functions be consistently used throughout Windows-specific code to reflect the compatibility and keep the casts safe. Change-Id: I2f7c65606d0e2d0c01a00f08812bb4ab7659c5f6 Reviewed-on: https://gerrit.libreoffice.org/43150 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2017-09-30Use SAL_W/SAL_U instead of reinterpret_cast btwn wchar_t* and sal_Unicode*Mike Kaganski
This is type-safe, and allows to catch cases where a source type is changed for some reason, but reinterpret_cast masks that Change-Id: Ib64b6fa2e22d94a6bba890f0ccc3e20325c6f0a1 Reviewed-on: https://gerrit.libreoffice.org/42961 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2017-09-18Some more WIN32_LEAN_AND_MEANMike Kaganski
Change-Id: Iadb0ebb66809c192fb817b8c7cf2f8cdb4d0b874 Reviewed-on: https://gerrit.libreoffice.org/42419 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2017-08-24VBA tests-add VAL,VARTYPE,WEEKDAY,WEEKDAYNAME,YEAR testsZdeněk Crhonek
Change-Id: I3f1803617a2bdeaab9922ebb375ec4fd67318d20 Reviewed-on: https://gerrit.libreoffice.org/41499 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Zdenek Crhonek <zcrhonek@gmail.com>
2017-08-17Fix typosAndrea Gelmini
Change-Id: Iaa9c0aea3ea1a239e378bd714ba335f91bb1faf3 Reviewed-on: https://gerrit.libreoffice.org/41194 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
2017-08-08VBA functions tests-SYD, TIMESERIAL, TIMEVALUE, TRIM, TYPENAME, UBOUND,UCASEZdeněk Crhonek
Change-Id: I7ea7757291d996375584ef05d822701737020b1c Reviewed-on: https://gerrit.libreoffice.org/40894 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Zdenek Crhonek <zcrhonek@gmail.com>
2017-08-03VBA tests- add functions STRING,STRREVERSE,SWITCHZdeněk Crhonek
Change-Id: Ibba3b5cabee31af44f0e8dda5a11f152ab0cfe01 Reviewed-on: https://gerrit.libreoffice.org/40730 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Zdenek Crhonek <zcrhonek@gmail.com>
2017-08-02VBA tests - STR and STRCOMP functionsZdeněk Crhonek
Change-Id: I09daaa8be3687bf838f569849542d47c85907d1e Reviewed-on: https://gerrit.libreoffice.org/40687 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Zdenek Crhonek <zcrhonek@gmail.com>
2017-07-24VBA tests-functions RIGHT,RTRIM,SECOND,SGN,SIN,SLN,SPACE,SQRZdeněk Crhonek
Change-Id: I0db9233f20fccbc4b2c4f4b3e36cf0aaa8583c99 Reviewed-on: https://gerrit.libreoffice.org/40339 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Zdenek Crhonek <zcrhonek@gmail.com>
2017-07-21migrate to boost::gettextCaolán McNamara
* all .ui files go from <interface> to <interface domain="MODULE"> e.g. vcl * all .src files go away and the english source strings folded into the .hrc as NC_("context", "source string") * ResMgr is dropped in favour of std::locale imbued by boost::locale::generator pointed at matching MODULE .mo files * UIConfig translations are folded into the module .mo, so e.g. UIConfig_cui goes from l10n target to normal one, so the res/lang.zips of UI files go away * translation via Translation::get(hrc-define-key, imbued-std::locale) * python can now be translated with its inbuilt gettext support (we keep the name strings.hrc there to keep finding the .hrc file uniform) so magic numbers can go away there * java and starbasic components can be translated via the pre-existing css.resource.StringResourceWithLocation mechanism * en-US res files go away, their strings are now the .hrc keys in the source code * remaining .res files are replaced by .mo files * in .res/.ui-lang-zip files, the old scheme missing translations of strings results in inserting the english original so something can be found, now the standard fallback of using the english original from the source key is used, so partial translations shrink dramatically in size * extract .hrc strings with hrcex which backs onto xgettext -C --add-comments --keyword=NC_:1c,2 --from-code=UTF-8 --no-wrap * extract .ui strings with uiex which backs onto xgettext --add-comments --no-wrap * qtz for gettext translations is generated at runtime as ascii-ified crc32 of content + "|" + msgid * [API CHANGE] remove deprecated binary .res resouce loader related uno apis com::sun::star::resource::OfficeResourceLoader com::sun::star::resource::XResourceBundleLoader com::sun::star::resource::XResourceBundle when translating strings via uno apis com.sun.star.resource.StringResourceWithLocation can continue to be used Change-Id: Ia2594a2672b7301d9c3421fdf31b6cfe7f3f8d0a
2017-07-14tdf#103104 Allow line-continuation followed by a dot in BASICTakeshi Abe
as in VBA-compatibility mode. Change-Id: If263183fc1fa5742235213a8617fdf412d2a245e Reviewed-on: https://gerrit.libreoffice.org/39893 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Takeshi Abe <tabe@fixedpoint.jp>
2017-06-29VBA test - add RATE, RGB functionsZdeněk Crhonek
Change-Id: I284597a54067049479c56d6e6eea6322f0e3ee2b Reviewed-on: https://gerrit.libreoffice.org/39377 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Zdenek Crhonek <zcrhonek@gmail.com>
2017-06-07tdf#108039: check for nullptr in rtl_uString and OUStringMike Kaganski
rtl_[u]String_newConcat now checks allocation result to return early and avoid SIGSEGV. Other functions are not modified, to keep old behavior relying on allocation success and crashing early on OOM to avoid added overhead in performance-critical places. OUString operator+= now checks rtl_uString_newConcat result and throws std::bad_alloc on failure, to specifically address BASIC problem. It keeps strong exception guarantee of leaving this' state unaltered. Concatenation in BASIC now checks for bad string allocation (previously SIGSEGV was generated). Unit test included. Change-Id: I1513311d3d58eac43b2d2ec9a230e22dff0b4245 Reviewed-on: https://gerrit.libreoffice.org/37965 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Jenkins <ci@libreoffice.org>
2017-05-30basic: Drop unused variables in test scriptsTakeshi Abe
Change-Id: I9893e8bed254dcac91fbc7abb5ab4817a28ba339 Reviewed-on: https://gerrit.libreoffice.org/38133 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Takeshi Abe <tabe@fixedpoint.jp>
2017-05-27add VBA tests- PMT, PPMT, PV,QBCOLOR functionsZdeněk Crhonek
Change-Id: Idcbecbdee6a6c054886d6a11ce22e525ecf23736 Reviewed-on: https://gerrit.libreoffice.org/38084 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Zdenek Crhonek <zcrhonek@gmail.com>
2017-05-24tdf#93727 Support date literals in basicGrzegorz Araminowicz
* detect #...# in SbiScanner * add vb test * made date locale-independent Change-Id: Ic269df2df8d3a7c5af7858c3655bb40a0b6033f0 Reviewed-on: https://gerrit.libreoffice.org/36002 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com>
2017-05-22Test _WIN32 instead of WIN32Takeshi Abe
since the former is predefined by Visual C++ [0], but the latter is not. [0] https://msdn.microsoft.com/en-us/library/b0084kay.aspx Change-Id: I9ecb84779cbaf5f0186ef0b05da61b32293f8f2b Reviewed-on: https://gerrit.libreoffice.org/37808 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2017-05-19loplugin:comparisonwithconstant in basicNoel Grandin
Change-Id: Ie34a17d2fb465ffbe675ba4e99917d23959f1fb5 Reviewed-on: https://gerrit.libreoffice.org/37809 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-19basic: Fix broken unit test for IsMissing()Takeshi Abe
Change-Id: Ia6fb2622c85686a50701d4c37356e608a3df653b Reviewed-on: https://gerrit.libreoffice.org/37775 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Takeshi Abe <tabe@fixedpoint.jp>
2017-05-18basic: Fix broken unit test for Join()Takeshi Abe
Change-Id: Ib9768097d73fe664e24da4c3989141e87342a34e Reviewed-on: https://gerrit.libreoffice.org/37711 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Takeshi Abe <tabe@fixedpoint.jp>
2017-05-17basic: Fix broken test for VBA's LCaseTakeshi Abe
Change-Id: Icdbe62d4faa04b59a5cc11ea8f72f5e88f664a6d Reviewed-on: https://gerrit.libreoffice.org/37682 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2017-05-16basic: Test VBA's CDec() only on WindowsTakeshi Abe
since it is not implemented on others. Change-Id: If058207eb441caa65f93bbb554fe77cf469b1682 Reviewed-on: https://gerrit.libreoffice.org/37631 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Takeshi Abe <tabe@fixedpoint.jp>
2017-05-15basic: Fix broken logic in VBA's unit testsTakeshi Abe
It should not be "OK" when no assertion passes. Change-Id: Ib6bab2d597a138468e96b4acf8c3be7abd112cca Reviewed-on: https://gerrit.libreoffice.org/37540 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Takeshi Abe <tabe@fixedpoint.jp>
2017-05-15basic: Fix VBA constant vbNewLine with unit testTakeshi Abe
... making its value CRLF on Windows and LF on others. A winding road of regressions passed through it; first b680e352546dc614f3b30bbe212e6b415a6a6bf4, then 7beeced463648fc67defea2ad48d58dd42f0ca1e. Change-Id: I9e4da4a17436949b4fea35481b8355b4321cb268 Reviewed-on: https://gerrit.libreoffice.org/37500 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Takeshi Abe <tabe@fixedpoint.jp>
2017-05-03VBA tests- MONTHNAME,NPER, NPV,OCT test caseZdeněk Crhonek
Change-Id: Ia6c732d4c205ba2461007feacce1403b83e6043b Reviewed-on: https://gerrit.libreoffice.org/37109 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Zdenek Crhonek <zcrhonek@gmail.com>
2017-05-03Add two digit year test for CDateToIso()Eike Rathke
Change-Id: I69f067327504023a2f2439a73cdb1fc6a703aa39
2017-05-02BASIC: handle the full tools::Date range from -32768-01-01 to 32767-12-31Eike Rathke
* Input of two-digit years only possible through CDateFromIso() though to maintain compatibility with previous behavior and also VBA mode. * VBA mode restricted to years 1..9999 Change-Id: Ia9574c3bf136619b4831b349d263c96b162d1ed4
2017-04-28Add unit test for CDateFromIso with YYYY-MM-DD, tdf#106956Eike Rathke
Change-Id: Id7867228c091bb60764225a6436087dd390f13de
2017-04-28loplugin:cppunitassertequals: basicStephan Bergmann
Change-Id: Icaa3e0eace6ccff365d4ebdb007771fc8a78671a
2017-04-16add VBA test casesZdeněk Crhonek
functions - LEFT, LEN, LOG, LTRIM, MID, MINUTE, MIRR, MONTH Change-Id: Ifa4c6c1b715772644afc4280379b2a9e8429842f Reviewed-on: https://gerrit.libreoffice.org/36551 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Zdenek Crhonek <zcrhonek@gmail.com>
2017-04-13add VBA test casesZdeněk Crhonek
tests: ISARRAY, ISDATE, ISEMPTY, ISERROR, ISMISSING, ISNULL, ISNUMERIC, ISOBJECT, JOIN, LBOUND, LCASE Change-Id: I0b0dacd0d62bf00680f33866ce7ec0152eec27e0 Reviewed-on: https://gerrit.libreoffice.org/36509 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Zdenek Crhonek <zcrhonek@gmail.com>
2017-04-13VBA tests - INSTRREV, INT test caseZdeněk Crhonek
Change-Id: I220b8dd57927486b697b46777e20db7d2f53e487 Reviewed-on: https://gerrit.libreoffice.org/36486 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Zdenek Crhonek <zcrhonek@gmail.com>
2017-04-10Clean up uses of SAL_U/SAL_W: basicStephan Bergmann
Change-Id: I755b3b781c42cc9af61c0b90621d2eb7f544df62
2017-04-09VBA tests - HEX, HOUR, IIF, INSTR test casesZdeněk Crhonek
Change-Id: Ib9e05dcfbd72f56cb3b5fb4e4760f868c008c7ac Reviewed-on: https://gerrit.libreoffice.org/36315 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Zdenek Crhonek <zcrhonek@gmail.com>
2017-04-09VBA tests - FORMATNUMBER functionZdeněk Crhonek
Change-Id: Ibfb00e5be9a32e3767ec4e73cdbf81f53f07b42e Reviewed-on: https://gerrit.libreoffice.org/36229 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Zdenek Crhonek <zcrhonek@gmail.com>
2017-04-04Finally switch MSVC to sal_Unicode = char16_t, tooStephan Bergmann
There is lots of (Windows-only) code that relied on sal_Unicode being the same as wchar_t, and the best change may be different in each case (and doing the changes may be somewhat error prone). So for now add SAL_U/SAL_W scaffolding functions to sal/types.h, remove their uses one by one again, and finally drop those functions again. Change-Id: I2cc791bd941d089901abb5f6fc2f05fbc49e65ea Reviewed-on: https://gerrit.libreoffice.org/36077 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-04-02add VBA tests- FIX,EXP,ERROR,DAY functionsZdeněk Crhonek
Change-Id: I339abf03f88a0b8135184a892f5200ad381310bd Reviewed-on: https://gerrit.libreoffice.org/36010 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Zdenek Crhonek <zcrhonek@gmail.com>
2017-03-29VBA tests - add DATEDIFF and DATEPART test caseZdeněk Crhonek
Change-Id: I3d0026e707369e435013be1d11e1366a77ff2d0b Reviewed-on: https://gerrit.libreoffice.org/35881 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Zdenek Crhonek <zcrhonek@gmail.com>