Imported Upstream version 6.4.0.137

Former-commit-id: 943baa9f16a098c33e129777827f3a9d20da00d6
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2019-07-26 19:53:28 +00:00
parent e9207cf623
commit ef583813eb
2712 changed files with 74169 additions and 40587 deletions

View File

@@ -81,7 +81,7 @@ namespace MonoTests.Microsoft.Win32 {
public void FixtureSetUp ()
{
policy = new IntranetZoneCredentialPolicy ();
uri = new Uri ("http://www.mono-project.com");
uri = new Uri ("http://www.example.com");
request = WebRequest.Create (uri);
credential = new NetworkCredential ("me", "mine");
module = new Module ("type", true, "token");

View File

@@ -41,7 +41,7 @@ namespace MonoTests.System.ComponentModel.Design.Serialization {
[TestFixture]
public class InstanceDescriptorTest {
private const string url = "http://www.mono-project.com/";
private const string url = "http://www.example.com/";
private ConstructorInfo ci;
[TestFixtureSetUp]
@@ -185,10 +185,11 @@ namespace MonoTests.System.ComponentModel.Design.Serialization {
}
}
#if !DISABLE_SECURITY
[Test]
public void Property_Arguments_Mismatch ()
{
#if MOBILE
#if MOBILE && !DISABLE_SECURITY
// ensure the property is not linked out of the application since it make the test fails
Assert.IsNotNull (Thread.CurrentPrincipal, "pre-test");
#endif
@@ -211,7 +212,7 @@ namespace MonoTests.System.ComponentModel.Design.Serialization {
[Test]
public void Property_Arguments_Null ()
{
#if MOBILE
#if MOBILE && !DISABLE_SECURITY
// ensure the property is not linked out of the application since it make the test fails
Assert.IsNotNull (Thread.CurrentPrincipal, "pre-test");
#endif
@@ -223,6 +224,7 @@ namespace MonoTests.System.ComponentModel.Design.Serialization {
Assert.AreSame (pi, id.MemberInfo, "#3");
Assert.IsNotNull (id.Invoke (), "#4");
}
#endif
[Test]
public void Property_MemberInfo_NonStatic ()

View File

@@ -12,10 +12,10 @@ using System.ComponentModel;
using System.ComponentModel.Design.Serialization;
using System.Globalization;
using NUnit.Framework;
namespace MonoTests.System.ComponentModel
{
using NUnit.Framework;
[TestFixture]
public class DateTimeConverterTests
{
@@ -146,7 +146,8 @@ namespace MonoTests.System.ComponentModel
}
[Test]
[SetCulture("en-GB")]
[SetCulture ("en-GB")]
[Category ("Calendars")]
public void ConvertToString ()
{
CultureInfo culture = new MyCultureInfo ();

View File

@@ -1035,6 +1035,12 @@ namespace MonoTests.System.Diagnostics
[NUnit.Framework.Category ("MobileNotWorking")]
public void StandardInputWrite ()
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.Create("AIX")))
{
// This test is broken on AIX because the fork child seems to become comatose.
Assert.Ignore ("Skipping on AIX/i");
}
var psi = GetEchoCrossPlatformStartInfo ();
psi.RedirectStandardInput = true;
psi.RedirectStandardOutput = true;

View File

@@ -201,13 +201,16 @@ namespace MonoTests.System.Net.Sockets
}
[Test]
#if FEATURE_NO_BSD_SOCKETS
[ExpectedException (typeof (PlatformNotSupportedException))]
#endif
public void Group ()
{
IPAddress group;
IPAddress local;
MulticastOption option;
local = Dns.GetHostEntry (string.Empty).AddressList [0];
local = Dns.GetHostEntry ("localhost").AddressList [0];
group = IPAddress.Parse ("239.255.255.250");
option = new MulticastOption (group, local);
group = IPAddress.Parse ("224.0.0.23");
@@ -234,6 +237,9 @@ namespace MonoTests.System.Net.Sockets
}
[Test]
#if FEATURE_NO_BSD_SOCKETS
[ExpectedException (typeof (PlatformNotSupportedException))]
#endif
public void InterfaceIndex ()
{
IPAddress group;
@@ -255,7 +261,7 @@ namespace MonoTests.System.Net.Sockets
Assert.AreEqual (0xFFFFFF, option.InterfaceIndex, "#C2");
Assert.IsNull (option.LocalAddress, "#C3");
local = Dns.GetHostEntry (string.Empty).AddressList [0];
local = Dns.GetHostEntry ("localhost").AddressList [0];
option = new MulticastOption (group, local);
option.InterfaceIndex = 10;
Assert.AreSame (group, option.Group, "#D1");
@@ -296,13 +302,16 @@ namespace MonoTests.System.Net.Sockets
}
[Test]
#if FEATURE_NO_BSD_SOCKETS
[ExpectedException (typeof (PlatformNotSupportedException))]
#endif
public void LocalAddress ()
{
IPAddress group;
IPAddress local;
MulticastOption option;
local = Dns.GetHostEntry (string.Empty).AddressList [0];
local = Dns.GetHostEntry ("localhost").AddressList [0];
group = IPAddress.Parse ("239.255.255.250");
option = new MulticastOption (group, local);
local = IPAddress.Loopback;
@@ -310,7 +319,7 @@ namespace MonoTests.System.Net.Sockets
Assert.AreSame (group, option.Group, "#A1");
Assert.AreEqual (0, option.InterfaceIndex, "#A2");
Assert.AreSame (local, option.LocalAddress, "#A3");
local = Dns.GetHostEntry (string.Empty).AddressList [0];
local = Dns.GetHostEntry ("localhost").AddressList [0];
option.LocalAddress = local;
Assert.AreSame (group, option.Group, "#B1");
Assert.AreEqual (0, option.InterfaceIndex, "#B2");

View File

@@ -55,7 +55,7 @@ namespace MonoCasTests.System.Net.Sockets {
{
reset = new ManualResetEvent (false);
IPHostEntry host = Dns.Resolve ("www.google.com");
IPHostEntry host = Dns.Resolve ("www.example.com");
IPAddress ip = host.AddressList[0];
socket = new Socket (ip.AddressFamily, SocketType.Stream, ProtocolType.Tcp);
socket.Connect (new IPEndPoint (ip, 80));

View File

@@ -29,7 +29,7 @@ namespace MonoTests.System.Net.Sockets
#endif
public void NetworkStreamConnection ()
{
IPEndPoint ipe = new IPEndPoint(Dns.GetHostEntry ("www.google.com").AddressList [0], 80);
IPEndPoint ipe = new IPEndPoint(Dns.GetHostEntry ("www.example.com").AddressList [0], 80);
Socket s = new Socket(ipe.AddressFamily, SocketType.Stream, ProtocolType.Tcp);
s.Close ();
NetworkStream ns = new NetworkStream (s);

View File

@@ -38,7 +38,7 @@ namespace MonoCasTests.System.Net.Sockets {
{
reset = new ManualResetEvent (false);
IPHostEntry host = Dns.Resolve ("www.google.com");
IPHostEntry host = Dns.Resolve ("www.example.com");
IPAddress ip = host.AddressList[0];
ep = new IPEndPoint (ip, 80);
socket = new Socket (ip.AddressFamily, SocketType.Stream, ProtocolType.Tcp);

View File

@@ -1 +1 @@
14976edb39c9c0643ba059f92078e0e93a0eb567
3dc69374874d14e90b24abf706902b0dacb2d02d

View File

@@ -76,7 +76,7 @@ namespace MonoCasTests.System.Net.Sockets {
TcpClient s = new TcpClient ();
message = "AsyncConnect";
reset.Reset ();
IAsyncResult r = s.BeginConnect ("www.google.com", 80, new AsyncCallback (ConnectCallback), s);
IAsyncResult r = s.BeginConnect ("www.example.com", 80, new AsyncCallback (ConnectCallback), s);
Assert.IsNotNull (r, "IAsyncResult");
if (!reset.WaitOne (timeout, true))
Assert.Ignore ("Timeout");
@@ -88,7 +88,7 @@ namespace MonoCasTests.System.Net.Sockets {
[Category ("InetAccess")]
public void AsyncConnect_IPAddressIntAsyncCallbackObject ()
{
IPHostEntry host = Dns.Resolve ("www.google.com");
IPHostEntry host = Dns.Resolve ("www.example.com");
TcpClient s = new TcpClient ();
message = "AsyncConnect";
reset.Reset ();
@@ -104,7 +104,7 @@ namespace MonoCasTests.System.Net.Sockets {
[Category ("InetAccess")]
public void AsyncConnect_IPAddressArrayIntAsyncCallbackObject ()
{
IPHostEntry host = Dns.Resolve ("www.google.com");
IPHostEntry host = Dns.Resolve ("www.example.com");
TcpClient s = new TcpClient ();
message = "AsyncConnect";
reset.Reset ();

View File

@@ -872,7 +872,7 @@ namespace MonoTests.System.Net.Sockets {
public void JoinMulticastGroup4_Socket_NotBound ()
{
IPAddress mcast_addr = IPAddress.Parse ("224.0.0.23");
IPAddress local_addr = Dns.GetHostEntry (string.Empty).AddressList [0];
IPAddress local_addr = Dns.GetHostEntry ("localhost").AddressList [0];
using (UdpClient client = new UdpClient (AddressFamily.InterNetwork)) {
client.JoinMulticastGroup (mcast_addr, local_addr);
@@ -980,7 +980,7 @@ namespace MonoTests.System.Net.Sockets {
"BeginSend #4");
}
IPAddress[] addresses = Dns.GetHostEntry (string.Empty).AddressList;
IPAddress[] addresses = Dns.GetHostEntry ("localhost").AddressList;
IPEndPoint ep = null;
foreach (IPAddress a in addresses) {
if (a.AddressFamily == AddressFamily.InterNetwork) {

View File

@@ -24,7 +24,7 @@ namespace MonoCasTests.System.Net {
[Category ("NotWorking")] // compiler (CSC) issue (on Windows)
public class DnsCas {
private const string site = "www.go-mono.com";
private const string site = "www.example.com";
private const int timeout = 30000;
static ManualResetEvent reset;

View File

@@ -75,8 +75,7 @@ namespace MonoTests.System.Net
IAsyncResult async = Dns.BeginResolve (site1Dot, null, null);
IPHostEntry entry = Dns.EndResolve (async);
SubTestValidIPHostEntry (entry);
var ip = GetIPv4Address (entry);
Assert.AreEqual (site1Dot, ip.ToString ());
CheckIPv4Address (entry, IPAddress.Parse (site1Dot));
}
[Test]
@@ -239,12 +238,10 @@ namespace MonoTests.System.Net
}
}
static IPAddress GetIPv4Address (IPHostEntry h)
static void CheckIPv4Address (IPHostEntry h, IPAddress a)
{
var al = h.AddressList.FirstOrDefault (x => x.AddressFamily == AddressFamily.InterNetwork);
if (al == null)
Assert.Ignore ("Could not resolve an IPv4 address as required by this test case, e.g. running on an IPv6 only network");
return al;
var al = h.AddressList.Contains (a);
Assert.True (al, "Failed to resolve host name " + h.HostName + " to expected IP address " + a.ToString());
}
void SubTestGetHostByName (string siteName, string siteDot)
@@ -252,8 +249,7 @@ namespace MonoTests.System.Net
IPHostEntry h = Dns.GetHostByName (siteName);
SubTestValidIPHostEntry (h);
Assert.AreEqual (siteName, h.HostName, "siteName");
var ip = GetIPv4Address (h);
Assert.AreEqual (siteDot, ip.ToString (), "siteDot");
CheckIPv4Address (h, IPAddress.Parse (siteDot));
}
[Test]
@@ -330,8 +326,7 @@ namespace MonoTests.System.Net
IPAddress addr = new IPAddress (IPAddress.NetworkToHostOrder ((int) site1IP));
IPHostEntry h = Dns.GetHostByAddress (addr);
SubTestValidIPHostEntry (h);
var ip = GetIPv4Address (h);
Assert.AreEqual (addr.ToString (), ip.ToString ());
CheckIPv4Address (h, addr);
}
[Test]
@@ -340,8 +335,7 @@ namespace MonoTests.System.Net
IPAddress addr = new IPAddress (IPAddress.NetworkToHostOrder ((int) site2IP));
IPHostEntry h = Dns.GetHostByAddress (addr);
SubTestValidIPHostEntry (h);
var ip = GetIPv4Address (h);
Assert.AreEqual (addr.ToString (), ip.ToString ());
CheckIPv4Address (h, addr);
}
[Test]
@@ -565,7 +559,7 @@ namespace MonoTests.System.Net
[Test]
public void GetHostEntry_StringEmpty ()
{
Dns.GetHostEntry (string.Empty);
Dns.GetHostEntry ("localhost");
}
/* This isn't used anymore, but could be useful for debugging

View File

@@ -775,7 +775,7 @@ namespace MonoTests.System.Net {
wait.WaitOne ();
NetworkStream ns = HttpListener2Test.CreateNS (port);
HttpListener2Test.Send (ns, "GET http://www.google.com/ HTTP/1.1\r\nHost: www.google.com\r\nContent-Length: 3\r\n\r\n123456");
HttpListener2Test.Send (ns, "GET http://www.example.com/ HTTP/1.1\r\nHost: www.example.com\r\nContent-Length: 3\r\n\r\n123456");
wait2.WaitOne ();
ns.Close ();
@@ -786,8 +786,8 @@ namespace MonoTests.System.Net {
wait.Set ();
HttpListenerContext ctx = listener.GetContext ();
Assert.AreEqual ("http://www.google.com:" + port + "/", ctx.Request.Url.ToString ());
Assert.AreEqual ("http://www.google.com/", ctx.Request.RawUrl);
Assert.AreEqual ("http://www.example.com:" + port + "/", ctx.Request.Url.ToString ());
Assert.AreEqual ("http://www.example.com/", ctx.Request.RawUrl);
wait2.Set ();
listener.Close ();

View File

@@ -26,7 +26,7 @@ namespace MonoCasTests.System.Net {
static ManualResetEvent reset;
private string message;
private string uri = "http://www.google.com";
private string uri = "http://www.example.com";
[TestFixtureSetUp]
public void FixtureSetUp ()

View File

@@ -1 +1 @@
befcc4eda76a0a81de84418baf554059f7754ec0
0252b387e04bece7b463e77edb0534daf063deb1

View File

@@ -329,7 +329,7 @@ public class IPAddressTest
Assert.Fail ("#1:" + i + " (" + ipAddress + ")");
} catch (FormatException ex) {
Assert.AreEqual (typeof (FormatException), ex.GetType (), "#2:" + i);
Assert.IsNull (ex.InnerException, "#3:" + i);
Assert.IsNotNull (ex.InnerException, "#3:" + i);
Assert.IsNotNull (ex.Message, "#4:" + i);
}
}
@@ -534,7 +534,7 @@ public class IPAddressTest
IPAddress i;
Assert.IsTrue (IPAddress.TryParse ("0.0.0.0", out i), "#1");
Assert.IsTrue (IPAddress.TryParse ("127.0.0.1", out i), "#2");
Assert.IsFalse (IPAddress.TryParse ("www.mono-project.com", out i), "#3");
Assert.IsFalse (IPAddress.TryParse ("www.example.com", out i), "#3");
Assert.IsTrue (IPAddress.TryParse ("0001:0002:0003:0004:0005:0006:0007:0008", out i), "#4");
Assert.IsTrue (IPAddress.TryParse ("1:2:3:4:5:6:7:8", out i), "#5");
Assert.IsTrue (IPAddress.TryParse ("1::8", out i), "#6");
@@ -667,19 +667,6 @@ public class IPAddressTest
}
}
[Test]
[Category ("NotDotNet")]
public void UnixInterfaceNameAsZoneIndex ()
{
var ip = IPAddress.Parse ("fe80::bae8:56ff:fe47:af7e%en0");
// Should be en0 but it's of long type!
Assert.AreEqual (0, ip.ScopeId);
Assert.AreEqual ("fe80::bae8:56ff:fe47:af7e", ip.ToString ());
}
}
}

View File

@@ -50,7 +50,7 @@ namespace MonoTests.System.Net {
Assert.AreEqual ("dom", nc.Domain, "Domain");
Assert.AreEqual ("********", nc.Password, "Password");
Assert.AreEqual ("user", nc.UserName, "UserName");
Assert.AreSame (nc, nc.GetCredential (new Uri ("http://www.mono-project.com"), "basic"), "GetCredential");
Assert.AreSame (nc, nc.GetCredential (new Uri ("http://www.example.com"), "basic"), "GetCredential");
}
[Test]

View File

@@ -21,9 +21,8 @@ namespace MonoTests.System.Net
[TestFixture]
public class ServicePointManagerTest
{
private Uri googleUri;
private Uri yahooUri;
private Uri apacheUri;
private Uri exampleComUri;
private Uri exampleOrgUri;
private int maxIdle;
[SetUp]
@@ -33,9 +32,8 @@ public class ServicePointManagerTest
maxIdle = ServicePointManager.MaxServicePointIdleTime;
ServicePointManager.MaxServicePointIdleTime = 10;
#endif
googleUri = new Uri ("http://www.google.com");
yahooUri = new Uri ("http://www.yahoo.com");
apacheUri = new Uri ("http://www.apache.org");
exampleComUri = new Uri ("http://www.example.com");
exampleOrgUri = new Uri ("http://www.example.org");
}
[TearDown]
@@ -53,27 +51,21 @@ public class ServicePointManagerTest
{
Assert.AreEqual (0, ServicePointManager.MaxServicePoints, "#1");
DoWebRequest (googleUri);
DoWebRequest (exampleComUri);
Thread.Sleep (100);
DoWebRequest (yahooUri);
Thread.Sleep (100);
DoWebRequest (apacheUri);
DoWebRequest (exampleOrgUri);
Thread.Sleep (100);
ServicePoint sp = ServicePointManager.FindServicePoint (googleUri);
ServicePoint sp = ServicePointManager.FindServicePoint (exampleComUri);
//WriteServicePoint (sp);
sp = ServicePointManager.FindServicePoint (yahooUri);
//WriteServicePoint (sp);
sp = ServicePointManager.FindServicePoint (apacheUri);
sp = ServicePointManager.FindServicePoint (exampleOrgUri);
//WriteServicePoint (sp);
ServicePointManager.MaxServicePoints = 1;
sp = ServicePointManager.FindServicePoint (googleUri);
sp = ServicePointManager.FindServicePoint (exampleComUri);
//WriteServicePoint (sp);
sp = ServicePointManager.FindServicePoint (yahooUri);
//WriteServicePoint (sp);
sp = ServicePointManager.FindServicePoint (apacheUri);
sp = ServicePointManager.FindServicePoint (exampleOrgUri);
//WriteServicePoint (sp);
GC.Collect ();
@@ -94,8 +86,8 @@ public class ServicePointManagerTest
public void FindServicePoint ()
{
ServicePointManager.MaxServicePoints = 0;
ServicePoint sp = ServicePointManager.FindServicePoint (googleUri, new WebProxy (apacheUri));
Assert.AreEqual (apacheUri, sp.Address, "#1");
ServicePoint sp = ServicePointManager.FindServicePoint (exampleComUri, new WebProxy (exampleOrgUri));
Assert.AreEqual (exampleOrgUri, sp.Address, "#1");
#if MOBILE
Assert.AreEqual (10, sp.ConnectionLimit, "#2");
#else

View File

@@ -45,45 +45,45 @@ public class ServicePointTest
//WriteServicePoint ("A servicepoint that isn't really", p);
ServicePointManager.MaxServicePoints = 2;
ServicePoint google = ServicePointManager.FindServicePoint (new Uri ("http://www.google.com"));
ServicePoint exampleCom = ServicePointManager.FindServicePoint (new Uri ("http://www.example.com"));
try {
ServicePoint slashdot = ServicePointManager.FindServicePoint (new Uri ("http://www.slashdot.org"));
ServicePoint exampleOrg = ServicePointManager.FindServicePoint (new Uri ("http://www.example.org"));
Assert.Fail ("#1");
} catch (InvalidOperationException) { }
ServicePointManager.MaxServicePoints = 0;
//WriteServicePoint ("google before getting a webrequest", google);
//WriteServicePoint ("example before getting a webrequest", example);
HttpWebRequest req = (HttpWebRequest) WebRequest.Create ("http://www.google.com");
HttpWebRequest req = (HttpWebRequest) WebRequest.Create ("http://www.example.com");
HttpWebResponse res = (HttpWebResponse) req.GetResponse ();
#if FOUND_SOME_OTHER_URL
// URL is no longer found, disabled the test until a more reliable URL is found :P
//WriteServicePoint ("google after getting a response", google);
ServicePoint google2 = ServicePointManager.FindServicePoint (new Uri ("http://www.google.com/dilbert.html"));
Assert.AreEqual (google, google2, "#equals");
//WriteServicePoint ("example after getting a response", example);
ServicePoint example2 = ServicePointManager.FindServicePoint (new Uri ("http://www.example.com/dilbert.html"));
Assert.AreEqual (example, example2, "#equals");
res.Close ();
#endif
// in both instances property CurrentConnections is 0 according to ms.net.
// let's see what it says when we do async operations...
HttpWebRequest req2 = (HttpWebRequest) WebRequest.Create ("http://www.google.com");
HttpWebRequest req2 = (HttpWebRequest) WebRequest.Create ("http://www.example.com");
req2.Method = "PUT";
IAsyncResult async = req2.BeginGetRequestStream (null, null);
//WriteServicePoint ("after async BeginGetRequestStream", google);
//WriteServicePoint ("after async BeginGetRequestStream", example);
// CurrentConnections: 1
Stream stream2 = req2.EndGetRequestStream (async);
//WriteServicePoint ("after async EndGetRequestStream", google);
//WriteServicePoint ("after async EndGetRequestStream", example);
// CurrentConnections: 1
stream2.Close ();
req2 = (HttpWebRequest) WebRequest.Create ("http://www.google.com");
req2 = (HttpWebRequest) WebRequest.Create ("http://www.example.com");
async = req2.BeginGetResponse (null, null);
//WriteServicePoint ("after async BeginGetResponse", google);
//WriteServicePoint ("after async BeginGetResponse", example);
// CurrentConnections: 2
WebResponse res2 = req2.EndGetResponse (async);
//WriteServicePoint ("after async EndGetResponse", google);
//WriteServicePoint ("after async EndGetResponse", example);
// CurrentConnections: 0
// curious that after you get the webresponse object CurrentConnections is set to 0.
// you'd think that you'd still be connected until you close the webresponse..
@@ -109,10 +109,10 @@ public class ServicePointTest
// what's the limit of the cache?
req2 = (HttpWebRequest) WebRequest.Create ("http://www.apache.org/");
req2 = (HttpWebRequest) WebRequest.Create ("http://www.example.org/");
res2 = req2.GetResponse ();
sp2 = ServicePointManager.FindServicePoint (new Uri("http://www.apache.org/"));
//WriteServicePoint ("apache", sp2);
sp2 = ServicePointManager.FindServicePoint (new Uri("http://www.example.org/"));
//WriteServicePoint ("example", sp2);
//Console.WriteLine ("ContentLength: " + res2.ContentLength);
// CurrentConnections: 1
res2.Close ();
@@ -130,7 +130,7 @@ public class ServicePointTest
// the default is already 2, just in case it isn't..
ServicePointManager.DefaultConnectionLimit = 5;
Uri uri = new Uri ("http://www.go-mono.com/");
Uri uri = new Uri ("http://www.example.com/");
ServicePoint sp = ServicePointManager.FindServicePoint (uri);
WebResponse [] res = new WebResponse [5];
for (int i = 0; i < 5; i++) {
@@ -159,7 +159,7 @@ public class ServicePointTest
[Category ("NotWorking")] // #A1 fails
public void EndPointBind ()
{
Uri uri = new Uri ("http://www.go-mono.com/");
Uri uri = new Uri ("http://www.example.com/");
ServicePoint sp = ServicePointManager.FindServicePoint (uri);
HttpWebRequest req = (HttpWebRequest) WebRequest.Create (uri);

Some files were not shown because too many files have changed in this diff Show More