diff options
-rw-r--r-- | include/unotest/directories.hxx | 2 | ||||
-rw-r--r-- | test/source/screenshot_test.cxx | 10 | ||||
-rw-r--r-- | unotest/source/cpp/directories.cxx | 2 |
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: */ |