summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
authorJan-Marek Glogowski <jan-marek.glogowski@extern.cib.de>2019-11-29 16:07:55 +0100
committerJan-Marek Glogowski <glogow@fbihome.de>2019-12-03 09:08:59 +0100
commitc6553564a858a65a74c8727f08ae737c35b81a08 (patch)
treedb6b313c74329bfcb0bfc3e5f44d1728db7f7205 /sal
parent5a77636c9a638c86fd3de3afb6e88cf48f987b6a (diff)
WIN map ERROR_DIRECTORY to osl_File_E_NOTDIR
The open_004 unit test fails on Windows with E_NOENT. I think the assert is correct, and it's better change the ERROR_DIRECTORY mapping, as FindFirstFileW returns ERROR_PATH_NOT_FOUND, if the path doesn't exists at all. The description of that error code in the MS API docs is "The directory name is invalid.". And obviously there is no way to tell, if this is actually a better mapping. Change-Id: Id122ce39e90f3562e70c96a06752e5b32ed55b41 Reviewed-on: https://gerrit.libreoffice.org/84070 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Diffstat (limited to 'sal')
-rw-r--r--sal/osl/w32/file_error.cxx2
-rw-r--r--sal/qa/osl/file/osl_File.cxx2
2 files changed, 1 insertions, 3 deletions
diff --git a/sal/osl/w32/file_error.cxx b/sal/osl/w32/file_error.cxx
index 5336c17fd970..27b0f90cbd2d 100644
--- a/sal/osl/w32/file_error.cxx
+++ b/sal/osl/w32/file_error.cxx
@@ -77,7 +77,7 @@ static const struct osl_file_error_entry errtable[] = {
{ ERROR_FILENAME_EXCED_RANGE, osl_File_E_NOENT }, /* 206 */
{ ERROR_NESTING_NOT_ALLOWED, osl_File_E_AGAIN }, /* 215 */
{ ERROR_FILE_CHECKED_OUT, osl_File_E_ACCES }, /* 220 */
- { ERROR_DIRECTORY, osl_File_E_NOENT }, /* 267 */
+ { ERROR_DIRECTORY, osl_File_E_NOTDIR }, /* 267 */
{ ERROR_NOT_ENOUGH_QUOTA, osl_File_E_NOMEM }, /* 1816 */
{ ERROR_CANT_ACCESS_FILE, osl_File_E_ACCES }, /* 1920 */
{ ERROR_UNEXP_NET_ERR, osl_File_E_NETWORK } /* 59 */
diff --git a/sal/qa/osl/file/osl_File.cxx b/sal/qa/osl/file/osl_File.cxx
index 28f63b3055c3..31f15bc6a41f 100644
--- a/sal/qa/osl/file/osl_File.cxx
+++ b/sal/qa/osl/file/osl_File.cxx
@@ -4142,10 +4142,8 @@ namespace osl_Directory
CPPUNIT_ASSERT_EQUAL(osl::FileBase::E_None, nError2);
}
-#ifndef _WIN32 // returns E_NOENT on Windows
CPPUNIT_ASSERT_MESSAGE("test for open function: open a file instead of a directory",
(osl::FileBase::E_NOTDIR == nError1) || (osl::FileBase::E_ACCES == nError1));
-#endif
}
CPPUNIT_TEST_SUITE(open);