Imported Upstream version 4.4.2.4

Former-commit-id: 92904c9c5915c37244316e42ba99e7b934ed7ee2
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2016-07-21 09:40:10 +00:00
parent 589d484eee
commit 0b4a830db1
343 changed files with 9849 additions and 688 deletions

View File

@@ -215,6 +215,10 @@ namespace Mono.CSharp
mcs.StartInfo.RedirectStandardOutput=true;
mcs.StartInfo.RedirectStandardError=true;
mcs.ErrorDataReceived += new DataReceivedEventHandler (McsStderrDataReceived);
// Use same text decoder as mcs and not user set values in Console
mcs.StartInfo.StandardOutputEncoding =
mcs.StartInfo.StandardErrorEncoding = Encoding.UTF8;
try {
mcs.Start();

View File

@@ -0,0 +1,62 @@
//
// SafeX509ChainHandle.cs
//
// Authors:
// Alexander Köplinger <alexander.koeplinger@xamarin.com>
//
// Copyright (C) 2016 Xamarin Inc (http://www.xamarin.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if SECURITY_DEP
using System;
using System.Runtime.InteropServices;
using System.Security;
namespace Microsoft.Win32.SafeHandles
{
public sealed class SafeX509ChainHandle : SafeHandle
{
[MonoTODO]
public override bool IsInvalid
{
get
{
throw new NotImplementedException ();
}
}
[MonoTODO]
internal SafeX509ChainHandle() : base ((IntPtr)0, false)
{
throw new NotImplementedException ();
}
[MonoTODO]
protected override bool ReleaseHandle()
{
throw new NotImplementedException ();
}
}
}
#endif

View File

@@ -246,7 +246,7 @@ namespace Mono.Net.Security.Private
}
public int KeyExchangeStrength {
get { return KeyExchangeStrength; }
get { return Impl.KeyExchangeStrength; }
}
public bool CanRead {

View File

@@ -1,7 +1,15 @@
using System;
namespace Microsoft.Win32
{
static class NativeMethods
{
public const int E_ABORT = unchecked ((int)0x80004004);
public const int E_ABORT = unchecked ((int)0x80004004);
public static bool CloseProcess (IntPtr handle)
{
// TODO:
return true;
}
}
}

View File

@@ -0,0 +1,55 @@
//
// FileSystemWatcher.cs
//
// Authors:
// Marek Safar <marek.safar@gmail.com>
//
// Copyright (C) 2016 Xamarin Inc (http://www.xamarin.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
namespace System.IO
{
public class FileSystemWatcher
{
public FileSystemWatcher () { throw new NotImplementedException (); }
public FileSystemWatcher (string path) { throw new NotImplementedException (); }
public FileSystemWatcher (string path, string filter) { throw new NotImplementedException (); }
public bool EnableRaisingEvents { get { throw new NotImplementedException (); } set { throw new NotImplementedException (); } }
public string Filter { get { throw new NotImplementedException (); } set { } }
public bool IncludeSubdirectories { get { throw new NotImplementedException (); } set { } }
public int InternalBufferSize { get { throw new NotImplementedException (); } set { } }
public NotifyFilters NotifyFilter { get { throw new NotImplementedException (); } set { } }
public string Path { get { throw new NotImplementedException (); } set { } }
public event FileSystemEventHandler Changed;
public event FileSystemEventHandler Created;
public event FileSystemEventHandler Deleted;
public event ErrorEventHandler Error;
public event RenamedEventHandler Renamed;
protected void OnChanged (FileSystemEventArgs e) { throw new NotImplementedException (); }
protected void OnCreated (FileSystemEventArgs e) { throw new NotImplementedException (); }
protected void OnDeleted (System.IO.FileSystemEventArgs e) { throw new NotImplementedException (); }
protected void OnError (ErrorEventArgs e) { throw new NotImplementedException (); }
protected void OnRenamed (RenamedEventArgs e) { throw new NotImplementedException (); }
public WaitForChangedResult WaitForChanged (WatcherChangeTypes changeType) { throw new NotImplementedException (); }
public WaitForChangedResult WaitForChanged (WatcherChangeTypes changeType, int timeout) { throw new NotImplementedException (); }
}
}

View File

@@ -1 +1 @@
b41d204ace8747f8b745660642c23d3998baf913
182963e0d0511570de591fc887252bccf6cf09cb

View File

@@ -38,12 +38,12 @@ namespace System.Net.WebSockets
EndpointUnavailable = 1001,
ProtocolError = 1002,
InvalidMessageType = 1003,
Empty,
Empty = 1005,
InvalidPayloadData = 1007,
PolicyViolation = 1008,
MessageTooBig = 1004,
MessageTooBig = 1009,
MandatoryExtension = 1010,
InternalServerError
InternalServerError = 1011
}
}

