summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorChristian Lohmaier <lohmaier+LibreOffice@googlemail.com>2016-11-24 11:26:21 +0100
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2016-11-26 15:40:20 +0000
commitbc13c1c2bab46135ef7c05fa1a772989f8ff4460 (patch)
tree01221bed6f5f4967aa355b4ff3bfc97b953b7314 /test
parente40a2670d1a0146d523ba65a9d9ceecceb8c78c4 (diff)
screenshots: builddir is not neccessarily same as srcdir
Change-Id: Ic7d3d7854eeb5511d5e94e7329fcffa8a3ccba34 Reviewed-on: https://gerrit.libreoffice.org/31160 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'test')
-rw-r--r--test/source/screenshot_test.cxx10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/source/screenshot_test.cxx b/test/source/screenshot_test.cxx
index b4e863392bc6..dcd0befda337 100644
--- a/test/source/screenshot_test.cxx
+++ b/test/source/screenshot_test.cxx
@@ -36,7 +36,7 @@ using namespace css;
using namespace css::uno;
ScreenshotTest::ScreenshotTest()
-: m_aScreenshotDirectory("/workdir/screenshots/"),
+: m_aScreenshotDirectory("/screenshots/"),
maKnownDialogs()
{
SvtSysLocaleOptions localeOptions;
@@ -54,8 +54,8 @@ void ScreenshotTest::setUp()
mxDesktop = css::frame::Desktop::create( comphelper::getComponentContext(getMultiServiceFactory()) );
CPPUNIT_ASSERT_MESSAGE("no desktop!", mxDesktop.is());
- osl::FileBase::RC err = osl::Directory::create( m_directories.getURLFromSrc( m_aScreenshotDirectory ) );
- CPPUNIT_ASSERT_MESSAGE( "Failed to create screenshot directory", (err == osl::FileBase::E_None || err == osl::FileBase::E_EXIST) );
+ osl::FileBase::RC err = osl::Directory::create( m_directories.getURLFromWorkdir( OUStringToOString(m_aScreenshotDirectory, RTL_TEXTENCODING_UTF8).getStr())) ;
+ CPPUNIT_ASSERT_MESSAGE(OUStringToOString("Failed to create screenshot directory - " + m_directories.getURLFromWorkdir( OUStringToOString(m_aScreenshotDirectory, RTL_TEXTENCODING_UTF8).getStr()), RTL_TEXTENCODING_UTF8).getStr(), (err == osl::FileBase::E_None || err == osl::FileBase::E_EXIST) );
// initialize maKnownDialogs
if (maKnownDialogs.empty())
@@ -70,11 +70,11 @@ void ScreenshotTest::implSaveScreenshot(const Bitmap& rScreenshot, const OString
splitHelpId(rScreenshotId, aDirname, aBasename);
aDirname = m_aScreenshotDirectory + maCurrentLanguage + "/" + aDirname;
- osl::FileBase::RC err = osl::Directory::createPath(m_directories.getURLFromSrc(aDirname));
+ osl::FileBase::RC err = osl::Directory::createPath(m_directories.getURLFromWorkdir(OUStringToOString(aDirname,RTL_TEXTENCODING_UTF8).getStr()));
CPPUNIT_ASSERT_MESSAGE(OUStringToOString("Failed to create " + aDirname, RTL_TEXTENCODING_UTF8).getStr(),
(err == osl::FileBase::E_None || err == osl::FileBase::E_EXIST));
- OUString aFullPath = m_directories.getSrcRootPath() + aDirname + "/" + aBasename + ".png";
+ OUString aFullPath = m_directories.getPathFromWorkdir(OUStringToOString(aDirname + "/" + aBasename + ".png",RTL_TEXTENCODING_UTF8).getStr());
SvFileStream aNew(aFullPath, StreamMode::WRITE | StreamMode::TRUNC);
CPPUNIT_ASSERT_MESSAGE(OUStringToOString("Failed to open " + OUString::number(aNew.GetErrorCode()), RTL_TEXTENCODING_UTF8).getStr(), aNew.IsOpen());