[Tests] Fail with message in case symlink fails
authorLudovic Henry <ludovic@xamarin.com>
Mon, 25 Sep 2017 20:38:44 +0000 (16:38 -0400)
committerMarek Safar <marek.safar@gmail.com>
Tue, 26 Sep 2017 11:33:25 +0000 (13:33 +0200)
mcs/class/corlib/Test/System.IO/FileTest.cs

index 4528027b24e9bc730bcb914ef0f2573189f1cc90..7e01ce544d7240a073f1ca6fbc32d2cf3cb54c71 100644 (file)
@@ -2709,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");