Fixes MonoTests.System.IO.DirectoryTest.DeleteDirectoryOnExistingFileName on
authorNiklas Therning <niklas@therning.org>
Fri, 19 Aug 2016 13:54:55 +0000 (15:54 +0200)
committerNiklas Therning <niklas@therning.org>
Fri, 19 Aug 2016 13:54:55 +0000 (15:54 +0200)
Windows

The error (ERROR_DIRECTORY) wasn't recognized in MonoIO so the error message
became "Win32 IO returned 267. Path: C:\foo\bar" which includes the path. The
test tests that the path isn't include in the message in the thrown
IOException.

mcs/class/corlib/System.IO/MonoIO.cs
mcs/class/corlib/System.IO/MonoIOError.cs

index 7297e18d7a2b308ba5b500b812e3a6ca1d79a2c3..35a81c5e44984e708ae919fbd399daa9f5512fcb 100644 (file)
@@ -155,6 +155,10 @@ namespace System.IO
                        case MonoIOError.ERROR_NOT_SAME_DEVICE:
                                message = "Source and destination are not on the same device";
                                return new IOException (message, unchecked((int)0x80070000) | (int)error);
+
+                       case MonoIOError.ERROR_DIRECTORY:
+                               message = "The directory name is invalid";
+                               return new IOException (message, unchecked((int)0x80070000) | (int)error);
                                
                        default:
                                message = String.Format ("Win32 IO returned {0}. Path: {1}", error, path);
index 63756d190102372893732fd9e10aed7dabbf6526..2a78687ef36d21f80290a1816a747ef91eac5773 100644 (file)
@@ -217,8 +217,8 @@ namespace System.IO
                WAIT_TIMEOUT = 258,\r
                ERROR_NO_MORE_ITEMS = 259,\r
                ERROR_CANNOT_COPY = 266,\r
-               ERROR_DIRECTORY = 267,\r
-               ERROR_EAS_DIDNT_FIT = 275,\r
+       */      ERROR_DIRECTORY = 267,\r
+       /*      ERROR_EAS_DIDNT_FIT = 275,\r
                ERROR_EA_FILE_CORRUPT = 276,\r
                ERROR_EA_TABLE_FULL = 277,\r
                ERROR_INVALID_EA_HANDLE = 278,\r