[Libreoffice-commits] core.git: test/source
Stephan Bergmann
sbergman at redhat.com
Wed Aug 23 14:19:11 UTC 2017
test/source/screenshot_test.cxx | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
New commits:
commit 63e1596ae6d633bf6bf653123e6851ffa0fe6051
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Wed Aug 23 16:15:37 2017 +0200
Report osl::Directory::createPath failure
Change-Id: I75ede7f03edf80c00d33281afdebc3b620fb33eb
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);
More information about the Libreoffice-commits
mailing list