[Tests] Fail with message in case symlink fails
[mono.git] / mcs / class / corlib / Test / System.IO / FileTest.cs
index 4fc95243fe0b899020c9f96256de8d9387082442..7e01ce544d7240a073f1ca6fbc32d2cf3cb54c71 100644 (file)
@@ -532,6 +532,12 @@ namespace MonoTests.System.IO
                        }
                }
 
+               [Test]
+               public void Delete_NonExisting_NoException ()
+               {
+                       File.Delete (Path.Combine (Directory.GetDirectoryRoot (Directory.GetCurrentDirectory ()), "monononexistingfile.dat"));
+               }
+
                [Test]
                public void GetAttributes_Archive ()
                {
@@ -2703,8 +2709,10 @@ namespace MonoTests.System.IO
                        File.Delete (path2);
 
                        try {
-                               symlink (path1, path2);
-                               symlink (path2, path1);
+                               if (symlink (path1, path2) != 0)
+                                       Assert.Fail ("symlink #1 failed with errno={0}", Marshal.GetLastWin32Error ());
+                               if (symlink (path2, path1) != 0)
+                                       Assert.Fail ("symlink #2 failed with errno={0}", Marshal.GetLastWin32Error ());
 
                                Assert.IsTrue (File.Exists (path1), "File.Exists must return true for path1 symlink loop");
                                Assert.IsTrue (File.Exists (path2), "File.Exists must return true for path2 symlink loop");