Imported Upstream version 5.0.0.42

Former-commit-id: fd56571888259555122d8a0f58c68838229cea2b
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2017-04-10 11:41:01 +00:00
parent 1190d13a04
commit 6bdd276d05
19939 changed files with 3099680 additions and 93811 deletions

View File

@ -558,25 +558,15 @@ namespace MonoTests.System.Net.Sockets {
}
[Test] // JoinMulticastGroup (IPAddress)
[Category ("NotWorking")]
#if FEATURE_NO_BSD_SOCKETS
[ExpectedException (typeof (PlatformNotSupportedException))]
#endif
public void JoinMulticastGroup1_Socket_NotBound ()
{
IPAddress mcast_addr = IPAddress.Parse ("224.0.0.23");
UdpClient client = new UdpClient (AddressFamily.InterNetwork);
try {
using (UdpClient client = new UdpClient (AddressFamily.InterNetwork)) {
client.JoinMulticastGroup (mcast_addr);
Assert.Fail ("#1");
} catch (SocketException ex) {
// An invalid argument was supplied
Assert.AreEqual (typeof (SocketException), ex.GetType (), "#2");
Assert.AreEqual (10022, ex.ErrorCode, "#3");
Assert.IsNull (ex.InnerException, "#4");
Assert.IsNotNull (ex.Message, "#5");
Assert.AreEqual (10022, ex.NativeErrorCode, "#6");
Assert.AreEqual (SocketError.InvalidArgument, ex.SocketErrorCode, "#7");
} finally {
client.Close ();
}
}
@ -666,25 +656,15 @@ namespace MonoTests.System.Net.Sockets {
}
[Test] // JoinMulticastGroup (Int32, IPAddress)
[Category ("NotWorking")]
#if FEATURE_NO_BSD_SOCKETS
[ExpectedException (typeof (PlatformNotSupportedException))]
#endif
public void JoinMulticastGroup2_Socket_NotBound ()
{
IPAddress mcast_addr = IPAddress.Parse ("ff02::1");
UdpClient client = new UdpClient (AddressFamily.InterNetworkV6);
try {
using (UdpClient client = new UdpClient (AddressFamily.InterNetworkV6)) {
client.JoinMulticastGroup (0, mcast_addr);
Assert.Fail ("#1");
} catch (SocketException ex) {
// An invalid argument was supplied
Assert.AreEqual (typeof (SocketException), ex.GetType (), "#2");
Assert.AreEqual (10022, ex.ErrorCode, "#3");
Assert.IsNull (ex.InnerException, "#4");
Assert.IsNotNull (ex.Message, "#5");
Assert.AreEqual (10022, ex.NativeErrorCode, "#6");
Assert.AreEqual (SocketError.InvalidArgument, ex.SocketErrorCode, "#7");
} finally {
client.Close ();
}
}
@ -767,25 +747,15 @@ namespace MonoTests.System.Net.Sockets {
}
[Test] // JoinMulticastGroup (IPAddress, Int32)
[Category ("NotWorking")]
#if FEATURE_NO_BSD_SOCKETS
[ExpectedException (typeof (PlatformNotSupportedException))]
#endif
public void JoinMulticastGroup3_Socket_NotBound ()
{
IPAddress mcast_addr = IPAddress.Parse ("224.0.0.23");
UdpClient client = new UdpClient (AddressFamily.InterNetwork);
try {
using (UdpClient client = new UdpClient (AddressFamily.InterNetwork)) {
client.JoinMulticastGroup (mcast_addr, 5);
Assert.Fail ("#1");
} catch (SocketException ex) {
// An invalid argument was supplied
Assert.AreEqual (typeof (SocketException), ex.GetType (), "#2");
Assert.AreEqual (10022, ex.ErrorCode, "#3");
Assert.IsNull (ex.InnerException, "#4");
Assert.IsNotNull (ex.Message, "#5");
Assert.AreEqual (10022, ex.NativeErrorCode, "#6");
Assert.AreEqual (SocketError.InvalidArgument, ex.SocketErrorCode, "#7");
} finally {
client.Close ();
}
}
@ -896,26 +866,16 @@ namespace MonoTests.System.Net.Sockets {
}
[Test] // JoinMulticastGroup (IPAddress, IPAddress)
[Category ("NotWorking")]
#if FEATURE_NO_BSD_SOCKETS
[ExpectedException (typeof (PlatformNotSupportedException))]
#endif
public void JoinMulticastGroup4_Socket_NotBound ()
{
IPAddress mcast_addr = IPAddress.Parse ("224.0.0.23");
IPAddress local_addr = Dns.GetHostEntry (string.Empty).AddressList [0];
UdpClient client = new UdpClient (AddressFamily.InterNetwork);
try {
using (UdpClient client = new UdpClient (AddressFamily.InterNetwork)) {
client.JoinMulticastGroup (mcast_addr, local_addr);
Assert.Fail ("#1");
} catch (SocketException ex) {
// An invalid argument was supplied
Assert.AreEqual (typeof (SocketException), ex.GetType (), "#2");
Assert.AreEqual (10022, ex.ErrorCode, "#3");
Assert.IsNull (ex.InnerException, "#4");
Assert.IsNotNull (ex.Message, "#5");
Assert.AreEqual (10022, ex.NativeErrorCode, "#6");
Assert.AreEqual (SocketError.InvalidArgument, ex.SocketErrorCode, "#7");
} finally {
client.Close ();
}
}
@ -1031,8 +991,14 @@ namespace MonoTests.System.Net.Sockets {
"BeginSend #4");
}
IPEndPoint ep = new IPEndPoint (Dns.GetHostEntry (string.Empty).AddressList[0], 1236);
IPAddress[] addresses = Dns.GetHostEntry (string.Empty).AddressList;
IPEndPoint ep = null;
foreach (IPAddress a in addresses) {
if (a.AddressFamily == AddressFamily.InterNetwork) {
ep = new IPEndPoint (a, 1236);
break;
}
}
BSCalledBack.Reset ();
client.BeginSend (bytes, bytes.Length, ep,