You've already forked linux-packaging-mono
Imported Upstream version 3.10.0
Former-commit-id: 172c8e3c300b39d5785c7a3e8dfb08ebdbc1a99b
This commit is contained in:
@ -325,9 +325,6 @@ namespace MonoTests.System.Collections.Generic {
|
||||
}
|
||||
|
||||
[Test]
|
||||
#if TARGET_JVM
|
||||
[Category ("NotWorking")]
|
||||
#endif
|
||||
public void DeserializeTest ()
|
||||
{
|
||||
MemoryStream ms = new MemoryStream ();
|
||||
|
@ -292,9 +292,6 @@ namespace MonoTests.System.Collections.Generic
|
||||
}
|
||||
|
||||
[Test]
|
||||
#if TARGET_JVM
|
||||
[Category ("NotWorking")]
|
||||
#endif // TARGET_JVM
|
||||
public void DeserializeTest ()
|
||||
{
|
||||
MemoryStream ms = new MemoryStream ();
|
||||
|
@ -45,9 +45,7 @@ namespace MonoTests.System.ComponentModel
|
||||
numbers, (Type) null);
|
||||
Assert.Fail ("#1");
|
||||
} catch (ArgumentNullException ex) {
|
||||
#if !TARGET_JVM
|
||||
Assert.AreEqual ("destinationType", ex.ParamName, "#2");
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -206,9 +206,6 @@ namespace MonoTests.System.ComponentModel
|
||||
}
|
||||
|
||||
[Test]
|
||||
#if TARGET_JVM
|
||||
[NUnit.Framework.Category("NotWorking")]
|
||||
#endif
|
||||
public void ConvertFrom_String_Flags ()
|
||||
{
|
||||
EnumConverter converter = new EnumConverter (typeof (E2));
|
||||
|
@ -35,9 +35,6 @@ namespace MonoTests.System.ComponentModel
|
||||
}
|
||||
|
||||
[Test]
|
||||
#if TARGET_JVM
|
||||
[Ignore ("TD BUG ID: 7229")]
|
||||
#endif
|
||||
public void Empty ()
|
||||
{
|
||||
PropertyDescriptorCollection descriptors = PropertyDescriptorCollection.Empty;
|
||||
|
@ -18,9 +18,6 @@ namespace MonoTests.System.ComponentModel
|
||||
{
|
||||
#if !MOBILE
|
||||
[Test]
|
||||
#if TARGET_JVM
|
||||
[Ignore ("TD BUG ID: 7215, 7216")]
|
||||
#endif
|
||||
public void DefaultType ()
|
||||
{
|
||||
ToolboxItemAttribute attr = new ToolboxItemAttribute (true);
|
||||
|
@ -44,9 +44,6 @@ namespace MonoTests.System.ComponentModel
|
||||
}
|
||||
|
||||
[Test]
|
||||
#if TARGET_JVM
|
||||
[Ignore ("TD BUG ID: 7229")]
|
||||
#endif
|
||||
public void GetProperties ()
|
||||
{
|
||||
PropertyDescriptorCollection properties = null;
|
||||
|
@ -288,9 +288,7 @@ namespace MonoTests.System.Configuration {
|
||||
// This test will fail when there are newer versions
|
||||
// of the test assemblies - so conditionalize it in
|
||||
// such cases.
|
||||
#if TARGET_JVM
|
||||
string expected = "MonoTests.System.Configuration.ProviderPoker, System.Test, Version=0.0.0.0";
|
||||
#elif NET_4_5
|
||||
#if NET_4_5
|
||||
string expected = "MonoTests.System.Configuration.ProviderPoker, System_test_net_4_5, Version=0.0.0.0";
|
||||
#elif NET_4_0
|
||||
string expected = "MonoTests.System.Configuration.ProviderPoker, System_test_net_4_0, Version=0.0.0.0";
|
||||
|
@ -44,9 +44,6 @@ namespace MonoTests.System.Configuration
|
||||
[TestFixture]
|
||||
public class SettingsBaseTest
|
||||
{
|
||||
#if TARGET_JVM
|
||||
class CustomerException : Exception { }
|
||||
#endif
|
||||
class MySettings : SettingsBase
|
||||
{
|
||||
[UserScopedSetting] // ignored in non-ApplicationSettingsBase
|
||||
@ -235,11 +232,7 @@ namespace MonoTests.System.Configuration
|
||||
try {
|
||||
Assert.AreEqual (100, s.Foo, "#1");
|
||||
Assert.Fail ("#2");
|
||||
#if !TARGET_JVM
|
||||
} catch (Win32Exception) {
|
||||
#else
|
||||
} catch (CustomerException) {
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@ -264,11 +257,7 @@ namespace MonoTests.System.Configuration
|
||||
{
|
||||
public override SettingsPropertyValueCollection GetPropertyValues (SettingsContext context, SettingsPropertyCollection props)
|
||||
{
|
||||
#if !TARGET_JVM
|
||||
throw new Win32Exception (); // unlikely thrown otherwise.
|
||||
#else
|
||||
throw new CustomerException (); // unlikely thrown otherwise.
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -14,6 +14,7 @@ using NUnit.Framework;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.IO.Compression;
|
||||
using System.Text;
|
||||
|
||||
namespace MonoTests.System.IO.Compression
|
||||
{
|
||||
@ -297,6 +298,60 @@ namespace MonoTests.System.IO.Compression
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class Bug19313Stream : MemoryStream
|
||||
{
|
||||
public Bug19313Stream (byte [] buffer)
|
||||
: base (buffer)
|
||||
{
|
||||
}
|
||||
|
||||
public override int Read (byte [] buffer, int offset, int count)
|
||||
{
|
||||
// Thread was blocking when DeflateStream uses a NetworkStream.
|
||||
// Because the NetworkStream.Read calls Socket.Receive that
|
||||
// blocks the thread waiting for at least a byte to return.
|
||||
// This assert guarantees that Read is called only when there
|
||||
// is something to be read.
|
||||
Assert.IsTrue (Position < Length, "Trying to read empty stream.");
|
||||
|
||||
return base.Read (buffer, offset, count);
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Bug19313 ()
|
||||
{
|
||||
byte [] buffer = new byte [512];
|
||||
using (var backing = new Bug19313Stream (compressed_data))
|
||||
using (var decompressing = new DeflateStream (backing, CompressionMode.Decompress))
|
||||
decompressing.Read (buffer, 0, buffer.Length);
|
||||
}
|
||||
|
||||
public MemoryStream GenerateStreamFromString(string s)
|
||||
{
|
||||
return new MemoryStream (Encoding.UTF8.GetBytes (s));
|
||||
}
|
||||
|
||||
#if NET_4_5
|
||||
[Test]
|
||||
public void CheckNet45Overloads () // Xambug #21982
|
||||
{
|
||||
MemoryStream dataStream = GenerateStreamFromString("Hello");
|
||||
MemoryStream backing = new MemoryStream ();
|
||||
DeflateStream compressing = new DeflateStream (backing, CompressionLevel.Fastest, true);
|
||||
CopyStream (dataStream, compressing);
|
||||
dataStream.Close();
|
||||
compressing.Close();
|
||||
|
||||
backing.Seek (0, SeekOrigin.Begin);
|
||||
DeflateStream decompressing = new DeflateStream (backing, CompressionMode.Decompress);
|
||||
StreamReader reader = new StreamReader (decompressing);
|
||||
Assert.AreEqual ("Hello", reader.ReadLine ());
|
||||
decompressing.Close();
|
||||
backing.Close();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -12,6 +12,7 @@ using NUnit.Framework;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.IO.Compression;
|
||||
using System.Text;
|
||||
|
||||
namespace MonoTests.System.IO.Compression
|
||||
{
|
||||
@ -296,6 +297,31 @@ namespace MonoTests.System.IO.Compression
|
||||
0x03, 0x74, 0x65, 0x73, 0x74, 0x00, 0xf3, 0x48, 0xcd,
|
||||
0xc9, 0xc9, 0xe7, 0x02, 0x00, 0x16, 0x35, 0x96, 0x31,
|
||||
0x06, 0x00, 0x00, 0x00};
|
||||
|
||||
public MemoryStream GenerateStreamFromString(string s)
|
||||
{
|
||||
return new MemoryStream (Encoding.UTF8.GetBytes (s));
|
||||
}
|
||||
|
||||
#if NET_4_5
|
||||
[Test]
|
||||
public void CheckNet45Overloads () // Xambug #21982
|
||||
{
|
||||
MemoryStream dataStream = GenerateStreamFromString("Hello");
|
||||
MemoryStream backing = new MemoryStream ();
|
||||
GZipStream compressing = new GZipStream (backing, CompressionLevel.Fastest, true);
|
||||
CopyStream (dataStream, compressing);
|
||||
dataStream.Close();
|
||||
compressing.Close();
|
||||
|
||||
backing.Seek (0, SeekOrigin.Begin);
|
||||
GZipStream decompressing = new GZipStream (backing, CompressionMode.Decompress);
|
||||
StreamReader reader = new StreamReader (decompressing);
|
||||
Assert.AreEqual ("Hello", reader.ReadLine ());
|
||||
decompressing.Close();
|
||||
backing.Close();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -68,7 +68,7 @@ namespace MonoTests.System.Net.Sockets
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category("Test")]
|
||||
[Category("NotWorking")]
|
||||
public void Connect ()
|
||||
{
|
||||
StartServer();
|
||||
|
@ -1 +1 @@
|
||||
b6ddbf164a5e04ef05fc2d35b59923c2f82abef6
|
||||
1f18e4705d0a176a08e3d422b0fbd480cbeb3370
|
@ -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 ()
|
||||
|
@ -28,8 +28,8 @@ namespace MonoTests.System.Net
|
||||
[TestFixture]
|
||||
public class DnsTest
|
||||
{
|
||||
private String site1Name = "xamarin.com",
|
||||
site1Dot = "50.19.126.231",
|
||||
private String site1Name = "jenkins.mono-project.com",
|
||||
site1Dot = "162.253.133.196",
|
||||
site2Name = "info.diku.dk",
|
||||
site2Dot = "130.225.96.4",
|
||||
noneExistingSite = "unlikely.xamarin.com";
|
||||
@ -44,7 +44,7 @@ namespace MonoTests.System.Net
|
||||
IAsyncResult async = Dns.BeginGetHostByName (site1Name, null, null);
|
||||
IPHostEntry entry = Dns.EndGetHostByName (async);
|
||||
SubTestValidIPHostEntry (entry);
|
||||
Assert.IsTrue (entry.HostName == "www.xamarin.com" || entry.HostName == "xamarin.com");
|
||||
Assert.IsTrue (entry.HostName == "jenkins.mono-project.com");
|
||||
}
|
||||
|
||||
void GetHostByNameCallback (IAsyncResult ar)
|
||||
@ -191,7 +191,7 @@ namespace MonoTests.System.Net
|
||||
[Test]
|
||||
public void GetHostByName ()
|
||||
{
|
||||
SubTestGetHostByName ("www.xamarin.com", site1Dot);
|
||||
SubTestGetHostByName ("jenkins.mono-project.com", site1Dot);
|
||||
SubTestGetHostByName (site2Name, site2Dot);
|
||||
try {
|
||||
var entry = Dns.GetHostByName (noneExistingSite);
|
||||
@ -252,9 +252,6 @@ namespace MonoTests.System.Net
|
||||
|
||||
[Test]
|
||||
[ExpectedException (typeof (SocketException))]
|
||||
#if TARGET_JVM
|
||||
[Ignore ("Ignore failures in Sys.Net")]
|
||||
#endif
|
||||
public void GetHostByAddressString2 ()
|
||||
{
|
||||
Dns.GetHostByAddress ("123.255.23");
|
||||
|
@ -21,10 +21,6 @@ using System.Security.Permissions;
|
||||
|
||||
using NUnit.Framework;
|
||||
|
||||
#if TARGET_JVM
|
||||
using System.Globalization;
|
||||
using System.Reflection;
|
||||
#endif
|
||||
|
||||
namespace MonoTests.System.Net
|
||||
{
|
||||
@ -363,13 +359,11 @@ namespace MonoTests.System.Net
|
||||
#else
|
||||
Assert.AreEqual ("value", ex.Message, "#4");
|
||||
#endif
|
||||
#if !TARGET_JVM
|
||||
#if NET_2_0
|
||||
Assert.IsNotNull (ex.ParamName, "#5");
|
||||
Assert.AreEqual ("value", ex.ParamName, "#6");
|
||||
#else
|
||||
Assert.IsNull (ex.ParamName, "#5");
|
||||
#endif
|
||||
#endif
|
||||
Assert.IsNull (ex.InnerException, "#7");
|
||||
}
|
||||
@ -588,11 +582,9 @@ namespace MonoTests.System.Net
|
||||
} catch (WebException ex) {
|
||||
Assert.AreEqual (typeof (WebException), ex.GetType (), "#1");
|
||||
Assert.IsNotNull (ex.Message, "#2");
|
||||
#if !TARGET_JVM
|
||||
Assert.IsTrue (ex.Message.IndexOf ("FileWebRequestTest.tmp") != -1, "#3");
|
||||
Assert.IsNull (ex.Response, "#4");
|
||||
Assert.IsNotNull (ex.InnerException, "#5");
|
||||
#endif
|
||||
|
||||
#if ONLY_1_1
|
||||
FileNotFoundException fnf = ex.InnerException as FileNotFoundException;
|
||||
@ -631,12 +623,10 @@ namespace MonoTests.System.Net
|
||||
} catch (ArgumentException ex) {
|
||||
Assert.AreEqual (typeof (ArgumentException), ex.GetType (), "#2");
|
||||
Assert.IsNotNull (ex.Message, "#3");
|
||||
#if !TARGET_JVM
|
||||
#if NET_2_0
|
||||
Assert.AreEqual ("value", ex.ParamName, "#4");
|
||||
#else
|
||||
Assert.IsNull (ex.ParamName, "#4");
|
||||
#endif
|
||||
#endif
|
||||
Assert.IsNull (ex.InnerException, "#5");
|
||||
}
|
||||
@ -652,12 +642,10 @@ namespace MonoTests.System.Net
|
||||
} catch (ArgumentException ex) {
|
||||
Assert.AreEqual (typeof (ArgumentException), ex.GetType (), "#2");
|
||||
Assert.IsNotNull (ex.Message, "#3");
|
||||
#if !TARGET_JVM
|
||||
#if NET_2_0
|
||||
Assert.AreEqual ("value", ex.ParamName, "#4");
|
||||
#else
|
||||
Assert.IsNull (ex.ParamName, "#4");
|
||||
#endif
|
||||
#endif
|
||||
Assert.IsNull (ex.InnerException, "#5");
|
||||
}
|
||||
@ -713,23 +701,17 @@ namespace MonoTests.System.Net
|
||||
} catch (ArgumentOutOfRangeException ex) {
|
||||
Assert.AreEqual (typeof (ArgumentOutOfRangeException), ex.GetType (), "#3");
|
||||
Assert.IsNotNull (ex.Message, "#4");
|
||||
#if !TARGET_JVM
|
||||
Assert.IsNotNull (ex.ParamName, "#5");
|
||||
#if NET_2_0
|
||||
Assert.IsFalse (ex.ParamName == "value", "#6");
|
||||
#else
|
||||
Assert.AreEqual ("value", ex.ParamName, "#6");
|
||||
#endif
|
||||
#endif
|
||||
Assert.IsNull (ex.InnerException, "#7");
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
#if TARGET_JVM
|
||||
//FIXME: include Java serialization compliant tests
|
||||
[Ignore ("The MS compliant binary serialization is not supported")]
|
||||
#endif
|
||||
public void GetObjectData ()
|
||||
{
|
||||
FileWebRequest fwr = (FileWebRequest) WebRequest.Create ("file:///test.txt");
|
||||
@ -833,9 +815,6 @@ namespace MonoTests.System.Net
|
||||
}
|
||||
|
||||
[Test]
|
||||
#if TARGET_JVM
|
||||
[Ignore ("The MS compliant binary serialization is not supported")]
|
||||
#endif
|
||||
public void Deserialize ()
|
||||
{
|
||||
MemoryStream ms = new MemoryStream ();
|
||||
@ -888,23 +867,6 @@ namespace MonoTests.System.Net
|
||||
return new Uri ("file:///" + tempFile);
|
||||
}
|
||||
|
||||
#if TARGET_JVM
|
||||
|
||||
private bool RunningOnUnix {
|
||||
get {
|
||||
Type t = Type.GetType("java.lang.System");
|
||||
MethodInfo mi = t.GetMethod("getProperty", new Type[] { typeof(string) });
|
||||
string osName = (string) mi.Invoke(null, new object[] { "os.name" });
|
||||
|
||||
if(osName == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return !osName.StartsWith("win", true, CultureInfo.InvariantCulture);
|
||||
}
|
||||
}
|
||||
|
||||
#else
|
||||
private bool RunningOnUnix {
|
||||
get {
|
||||
// check for Unix platforms - see FAQ for more details
|
||||
@ -913,7 +875,6 @@ namespace MonoTests.System.Net
|
||||
return ((platform == 4) || (platform == 128) || (platform == 6));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
private static readonly byte [] _serialized = new byte [] {
|
||||
#if NET_2_0
|
||||
|
@ -13,10 +13,6 @@ using System.Net;
|
||||
|
||||
using NUnit.Framework;
|
||||
|
||||
#if TARGET_JVM
|
||||
using System.Globalization;
|
||||
using System.Reflection;
|
||||
#endif
|
||||
|
||||
|
||||
namespace MonoTests.System.Net
|
||||
@ -225,23 +221,6 @@ namespace MonoTests.System.Net
|
||||
}
|
||||
return new Uri ("file:///" + tempFile);
|
||||
}
|
||||
#if TARGET_JVM
|
||||
|
||||
private bool RunningOnUnix {
|
||||
get {
|
||||
Type t = Type.GetType("java.lang.System");
|
||||
MethodInfo mi = t.GetMethod("getProperty", new Type[] { typeof(string) });
|
||||
string osName = (string) mi.Invoke(null, new object[] { "os.name" });
|
||||
|
||||
if(osName == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return !osName.StartsWith("win", true, CultureInfo.InvariantCulture);
|
||||
}
|
||||
}
|
||||
|
||||
#else
|
||||
private bool RunningOnUnix {
|
||||
get {
|
||||
// check for Unix platforms - see FAQ for more details
|
||||
@ -250,6 +229,5 @@ namespace MonoTests.System.Net
|
||||
return ((platform == 4) || (platform == 128));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
@ -45,9 +45,6 @@ using NUnit.Framework;
|
||||
namespace MonoTests.System.Net {
|
||||
|
||||
[TestFixture]
|
||||
#if TARGET_JVM
|
||||
[Ignore ("The class HttpListener is not supported")]
|
||||
#endif
|
||||
public class HttpListener2Test {
|
||||
|
||||
private HttpListener _listener = null;
|
||||
|
@ -33,9 +33,6 @@ using NUnit.Framework;
|
||||
|
||||
namespace MonoTests.System.Net {
|
||||
[TestFixture]
|
||||
#if TARGET_JVM
|
||||
[Ignore ("The class HttpListenerBasicIdentity - is not supported")]
|
||||
#endif
|
||||
public class HttpListenerBasicIdentityTest {
|
||||
[Test]
|
||||
[ExpectedException (typeof (ArgumentNullException))]
|
||||
|
@ -34,11 +34,7 @@ using HLPC=System.Net.HttpListenerPrefixCollection;
|
||||
|
||||
namespace MonoTests.System.Net {
|
||||
[TestFixture]
|
||||
#if TARGET_JVM
|
||||
[Ignore ("The class System.Net.HttpListenerPrefixCollection - is not supported")]
|
||||
#endif
|
||||
public class HttpListenerPrefixCollectionTest {
|
||||
#if !TARGET_JVM
|
||||
// NL -> Not listening -> tests when listener.IsListening == false
|
||||
[Test]
|
||||
public void NL_DefaultProperties ()
|
||||
@ -250,7 +246,6 @@ namespace MonoTests.System.Net {
|
||||
}
|
||||
Assert.AreEqual (items, 1);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user