[Cleanup] Removed TARGET_JVM
[mono.git] / mcs / class / System / Test / System.Net.Sockets / UdpClientTest.cs
index c91939192234478aca44e95dca7340697a387eba..9b2453bd6f1d9cade2de2fdc27fecdd5544eabc3 100644 (file)
@@ -13,9 +13,6 @@ using System.Threading;
 using NUnit.Framework;
 
 namespace MonoTests.System.Net.Sockets {
-#if TARGET_JVM
-       [Ignore("UdpClient is not supported - since UDP sockets are not supported")]
-#endif
        [TestFixture]
        public class UdpClientTest {
                [Test] // .ctor ()
@@ -74,6 +71,13 @@ namespace MonoTests.System.Net.Sockets {
                        //Assert.AreEqual (32, client.Ttl, "#A:Ttl");
 #endif
 
+#if NET_2_0
+                       if (!Socket.OSSupportsIPv6)
+#else
+                       if (!Socket.SupportsIPv6)
+#endif
+                               Assert.Ignore ("IPv6 not enabled.");
+
                        client = new MyUdpClient (AddressFamily.InterNetworkV6);
                        s = client.Client;
                        Assert.IsNotNull (s, "#B:Client");
@@ -297,6 +301,13 @@ namespace MonoTests.System.Net.Sockets {
                                Assert.AreEqual (AddressFamily.InterNetwork, localEP.AddressFamily, "#A:Client:LocalEndPoint/AddressFamily");
                        }
 
+#if NET_2_0
+                       if (!Socket.OSSupportsIPv6)
+#else
+                       if (!Socket.SupportsIPv6)
+#endif
+                               Assert.Ignore ("IPv6 not enabled.");
+
                        using (MyUdpClient client = new MyUdpClient (IPEndPoint.MaxPort, AddressFamily.InterNetworkV6))
                        {
                                s = client.Client;
@@ -656,6 +667,13 @@ namespace MonoTests.System.Net.Sockets {
                [Test] // JoinMulticastGroup (Int32, IPAddress)
                public void JoinMulticastGroup2_Socket_Closed ()
                {
+#if NET_2_0
+                       if (!Socket.OSSupportsIPv6)
+#else
+                       if (!Socket.SupportsIPv6)
+#endif
+                               Assert.Ignore ("IPv6 not enabled.");
+
                        IPAddress mcast_addr = null;
 
                        UdpClient client = new UdpClient (new IPEndPoint (IPAddress.IPv6Any, 1234));