View File

@@ -32,8 +32,8 @@ namespace System.Security.Authentication.ExtendedProtection
{
public enum ChannelBindingKind
{
Unknown,
Unique,
Endpoint
Unknown = 0,
Unique = 25,
Endpoint = 26
}
}

View File

@@ -26,6 +26,8 @@ Microsoft.Win32/UserPreferenceChangedEventArgs.cs
Microsoft.Win32/UserPreferenceChangedEventHandler.cs
Microsoft.Win32/UserPreferenceChangingEventArgs.cs
Microsoft.Win32/UserPreferenceChangingEventHandler.cs
Microsoft.Win32.SafeHandles/SafeX509ChainHandle.cs
Mono.Http/NtlmClient.cs
System.CodeDom.Compiler/CodeCompiler.cs
System.CodeDom.Compiler/CodeDomConfigurationHandler.cs
@@ -1183,3 +1185,6 @@ ReferenceSources/_SslStream.cs
../../../external/referencesource/System/compmod/system/codedom/compiler/LanguageOptions.cs
../../../external/referencesource/System/services/monitoring/system/diagnosticts/AsyncStreamReader.cs
../../../external/referencesource/System/compmod/microsoft/win32/safehandles/SafeProcessHandle.cs

View File

@@ -16,6 +16,8 @@ using System.IO;
using System.Reflection;
using Microsoft.CSharp;
using NUnit.Framework;
using System.Text;
using System.Linq;
namespace MonoTests.Microsoft.CSharp
{
@@ -566,6 +568,39 @@ namespace MonoTests.Microsoft.CSharp
AssertCompileResults (results, true);
}
[Test]
public void EncodingMismatch ()
{
var source = @"
#warning Trigger Some Warning
public class MyClass {
public static string MyMethod () { return ""data""; }
}";
var p = new CompilerParameters () {
GenerateInMemory = false,
GenerateExecutable = false,
IncludeDebugInformation = true,
TreatWarningsAsErrors = false,
TempFiles = new TempFileCollection (_tempDir, true),
};
var prov = new CSharpCodeProvider ();
CompilerResults results;
var prev = Console.OutputEncoding;
try {
Console.OutputEncoding = Encoding.Unicode;
results = prov.CompileAssemblyFromSource (p, source);
} finally {
Console.OutputEncoding = prev;
}
Assert.IsNotNull (results.Errors);
Assert.IsTrue (results.Output.Cast<string>().ToArray ()[1].Contains ("Trigger Some Warning"));
}
private static string CreateTempDirectory ()
{
// create a uniquely named zero-byte file

View File

@@ -1 +1 @@
a0e19d4f2d15d6d856fcf37ff33c86c1173274d5
b2e9eba4a8518bcdbcccdc6031b2c323af6ce88b

View File

@@ -40,7 +40,6 @@ namespace MonoTests.System.Timers
public class TimerTest
{
Timer timer;
int _elapsedCount;
[SetUp]
public void SetUp ()
@@ -287,19 +286,46 @@ namespace MonoTests.System.Timers
Assert.IsFalse (timer.Enabled, "#3");
}
[Test] // bug #325368
[Test] // bug https://bugzilla.novell.com/show_bug.cgi?id=325368
public void EnabledInElapsed ()
{
_elapsedCount = 0;
var elapsedCount = 0;
var mre = new ST.ManualResetEventSlim ();
timer = new Timer (50);
timer.AutoReset = false;
timer.Elapsed += new ElapsedEventHandler (EnabledInElapsed_Elapsed);
timer.Elapsed += (s, e) =>
{
elapsedCount++;
if (elapsedCount == 1)
timer.Enabled = true;
else if (elapsedCount == 2)
mre.Set ();
};
timer.Start ();
ST.Thread.Sleep (200);
Assert.IsTrue (mre.Wait (500), "#1 re-enabling timer in Elapsed didn't work");
Assert.AreEqual (2, elapsedCount, "#2 wrong elapsedCount");
timer.Stop ();
}
Assert.IsTrue (_elapsedCount == 2, "#1 loss of events");
[Test]
public void AutoResetEventFalseStopsFiringElapsed ()
{
var elapsedCount = 0;
var mre = new ST.ManualResetEventSlim ();
timer = new Timer (50);
timer.AutoReset = false;
timer.Elapsed += (s, e) =>
{
elapsedCount++;
if (elapsedCount > 1)
mre.Set ();
};
timer.Start ();
Assert.IsFalse (mre.Wait (500), "#1 AutoResetEvent=false didn't stop firing Elapsed, elapsedCount=" + elapsedCount);
Assert.AreEqual (1, elapsedCount, "#2 wrong elapsedCount");
timer.Stop ();
}
[Test]
@@ -308,14 +334,6 @@ namespace MonoTests.System.Timers
Assert.IsTrue (new RaceTest (true).Success, "#1");
Assert.IsTrue (new RaceTest (false).Success, "#2");
}
void EnabledInElapsed_Elapsed (object sender, ElapsedEventArgs e)
{
_elapsedCount++;
Timer t = sender as Timer;
if (_elapsedCount == 1)
t.Enabled = true;
}
}
class RaceTest

