Author: gert
Date: 2007-06-22 13:41:31 -0400 (Fri, 22 Jun 2007)
New Revision: 80562

Modified:
   trunk/mcs/class/corlib/Test/System.IO/ChangeLog
   trunk/mcs/class/corlib/Test/System.IO/FileStreamTest.cs
Log:
* FileStreamTest.cs: Added test for bug #79250.


Modified: trunk/mcs/class/corlib/Test/System.IO/ChangeLog
===================================================================
--- trunk/mcs/class/corlib/Test/System.IO/ChangeLog     2007-06-22 16:18:39 UTC 
(rev 80561)
+++ trunk/mcs/class/corlib/Test/System.IO/ChangeLog     2007-06-22 17:41:31 UTC 
(rev 80562)
@@ -1,3 +1,7 @@
+2007-06-22  Gert Driesen  <[EMAIL PROTECTED]>
+
+       * FileStreamTest.cs: Added test for bug #79250.
+
 2007-05-25  Gert Driesen  <[EMAIL PROTECTED]>
 
        * UnmanagedMemoryStreamTest.cs: Added tests for CanRead, CanSeek,

Modified: trunk/mcs/class/corlib/Test/System.IO/FileStreamTest.cs
===================================================================
--- trunk/mcs/class/corlib/Test/System.IO/FileStreamTest.cs     2007-06-22 
16:18:39 UTC (rev 80561)
+++ trunk/mcs/class/corlib/Test/System.IO/FileStreamTest.cs     2007-06-22 
17:41:31 UTC (rev 80562)
@@ -821,6 +821,39 @@
                        }
                }
 
+#if NET_2_0
+               [Test] // bug #79250
+               public void FileShare_Delete ()
+               {
+                       string fn = Path.Combine (TempFolder, "temp");
+                       
+                       using (Stream s = new FileStream (fn, 
FileMode.OpenOrCreate, FileAccess.Write, FileShare.Delete)) {
+                               s.Write (new byte [1] { 0x5 }, 0, 1);
+                               File.Delete (fn);
+                       }
+
+                       using (Stream s = new FileStream (fn, 
FileMode.OpenOrCreate, FileAccess.Write, FileShare.ReadWrite | 
FileShare.Delete)) {
+                               s.Write (new byte [1] { 0x5 }, 0, 1);
+                               File.Delete (fn);
+                       }
+
+                       using (Stream s = new FileStream (fn, 
FileMode.OpenOrCreate, FileAccess.Write, FileShare.Write | FileShare.Delete)) {
+                               s.Write (new byte [1] { 0x5 }, 0, 1);
+                               File.Delete (fn);
+                       }
+
+                       using (Stream s = new FileStream (fn, 
FileMode.OpenOrCreate, FileAccess.Write, FileShare.Read | FileShare.Delete)) {
+                               s.Write (new byte [1] { 0x5 }, 0, 1);
+                               File.Delete (fn);
+                       }
+
+                       using (Stream s = new FileStream (fn, 
FileMode.OpenOrCreate, FileAccess.Write, FileShare.Inheritable | 
FileShare.Delete)) {
+                               s.Write (new byte [1] { 0x5 }, 0, 1);
+                               File.Delete (fn);
+                       }
+               }
+#endif
+
                [Test]
                public void Write ()
                {
@@ -1555,7 +1588,8 @@
 
 #if NET_2_0
                [Category("TargetJvmNotSupported")] // 
FileOptions.DeleteOnClose not supported for TARGET_JVM
-               [Test] public void DeleteOnClose ()
+               [Test]
+               public void DeleteOnClose ()
                {
                        string path = TempFolder + DSC + "created.txt";
                        DeleteFile (path);
@@ -1569,4 +1603,3 @@
 #endif
        }
 }
-

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to