summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2017-08-23 16:15:37 +0200
committerStephan Bergmann <sbergman@redhat.com>2017-08-23 16:15:37 +0200
commit63e1596ae6d633bf6bf653123e6851ffa0fe6051 (patch)
tree27ec78dea13d57a255da40163f92f290053b3b03 /test
parent7aaa3fe571810d4c68d974353d4b171453b12362 (diff)
Report osl::Directory::createPath failure
Change-Id: I75ede7f03edf80c00d33281afdebc3b620fb33eb
Diffstat (limited to 'test')
-rw-r--r--test/source/screenshot_test.cxx10
1 files changed, 9 insertions, 1 deletions
diff --git a/test/source/screenshot_test.cxx b/test/source/screenshot_test.cxx
index e5cc0e56c861..f3d535ba2374 100644
--- a/test/source/screenshot_test.cxx
+++ b/test/source/screenshot_test.cxx
@@ -70,7 +70,15 @@ void ScreenshotTest::implSaveScreenshot(const Bitmap& rScreenshot, const OString
aDirname = m_aScreenshotDirectory + "/" + aDirname +
( (maCurrentLanguage == "en-US") ? OUString() : "/" + maCurrentLanguage );
- osl::Directory::createPath(m_directories.getURLFromWorkdir(OUStringToOString(aDirname,RTL_TEXTENCODING_UTF8).getStr()));
+ auto const path = m_directories.getURLFromWorkdir(
+ OUStringToOString(aDirname, RTL_TEXTENCODING_UTF8).getStr());
+ auto const e = osl::Directory::createPath(path);
+ if (e != osl::FileBase::E_EXIST) {
+ CPPUNIT_ASSERT_EQUAL_MESSAGE(
+ OUStringToOString(
+ "Failed to create " + path, RTL_TEXTENCODING_UTF8).getStr(),
+ osl::FileBase::E_None, e);
+ }
OUString aFullPath = m_directories.getPathFromWorkdir(OUStringToOString(aDirname + "/" + aBasename + ".png",RTL_TEXTENCODING_UTF8).getStr());
SvFileStream aNew(aFullPath, StreamMode::WRITE | StreamMode::TRUNC);