139 Commits

Author SHA1 Message Date
Stephan Bergmann
9ac98e6e34 Finally switch MSVC to sal_Unicode = char16_t, too
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-04 16:12:11 +00:00
Zdeněk Crhonek
d9dc5dcd39 add VBA tests- FIX,EXP,ERROR,DAY functions
Change-Id: I339abf03f88a0b8135184a892f5200ad381310bd
Reviewed-on: https://gerrit.libreoffice.org/36010
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Zdenek Crhonek <zcrhonek@gmail.com>
2017-04-02 11:02:27 +00:00
Zdeněk Crhonek
a2c746ecd8 VBA tests - add DATEDIFF and DATEPART test case
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-29 21:01:48 +00:00
Zdeněk Crhonek
1e02750ef2 VBA tests - add CVDATE,CVERR,DATEADD test case
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-18 16:26:09 +00:00
Zdeněk Crhonek
7ea2962e76 VBA tests - add CSNG, CSTR test case
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-17 17:39:13 +00:00
Zdeněk Crhonek
c0ed8e9537 add VBA test CINT,CLNG functions tests
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-11 06:16:58 +00:00
Zdeněk Crhonek
1577f01b29 add VBA COS function test case
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-10 20:18:41 +00:00
Zdeněk Crhonek
8528712b6e VBA test CHOOSE function
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-06 05:43:29 +00:00
Zdeněk Crhonek
ed0e8f970f VBA test CDATE, CDBL function
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-04 09:20:02 +00:00
Andrea Gelmini
0a850f3e15 Fix typos
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-03 07:47:54 +00:00
Zdeněk Crhonek
38f13e4dca add VBA functions tests - ABS,ARRAY, ASC, ATN, CBOOL
Change-Id: I8a0b8b833ba32b9d27773748b3bbd8bbc07d1959
Reviewed-on: https://gerrit.libreoffice.org/34696
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Zdenek Crhonek <zcrhonek@gmail.com>
2017-03-01 05:16:52 +00:00
Justin Luth
56d44e10df VBA: unit test for PtrSafe and compiler directives
#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-28 02:49:25 +00:00
Zdeněk Crhonek
b5c83cf676 add VBA CHR() test case
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-27 20:37:36 +00:00
Tor Lillqvist
90aac3a3fd Our GetSystemTicks can now again return negative 32-bit values on Windows
See 93bde3156284df4419c49447cbf455de9d74f00a .

Change-Id: Ib41c2d525faab2bedab10f91c3a4f62f94870e10
2017-02-07 11:55:55 +02:00
Noel Grandin
83721f4365 makeAny->Any in basctl..chart2
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-03 08:50:50 +00:00
Noel Grandin
4978328534 convert method names in tools::SvRef to be more like our other..
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-02-02 08:02:54 +00:00
Stephan Bergmann
b6988293c1 Revert "Remove test_getsystemticks_method.vb for now"
This reverts commit 93a8ebac2d6eb124bf57223069765af08fcd5c85, now that
fce604c8ae11b462113305aba080d77f8193cfea "[API CHANGE] return unsigned 64-bit
value from GetSystemTicks in basic code" is in.
2017-01-09 14:25:54 +01:00
Stephan Bergmann
93a8ebac2d Remove test_getsystemticks_method.vb for now
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-09 10:53:30 +01:00
Laurent Balland-Poirier
060c2b9b1b QA Basic: split tests of methods in different files
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>
2017-01-06 09:35:44 +00:00
Laurent Balland-Poirier
40578897d3 basic: cleanup test_*_methods
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-24 16:28:28 +00:00
Mike Kaganski
5ecd7ebbdf Partially fix VBATest::testMiscOLEStuff for Win64
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-14 19:03:56 +00:00
Arnaud Versini
8d43bc6ce8 basic: cleanup test_math_methods
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-12-04 12:21:05 +00:00
Stephan Bergmann
f338935019 loplugin:unnecessaryoverride (dtors) in basic
Change-Id: I5756b96bcc7563b82e35d3cdfdda3b80692767e5
2016-11-23 18:37:02 +01:00
Laurent Balland-Poirier
8a50ea5454 tdf#102872 Add qa unit test for BASIC methods
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-11-22 09:30:41 +00:00
Tor Lillqvist
f29ce347f9 Bypass VBATest::testMiscOLEStuff() in a 64-bit Windows build for now
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-27 12:33:34 +03:00
Stephan Bergmann
233e5d5f85 clang-cl loplugin: basic
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-16 14:19:33 +00:00
Jacek Fraczek
f004aa9951 tdf#89307: Removed SvRef::operator T*()
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-10 08:48:30 +00:00
Stephan Bergmann
106ea87205 Remove _TYPED suffix from tools/link.hxx macros
...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
2016-10-05 07:56:12 +02:00
Stephan Bergmann
91dd2db17b loplugin:override: No more need for the "MSVC dtor override" workaround
The issue of 362d4f0cd4e50111edfae9d30c90602c37ed65a2 "Explicitly mark
overriding destructors as 'virtual'" appears to no longer be a problem with
MSVC 2013.

(The little change in the rewriting code of compilerplugins/clang/override.cxx
was necessary to prevent an endless loop when adding "override" to

  OOO_DLLPUBLIC_CHARTTOOLS    virtual ~CloseableLifeTimeManager();

in chart2/source/inc/LifeTime.hxx, getting stuck in the leading
OOO_DLLPUBLIC_CHARTTOOLS macro.  Can't remember what that
isAtEndOfImmediateMacroExpansion thing was originally necessary for, anyway.)

Change-Id: I534c634504d7216b9bb632c2775c04eaf27e927e
2016-09-13 13:19:22 +02:00
Miklos Vajna
4e6d0f6fe7 basic: fix loplugin:cppunitassertequals warnings
Change-Id: I80c773f3127ebbce4b9b2a122a91a2e2ca4f505b
Reviewed-on: https://gerrit.libreoffice.org/27424
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
2016-07-22 08:32:36 +00:00
Muhammet Kara
d5784e91e9 Improve readability of OUString concatanation in LibPage
, ScriptDocument
, PropBrw
, VBATest
, SbUnoClass
, SbModule
, and SbiSymPool

It is more readable and more efficient as a bonus.
See: https://goo.gl/jsVAwy:

Change-Id: I73926989345193b133e538d5aeca36f12723162c
Reviewed-on: https://gerrit.libreoffice.org/26853
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2016-07-03 15:46:58 +00:00
Noel Grandin
cea4c1afdf loplugin:singlevalfields in basic and fix leak
And fix leak in BasicManagerImpl where it would never have freed
the streams.

Change-Id: I1e99c2c6a70a8cac27dd5c86a7042efc3de7a578
Reviewed-on: https://gerrit.libreoffice.org/26632
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-06-27 05:17:31 +00:00
Tomofumi Yagi
d2a44e6270 tdf#99696 fix build error for 64bit Windows in unit tests using ADODB
This patch fixes the problem that the build for x64 fails in basic module
on 64bit Windows installed 32bit Excel Application.

New code checks the existance of ODBC driver for excel insted of the
existance of Excel application(at this time the bitness of ODBC driver for
excel would match that of building LibreOffice).

What we need is probably not Excel Application but ODBC drivers for proper
bitness.

Change-Id: I62285eb2351f2022754fc34cb2d54db1bd9e8142
Reviewed-on: https://gerrit.libreoffice.org/25301
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
2016-05-30 09:30:33 +00:00
Noel Grandin
f107d45381 Convert SbxClassType to scoped enum
Change-Id: I48afcdd9924d22b52a8db21aa253061e4d38c85b
Reviewed-on: https://gerrit.libreoffice.org/25259
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-23 11:49:32 +00:00
Ryan McCoskrie
666dc67eaf Remove needless typedef from basic/qa/cppunit/basic_coverage.cxx
Change-Id: Iba1c48d58daa618107ad84240d613f675d447aad
Reviewed-on: https://gerrit.libreoffice.org/24175
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-04-18 07:16:41 +00:00
Stephan Bergmann
60b1c95cc4 Extract Directories from BootstrapFixtureBase
(as some tests derive from the latter only for the Directories part, not for the
setUp/tearDown overrides: those tests will be cleaned up next)

Change-Id: Ib6b78eea868b8bc21d4cc6e8fd9e1d025deca05f
Reviewed-on: https://gerrit.libreoffice.org/23078
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2016-03-10 08:04:40 +00:00
Noel Grandin
2087484c65 use consistent #define checks for the Windows platform
stage 2 of replacing usage of various checks for the windows platform
with the compiler-defined '_WIN32' macro

