summaryrefslogtreecommitdiff
path: root/basic/qa
AgeCommit message (Collapse)Author
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>
2017-03-18VBA tests - add CVDATE,CVERR,DATEADD test caseZdeněk Crhonek
Change-Id: Ib6b79eb3a3daf22dd4f15427a3e8547300f8b8f9 Reviewed-on: https://gerrit.libreoffice.org/35403 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Zdenek Crhonek <zcrhonek@gmail.com>
2017-03-17VBA tests - add CSNG, CSTR test caseZdeněk Crhonek
Change-Id: I5e9bc24bb89cc634a3c01e8c8b23a19927e7010c Reviewed-on: https://gerrit.libreoffice.org/35341 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Zdenek Crhonek <zcrhonek@gmail.com>
2017-03-11add VBA test CINT,CLNG functions testsZdeněk Crhonek
Change-Id: I69f0144006e4ed226e8b158c0cc9f60dda0a9184 Reviewed-on: https://gerrit.libreoffice.org/35060 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Zdenek Crhonek <zcrhonek@gmail.com>
2017-03-10add VBA COS function test caseZdeněk Crhonek
Change-Id: I9014e068576d68613da6a70526dcb5b8e278e3f1 Reviewed-on: https://gerrit.libreoffice.org/35027 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Zdenek Crhonek <zcrhonek@gmail.com>
2017-03-06VBA test CHOOSE functionZdeněk Crhonek
Change-Id: Ieb76595199ea1f6c23924d4860228fe5f4d30df1 Reviewed-on: https://gerrit.libreoffice.org/34909 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Zdenek Crhonek <zcrhonek@gmail.com>
2017-03-04VBA test CDATE, CDBL functionZdeněk Crhonek
Change-Id: Id45930e6d329a0b1142bfde612c1a089390e4817 Reviewed-on: https://gerrit.libreoffice.org/34868 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Zdenek Crhonek <zcrhonek@gmail.com>
2017-03-03Fix typosAndrea Gelmini
Change-Id: Iaefa094c82006346897f5563ac3ddcdc60ab68a3 Reviewed-on: https://gerrit.libreoffice.org/34809 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-03-01add VBA functions tests - ABS,ARRAY, ASC, ATN, CBOOLZdeněk Crhonek
Change-Id: I8a0b8b833ba32b9d27773748b3bbd8bbc07d1959 Reviewed-on: https://gerrit.libreoffice.org/34696 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Zdenek Crhonek <zcrhonek@gmail.com>
2017-02-28VBA: unit test for PtrSafe and compiler directivesJustin Luth
#If Vba7 Declare PtrSafe Function xx #Else Declare Function xx #End if Change-Id: I807efb9fa68b5ac50f2bd59ba7cfa45c499af189 Reviewed-on: https://gerrit.libreoffice.org/34522 Reviewed-by: Justin Luth <justin_luth@sil.org> Tested-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2017-02-27add VBA CHR() test caseZdeněk Crhonek
Change-Id: I9e7aefdd0309fd4f209fba6fb4f698b098856d01 Reviewed-on: https://gerrit.libreoffice.org/34133 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com>
2017-02-07Our GetSystemTicks can now again return negative 32-bit values on WindowsTor Lillqvist
See 93bde3156284df4419c49447cbf455de9d74f00a . Change-Id: Ib41c2d525faab2bedab10f91c3a4f62f94870e10
2017-02-03makeAny->Any in basctl..chart2Noel Grandin
Change-Id: Ief1cdffbfc59ab4e35ac945d020772ff84c50d61 Reviewed-on: https://gerrit.libreoffice.org/33867 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-02convert method names in tools::SvRef to be more like our other..Noel Grandin
reference classes, uno::Reference and rtl::Reference. Specifically rename Is()->is() and Clear()->clear(). Change-Id: Icb7e05e2d09cb9977121508b837ba0961dabb4ae Reviewed-on: https://gerrit.libreoffice.org/33576 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-01-09Revert "Remove test_getsystemticks_method.vb for now"Stephan Bergmann
This reverts commit 93a8ebac2d6eb124bf57223069765af08fcd5c85, now that fce604c8ae11b462113305aba080d77f8193cfea "[API CHANGE] return unsigned 64-bit value from GetSystemTicks in basic code" is in.
2017-01-09Remove test_getsystemticks_method.vb for nowStephan Bergmann
Introduced with 060c2b9b1b0d3c9cf27f1b289a620cfa82b5b060 "QA Basic: split tests of methods in different files", but GetSystemTicks appears to routinely return negative values. Change-Id: Ibccdf753aea581e05e9d4e1bf551ae72dc70c959
2017-01-06QA Basic: split tests of methods in different filesLaurent Balland-Poirier
Following resolution of "Missing TAN method" [1] as discussed on dev list [2] a large majority of methods are now tested with (almost) one method per file Missing methods: - colors failed: RED, GREEN, BLUE - file methods: DIR, CHDRIVE, EOF,... - financial methods calling Calc functions: IPmt, IRR,... - not totaly implemented methods (?): ROUND, WAITUNTIL... [1] https://bugs.documentfoundation.org/show_bug.cgi?id=102872 [2] http://nabble.documentfoundation.org/QA-test-for-BASIC-functions-tt4202257.html Change-Id: I2b2824b5b18a2cfbbee2bbc5369e9e2b9e5c930b Reviewed-on: https://gerrit.libreoffice.org/32519 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2016-12-24basic: cleanup test_*_methodsLaurent Balland-Poirier
cleanup remove duplicate test with other tests Change-Id: I4c82ad9f226f25080199ac0dc3815492fc4c265a Reviewed-on: https://gerrit.libreoffice.org/31860 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Arnaud Versini <arnaud.versini@libreoffice.org>
2016-12-14Partially fix VBATest::testMiscOLEStuff for Win64Mike Kaganski
On Windows x64 there are two ODBCs - one for each bitness. A 64-bit build gets 64-bit ODBC, and there is no provider named "Microsoft Excel Driver (*.xls)", no normally the test is simply skipped. But if MS Excel is installed, then it installs provider "Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)", that was detected by previous code, but not used inside the VBAs. So, VBAs tried to use "Microsoft Excel Driver (*.xls)" unavailable to them. This patch allows using Excel's provider as well, thus allowing developer to test against 64-bit-specific regressions. However, the last test uses Microsoft.Jet.OLEDB.4.0 provider, that is unavailable on Win64. There are substitutions - Microsoft.ACE.OLEDB.12.0 and Microsoft.ACE.OLEDB.15.0, but there is no easy way to test if they are installed. Thus, that test is disabled on Win64 for now. Also, possible buffer overflow fixed, when byte count was passed to SQLGetInstalledDriversW instead of char count. Change-Id: Ib5c55251f0e92b3078a46aee173b5061439445ae Reviewed-on: https://gerrit.libreoffice.org/32019 Reviewed-by: Tor Lillqvist <tml@collabora.com> Tested-by: Tor Lillqvist <tml@collabora.com>
2016-12-04basic: cleanup test_math_methodsArnaud Versini
Change-Id: I11b3ca4c55151de7403ff9980ada9958d8ef12dc Reviewed-on: https://gerrit.libreoffice.org/31592 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Laurent BP <laurent.balland-poirier@laposte.net>
2016-11-23loplugin:unnecessaryoverride (dtors) in basicStephan Bergmann
Change-Id: I5756b96bcc7563b82e35d3cdfdda3b80692767e5
2016-11-22tdf#102872 Add qa unit test for BASIC methodsLaurent Balland-Poirier
Add test if several methods still works Change-Id: I8d26e5e3555dbbc0f07152138e1bc0cd65d90998 Reviewed-on: https://gerrit.libreoffice.org/30166 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: jan iversen <jani@documentfoundation.org> Tested-by: jan iversen <jani@documentfoundation.org> Reviewed-by: Laurent BP <laurent.balland-poirier@laposte.net>
2016-10-27Bypass VBATest::testMiscOLEStuff() in a 64-bit Windows build for nowTor Lillqvist
It fails when Excel is installed, for some reason: Basic error: Type: com.sun.star.uno.RuntimeException Message: [automation bridge] unexpected exception in IUnknownWrapper_Impl::invoke ! Message : [automation bridge]: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified macro result for ole_ObjAssignNoDflt.vb macro returned: C:/cygwin64/home/Tor/lo/64bit-debug/basic/qa/cppunit/test_vba.cxx:155:`anonymous namespace'::VBATest::testMiscOLEStuff assertion failed - Expression: pReturn->GetOUString() == "OK" - Result not as expected Note that this test returns early if Excel is not installed, so it is not run effectively performed anyway even in 32-bit builds on most (any?) Jenkins and tinderbox machines. Change-Id: I0a0b6f27219dec116369fae1bb7c95b3e9597e77
2016-10-16clang-cl loplugin: basicStephan Bergmann
Change-Id: Ibb324ac81343d56038d18a4ee9b27b486df6e520 Reviewed-on: https://gerrit.libreoffice.org/29881 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2016-10-10tdf#89307: Removed SvRef::operator T*()Jacek Fraczek
Conditional statements are using SvRef::Is() method. Changed static_cast<T*>(svRef<T>) occurances to svRef.get(). Added operator == and != to SvRef. SbxObject::Execute is using SbxVariableRef internally. SbxObject::FindQualified is using SbxVariableRef internally. Change-Id: I45b553e35d8fca9bf71163e6eefc60802a066395 Reviewed-on: https://gerrit.libreoffice.org/29621 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2016-10-05Remove _TYPED suffix from tools/link.hxx macrosStephan Bergmann
...which was introduced with 3ead3ad52f9bb2f9d1d6cf8dfc73a0a25e6778ed "Gradually typed Link" to distinguish the new, typed versions from the old, untyped ones, but is no longer necessary since 382eb1a23c390154619c385414bdbe6f6e461173 "remove untyped Link<>" removed the old versions. Change-Id: I494025df486a16a45861fcd8192dfe0275b1103c