View File

@@ -28,6 +28,16 @@ System.IO.Compression/DeflateStream.cs
System.IO.Compression/GZipStream.cs
System.IO/InternalBufferOverflowException.cs
System.IO/InvalidDataException.cs
System.IO/ErrorEventArgs.cs
System.IO/ErrorEventHandler.cs
System.IO/FileSystemEventArgs.cs
System.IO/FileSystemEventHandler.cs
System.IO/FileSystemWatcher_mobile.cs
System.IO/NotifyFilters.cs
System.IO/RenamedEventArgs.cs
System.IO/RenamedEventHandler.cs
System.IO/WaitForChangedResult.cs
System.IO/WatcherChangeTypes.cs
System.Net.Mail/AlternateView.cs
System.Net.Mail/AlternateViewCollection.cs
System.Net.Mail/Attachment.cs
@@ -359,6 +369,7 @@ System/UriTypeConverter.cs
System/UriElements.cs
System/UriParseComponents.cs
System.Windows.Input/ICommand.cs
Microsoft.Win32.SafeHandles/SafeX509ChainHandle.cs
Mono.Net.Security/CallbackHelpers.cs
Mono.Net.Security/ChainValidationHelper.cs
@@ -887,4 +898,18 @@ ReferenceSources/Win32Exception.cs
../Mono.Security/Mono.Security.Interface/TlsProtocolCode.cs
../Mono.Security/Mono.Security.Interface/TlsProtocols.cs
../../../external/referencesource/System/services/monitoring/system/diagnosticts/AsyncStreamReader.cs
../../../external/referencesource/System/services/monitoring/system/diagnosticts/AsyncStreamReader.cs
../../../external/referencesource/System/compmod/microsoft/win32/safehandles/SafeProcessHandle.cs
System.Runtime.InteropServices.ComTypes/ADVF.cs
System.Runtime.InteropServices.ComTypes/DATADIR.cs
System.Runtime.InteropServices.ComTypes/DVASPECT.cs
System.Runtime.InteropServices.ComTypes/FORMATETC.cs
System.Runtime.InteropServices.ComTypes/IAdviseSink.cs
System.Runtime.InteropServices.ComTypes/IDataObject.cs
System.Runtime.InteropServices.ComTypes/IEnumFORMATETC.cs
System.Runtime.InteropServices.ComTypes/IEnumSTATDATA.cs
System.Runtime.InteropServices.ComTypes/STATDATA.cs
System.Runtime.InteropServices.ComTypes/STGMEDIUM.cs
System.Runtime.InteropServices.ComTypes/TYMED.cs