diff options
author | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2016-12-16 14:44:58 +0100 |
---|---|---|
committer | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2016-12-16 13:52:38 +0000 |
commit | bfcecd677434a253b326bfe31d87b1a0958c8cea (patch) | |
tree | c10ed86dec256d25aac709be5f90eaf4f4031e51 /test/source | |
parent | 5b5856415d87cc1c1fa29364d0c9fe921059fb7d (diff) |
screnshot test: Ignore error when creating directories
createPath documentation advises against relying on the E_EXIST error code,
so we just ignore it
Change-Id: I0e842315e1fd5c661d2b504b196e320f84c58e4f
Reviewed-on: https://gerrit.libreoffice.org/32081
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Diffstat (limited to 'test/source')
-rw-r--r-- | test/source/screenshot_test.cxx | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/test/source/screenshot_test.cxx b/test/source/screenshot_test.cxx index 798ed20b362d..84275b5f34d5 100644 --- a/test/source/screenshot_test.cxx +++ b/test/source/screenshot_test.cxx @@ -54,8 +54,7 @@ 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.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) ); + osl::Directory::create( m_directories.getURLFromWorkdir( OUStringToOString(m_aScreenshotDirectory, RTL_TEXTENCODING_UTF8).getStr())) ; // initialize maKnownDialogs if (maKnownDialogs.empty()) @@ -71,10 +70,7 @@ void ScreenshotTest::implSaveScreenshot(const Bitmap& rScreenshot, const OString aDirname = m_aScreenshotDirectory + "/" + aDirname + ( (maCurrentLanguage == "en-US") ? OUString() : "/" + maCurrentLanguage ); - osl::FileBase::RC err = osl::Directory::createPath(m_directories.getURLFromWorkdir(OUStringToOString(aDirname,RTL_TEXTENCODING_UTF8).getStr())); - CPPUNIT_ASSERT_MESSAGE(OUStringToOString("Failed to create screenshot directory - " + m_directories.getURLFromWorkdir( - OUStringToOString(aDirname, RTL_TEXTENCODING_UTF8).getStr()), RTL_TEXTENCODING_UTF8).getStr(), - (err == osl::FileBase::E_None || err == osl::FileBase::E_EXIST) ); + osl::Directory::createPath(m_directories.getURLFromWorkdir(OUStringToOString(aDirname,RTL_TEXTENCODING_UTF8).getStr())); OUString aFullPath = m_directories.getPathFromWorkdir(OUStringToOString(aDirname + "/" + aBasename + ".png",RTL_TEXTENCODING_UTF8).getStr()); SvFileStream aNew(aFullPath, StreamMode::WRITE | StreamMode::TRUNC); |