[Libreoffice-commits] core.git: dbaccess/CppunitTest_dbaccess_firebird_test.mk embeddedobj/CppunitTest_embeddedobj_general.mk include/test oox/CppunitTest_oox_drawingml.mk oox/CppunitTest_oox_export.m
dbaccess/CppunitTest_dbaccess_firebird_test.mk |1 embeddedobj/CppunitTest_embeddedobj_general.mk |1 include/test/unoapi_test.hxx | 27 -- oox/CppunitTest_oox_drawingml.mk |1 oox/CppunitTest_oox_export.mk|1 oox/CppunitTest_oox_mathml.mk|1 oox/CppunitTest_oox_shape.mk |1 oox/CppunitTest_oox_vml.mk |1 sc/CppunitTest_sc_functionlistobj.mk |1 sc/CppunitTest_sc_pdf_export.mk |1 sc/common_unoapi_tests.mk|1 sd/CppunitTest_sd_filter_eppt.mk |1 sfx2/CppunitTest_sfx2_doc.mk |1 sfx2/CppunitTest_sfx2_view.mk|1 svx/CppunitTest_svx_styles.mk|1 sw/qa/inc/swmodeltestbase.hxx| 17 -- sw/qa/unit/swmodeltestbase.cxx | 48 -- test/source/unoapi_test.cxx | 60 --- writerfilter/CppunitTest_writerfilter_dmapper.mk |1 writerfilter/CppunitTest_writerfilter_rtftok.mk |1 xmloff/CppunitTest_xmloff_draw.mk|1 xmloff/CppunitTest_xmloff_style.mk |1 xmloff/CppunitTest_xmloff_text.mk|1 23 files changed, 97 insertions(+), 74 deletions(-) New commits: commit 7986d35eee84fdf391c563602fb348758e1cd254 Author: Xisco Fauli AuthorDate: Fri Nov 11 16:44:59 2022 +0100 Commit: Xisco Fauli CommitDate: Fri Nov 11 20:09:41 2022 +0100 move password handling from SwModelTestBase to UnoApiTest so other places inheriting from UnoApiTest can also import/export protected documents Change-Id: I0e2716204dbb171c9e17e3939b266977e1b96dda Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142592 Tested-by: Jenkins Reviewed-by: Xisco Fauli diff --git a/dbaccess/CppunitTest_dbaccess_firebird_test.mk b/dbaccess/CppunitTest_dbaccess_firebird_test.mk index 9b7af21ff31b..a8d4704eb1e9 100644 --- a/dbaccess/CppunitTest_dbaccess_firebird_test.mk +++ b/dbaccess/CppunitTest_dbaccess_firebird_test.mk @@ -18,6 +18,7 @@ $(eval $(call gb_CppunitTest_add_exception_objects,dbaccess_firebird_test, \ $(eval $(call gb_CppunitTest_use_libraries,dbaccess_firebird_test, \ comphelper \ cppu \ +cppuhelper \ dbaxml \ firebird_sdbc \ sal \ diff --git a/embeddedobj/CppunitTest_embeddedobj_general.mk b/embeddedobj/CppunitTest_embeddedobj_general.mk index eb794f38548c..6c4014e2fc89 100644 --- a/embeddedobj/CppunitTest_embeddedobj_general.mk +++ b/embeddedobj/CppunitTest_embeddedobj_general.mk @@ -22,6 +22,7 @@ $(eval $(call gb_CppunitTest_add_exception_objects,embeddedobj_general, \ $(eval $(call gb_CppunitTest_use_libraries,embeddedobj_general, \ comphelper \ cppu \ +cppuhelper \ embobj \ sal \ subsequenttest \ diff --git a/include/test/unoapi_test.hxx b/include/test/unoapi_test.hxx index 307d0f1a0589..0277131e31f7 100644 --- a/include/test/unoapi_test.hxx +++ b/include/test/unoapi_test.hxx @@ -14,7 +14,9 @@ #include +#include #include +#include #include #include #include @@ -28,24 +30,32 @@ class OOO_DLLPUBLIC_TEST UnoApiTest : public test::BootstrapFixture, public unot public: UnoApiTest(OUString path); -OUString createFileURL(std::u16string_view aFileBase); -OUString loadFromURL(std::u16string_view aFileBase); - virtual void setUp() override; virtual void tearDown() override; +OUString createFileURL(std::u16string_view aFileBase); +void load(const OUString& rURL, const char* pPassword = nullptr); +OUString loadFromURL(std::u16string_view aFileBase, const char* pPassword = nullptr); + css::uno::Any executeMacro(const OUString& rScriptURL, const css::uno::Sequence& rParams = {}); void save(const OUString& rFilter, const char* pPassword = nullptr); void saveAndClose(const OUString& rFilter); -void saveAndReload(const OUString& rFilter); +void saveAndReload(const OUString& rFilter, const char* pPassword = nullptr); std::unique_ptr parsePDFExport(const OString& rPassword = OString()); void skipValidation() { mbSkipValidation = true; } void setFilterOptions(const OUString& rFilterOptions) { maFilterOptions = rFilterOptions; } +void setImportFilterOptions(const OUString& rFilterOptions) +{ +maImportFilterOptions = rFilterOptions; +} + +void setImportFilterName(const OUString& rFilterName) { maImportFilterName = rFilterName; } + protected: // reference to document component that we are testing css::uno::Reference mxComponent; @@ -54,10 +64,19 @@ protected: SvMemoryStream maMemory; // Underlying memory for parsed PDF files. +rtl::Reference xInteractionHandler; + private: +void
[Libreoffice-commits] core.git: dbaccess/CppunitTest_dbaccess_firebird_test.mk dbaccess/CppunitTest_dbaccess_hsqldb_test.mk desktop/qa include/test oox/CppunitTest_oox_export.mk oox/CppunitTest_oox_ma
dbaccess/CppunitTest_dbaccess_firebird_test.mk |1 dbaccess/CppunitTest_dbaccess_hsqldb_test.mk |1 desktop/qa/desktop_lib/test_desktop_lib.cxx | 51 ++--- include/test/unoapi_test.hxx |4 oox/CppunitTest_oox_export.mk|1 oox/CppunitTest_oox_mathml.mk|1 oox/CppunitTest_oox_vml.mk |1 sc/CppunitTest_sc_functionlistobj.mk |1 sc/common_unoapi_tests.mk|1 sc/qa/extras/scpdfexport.cxx | 122 +++ sd/CppunitTest_sd_filter_eppt.mk |1 sd/qa/unit/SdrPdfImportTest.cxx |8 - sfx2/CppunitTest_sfx2_classification.mk |1 sfx2/CppunitTest_sfx2_doc.mk |1 sfx2/CppunitTest_sfx2_misc.mk|1 sfx2/CppunitTest_sfx2_view.mk|1 svx/CppunitTest_svx_styles.mk|1 svx/qa/unit/core.cxx |9 - svx/qa/unit/svdraw.cxx | 11 -- sw/qa/core/text/text.cxx | 16 +-- sw/qa/extras/uiwriter/uiwriter2.cxx | 13 -- sw/qa/extras/uiwriter/uiwriter8.cxx |8 - sw/qa/inc/swmodeltestbase.hxx|3 sw/qa/unit/swmodeltestbase.cxx | 12 -- test/source/unoapi_test.cxx | 15 ++ writerfilter/CppunitTest_writerfilter_dmapper.mk |1 writerfilter/CppunitTest_writerfilter_rtftok.mk |1 xmloff/CppunitTest_xmloff_draw.mk|1 xmloff/CppunitTest_xmloff_style.mk |1 xmloff/CppunitTest_xmloff_text.mk|1 30 files changed, 106 insertions(+), 184 deletions(-) New commits: commit 87dce617eb1cbbb650dda3e5dc557fa0a058e505 Author: Xisco Fauli AuthorDate: Wed Nov 9 14:22:09 2022 +0100 Commit: Xisco Fauli CommitDate: Wed Nov 9 19:08:32 2022 +0100 UnoApiTest: factor out common code Change-Id: I1d84d8c1e371016a4f4f068af1e9c76635f28cf4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142490 Tested-by: Jenkins Reviewed-by: Xisco Fauli diff --git a/dbaccess/CppunitTest_dbaccess_firebird_test.mk b/dbaccess/CppunitTest_dbaccess_firebird_test.mk index c9ca5b9bf4bb..9b7af21ff31b 100644 --- a/dbaccess/CppunitTest_dbaccess_firebird_test.mk +++ b/dbaccess/CppunitTest_dbaccess_firebird_test.mk @@ -24,6 +24,7 @@ $(eval $(call gb_CppunitTest_use_libraries,dbaccess_firebird_test, \ subsequenttest \ svt \ test \ +tl \ unotest \ utl \ xo \ diff --git a/dbaccess/CppunitTest_dbaccess_hsqldb_test.mk b/dbaccess/CppunitTest_dbaccess_hsqldb_test.mk index 3cad59f2ad47..07b4f960b859 100644 --- a/dbaccess/CppunitTest_dbaccess_hsqldb_test.mk +++ b/dbaccess/CppunitTest_dbaccess_hsqldb_test.mk @@ -28,6 +28,7 @@ $(eval $(call gb_CppunitTest_use_libraries,dbaccess_hsqldb_test, \ utl \ test \ tk \ +tl \ unotest \ xo \ )) diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx index 2ac74ba74a87..0850a1cb884d 100644 --- a/desktop/qa/desktop_lib/test_desktop_lib.cxx +++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx @@ -675,9 +675,7 @@ void DesktopLOKTest::testPaintTile() void DesktopLOKTest::testSaveAs() { LibLODocument_Impl* pDocument = loadDoc("blank_text.odt"); -utl::TempFileNamed aTempFile; -aTempFile.EnableKillingFile(); -CPPUNIT_ASSERT(pDocument->pClass->saveAs(pDocument, aTempFile.GetURL().toUtf8().getStr(), "png", nullptr)); +CPPUNIT_ASSERT(pDocument->pClass->saveAs(pDocument, maTempFile.GetURL().toUtf8().getStr(), "png", nullptr)); } void DesktopLOKTest::testSaveAsJsonOptions() @@ -686,21 +684,12 @@ void DesktopLOKTest::testSaveAsJsonOptions() LibLODocument_Impl* pDocument = loadDoc("3page.odg"); // When exporting that document to PDF, skipping the first page: -utl::TempFileNamed aTempFile; -aTempFile.EnableKillingFile(); OString aOptions("{\"PageRange\":{\"type\":\"string\",\"value\":\"2-\"}}"); -CPPUNIT_ASSERT(pDocument->pClass->saveAs(pDocument, aTempFile.GetURL().toUtf8().getStr(), "pdf", aOptions.getStr())); +CPPUNIT_ASSERT(pDocument->pClass->saveAs(pDocument, maTempFile.GetURL().toUtf8().getStr(), "pdf", aOptions.getStr())); // Then make sure the resulting PDF has 2 pages: -SvFileStream aFile(aTempFile.GetURL(), StreamMode::READ); -SvMemoryStream aMemory; -aMemory.WriteStream(aFile); -std::shared_ptr pPDFium = vcl::pdf::PDFiumLibrary::get(); -if (!pPDFium) -return; std::unique_ptr pPdfDocument -= pPDFium->openDocument(aMemory.GetData(), aMemory.GetSize(), OString()); -CPPUNIT_ASSERT(pPdfDocument); += parsePDFExport(); // Without the accompanying fix in place, this test would have failed with:
[Libreoffice-commits] core.git: dbaccess/CppunitTest_dbaccess_firebird_test.mk
dbaccess/CppunitTest_dbaccess_firebird_test.mk |4 1 file changed, 4 insertions(+) New commits: commit f6f0ef29f17a7afebd855dc06bd7172884649d73 Author: Stephan Bergmann AuthorDate: Wed Aug 31 11:14:24 2022 +0200 Commit: Stephan Bergmann CommitDate: Wed Aug 31 21:41:26 2022 +0200 Missing test dependency > warn:vcl.builder:1135119:1135119:vcl/source/window/builder.cxx:480: DBG_UNHANDLED_EXCEPTION in VclBuilder > when: Unable to read .ui file exception: com.sun.star.container.NoSuchElementException message: "file:///.../instdir/share/config/soffice.cfg/dbaccess/ui/appborderwindow.ui" > warn:dbaccess:1135119:1135119:dbaccess/source/filter/xml/dbloader2.cxx:460: DBG_UNHANDLED_EXCEPTION in load exception: com.sun.star.container.NoSuchElementException message: "file:///.../instdir/share/config/soffice.cfg/dbaccess/ui/appborderwindow.ui" > unotest/source/cpp/macros_test.cxx:74:FirebirdTest::testEmptyDBConnection > assertion failed > - Expression: xComponent.is() > - loading failed: file:tmp/FirebirdTest__testEmptyDBConnection_2lyauo.tmp Change-Id: I25ede2d4b74753d056a15147737ae67e1c4b5588 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139087 Tested-by: Jenkins Reviewed-by: Stephan Bergmann diff --git a/dbaccess/CppunitTest_dbaccess_firebird_test.mk b/dbaccess/CppunitTest_dbaccess_firebird_test.mk index 5065520993e2..c9ca5b9bf4bb 100644 --- a/dbaccess/CppunitTest_dbaccess_firebird_test.mk +++ b/dbaccess/CppunitTest_dbaccess_firebird_test.mk @@ -67,4 +67,8 @@ $(eval $(call gb_CppunitTest_use_components,dbaccess_firebird_test,\ $(eval $(call gb_CppunitTest_use_configuration,dbaccess_firebird_test)) +$(eval $(call gb_CppunitTest_use_uiconfigs,dbaccess_firebird_test, \ +dbaccess \ +)) + # vim: set noet sw=4 ts=4:
[Libreoffice-commits] core.git: dbaccess/CppunitTest_dbaccess_firebird_test.mk dbaccess/qa include/unotools unotools/source
dbaccess/CppunitTest_dbaccess_firebird_test.mk |1 dbaccess/qa/unit/dbtest_base.cxx | 29 +++-- dbaccess/qa/unit/firebird.cxx |3 +- include/unotools/tempfile.hxx |5 +--- unotools/source/ucbhelper/tempfile.cxx |9 +++ 5 files changed, 41 insertions(+), 6 deletions(-) New commits: commit 15d134b4f57e66faa8bcf538a08db98dc9204c54 Author: Stephan Bergmann Date: Fri Dec 15 15:26:27 2017 +0100 Make temp copy of dbaccess/qa/unit/data/firebird_empty.odb for testing ...in CppunitTest_dbaccess_firebird_test. Otherwise, the test would fail with > Test name: FirebirdTest::testEmptyDBConnection > An uncaught exception of type com.sun.star.sdbc.SQLException > - The connection can not be established. No storage or URL was given. if dbaccess/qa/unit/data/firebird_empty.odb is read-only, as DocumentStorageAccess::impl_openSubStorage_nothrow (dbaccess/source/core/dataaccess/ModelImpl.cxx) takes m_pModelImplementation->m_bDocumentReadOnly into account and returns a null xStorage. Adds a move ctor to utl::TempFile (thus causing copy ctor and copy assignment op to be implicitly deleted), but leaves any move assignment op undeclared for now, as none happens to be needed (yet). Change-Id: I6f9eff07eb54f1364a0560ffa4cf1f676a319d16 Reviewed-on: https://gerrit.libreoffice.org/46561 Tested-by: Jenkins Reviewed-by: Stephan Bergmann diff --git a/dbaccess/CppunitTest_dbaccess_firebird_test.mk b/dbaccess/CppunitTest_dbaccess_firebird_test.mk index 5652e6622d76..5065520993e2 100644 --- a/dbaccess/CppunitTest_dbaccess_firebird_test.mk +++ b/dbaccess/CppunitTest_dbaccess_firebird_test.mk @@ -25,6 +25,7 @@ $(eval $(call gb_CppunitTest_use_libraries,dbaccess_firebird_test, \ svt \ test \ unotest \ +utl \ xo \ )) diff --git a/dbaccess/qa/unit/dbtest_base.cxx b/dbaccess/qa/unit/dbtest_base.cxx index 86914faee5c2..3541715f6b49 100644 --- a/dbaccess/qa/unit/dbtest_base.cxx +++ b/dbaccess/qa/unit/dbtest_base.cxx @@ -7,9 +7,13 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +#include + +#include + #include #include - +#include #include #include #include @@ -25,20 +29,41 @@ class DBTestBase public: DBTestBase() : UnoApiTest("dbaccess/qa/unit/data") {}; +utl::TempFile createTempCopy(OUString const & pathname); + uno::Reference< XOfficeDatabaseDocument > getDocumentForFileName(const OUString &sFileName); +uno::Reference getDocumentForUrl(OUString const & url); + uno::Reference< XConnection > getConnectionForDocument( uno::Reference< XOfficeDatabaseDocument > const & xDocument); }; +utl::TempFile DBTestBase::createTempCopy(OUString const & pathname) { +OUString url; +createFileURL(pathname, url); +utl::TempFile tmp; +tmp.EnableKillingFile(); +auto const e = osl::File::copy(url, tmp.GetURL()); +CPPUNIT_ASSERT_EQUAL_MESSAGE( +(OUStringToOString("<" + url + "> -> <" + tmp.GetURL() + ">", RTL_TEXTENCODING_UTF8) + .getStr()), +osl::FileBase::E_None, e); +return tmp; +} + uno::Reference< XOfficeDatabaseDocument > DBTestBase::getDocumentForFileName(const OUString &sFileName) { OUString sFilePath; createFileURL(sFileName, sFilePath); -uno::Reference< lang::XComponent > xComponent (loadFromDesktop(sFilePath)); +return getDocumentForUrl(sFilePath); +} + +uno::Reference DBTestBase::getDocumentForUrl(OUString const & url) { +uno::Reference< lang::XComponent > xComponent (loadFromDesktop(url)); CPPUNIT_ASSERT(xComponent.is()); uno::Reference< XOfficeDatabaseDocument > xDocument(xComponent, UNO_QUERY); diff --git a/dbaccess/qa/unit/firebird.cxx b/dbaccess/qa/unit/firebird.cxx index 16a4fb60e800..f7361ac76548 100644 --- a/dbaccess/qa/unit/firebird.cxx +++ b/dbaccess/qa/unit/firebird.cxx @@ -51,8 +51,9 @@ void FirebirdTest::setUp() */ void FirebirdTest::testEmptyDBConnection() { +auto const tmp = createTempCopy("firebird_empty.odb"); uno::Reference< XOfficeDatabaseDocument > xDocument = -getDocumentForFileName("firebird_empty.odb"); +getDocumentForUrl(tmp.GetURL()); getConnectionForDocument(xDocument); diff --git a/include/unotools/tempfile.hxx b/include/unotools/tempfile.hxx index 9f5ac4c45dab..791b51573f29 100644 --- a/include/unotools/tempfile.hxx +++ b/include/unotools/tempfile.hxx @@ -49,9 +49,6 @@ class UNOTOOLS_DLLPUBLIC TempFile boolbIsDirectory; boolbKillingFileEnabled; -TempFile( const TempFile& ) = delete; -TempFile& operator=(const TempFile&) = delete; - public: /** Create a temporary file or directory, in the default tempfile folder or if possible in a given folder. @@ -72,6 +69,8 @@ public: TempF
[Libreoffice-commits] core.git: dbaccess/CppunitTest_dbaccess_firebird_test.mk
dbaccess/CppunitTest_dbaccess_firebird_test.mk |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 8dc5941064c50fe0a61490e274d61eccb43fd089 Author: Andrzej J.R. Hunt Date: Tue Sep 10 09:05:04 2013 +0100 Fix typo. Change-Id: I34df96334478b10f151e630188f45e6ce0487f1a diff --git a/dbaccess/CppunitTest_dbaccess_firebird_test.mk b/dbaccess/CppunitTest_dbaccess_firebird_test.mk index 92c6083..3f5df09 100644 --- a/dbaccess/CppunitTest_dbaccess_firebird_test.mk +++ b/dbaccess/CppunitTest_dbaccess_firebird_test.mk @@ -9,7 +9,7 @@ $(eval $(call gb_CppunitTest_CppunitTest,dbaccess_firebird_test)) -$(eval $(call gb_CppunitTest_use_external,basic_coverage,boost_headers)) +$(eval $(call gb_CppunitTest_use_external,dbaccess_firebird_test,boost_headers)) $(eval $(call gb_CppunitTest_add_exception_objects,dbaccess_firebird_test, \ dbaccess/qa/unit/firebird \ ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: dbaccess/CppunitTest_dbaccess_firebird_test.mk
dbaccess/CppunitTest_dbaccess_firebird_test.mk |2 ++ 1 file changed, 2 insertions(+) New commits: commit da8d7533f8547f57476a69849331c6c1781ce326 Author: Andrzej J.R. Hunt Date: Tue Sep 10 08:56:08 2013 +0100 Try to fix Mac/Win Tinderboxes. Change-Id: Ibfd017c23cf510bf481d60b1e836654fd7240df0 diff --git a/dbaccess/CppunitTest_dbaccess_firebird_test.mk b/dbaccess/CppunitTest_dbaccess_firebird_test.mk index c91bdb7..92c6083 100644 --- a/dbaccess/CppunitTest_dbaccess_firebird_test.mk +++ b/dbaccess/CppunitTest_dbaccess_firebird_test.mk @@ -9,6 +9,8 @@ $(eval $(call gb_CppunitTest_CppunitTest,dbaccess_firebird_test)) +$(eval $(call gb_CppunitTest_use_external,basic_coverage,boost_headers)) + $(eval $(call gb_CppunitTest_add_exception_objects,dbaccess_firebird_test, \ dbaccess/qa/unit/firebird \ )) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits