Imported Upstream version 4.0.0~alpha1

Former-commit-id: 806294f5ded97629b74c85c09952f2a74fe182d9
This commit is contained in:
Jo Shields
2015-04-07 09:35:12 +01:00
parent 283343f570
commit 3c1f479b9d
22469 changed files with 2931443 additions and 869343 deletions

View File

@@ -26,17 +26,13 @@ namespace MonoTests.System.Net.Sockets
group = IPAddress.Parse ("239.255.255.250");
option = new MulticastOption (group);
Assert.AreSame (group, option.Group, "#A:Group");
#if NET_2_0
Assert.AreEqual (0, option.InterfaceIndex, "#A:InterfaceIndex");
#endif
Assert.AreEqual (IPAddress.Any, option.LocalAddress, "#A:LocalAddress");
group = IPAddress.Parse ("ff02::1");
option = new MulticastOption (group);
Assert.AreSame (group, option.Group, "#B:Group");
#if NET_2_0
Assert.AreEqual (0, option.InterfaceIndex, "#B:InterfaceIndex");
#endif
Assert.AreEqual (IPAddress.Any, option.LocalAddress, "#B:LocalAddress");
}
@@ -65,18 +61,14 @@ namespace MonoTests.System.Net.Sockets
mcint = IPAddress.Any;
option = new MulticastOption (group, mcint);
Assert.AreSame (group, option.Group, "#A:Group");
#if NET_2_0
Assert.AreEqual (0, option.InterfaceIndex, "#A:InterfaceIndex");
#endif
Assert.AreEqual (mcint, option.LocalAddress, "#A:LocalAddress");
group = IPAddress.Parse ("ff02::1");
mcint = IPAddress.IPv6Any;
option = new MulticastOption (group, mcint);
Assert.AreSame (group, option.Group, "#B:Group");
#if NET_2_0
Assert.AreEqual (0, option.InterfaceIndex, "#B:InterfaceIndex");
#endif
Assert.AreEqual (mcint, option.LocalAddress, "#B:LocalAddress");
}
@@ -114,7 +106,6 @@ namespace MonoTests.System.Net.Sockets
}
}
#if NET_2_0
[Test] // .ctor (IPAddress, Int32)
public void Constructor3 ()
{
@@ -208,7 +199,6 @@ namespace MonoTests.System.Net.Sockets
Assert.AreEqual ("interfaceIndex", ex.ParamName, "#B5");
}
}
#endif
[Test]
public void Group ()
@@ -217,11 +207,7 @@ namespace MonoTests.System.Net.Sockets
IPAddress local;
MulticastOption option;
#if NET_2_0
local = Dns.GetHostEntry (string.Empty).AddressList [0];
#else
local = IPAddress.Loopback;
#endif
group = IPAddress.Parse ("239.255.255.250");
option = new MulticastOption (group, local);
group = IPAddress.Parse ("224.0.0.23");
@@ -239,17 +225,14 @@ namespace MonoTests.System.Net.Sockets
option.Group = null;
Assert.IsNull (option.Group, "#D1");
Assert.AreSame (local, option.LocalAddress, "#D2");
#if NET_2_0
option = new MulticastOption (group, 5);
group = IPAddress.Parse ("224.0.0.23");
option.Group = group;
Assert.AreSame (group, option.Group, "#E1");
Assert.AreEqual (5, option.InterfaceIndex, "#E2");
Assert.IsNull (option.LocalAddress, "#E3");
#endif
}
#if NET_2_0
[Test]
public void InterfaceIndex ()
{
@@ -311,7 +294,6 @@ namespace MonoTests.System.Net.Sockets
// ensure original value was retained
Assert.AreEqual (10, option.InterfaceIndex, "#C");
}
#endif
[Test]
public void LocalAddress ()
@@ -320,45 +302,29 @@ namespace MonoTests.System.Net.Sockets
IPAddress local;
MulticastOption option;
#if NET_2_0
local = Dns.GetHostEntry (string.Empty).AddressList [0];
#else
local = IPAddress.Loopback;
#endif
group = IPAddress.Parse ("239.255.255.250");
option = new MulticastOption (group, local);
local = IPAddress.Loopback;
option.LocalAddress = local;
Assert.AreSame (group, option.Group, "#A1");
#if NET_2_0
Assert.AreEqual (0, option.InterfaceIndex, "#A2");
#endif
Assert.AreSame (local, option.LocalAddress, "#A3");
#if NET_2_0
local = Dns.GetHostEntry (string.Empty).AddressList [0];
#else
local = IPAddress.Loopback;
#endif
option.LocalAddress = local;
Assert.AreSame (group, option.Group, "#B1");
#if NET_2_0
Assert.AreEqual (0, option.InterfaceIndex, "#B2");
#endif
Assert.AreSame (local, option.LocalAddress, "#B3");
option.LocalAddress = null;
Assert.AreSame (group, option.Group, "#C1");
#if NET_2_0
Assert.AreEqual (0, option.InterfaceIndex, "#C2");
#endif
Assert.IsNull (option.LocalAddress, "#C3");
#if NET_2_0
option = new MulticastOption (group, 5);
local = IPAddress.Loopback;
option.LocalAddress = local;
Assert.AreSame (group, option.Group, "#D1");
Assert.AreEqual (0, option.InterfaceIndex, "#D2");
Assert.AreSame (local, option.LocalAddress, "#D3");
#endif
}
}
}

View File

@@ -18,7 +18,6 @@ namespace MonoTests.System.Net.Sockets
[TestFixture]
public class NetworkStreamTest
{
#if NET_2_0
[Test]
// See bug #371923
[ExpectedException(typeof(IOException))]
@@ -71,6 +70,5 @@ namespace MonoTests.System.Net.Sockets
listen.Close ();
}
}
#endif
}
}

View File

@@ -26,7 +26,6 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_2_0
using System;
using System.Collections.Generic;
@@ -251,5 +250,4 @@ namespace MonoTests.System.Net.Sockets {
}
}
#endif

View File

@@ -1 +1 @@
1f18e4705d0a176a08e3d422b0fbd480cbeb3370
697830b3fd848d3d5f96b48aab738910621cfffe

View File

@@ -50,7 +50,6 @@ namespace MonoCasTests.System.Net.Sockets {
}
// async tests (for stack propagation)
#if NET_2_0
/* Oops - not yet implemented in Mono
private void ConnectCallback (IAsyncResult ar)
{
@@ -117,6 +116,5 @@ namespace MonoCasTests.System.Net.Sockets {
Assert.IsNull (message, message);
}
*/
#endif
}
}

View File

@@ -82,13 +82,10 @@ namespace MonoTests.System.Net.Sockets
TcpClient tcpClient = new TcpClient (IPAddress.Loopback.ToString (), 8765);
NetworkStream ns = tcpClient.GetStream ();
Assert.IsNotNull (ns, "#A1");
#if NET_2_0
Assert.AreEqual (0, tcpClient.Available, "#A2");
Assert.IsTrue (tcpClient.Connected, "#A3");
// Assert.IsFalse (tcpClient.ExclusiveAddressUse, "#A4");
#endif
tcpClient.Close ();
#if NET_2_0
Assert.IsNotNull (tcpClient.Client, "#A5");
try {
int available = tcpClient.Available;
@@ -104,20 +101,16 @@ namespace MonoTests.System.Net.Sockets
} catch (ObjectDisposedException) {
}
*/
#endif
}
using (SocketResponder sr = new SocketResponder (localEP, new SocketRequestHandler (CloseRequestHandler))) {
sr.Start ();
TcpClient tcpClient = new TcpClient (IPAddress.Loopback.ToString (), 8765);
#if NET_2_0
Assert.AreEqual (0, tcpClient.Available, "#B1");
Assert.IsTrue (tcpClient.Connected, "#B2");
// Assert.IsFalse (tcpClient.ExclusiveAddressUse, "#B3");
#endif
tcpClient.Close ();
#if NET_2_0
Assert.IsNull (tcpClient.Client, "#B4");
try {
int available = tcpClient.Available;
@@ -137,7 +130,6 @@ namespace MonoTests.System.Net.Sockets
} catch (NullReferenceException) {
}
*/
#endif
}
}
@@ -146,7 +138,6 @@ namespace MonoTests.System.Net.Sockets
return new byte [0];
}
#if NET_2_0
[Test]
[ExpectedException (typeof(ArgumentNullException))]
public void ConnectMultiNull ()
@@ -192,6 +183,5 @@ namespace MonoTests.System.Net.Sockets
Assert.Fail ("ConnectMultiRefused #3");
}
}
#endif
}
}

View File

@@ -168,7 +168,6 @@ namespace MonoTests.System.Net.Sockets
Assert.IsTrue (sock != listener.GetSocket (), "#08");
}
#if NET_2_0
[Test]
public void StartListenMoreThan5 ()
{
@@ -189,6 +188,5 @@ namespace MonoTests.System.Net.Sockets
listen.Start (65536);
listen.Stop ();
}
#endif
}
}

View File

@@ -26,21 +26,17 @@ namespace MonoTests.System.Net.Sockets {
Assert.IsNotNull (s, "Client");
Assert.AreEqual (AddressFamily.InterNetwork, s.AddressFamily, "Client:AddressFamily");
Assert.IsFalse (s.Connected, "Client:Connected");
#if NET_2_0
Assert.IsFalse (s.IsBound, "#A:Client:IsBound");
#endif
Assert.IsNull (s.LocalEndPoint, "Client:LocalEndPoint");
Assert.AreEqual (ProtocolType.Udp, s.ProtocolType, "Client:ProtocolType");
Assert.IsNull (s.RemoteEndPoint, "Client:RemoteEndPoint");
Assert.AreEqual (SocketType.Dgram, s.SocketType, "Client:SocketType");
Assert.IsFalse (client.Active, "Active");
#if NET_2_0
Assert.IsFalse (client.DontFragment, "DontFragment");
Assert.IsFalse (client.EnableBroadcast, "EnableBroadcast");
//Assert.IsFalse (client.ExclusiveAddressUse, "ExclusiveAddressUse");
Assert.IsTrue (client.MulticastLoopback, "MulticastLoopback");
//Assert.AreEqual (32, client.Ttl, "Ttl");
#endif
client.Close ();
}
@@ -55,27 +51,19 @@ namespace MonoTests.System.Net.Sockets {
Assert.IsNotNull (s, "#A:Client");
Assert.AreEqual (AddressFamily.InterNetwork, s.AddressFamily, "#A:Client:AddressFamily");
Assert.IsFalse (s.Connected, "#A:Client:Connected");
#if NET_2_0
Assert.IsFalse (s.IsBound, "#A:Client:IsBound");
#endif
Assert.IsNull (s.LocalEndPoint, "#A:Client:LocalEndPoint");
Assert.AreEqual (ProtocolType.Udp, s.ProtocolType, "#A:Client:ProtocolType");
Assert.IsNull (s.RemoteEndPoint, "#A:Client:RemoteEndPoint");
Assert.AreEqual (SocketType.Dgram, s.SocketType, "#A:Client:SocketType");
Assert.IsFalse (client.Active, "#A:Active");
#if NET_2_0
//Assert.IsFalse (client.DontFragment, "#A:DontFragment");
Assert.IsFalse (client.EnableBroadcast, "#A:EnableBroadcast");
//Assert.IsFalse (client.ExclusiveAddressUse, "#A:ExclusiveAddressUse");
Assert.IsTrue (client.MulticastLoopback, "#A:MulticastLoopback");
//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);
@@ -83,21 +71,17 @@ namespace MonoTests.System.Net.Sockets {
Assert.IsNotNull (s, "#B:Client");
Assert.AreEqual (AddressFamily.InterNetworkV6, s.AddressFamily, "#B:Client:AddressFamily");
Assert.IsFalse (s.Connected, "#B:Client:Connected");
#if NET_2_0
Assert.IsFalse (s.IsBound, "#A:Client:IsBound");
#endif
Assert.IsNull (s.LocalEndPoint, "#B:Client:LocalEndPoint");
Assert.AreEqual (ProtocolType.Udp, s.ProtocolType, "#B:Client:ProtocolType");
Assert.IsNull (s.RemoteEndPoint, "#B:Client:RemoteEndPoint");
Assert.AreEqual (SocketType.Dgram, s.SocketType, "#B:Client:SocketType");
Assert.IsFalse (client.Active, "#B:Active");
#if NET_2_0
//Assert.IsFalse (client.DontFragment, "#B:DontFragment");
Assert.IsFalse (client.EnableBroadcast, "#B:EnableBroadcast");
//Assert.IsFalse (client.ExclusiveAddressUse, "#B:ExclusiveAddressUse");
Assert.IsTrue (client.MulticastLoopback, "#B:MulticastLoopback");
//Assert.AreEqual (32, client.Ttl, "#B:Ttl");
#endif
client.Close ();
}
@@ -110,15 +94,10 @@ namespace MonoTests.System.Net.Sockets {
} catch (ArgumentException ex) {
Assert.AreEqual (typeof (ArgumentException), ex.GetType (), "#A2");
Assert.IsNull (ex.InnerException, "#A3");
#if NET_2_0
// 'UDP' Client can only accept InterNetwork or InterNetworkV6
// addresses
Assert.IsNotNull (ex.Message, "#A4");
Assert.AreEqual ("family", ex.ParamName, "#A5");
#else
Assert.AreEqual ("family", ex.Message, "#A4");
Assert.IsNull (ex.ParamName, "#A5");
#endif
}
try {
@@ -127,13 +106,8 @@ namespace MonoTests.System.Net.Sockets {
} catch (ArgumentException ex) {
Assert.AreEqual (typeof (ArgumentException), ex.GetType (), "#B2");
Assert.IsNull (ex.InnerException, "#B3");
#if NET_2_0
Assert.IsNotNull (ex.Message, "#B4");
Assert.AreEqual ("family", ex.ParamName, "#B5");
#else
Assert.AreEqual ("family", ex.Message, "#B4");
Assert.IsNull (ex.ParamName, "#B5");
#endif
}
}
@@ -149,19 +123,15 @@ namespace MonoTests.System.Net.Sockets {
Assert.IsNotNull (s, "#A:Client");
Assert.AreEqual (AddressFamily.InterNetwork, s.AddressFamily, "#A:Client:AddressFamily");
Assert.IsFalse (s.Connected, "#A:Client:Connected");
#if NET_2_0
Assert.IsTrue (s.IsBound, "#A:Client:IsBound");
#endif
Assert.AreEqual (ProtocolType.Udp, s.ProtocolType, "#A:Client:ProtocolType");
Assert.AreEqual (SocketType.Dgram, s.SocketType, "#A:Client:SocketType");
Assert.IsFalse (client.Active, "#A:Active");
#if NET_2_0
Assert.IsFalse (client.DontFragment, "#A:DontFragment");
Assert.IsFalse (client.EnableBroadcast, "#A:EnableBroadcast");
//Assert.IsFalse (client.ExclusiveAddressUse, "#A:ExclusiveAddressUse");
Assert.IsTrue (client.MulticastLoopback, "#A:MulticastLoopback");
//Assert.AreEqual (32, client.Ttl, "#A:Ttl");
#endif
localEP = s.LocalEndPoint as IPEndPoint;
Assert.IsNotNull (localEP, "#A:Client:LocalEndpoint");
Assert.AreEqual (IPAddress.Any, localEP.Address, "#A:Client:LocalEndPoint/Address");
@@ -173,19 +143,15 @@ namespace MonoTests.System.Net.Sockets {
Assert.IsNotNull (s, "#B:Client");
Assert.AreEqual (AddressFamily.InterNetwork, s.AddressFamily, "#B:Client:AddressFamily");
Assert.IsFalse (s.Connected, "#B:Client:Connected");
#if NET_2_0
Assert.IsTrue (s.IsBound, "#B:Client:IsBound");
#endif
Assert.AreEqual (ProtocolType.Udp, s.ProtocolType, "#B:Client:ProtocolType");
Assert.AreEqual (SocketType.Dgram, s.SocketType, "#B:Client:SocketType");
Assert.IsFalse (client.Active, "#B:Active");
#if NET_2_0
Assert.IsFalse (client.DontFragment, "#B:DontFragment");
Assert.IsFalse (client.EnableBroadcast, "#B:EnableBroadcast");
//Assert.IsFalse (client.ExclusiveAddressUse, "#B:ExclusiveAddressUse");
Assert.IsTrue (client.MulticastLoopback, "#B:MulticastLoopback");
//Assert.AreEqual (32, client.Ttl, "#B:Ttl");
#endif
localEP = s.LocalEndPoint as IPEndPoint;
Assert.IsNotNull (localEP, "#B:Client:LocalEndpoint");
Assert.AreEqual (IPAddress.Any, localEP.Address, "#B:Client:LocalEndPoint/Address");
@@ -234,19 +200,15 @@ namespace MonoTests.System.Net.Sockets {
Assert.IsNotNull (s, "#A:Client");
Assert.AreEqual (AddressFamily.InterNetwork, s.AddressFamily, "#A:Client:AddressFamily");
Assert.IsFalse (s.Connected, "#A:Client:Connected");
#if NET_2_0
Assert.IsTrue (s.IsBound, "#A:Client:IsBound");
#endif
Assert.AreEqual (ProtocolType.Udp, s.ProtocolType, "#A:Client:ProtocolType");
Assert.AreEqual (SocketType.Dgram, s.SocketType, "#A:Client:SocketType");
Assert.IsFalse (client.Active, "#A:Active");
#if NET_2_0
Assert.IsFalse (client.DontFragment, "#A:DontFragment");
Assert.IsFalse (client.EnableBroadcast, "#A:EnableBroadcast");
//Assert.IsFalse (client.ExclusiveAddressUse, "#A:ExclusiveAddressUse");
Assert.IsTrue (client.MulticastLoopback, "#A:MulticastLoopback");
//Assert.AreEqual (32, client.Ttl, "#A:Ttl");
#endif
localEP = s.LocalEndPoint as IPEndPoint;
Assert.IsNotNull (localEP, "#A:Client:LocalEndpoint");
Assert.IsFalse (object.ReferenceEquals (clientEP, localEP), "#A:Client:LocalEndPoint/ReferenceEquality");
@@ -282,30 +244,22 @@ namespace MonoTests.System.Net.Sockets {
Assert.IsNotNull (s, "#A:Client");
Assert.AreEqual (AddressFamily.InterNetwork, s.AddressFamily, "#A:Client:AddressFamily");
Assert.IsFalse (s.Connected, "#A:Client:Connected");
#if NET_2_0
Assert.IsTrue (s.IsBound, "#A:Client:IsBound");
#endif
Assert.AreEqual (ProtocolType.Udp, s.ProtocolType, "#A:Client:ProtocolType");
Assert.AreEqual (SocketType.Dgram, s.SocketType, "#A:Client:SocketType");
Assert.IsFalse (client.Active, "#A:Active");
#if NET_2_0
//Assert.IsFalse (client.DontFragment, "#A:DontFragment");
Assert.IsFalse (client.EnableBroadcast, "#A:EnableBroadcast");
//Assert.IsFalse (client.ExclusiveAddressUse, "#A:ExclusiveAddressUse");
Assert.IsTrue (client.MulticastLoopback, "#A:MulticastLoopback");
//Assert.AreEqual (32, client.Ttl, "#A:Ttl");
#endif
localEP = s.LocalEndPoint as IPEndPoint;
Assert.IsNotNull (localEP, "#A:Client:LocalEndpoint");
Assert.AreEqual (IPAddress.Any, localEP.Address, "#A:Client:LocalEndPoint/Address");
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))
@@ -314,19 +268,15 @@ namespace MonoTests.System.Net.Sockets {
Assert.IsNotNull (s, "#B:Client");
Assert.AreEqual (AddressFamily.InterNetworkV6, s.AddressFamily, "#B:Client:AddressFamily");
Assert.IsFalse (s.Connected, "#B:Client:Connected");
#if NET_2_0
Assert.IsTrue (s.IsBound, "#B:Client:IsBound");
#endif
Assert.AreEqual (ProtocolType.Udp, s.ProtocolType, "#B:Client:ProtocolType");
Assert.AreEqual (SocketType.Dgram, s.SocketType, "#B:Client:SocketType");
Assert.IsFalse (client.Active, "#B:Active");
#if NET_2_0
//Assert.IsFalse (client.DontFragment, "#B:DontFragment");
Assert.IsFalse (client.EnableBroadcast, "#B:EnableBroadcast");
//Assert.IsFalse (client.ExclusiveAddressUse, "#B:ExclusiveAddressUse");
Assert.IsTrue (client.MulticastLoopback, "#B:MulticastLoopback");
//Assert.AreEqual (32, client.Ttl, "#B:Ttl");
#endif
localEP = s.LocalEndPoint as IPEndPoint;
Assert.IsNotNull (localEP, "#B:Client:LocalEndpoint");
Assert.AreEqual (IPAddress.IPv6Any, localEP.Address, "#B:Client:LocalEndPoint/Address");
@@ -345,15 +295,10 @@ namespace MonoTests.System.Net.Sockets {
// family
Assert.AreEqual (typeof (ArgumentException), ex.GetType (), "#A2");
Assert.IsNull (ex.InnerException, "#A3");
#if NET_2_0
// 'UDP' Client can only accept InterNetwork or InterNetworkV6
// addresses
Assert.IsNotNull (ex.Message, "#A4");
Assert.AreEqual ("family", ex.ParamName, "#A5");
#else
Assert.AreEqual ("family", ex.Message, "#A4");
Assert.IsNull (ex.ParamName, "#A5");
#endif
}
try {
@@ -363,15 +308,10 @@ namespace MonoTests.System.Net.Sockets {
// family
Assert.AreEqual (typeof (ArgumentException), ex.GetType (), "#B2");
Assert.IsNull (ex.InnerException, "#B3");
#if NET_2_0
// 'UDP' Client can only accept InterNetwork or InterNetworkV6
// addresses
Assert.IsNotNull (ex.Message, "#B4");
Assert.AreEqual ("family", ex.ParamName, "#B5");
#else
Assert.AreEqual ("family", ex.Message, "#B4");
Assert.IsNull (ex.ParamName, "#B5");
#endif
}
}
@@ -415,19 +355,15 @@ namespace MonoTests.System.Net.Sockets {
Assert.IsNotNull (s, "#A:Client");
Assert.AreEqual (AddressFamily.InterNetwork, s.AddressFamily, "#A:Client:AddressFamily");
Assert.IsTrue (s.Connected, "#A:Client:Connected");
#if NET_2_0
Assert.IsTrue (s.IsBound, "#A:Client:IsBound");
#endif
Assert.AreEqual (ProtocolType.Udp, s.ProtocolType, "#A:Client:ProtocolType");
Assert.AreEqual (SocketType.Dgram, s.SocketType, "#A:Client:SocketType");
Assert.IsTrue (client.Active, "#A:Active");
#if NET_2_0
Assert.IsFalse (client.DontFragment, "#A:DontFragment");
Assert.IsFalse (client.EnableBroadcast, "#A:EnableBroadcast");
//Assert.IsFalse (client.ExclusiveAddressUse, "#A:ExclusiveAddressUse");
//Assert.IsFalse (client.MulticastLoopback, "#A:MulticastLoopback");
//Assert.AreEqual (32, client.Ttl, "#A:Ttl");
#endif
localEP = s.LocalEndPoint as IPEndPoint;
Assert.IsNotNull (localEP, "#A:Client:LocalEndpoint");
Assert.AreEqual (IPAddress.Loopback, localEP.Address, "#A:Client:LocalEndPoint/Address");
@@ -439,19 +375,15 @@ namespace MonoTests.System.Net.Sockets {
Assert.IsNotNull (s, "#B:Client");
Assert.AreEqual (AddressFamily.InterNetwork, s.AddressFamily, "#B:Client:AddressFamily");
Assert.IsTrue (s.Connected, "#B:Client:Connected");
#if NET_2_0
Assert.IsTrue (s.IsBound, "#B:Client:IsBound");
#endif
Assert.AreEqual (ProtocolType.Udp, s.ProtocolType, "#B:Client:ProtocolType");
Assert.AreEqual (SocketType.Dgram, s.SocketType, "#B:Client:SocketType");
Assert.IsTrue (client.Active, "#B:Active");
#if NET_2_0
Assert.IsFalse (client.DontFragment, "#B:DontFragment");
Assert.IsFalse (client.EnableBroadcast, "#B:EnableBroadcast");
//Assert.IsFalse (client.ExclusiveAddressUse, "#B:ExclusiveAddressUse");
//Assert.IsFalse (client.MulticastLoopback, "#B:MulticastLoopback");
//Assert.AreEqual (32, client.Ttl, "#B:Ttl");
#endif
localEP = s.LocalEndPoint as IPEndPoint;
Assert.IsNotNull (localEP, "#B:Client:LocalEndpoint");
Assert.AreEqual (IPAddress.Loopback, localEP.Address, "#B:Client:LocalEndPoint/Address");
@@ -525,11 +457,7 @@ namespace MonoTests.System.Net.Sockets {
[Test] // JoinMulticastGroup (IPAddress)
public void JoinMulticastGroup1_IPv6 ()
{
#if NET_2_0
if (!Socket.OSSupportsIPv6)
#else
if (!Socket.SupportsIPv6)
#endif
Assert.Ignore ("IPv6 not enabled.");
IPAddress mcast_addr = IPAddress.Parse ("ff02::1");
@@ -546,20 +474,12 @@ namespace MonoTests.System.Net.Sockets {
try {
client.JoinMulticastGroup ((IPAddress) null);
Assert.Fail ("#1");
#if NET_2_0
} catch (ArgumentNullException ex) {
Assert.AreEqual (typeof (ArgumentNullException), ex.GetType (), "#2");
Assert.IsNull (ex.InnerException, "#3");
Assert.IsNotNull (ex.Message, "#4");
Assert.AreEqual ("multicastAddr", ex.ParamName, "#5");
}
#else
} catch (NullReferenceException ex) {
Assert.AreEqual (typeof (NullReferenceException), ex.GetType (), "#2");
Assert.IsNull (ex.InnerException, "#3");
Assert.IsNotNull (ex.Message, "#4");
}
#endif
}
}
@@ -599,9 +519,7 @@ namespace MonoTests.System.Net.Sockets {
Assert.IsNull (ex.InnerException, "#4");
Assert.IsNotNull (ex.Message, "#5");
Assert.AreEqual (10022, ex.NativeErrorCode, "#6");
#if NET_2_0
Assert.AreEqual (SocketError.InvalidArgument, ex.SocketErrorCode, "#7");
#endif
} finally {
client.Close ();
}
@@ -624,9 +542,7 @@ namespace MonoTests.System.Net.Sockets {
Assert.IsNull (ex.InnerException, "#4");
Assert.IsNotNull (ex.Message, "#5");
Assert.AreEqual (10045, ex.NativeErrorCode, "#6");
#if NET_2_0
Assert.AreEqual (SocketError.OperationNotSupported, ex.SocketErrorCode, "#7");
#endif
}
}
}
@@ -634,11 +550,7 @@ namespace MonoTests.System.Net.Sockets {
[Test] // JoinMulticastGroup (In32, IPAddress)
public void JoinMulticastGroup2_IPv6 ()
{
#if NET_2_0
if (!Socket.OSSupportsIPv6)
#else
if (!Socket.SupportsIPv6)
#endif
Assert.Ignore ("IPv6 not enabled.");
IPAddress mcast_addr = IPAddress.Parse ("ff02::1");
@@ -667,11 +579,7 @@ 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;
@@ -707,9 +615,7 @@ namespace MonoTests.System.Net.Sockets {
Assert.IsNull (ex.InnerException, "#4");
Assert.IsNotNull (ex.Message, "#5");
Assert.AreEqual (10022, ex.NativeErrorCode, "#6");
#if NET_2_0
Assert.AreEqual (SocketError.InvalidArgument, ex.SocketErrorCode, "#7");
#endif
} finally {
client.Close ();
}
@@ -732,11 +638,7 @@ namespace MonoTests.System.Net.Sockets {
[Test] // JoinMulticastGroup (IPAddress, Int32)
public void JoinMulticastGroup3_IPv6 ()
{
#if NET_2_0
if (!Socket.OSSupportsIPv6)
#else
if (!Socket.SupportsIPv6)
#endif
Assert.Ignore ("IPv6 not enabled.");
IPAddress mcast_addr = IPAddress.Parse ("ff02::1");
@@ -802,15 +704,12 @@ namespace MonoTests.System.Net.Sockets {
Assert.IsNull (ex.InnerException, "#4");
Assert.IsNotNull (ex.Message, "#5");
Assert.AreEqual (10022, ex.NativeErrorCode, "#6");
#if NET_2_0
Assert.AreEqual (SocketError.InvalidArgument, ex.SocketErrorCode, "#7");
#endif
} finally {
client.Close ();
}
}
#if NET_2_0
[Test] // JoinMulticastGroup (IPAddress, IPAddress)
public void JoinMulticastGroup4_IPv4 ()
{
@@ -1160,7 +1059,6 @@ namespace MonoTests.System.Net.Sockets {
}
/* No test for Ttl default as it is platform dependent */
#endif
class MyUdpClient : UdpClient
{
@@ -1199,12 +1097,6 @@ namespace MonoTests.System.Net.Sockets {
set { base.Active = value; }
}
#if ONLY_1_1
public new Socket Client {
get { return base.Client; }
set { base.Client = value; }
}
#endif
}
}
}