Imported Upstream version 5.18.0.161

Former-commit-id: 4db48158d3a35497b8f118ab21b5f08ac3d86d98
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2018-10-19 08:34:24 +00:00
parent 37fbf886a3
commit e19d552987
28702 changed files with 3868076 additions and 803 deletions

View File

@@ -22,7 +22,9 @@ namespace System.Text
//
// So if you change the wrappers in this class, you must change the wrappers in the other classes
// as well because they should have the same behavior.
#if MONO
[Serializable]
#endif
internal abstract class EncodingNLS : Encoding
{
protected EncodingNLS(int codePage) : base(codePage)

View File

@@ -4,6 +4,7 @@
using System;
using System.Diagnostics;
using System.Runtime.Serialization;
namespace System.Text
{
@@ -11,7 +12,12 @@ namespace System.Text
// Latin1Encoding is a simple override to optimize the GetString version of Latin1Encoding.
// because of the best fit cases we can't do this when encoding the string, only when decoding
//
#if MONO
[Serializable]
internal class Latin1Encoding : EncodingNLS, ISerializable
#else
internal class Latin1Encoding : EncodingNLS
#endif
{
// Used by Encoding.Latin1 for lazy initialization
// The initialization code will not be run until a static member of the class is referenced
@@ -22,6 +28,23 @@ namespace System.Text
{
}
#if MONO
// ISerializable implementation, serialize it as a CodePageEncoding
[System.Security.SecurityCritical] // auto-generated_required
void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
{
// Make sure to get teh base stuff too This throws if info is null
SerializeEncoding(info, context);
// In Everett this is a CodePageEncoding, so it needs maxCharSize
info.AddValue("CodePageEncoding+maxCharSize", 1);
// And extras for Everett's wierdness
info.AddValue("CodePageEncoding+m_codePage", this.CodePage);
info.AddValue("CodePageEncoding+dataItem", null);
}
#endif
// GetByteCount
// Note: We start by assuming that the output will be the same as count. Having
// an encoder or fallback may change that assumption

View File

@@ -31,7 +31,11 @@ namespace System.Collections.Generic.Tests
Assert.False(comparer.Equals(EqualityComparer<Task<T>>.Default));
}
#if MOBILE
[Fact(Skip="Mono issue #10807")]
#else
[Fact]
#endif
public void EqualityComparer_EqualsShouldBeOverriddenAndWorkForDifferentInstances_cloned()
{
var comparer = EqualityComparer<T>.Default;