summaryrefslogtreecommitdiff
path: root/sdext
diff options
context:
space:
mode:
Diffstat (limited to 'sdext')
-rw-r--r--sdext/source/pdfimport/test/tests.cxx22
1 files changed, 10 insertions, 12 deletions
diff --git a/sdext/source/pdfimport/test/tests.cxx b/sdext/source/pdfimport/test/tests.cxx
index d3fa3e748b31..b73da1ddb133 100644
--- a/sdext/source/pdfimport/test/tests.cxx
+++ b/sdext/source/pdfimport/test/tests.cxx
@@ -596,15 +596,14 @@ namespace
pdfi::PDFIRawAdaptor aAdaptor( impl_getComponentContext() );
aAdaptor.setTreeVisitorFactory( createDrawTreeVisitorFactory() );
- ::rtl::OUString aURL, aAbsURL, aBaseURL;
- osl_getFileURLFromSystemPath( (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("pdfi_unittest_draw.xml"))).pData,
- &aURL.pData );
- osl_getProcessWorkingDir(&aBaseURL.pData);
- osl_getAbsoluteFileURL(aBaseURL.pData,aURL.pData,&aAbsURL.pData);
+ ::rtl::OUString tempFileURL;
+ CPPUNIT_ASSERT( osl::File::createTempFile( NULL, NULL, &tempFileURL ) == osl::File::E_None );
+ osl::File::remove( tempFileURL ); // FIXME the below apparently fails silently if the file already exists
CPPUNIT_ASSERT_MESSAGE("Exporting to ODF",
aAdaptor.odfConvert( getURLFromSrc("/sdext/source/pdfimport/test/testinput.pdf"),
- new OutputWrap(aAbsURL),
+ new OutputWrap(tempFileURL),
NULL ));
+ osl::File::remove( tempFileURL );
}
void testOdfWriterExport()
@@ -612,15 +611,14 @@ namespace
pdfi::PDFIRawAdaptor aAdaptor( impl_getComponentContext() );
aAdaptor.setTreeVisitorFactory( createWriterTreeVisitorFactory() );
- ::rtl::OUString aURL, aAbsURL, aBaseURL;
- osl_getFileURLFromSystemPath( (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("pdfi_unittest_writer.xml"))).pData,
- &aURL.pData );
- osl_getProcessWorkingDir(&aBaseURL.pData);
- osl_getAbsoluteFileURL(aBaseURL.pData,aURL.pData,&aAbsURL.pData);
+ ::rtl::OUString tempFileURL;
+ CPPUNIT_ASSERT( osl::File::createTempFile( NULL, NULL, &tempFileURL ) == osl::File::E_None );
+ osl::File::remove( tempFileURL ); // FIXME the below apparently fails silently if the file already exists
CPPUNIT_ASSERT_MESSAGE("Exporting to ODF",
aAdaptor.odfConvert( getURLFromSrc("/sdext/source/pdfimport/test/testinput.pdf"),
- new OutputWrap(aAbsURL),
+ new OutputWrap(tempFileURL),
NULL ));
+ osl::File::remove( tempFileURL );
}
CPPUNIT_TEST_SUITE(PDFITest);