[System] Relaxed Ping test to work under Linux.
authorJoão Matos <joao@tritao.eu>
Mon, 15 Dec 2014 17:06:27 +0000 (17:06 +0000)
committerJoão Matos <joao@tritao.eu>
Mon, 15 Dec 2014 17:06:27 +0000 (17:06 +0000)
So in Linux the PingTimeOut test was returning TtlExpired and failing the assertion. Since I'm not exactly sure how ping behaves under all platforms, relax the test to only make sure it doesn't succeed.

mcs/class/System/Test/System.Net.NetworkInformation/PingTest.cs

index 4b2daa60144b099b7752020964ced8abe700cab3..906528a64bb0b50593d56e3a02e3b993ddee85c9 100644 (file)
@@ -8,17 +8,17 @@ namespace MonoTests.System.Net.NetworkInformation
        public class PingTest
        {
                [Test] 
-               public void PingTimeOut()
+               public void PingFail()
                {
                        var p = new Ping ().Send ("192.0.2.0");
-                       Assert.AreEqual(p.Status, IPStatus.TimedOut);
+                       Assert.AreNotEqual(IPStatus.Success, p.Status);
                }
 
                [Test] 
                public void PingSuccess()
                {
                        var p = new Ping ().Send ("127.0.0.1");
-                       Assert.AreEqual(p.Status, IPStatus.Success);
+                       Assert.AreEqual(IPStatus.Success, p.Status);
                }               
        }
 }