dbaccess: use createTempCopy instead of doing it in make

Change-Id: Ib1e550dbe5ea74827562e3706c4a310171df77af
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168675
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
This commit is contained in:
Xisco Fauli 2024-06-11 14:38:36 +02:00
parent dc01a6e7ef
commit 1bcd3df23c
8 changed files with 12 additions and 45 deletions

View file

@ -108,10 +108,4 @@ $(eval $(call gb_CppunitTest_use_components,dbaccess_RowSetClones,\
$(eval $(call gb_CppunitTest_use_configuration,dbaccess_RowSetClones))
$(call gb_CppunitTest_get_target,dbaccess_RowSetClones) : $(WORKDIR)/CppunitTest/RowSetClones.odb
$(WORKDIR)/CppunitTest/RowSetClones.odb : $(SRCDIR)/dbaccess/qa/extras/testdocuments/RowSetClones.odb
mkdir -p $(dir $@)
cp -P -f "$<" "$@"
.PHONY: $(WORKDIR)/CppunitTest/RowSetClones.odb
# vim: set noet sw=4 ts=4:

View file

@ -100,10 +100,4 @@ $(eval $(call gb_CppunitTest_use_components,dbaccess_dialog_save,\
$(eval $(call gb_CppunitTest_use_configuration,dbaccess_dialog_save))
$(call gb_CppunitTest_get_target,dbaccess_dialog_save) : $(WORKDIR)/CppunitTest/testDialogSave.odb
$(WORKDIR)/CppunitTest/testDialogSave.odb : $(SRCDIR)/dbaccess/qa/extras/testdocuments/testDialogSave.odb
mkdir -p $(dir $@)
cp -P -f "$<" "$@"
.PHONY: $(WORKDIR)/CppunitTest/testDialogSave.odb
# vim: set noet sw=4 ts=4:

View file

@ -104,10 +104,4 @@ $(eval $(call gb_CppunitTest_use_uiconfigs,dbaccess_empty_stdlib_save, \
dbaccess \
))
$(call gb_CppunitTest_get_target,dbaccess_empty_stdlib_save) : $(WORKDIR)/CppunitTest/testEmptyStdlibSave.odb
$(WORKDIR)/CppunitTest/testEmptyStdlibSave.odb : $(SRCDIR)/dbaccess/qa/extras/testdocuments/testDialogSave.odb
mkdir -p $(dir $@)
cp -P -f "$<" "$@"
.PHONY: $(WORKDIR)/CppunitTest/testEmptyStdlibSave.odb
# vim: set noet sw=4 ts=4:

View file

@ -100,10 +100,4 @@ $(eval $(call gb_CppunitTest_use_components,dbaccess_nolib_save,\
$(eval $(call gb_CppunitTest_use_configuration,dbaccess_nolib_save))
$(call gb_CppunitTest_get_target,dbaccess_nolib_save) : $(WORKDIR)/CppunitTest/testNolibSave.odb
$(WORKDIR)/CppunitTest/testNolibSave.odb : $(SRCDIR)/dbaccess/qa/extras/testdocuments/testDialogSave.odb
mkdir -p $(dir $@)
cp -P -f "$<" "$@"
.PHONY: $(WORKDIR)/CppunitTest/testNolibSave.odb
# vim: set noet sw=4 ts=4:

View file

@ -29,10 +29,7 @@ public:
void test();
CPPUNIT_TEST_SUITE(DialogSaveTest);
// Should we disable this test on MOX and WNT?
// #if !defined(MACOSX) && !defined(_WIN32)
CPPUNIT_TEST(test);
// #endif
CPPUNIT_TEST_SUITE_END();
};
@ -45,9 +42,9 @@ DialogSaveTest::DialogSaveTest()
void DialogSaveTest::test()
{
const OUString aFileName(m_directories.getURLFromWorkdir(u"CppunitTest/testDialogSave.odb"));
createTempCopy(u"testDialogSave.odb");
{
mxComponent = loadFromDesktop(aFileName);
mxComponent = loadFromDesktop(maTempFile.GetURL());
uno::Reference< frame::XStorable > xDocStorable(mxComponent, UNO_QUERY_THROW);
uno::Reference< document::XEmbeddedScripts > xDocScr(mxComponent, UNO_QUERY_THROW);
uno::Reference< script::XStorageBasedLibraryContainer > xStorBasLib(xDocScr->getBasicLibraries());
@ -78,7 +75,7 @@ void DialogSaveTest::test()
// All our uno::References are (should?) be invalid now -> let them go out of scope
}
{
uno::Sequence<uno::Any> args{ uno::Any(aFileName) };
uno::Sequence<uno::Any> args{ uno::Any(maTempFile.GetURL()) };
Reference<container::XHierarchicalNameAccess> xHNA(getMultiServiceFactory()->createInstanceWithArguments(u"com.sun.star.packages.Package"_ustr, args), UNO_QUERY_THROW);
Reference< beans::XPropertySet > xPS(xHNA->getByHierarchicalName(u"Dialogs/Standard/Dialog1.xml"_ustr), UNO_QUERY_THROW);
sal_Int64 nSize = 0;

View file

@ -27,10 +27,7 @@ public:
void test();
CPPUNIT_TEST_SUITE(DialogSaveTest);
// Should we disable this test on MOX and WNT?
// #if !defined(MACOSX) && !defined(_WIN32)
CPPUNIT_TEST(test);
// #endif
CPPUNIT_TEST_SUITE_END();
};
@ -43,9 +40,9 @@ DialogSaveTest::DialogSaveTest()
void DialogSaveTest::test()
{
const OUString aFileName(m_directories.getURLFromWorkdir(u"CppunitTest/testEmptyStdlibSave.odb"));
createTempCopy(u"testDialogSave.odb");
{
mxComponent = loadFromDesktop(aFileName);
mxComponent = loadFromDesktop(maTempFile.GetURL());
uno::Reference< frame::XStorable > xDocStorable(mxComponent, UNO_QUERY_THROW);
uno::Reference< document::XEmbeddedScripts > xDocScr(mxComponent, UNO_QUERY_THROW);
uno::Reference< script::XStorageBasedLibraryContainer > xStorBasLib(xDocScr->getBasicLibraries());
@ -92,7 +89,7 @@ void DialogSaveTest::test()
// All our uno::References are (should?) be invalid now -> let them go out of scope
}
{
uno::Sequence<uno::Any> args{ uno::Any(aFileName) };
uno::Sequence<uno::Any> args{ uno::Any(maTempFile.GetURL()) };
Reference<container::XHierarchicalNameAccess> xHNA(getMultiServiceFactory()->createInstanceWithArguments(u"com.sun.star.packages.Package"_ustr, args), UNO_QUERY_THROW);
CPPUNIT_ASSERT(!xHNA->hasByHierarchicalName(u"Basic/Standard"_ustr));
CPPUNIT_ASSERT(!xHNA->hasByHierarchicalName(u"Dialogs/Standard"_ustr));

View file

@ -27,10 +27,7 @@ public:
void test();
CPPUNIT_TEST_SUITE(DialogSaveTest);
// Should we disable this test on MOX and WNT?
// #if !defined(MACOSX) && !defined(_WIN32)
CPPUNIT_TEST(test);
// #endif
CPPUNIT_TEST_SUITE_END();
};
@ -43,9 +40,9 @@ DialogSaveTest::DialogSaveTest()
void DialogSaveTest::test()
{
const OUString aFileName(m_directories.getURLFromWorkdir(u"CppunitTest/testNolibSave.odb"));
createTempCopy(u"testDialogSave.odb");
{
mxComponent = loadFromDesktop(aFileName);
mxComponent = loadFromDesktop(maTempFile.GetURL());
uno::Reference< frame::XStorable > xDocStorable(mxComponent, UNO_QUERY_THROW);
uno::Reference< document::XEmbeddedScripts > xDocScr(mxComponent, UNO_QUERY_THROW);
uno::Reference< script::XStorageBasedLibraryContainer > xStorBasLib(xDocScr->getBasicLibraries());
@ -82,7 +79,7 @@ void DialogSaveTest::test()
// All our uno::References are (should?) be invalid now -> let them go out of scope
}
{
uno::Sequence<uno::Any> args{ uno::Any(aFileName) };
uno::Sequence<uno::Any> args{ uno::Any(maTempFile.GetURL()) };
Reference<container::XHierarchicalNameAccess> xHNA(getMultiServiceFactory()->createInstanceWithArguments(u"com.sun.star.packages.Package"_ustr, args), UNO_QUERY_THROW);
CPPUNIT_ASSERT(!xHNA->hasByHierarchicalName(u"Basic/Standard"_ustr));
CPPUNIT_ASSERT(!xHNA->hasByHierarchicalName(u"Dialogs/Standard"_ustr));

View file

@ -40,15 +40,15 @@ public:
RowSetClones::RowSetClones()
: UnoApiTest(u""_ustr)
: UnoApiTest(u"/dbaccess/qa/extras/testdocuments/"_ustr)
{
}
void RowSetClones::test()
{
const OUString sFilePath(m_directories.getURLFromWorkdir(u"CppunitTest/RowSetClones.odb"));
createTempCopy(u"RowSetClones.odb");
mxComponent = loadFromDesktop(maTempFile.GetURL());
mxComponent = loadFromDesktop(sFilePath);
uno::Reference< XOfficeDatabaseDocument > xDocument(mxComponent, UNO_QUERY_THROW);
uno::Reference< XDataSource > xDataSource = xDocument->getDataSource();