In this stage we focus on replacing usage of the WIN macro

Change-Id: Ie8a4a63198a6de96bd158ecd707dadafb9c8ea84
Reviewed-on: https://gerrit.libreoffice.org/22393
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-02-17 11:33:57 +00:00
Laurent Balland-Poirier
d977a49ef0 tdf#40517 Unit test for question marks in number format
Unit test for https://gerrit.libreoffice.org/21021/

Add unit test for Engineering format
Add unit test for optional sign in exponent

Change-Id: I958ccdcc68a4e496cbd4bdc74d0650c133f3a3f7
Reviewed-on: https://gerrit.libreoffice.org/21824
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2016-02-17 08:53:33 +00:00
Noel Grandin
b14224fe97 loplugin:unusedmethods
using an idea from dtardon:

<dtardon> noelgrandin, hi. could you try to run the unusedmethods clang
plugin with "make build-nocheck"? that would catch functions that are
only used in tests. e.g., i just removed the whole o3tl::range class,
which has not been used in many years, but htere was a test for it...
<noelgrandin> dtardon, interesting idea! Sure, I can do that.

Change-Id: I5653953a426a2186a1e43017212d87ffce520387
Reviewed-on: https://gerrit.libreoffice.org/22041
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-02-08 06:08:14 +00:00
Matúš Kukan
aa20acb87d basic: Merge macro snippet tests
Change-Id: Ia2d8944227c6be8b5ae7b42f7d566ac150d522b9
2016-02-05 21:20:50 +01:00
Stephan Bergmann
38e965fe0f Use CPPUNIT_ASSERT_DOUBLES_EQUAL
...except when checking for infinity

Change-Id: If6e3b8965169cc615fa5d76422e1925866714936
2016-01-04 14:02:41 +01:00
Stephan Bergmann
efcbfa6f42 loplugin:cstylecast
Change-Id: I5ecd63d79e8be77879d3789c45079929696abe03
2016-01-04 13:44:48 +01:00
Dipangar Niranjar
0e41527fd5 tdf#96136 replace CPPUNIT_ASSERT with CPPUNIT_ASSERT_EQUAL
Change-Id: Ib45af8a56ac3adc428c530908cf1bbd95e9cc64c
Reviewed-on: https://gerrit.libreoffice.org/21065
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: jan iversen <jani@documentfoundation.org>
2016-01-04 11:40:41 +00:00
Stephan Bergmann
88ab9d4aa0 Get order of expected/actual args to CPPUNIT_ASSERT_EQUAL right
Change-Id: I0fa26417630991c6d07b5412fb579f9c222d09a6
2015-11-30 11:49:15 +01:00
Markus Mohrhard
36b658d389 generate better unit test assert message
Change-Id: Ibba7f18fefb4f2851472a6ae0b41447237a6b97f
Reviewed-on: https://gerrit.libreoffice.org/20270
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2015-11-29 20:22:45 +00:00
Noel Grandin
1f86864e97 loplugin:unusedfields various
Change-Id: I59d9f7f73677358b4ae57efda965d43718bdf0d5
2015-11-25 13:57:29 +02:00
Stephan Bergmann
08e49fa337 loplugin:nullptr (automatic rewrite)
Change-Id: I1ec9a671fe3ac838feb36297915e3cdf8749d944
2015-11-10 10:31:17 +01:00
Stephan Bergmann
a80bab7058 loplugin:stringconstant: elide explicit ctor usage (automatic rewrite)
Change-Id: I9979100550a86ac3f42d74a5403fb3ffd9d5006b
2015-11-06 09:34:39 +01:00
Benjamin Ni
be729e7721 tdf#94269: Replace "n" prefix for bool variables with "b"
Change-Id: I178545792c7354a362658ac7ef8b1d4cf0865797
Signed-off-by: Michael Stahl <mstahl@redhat.com>
2015-11-02 23:40:57 +01:00
Noel Grandin
065c8b48a6 use uno::Reference::set method instead of assignment
Change-Id: I58410209f32f988f258a588364e0b037c2790211
2015-10-30 08:10:22 +02:00