summaryrefslogtreecommitdiff
path: root/test/source
AgeCommit message (Collapse)Author
2018-12-05tdf#45904 Move XRefreshable Java tests to C++Jens Carl
Move XRefreshable Java tests to C++ for ScDDELinkObj. Change-Id: I121d9fe6a66c549e402b0cf6fd54fea1201e443f Reviewed-on: https://gerrit.libreoffice.org/64511 Tested-by: Jenkins Reviewed-by: Jens Carl <j.carl43@gmx.de>
2018-12-04tdf#45904 Move XNamed Java tests to C++Jens Carl
Move XNamed Java tests to C++ for ScDDELinkObj and refactor class XNamed. ScDDELinkObj doesn't allow to set the name, so test that a exception of type RuntimeException is thrown. Change-Id: Ie110c3c0ea22d205d4f2c4575f3db3676dda9ce3 Reviewed-on: https://gerrit.libreoffice.org/64497 Tested-by: Jenkins Reviewed-by: Jens Carl <j.carl43@gmx.de>
2018-12-01Rename testGetByIndex to testIndexJens Carl
Rename testGetByIndex to testIndex of sheet::XSheetAnnotations test cases so it won't collide with testGetByIndex of container::XIndexAccess. Change-Id: Ic48ffe954c9f4f00b68066ad5d0d2df89cc4dfd7 Reviewed-on: https://gerrit.libreoffice.org/64402 Tested-by: Jenkins Reviewed-by: Jens Carl <j.carl43@gmx.de>
2018-12-01Enable XIndexAccess test casesJens Carl
Add macro OOO_DLLPUBLIC_TEST to class XIndexAccess (needed to use the test cases), refactor ctor, and add missing header files. Change-Id: Id8b27c8c3a3d7fc5c64fafd25b0d9b4b511c281f Reviewed-on: https://gerrit.libreoffice.org/64375 Tested-by: Jenkins Reviewed-by: Jens Carl <j.carl43@gmx.de>
2018-12-01Enable XElementAccess test casesJens Carl
The class XElementAccess was missing the macro OOO_DLLPUBLIC_TEST, and so it wasn't possible to use these test cases. Change-Id: I358bb840c6088ea25b60ee57b8c69f31ab71ddbb Reviewed-on: https://gerrit.libreoffice.org/64363 Tested-by: Jenkins Reviewed-by: Jens Carl <j.carl43@gmx.de>
2018-11-30Give CPPUNIT_ASSERT_MESSAGE a more meaningful messageJens Carl
Change-Id: Ia83a4403243a2b2ab98c2b0e6a28213ce6fe1269 Reviewed-on: https://gerrit.libreoffice.org/64314 Tested-by: Jenkins Reviewed-by: Jens Carl <j.carl43@gmx.de>
2018-11-29tdf#42949 Fix IWYU warnings in include/vcl/[i-m]*Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: If1b2e04872eb0dd6725802c1709a9085f4cd8c91 Reviewed-on: https://gerrit.libreoffice.org/64141 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2018-11-27tdf#42949 Fix IWYU warnings in include/vcl/[f-h]*Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: Ice2eb8c5994bf2ccb88972332ca4a1d3ed41752a Reviewed-on: https://gerrit.libreoffice.org/63826 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2018-11-27tdf#45904 Move _XLinkTargetSupplier Java Tests to C++Rahul Gurung
Change-Id: Idd62a6458d7aa0d1d8a479f5ebf78637e0360548 Reviewed-on: https://gerrit.libreoffice.org/63950 Tested-by: Jenkins Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2018-11-21loplugin:redundantfcast improvementsNoel Grandin
check for calls to constructors, and extend the list of types we check for unnecessary temporary creation Change-Id: Ia2c1f202b41ed6866779fff5343c821128033eec Reviewed-on: https://gerrit.libreoffice.org/63472 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-14tdf#45904 Move _XEnumeration for ScCellsEnumeration to C++Jens Carl
Change-Id: Ic7c8e6a9fe777d16a98da89e00f1f52128ac1b5d Reviewed-on: https://gerrit.libreoffice.org/63351 Tested-by: Jenkins Reviewed-by: Jens Carl <j.carl43@gmx.de>
2018-11-08tdf#113624 EMF+ Fix shift of DrawString without StringFormatBartosz Kosiorek
While we are drawing DrawString record, in most cases optional StringFormat information is available. If StringFromat information is available then we should use default values. For LeadingMargin for String the default value is 1/6 inch. Change-Id: I4a0a68df5ebe74e810f8b5864232b477b3aac255 Reviewed-on: https://gerrit.libreoffice.org/62927 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2018-11-02tdf#45904 Move _XEnumerationAccess Java Tests to C++Rahul Gurung
Change-Id: Id0aa9f3587fc6427bdbd938293eb3cc564c52bb1 Reviewed-on: https://gerrit.libreoffice.org/61731 Tested-by: Jenkins Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2018-10-30tdf#116989: add unit testMike Kaganski
Change-Id: Ia8b5478b0d2a15f91add4ee76455e73c2c970392 Reviewed-on: https://gerrit.libreoffice.org/62544 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-10-24Simplify containers iterations in test..toolsArkadiy Illarionov
Use range-based loop or replace with STL functions. Change-Id: If8fac9236a4696c8e56c0e81c60c429782581b96 Reviewed-on: https://gerrit.libreoffice.org/62262 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-24remove more rtl::OUString and OString prefixesNoel Grandin
which seem to have snuck back in since the great rounds of removals. Change-Id: I85f7f5f4801c0b48dae8b50f51f83595b286d6a1 Reviewed-on: https://gerrit.libreoffice.org/62229 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-24clang-tidy performance-unnecessary-copy-init in test..xmlscriptNoel Grandin
Change-Id: I1ae16467a8e58e8a50f59b7a140e9f8b68bde07e Reviewed-on: https://gerrit.libreoffice.org/62254 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-22Let CppuniTest's unoexceptionprotector handle uncaught exceptionsStephan Bergmann
(it nicely prints exceptions' messages, too) Change-Id: I66bb4fd856d0249a7dc5bc58975b6ea322f9a9ca Reviewed-on: https://gerrit.libreoffice.org/62165 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-10-19clang-tidy readability-container-size-emptyNoel Grandin
Change-Id: I1df70b7dff5ebb6048f7fc618789faa15ca5d422 Reviewed-on: https://gerrit.libreoffice.org/61967 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-18clang-tidy readability-simplify-boolean-exprNoel Grandin
Change-Id: I78fa01a6c803dec782488490b730af3a11814d64 Reviewed-on: https://gerrit.libreoffice.org/61902 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-16tdf#45904 Move _XTableChartsSupplier Java Tests to C++Rahul Gurung
Change-Id: I4cd0b25cefce60e8253df65d5136d15d690dbc38 Reviewed-on: https://gerrit.libreoffice.org/61540 Tested-by: Jenkins Reviewed-by: Jens Carl <j.carl43@gmx.de>
2018-10-12clang-tidy misc-throw-by-value-catch-by-referenceNoel Grandin
Change-Id: I04750771b63551fd3df522753a4ed21b8d5c42f3 Reviewed-on: https://gerrit.libreoffice.org/61680 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-03loplugin:constfields in swNoel Grandin
Change-Id: I1eb6583bb9ec815bc0564b0d7c676f5b1fb9045f Reviewed-on: https://gerrit.libreoffice.org/61177 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-25screenshots: add better diagnostics for failing CIThorsten Behrens
Output current UI file being processed, in case any random exception pops up. Change-Id: If6937f70718cc801494f424f7e09e9cb8c8758f0 (cherry picked from commit fb5d849cdeebe5299da399efc9d0ca36b6fc192b) Reviewed-on: https://gerrit.libreoffice.org/60964 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2018-09-22tdf#45904 Move _XIndent Java Tests to C++Rahul Gurung
Change-Id: I65b594db595f0e08a50a9ea18baf44c496cf18e3 Reviewed-on: https://gerrit.libreoffice.org/60218 Tested-by: Jenkins Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2018-09-17New loplugin:externalStephan Bergmann
...warning about (for now only) functions and variables with external linkage that likely don't need it. The problems with moving entities into unnamed namespacs and breaking ADL (as alluded to in comments in compilerplugins/clang/external.cxx) are illustrated by the fact that while struct S1 { int f() { return 0; } }; int f(S1 s) { return s.f(); } namespace N { struct S2: S1 { int f() { return 1; } }; int f(S2 s) { return s.f(); } } int main() { return f(N::S2()); } returns 1, both moving just the struct S2 into an nunnamed namespace, struct S1 { int f() { return 0; } }; int f(S1 s) { return s.f(); } namespace N { namespace { struct S2: S1 { int f() { return 1; } }; } int f(S2 s) { return s.f(); } } int main() { return f(N::S2()); } as well as moving just the function f overload into an unnamed namespace, struct S1 { int f() { return 0; } }; int f(S1 s) { return s.f(); } namespace N { struct S2: S1 { int f() { return 1; } }; namespace { int f(S2 s) { return s.f(); } } } int main() { return f(N::S2()); } would each change the program to return 0 instead. Change-Id: I4d09f7ac5e8f9bcd6e6bde4712608444b642265c Reviewed-on: https://gerrit.libreoffice.org/60539 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-09-10tdf#45904 Move _XMergeable Java Tests to C++Rahul Gurung
Change-Id: I37dc759a64301810a7d32a3f160b9bcbf546dd01 Reviewed-on: https://gerrit.libreoffice.org/60211 Tested-by: Jenkins Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2018-09-10tdf#45904 Move _XChild Java tests to C++Rahul Gurung
Change-Id: Idaf883eadb95792bdb333dea487be084b1722194 Reviewed-on: https://gerrit.libreoffice.org/60146 Tested-by: Jenkins Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2018-09-07DeInitVCL in PythonTestStephan Bergmann
After b9757f5cfdb62b24e79eeb4c0ef0c8b98056cecf "loplugin:useuniqueptr in vcl/svdata" ASan/UBSan builds started to fail (like <https://ci.libreoffice.org//job/lo_ubsan/1025/>) at the end of PythonTest_dbaccess_python (and probably other PythonTests), when during exit the static utl::ConfigManager instance already happens to be destroyed by the time the static ImplSVData's mpSettingsConfigItem is destroyed (which would normally be cleared during DeInitVCL, if PythonTests would call that, and which in the past had thus simply been leaked in PythonTests when that mpSettingsConfigItem was a plain pointer instead of std::unique_ptr). So ensure that PythonTests that initialize VCL also call DeInitVCL, via a new private_deinitTestEnvironment, complementing the existing private_initTestEnvironment. However, while private_initTestEnvironment is called once (typically via UnoInProcess.setUp, which internally makes sure to only call it once) as soon as the first executed test needs it, private_deinitTestEnvironment must be called once after the lasts test needing it has executed. The only way that I found to do that is to override unittest.TextTestResult's stopTestRun method, which is called once after all tests have been executed. Hence a new test runner setup in unotest/source/python/org/libreoffice/unittest.py that is now called from solenv/gbuild/PythonTest.mk. That revealed a few places in PythonTests that didn't yet close/delete documents that they had opened, which has now been added. One remaining problem then is that classes like SwXTextDocument and friends call Application::GetSolarMutex from their dtors, via sw::UnoImplPtrDeleter (a "Smart pointer class ensuring that the pointed object is deleted with a locked SolarMutex", sw/inc/unobaseclass.hxx). That means that any PyUNO proxies to such C++ objects that remain alive after private_deinitTestEnvironment will cause issues at exit, when Python does a final garbage collection of those objects. The ultimate fix will be to remove that unhelpful UnoImplPtrDeleter and its locking of SolarMutex from the dtors of UNO objects; until then, the Python code is now sprinkled with some HACKs to make sure all those PyUNO proxies are released in a timely fashion (see the comment in unotest/source/python/org/libreoffice/unittest.py for details). (Also, it would probably help if UnoInProcess didn't keep a local self.xDoc around referencing (just) the last result of calling one of its open* methods, confusingly making it the responsibility of UnoInProcess to close that one document while making it the responsibility of the test code making the other UnoInProcess.open* calls to close any other documents.) Change-Id: Ief27c81e2b763e9be20cbf3234b68924315f13be Reviewed-on: https://gerrit.libreoffice.org/60100 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-09-06clang-tidy performance-unnecessary-value-paramNoel Grandin
Change-Id: I69247498e13331f6ef84afeb242479f8fb1178a8 Reviewed-on: https://gerrit.libreoffice.org/60068 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-06tdf#45904 Move _XColumnRowRange Java tests to C++Rahul Gurung
Change-Id: I35b5fc2f18867c386c8c92d1d7a3a0823bd07b78 Reviewed-on: https://gerrit.libreoffice.org/59863 Tested-by: Jenkins Reviewed-by: Jens Carl <j.carl43@gmx.de>
2018-09-05fix CppunitTest_cui_dialogs_test assertCaolán McNamara
Change-Id: I72bc0067cb0f0ecc648f216aad1c7e196749daff Reviewed-on: https://gerrit.libreoffice.org/60019 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-09-05tdf#45904 Move _XCell Java tests to C++Rahul Gurung
Change-Id: I79d8f42932f81bf8a2eb38fbd3eabbdf56c09111 Reviewed-on: https://gerrit.libreoffice.org/59901 Tested-by: Jenkins Reviewed-by: Jens Carl <j.carl43@gmx.de>
2018-08-30Fix typoAndrea Gelmini
Change-Id: Ib7d79f9ea2192e798891ea1c2a9d547c8ddf3574 Reviewed-on: https://gerrit.libreoffice.org/59790 Tested-by: Jenkins Reviewed-by: Jens Carl <j.carl43@gmx.de>
2018-08-30tdf#45904 Move _XCellCursor Java tests to C++Rahul Gurung
Change-Id: Iebada370e4fa58c5e21dd724789b5f05357a0faa Reviewed-on: https://gerrit.libreoffice.org/59610 Tested-by: Jenkins Reviewed-by: Jens Carl <j.carl43@gmx.de>
2018-08-13loplugin:returnconstant in hwpfilter,testNoel Grandin
Change-Id: I7c7c450f1da4ac3205148d2de8b344f0735f92ba Reviewed-on: https://gerrit.libreoffice.org/58881 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-02Add missing sal/log.hxx headersGabor Kelemen
rtl/string.hxx and rtl/ustring.hxx both unnecessarily #include <sal/log.hxx> (and don't make use of it themselves), but many other files happen to depend on it. This is a continuation of commit 6ff2d84ade299cb3d14d4110e4cf1a4b8070c030 to be able to remove those unneeded includes. This commit adds missing headers to every file found by: grep -FwL sal/log.hxx $(git grep -Elw 'SAL_INFO|SAL_INFO_IF|SAL_WARN|SAL_WARN_IF|SAL_DETAIL_LOG_STREAM|SAL_WHERE|SAL_STREAM|SAL_DEBUG') to directories from test to vbahelper Change-Id: Ia7f773511624099505d6a36a8d6e23c0cde4a737 Reviewed-on: https://gerrit.libreoffice.org/58225 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-07-29loplugin:stringloop in variousNoel Grandin
Change-Id: Ic2436c6d94729211cd5bc72fee18af228381e4a3 Reviewed-on: https://gerrit.libreoffice.org/58250 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-29cppcheck: useInitializationList in test to xmloffJochen Nitschke
Change-Id: I50545784c5412ab7767f401c6e40058a1d0bfab0 Reviewed-on: https://gerrit.libreoffice.org/58262 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-08tdf#45904 Move _XSheetCellCursor Java tests to C++Jens Carl
Change-Id: I9d12f9a13d3e0c59b7a28ff91563878efde22b68 Reviewed-on: https://gerrit.libreoffice.org/45067 Tested-by: Jenkins Reviewed-by: Jens Carl <j.carl43@gmx.de>
2018-07-08loplugin:passstuffbyrefNoel Grandin
Change-Id: I6e6c47020073ec183c6c8ff9cd026a0bec23b177 Reviewed-on: https://gerrit.libreoffice.org/57088 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-02tdf#117923: handle direct formatting for numbering in .docMike Kaganski
Since commit df07d6cb9f62c0a2c4b29bd850d4efb4fcd4790b, we do for DOCX. DOC also has this problem, so set the relevant compatibility flag on import for this format, too. Change-Id: I3aef593341edffa878a06566da815cb72aa38004 Reviewed-on: https://gerrit.libreoffice.org/56812 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-06-29schema: ODF 1.3 + libreoffice extensions schemaMichael Stahl
Build this with RelaxNG <include> feature instead of a complete schema. This isn't bad but could work better if the schema were a little more modular... In order to track down all the uses of extension namespaces like loext, invoke the validator without "-e". Change-Id: I92a666fc54c25d66cea38decdc188d60de2a0b74 Reviewed-on: https://gerrit.libreoffice.org/56488 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
2018-06-29test: invoke ODF validator with custom schemasMichael Stahl
This requires a new validator jar for the -m flag to specify MathML schema. Change-Id: If99cf70f386a16a90ba676f8f5ff65a537c9ce56 Reviewed-on: https://gerrit.libreoffice.org/56487 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
2018-06-29tdf#45904 Move _XDocumentAuditing Java test to C++Jens Carl
Change-Id: Ic03e42c9c2ff27579b442dc8d1408deaea839ec4 Reviewed-on: https://gerrit.libreoffice.org/56644 Tested-by: Jenkins Reviewed-by: Jens Carl <j.carl43@gmx.de>
2018-06-14tdf#45904 Move _XFormulaQuery Java tests to C++Jens Carl
Enable tests for ScTableSheetObj and fixes #i86793. Change-Id: Ic9914fd74a70034e4adc7e55203c92935a472f9d Reviewed-on: https://gerrit.libreoffice.org/55782 Tested-by: Jenkins Reviewed-by: Jens Carl <j.carl43@gmx.de>
2018-06-13tdf#45904 Move remaining _XCellRangeReferrer Java tests to C++Jens Carl
Move remaining _XCellRangeReferrer tests to C++ and partly fix #i84656. Change-Id: I77cc8550888f460a6ae265816907a19a81cbe871 Reviewed-on: https://gerrit.libreoffice.org/55732 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jens Carl <j.carl43@gmx.de>
2018-06-12tdf#45904 Move _XCellRangeData Java test to C++Jens Carl
Move the remaining tests to C++ and also enable/fix #i84671 by creating test cases for ScTableSheetObj. Change-Id: I9412fe7a1947b9afb4343a8f5726eccf9ea371a3 Reviewed-on: https://gerrit.libreoffice.org/55657 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jens Carl <j.carl43@gmx.de>
2018-06-08look for unnecessary calls to Reference::is() after an UNO_QUERY_THROWNoel Grandin
Since the previous call would throw if there was nothing to be assigned to the value. Idea from tml. Used the following script to find places: git grep -A3 -n UNO_QUERY_THROW | grep -B3 -F 'is()' Change-Id: I36ba7b00bcd014bdf16c0455ab91056f82194969 Reviewed-on: https://gerrit.libreoffice.org/55417 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tor Lillqvist <tml@collabora.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-06-01loplugin: look for CPPUNIT_ASSERT_EQUALS with params swappedNoel Grandin
idea originally from either tml or moggi, can't remember which Change-Id: Id78d75035036d3aa1666e33469c6eeb38f9e624d Reviewed-on: https://gerrit.libreoffice.org/55126 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>