summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Lohmaier <lohmaier+LibreOffice@googlemail.com>2016-11-24 11:26:21 +0100
committerChristian Lohmaier <lohmaier+LibreOffice@googlemail.com>2016-12-22 14:18:45 +0000
commite95e05795d192275fa3c44a87377ce8353ae32d8 (patch)
treef6e7b82e2dbdcb7b89a18d23ba4f28060df1c85a
parent371f0f6770add78ae81e0f769d0490874bca353c (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> (cherry picked from commit bc13c1c2bab46135ef7c05fa1a772989f8ff4460) Reviewed-on: https://gerrit.libreoffice.org/31868 Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
-rw-r--r--include/unotest/directories.hxx2
-rw-r--r--test/source/screenshot_test.cxx10
-rw-r--r--unotest/source/cpp/directories.cxx2
3 files changed, 5 insertions, 9 deletions
diff --git a/include/unotest/directories.hxx b/include/unotest/directories.hxx
index 3e44558a26ca..ae105d988d96 100644
--- a/include/unotest/directories.hxx
+++ b/include/unotest/directories.hxx
@@ -40,10 +40,8 @@ public:
// return a URL to a given c-str path from the workdir directory
OUString getURLFromWorkdir( const char *pPath );
-#ifdef _WIN32
// return a Path to a given c-str path from the workdir directory
OUString getPathFromWorkdir( const char *pPath );
-#endif
};
}
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());
diff --git a/unotest/source/cpp/directories.cxx b/unotest/source/cpp/directories.cxx
index 55084a2e3d53..508af534c35e 100644
--- a/unotest/source/cpp/directories.cxx
+++ b/unotest/source/cpp/directories.cxx
@@ -59,11 +59,9 @@ OUString test::Directories::getURLFromWorkdir( const char *pPath )
return m_aWorkdirRootURL + OUString::createFromAscii( pPath );
}
-#ifdef _WIN32 // ifdef just to keep it out of unusedcode.easy
OUString test::Directories::getPathFromWorkdir( const char *pPath )
{
return m_aWorkdirRootPath + OUString::createFromAscii( pPath );
}
-#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */