Imported Upstream version 5.12.0.220

Former-commit-id: c477e03582759447177c6d4bf412cd2355aad476
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2018-04-24 09:31:23 +00:00
parent 8bd104cef2
commit 8fc30896db
1200 changed files with 29534 additions and 26161 deletions

View File

@@ -1 +1 @@
a038b6c7fdad81fce73b4e0580c8b1d0159a7920
ea5e716e270682aa982464368bc77d8d447869c8

View File

@@ -29,6 +29,8 @@ using MonoTests.System.Threading.Tasks;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Concurrent;
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;
using NUnit;
using NUnit.Framework;
@@ -67,6 +69,7 @@ namespace MonoTests.System.Collections.Concurrent
}
[Test]
[Category ("MultiThreaded")]
public void AddParallelWithoutDuplicateTest ()
{
ParallelTestHelper.Repeat (delegate {
@@ -98,6 +101,7 @@ namespace MonoTests.System.Collections.Concurrent
}
[Test]
[Category ("MultiThreaded")]
public void RemoveParallelTest ()
{
ParallelTestHelper.Repeat (delegate {
@@ -362,5 +366,20 @@ namespace MonoTests.System.Collections.Concurrent
Assert.IsTrue (dict.Contains (validKeyPair));
Assert.IsFalse (dict.Contains (wrongKeyPair));
}
[Test]
public void SerializationRoundTrip ()
{
var bf = new BinaryFormatter();
var cd = new ConcurrentDictionary<int, int>();
cd[0] = 42;
var ms = new MemoryStream();
bf.Serialize(ms, cd);
ms.Seek(0, SeekOrigin.Begin);
var result = (ConcurrentDictionary<int, int>) bf.Deserialize(ms);
Assert.AreEqual (42, result [0]);
}
}
}

View File

@@ -50,6 +50,7 @@ namespace MonoTests.System.Collections.Concurrent
}
[Test]
[Category ("MultiThreaded")]
public void StressEnqueueTestCase ()
{
/*ParallelTestHelper.Repeat (delegate {
@@ -79,6 +80,7 @@ namespace MonoTests.System.Collections.Concurrent
}
[Test]
[Category ("MultiThreaded")]
public void StressDequeueTestCase ()
{
/*ParallelTestHelper.Repeat (delegate {
@@ -116,6 +118,7 @@ namespace MonoTests.System.Collections.Concurrent
}
[Test]
[Category ("MultiThreaded")]
public void StressTryPeekTestCase ()
{
ParallelTestHelper.Repeat (delegate {

View File

@@ -46,6 +46,7 @@ namespace MonoTests.System.Collections.Concurrent
}
[Test]
[Category ("MultiThreaded")]
public void StressPushTestCase ()
{
/*ParallelTestHelper.Repeat (delegate {
@@ -74,6 +75,7 @@ namespace MonoTests.System.Collections.Concurrent
}
[Test]
[Category ("MultiThreaded")]
public void StressPopTestCase ()
{
/*ParallelTestHelper.Repeat (delegate {

View File

@@ -43,6 +43,7 @@ namespace MonoTests.System.Collections.Concurrent
}
[Test]
[Category ("MultiThreaded")]
public void CountTestCase()
{
const int numThread = 5;

View File

@@ -43,6 +43,7 @@ namespace MonoTests.System.Collections.Concurrent
}
[Test]
[Category ("MultiThreaded")]
public void CountTestCase()
{
const int numThread = 5;

View File

@@ -37,7 +37,7 @@ namespace MonoTests.System.Collections.Concurrent
public class PartitionerTests
{
[Test]
[Category ("InterpreterNotWorking")]
[Category ("NotWorkingRuntimeInterpreter")]
public void PartitionerCreateIntegerWithExplicitRange ()
{
OrderablePartitioner<Tuple<int, int>> partitioner = Partitioner.Create (1, 20, 5);
@@ -59,7 +59,7 @@ namespace MonoTests.System.Collections.Concurrent
}
[Test]
[Category ("InterpreterNotWorking")]
[Category ("NotWorkingRuntimeInterpreter")]
public void PartitionerCreateLongWithExplicitRange ()
{
OrderablePartitioner<Tuple<long, long>> partitioner = Partitioner.Create ((long)1, (long)20, (long)5);

View File

@@ -725,6 +725,7 @@ namespace MonoTests.System.Globalization
}
[Test]
[Category ("MultiThreaded")]
public void DefaultThreadCurrentCultureIsIgnoredWhenCultureFlowsToThread ()
{
string us_str = null;

View File

@@ -1118,5 +1118,17 @@ namespace MonoTests.System.IO.IsolatedStorageTest {
isf.DeleteDirectory ("/test");
}
}
[Test] //fixes bxc #11771
public void GetFileNamesWithMultiSegmentDirectory ()
{
string dir = Path.Combine("Dir", "Level");
using (var f = IsolatedStorageFile.GetUserStoreForAssembly ())
{
f.CreateDirectory (dir);
f.GetFileNames (Path.Combine (dir, "*"));
f.DeleteDirectory (dir);
}
}
}
}

View File

@@ -65,7 +65,7 @@ namespace MonoTests.System.IO
}
[Test]
[Category ("InterpreterNotWorking")]
[Category ("NotWorkingRuntimeInterpreter")]
public void GetDrivesValidInfo ()
{
var drives = DriveInfo.GetDrives ();

View File

@@ -1264,6 +1264,57 @@ namespace MonoTests.System.IO
}
}
/* regression test for https://github.com/mono/mono/issues/7646 */
[Test]
public void LastWriteTimeSubMs ()
{
string path = tmpFolder + Path.DirectorySeparatorChar + "lastWriteTimeSubMs";
if (File.Exists (path))
File.Delete (path);
try {
var fmt = "HH:mm:ss:fffffff";
for (var i = 0; i < 200; i++) {
File.WriteAllText (path, "");
var untouched = File.GetLastWriteTimeUtc (path);
File.SetLastWriteTimeUtc (path, DateTime.UtcNow);
var touched = File.GetLastWriteTimeUtc (path);
Assert.IsTrue (touched >= untouched, $"Iteration #{i} failed, untouched: {untouched.ToString (fmt)} touched: {touched.ToString (fmt)}");
}
} finally {
DeleteFile (path);
}
}
/* regression test from https://github.com/xamarin/xamarin-macios/issues/3929 */
[Test]
public void LastWriteTimeSubMsCopy ()
{
string path = tmpFolder + Path.DirectorySeparatorChar + "lastWriteTimeSubMs";
if (File.Exists (path))
File.Delete (path);
string path_copy = tmpFolder + Path.DirectorySeparatorChar + "LastWriteTimeSubMs_copy";
if (File.Exists (path_copy))
File.Delete (path_copy);
try {
var fmt = "HH:mm:ss:fffffff";
for (var i = 0; i < 200; i++) {
File.WriteAllText (path, "");
var untouched = File.GetLastWriteTimeUtc (path);
File.Copy (path, path_copy);
var copy_touched = File.GetLastWriteTimeUtc (path_copy);
Assert.IsTrue (copy_touched >= untouched, $"Iteration #{i} failed, untouched: {untouched.ToString (fmt)} copy_touched: {copy_touched.ToString (fmt)}");
File.Delete (path_copy);
}
} finally {
DeleteFile (path);
DeleteFile (path_copy);
}
}
[Test]
public void GetCreationTime_Path_Null ()
{

View File

@@ -470,7 +470,7 @@ namespace MonoTests.System.Reflection.Emit
public delegate object RetObj();
[Test] //#640702
[Category ("InterpreterNotWorking")]
[Category ("NotWorkingRuntimeInterpreter")]
public void GetCurrentMethodWorksWithDynamicMethods ()
{
DynamicMethod dm = new DynamicMethod("Foo", typeof(object), null);
@@ -527,7 +527,7 @@ namespace MonoTests.System.Reflection.Emit
}
[Test]
[Category ("InterpreterNotWorking")]
[Category ("NotWorkingRuntimeInterpreter")]
public void ExceptionHandling ()
{
var method = new DynamicMethod ("", typeof(void), new[] { typeof(int) }, typeof (DynamicMethodTest));
@@ -588,13 +588,13 @@ namespace MonoTests.System.Reflection.Emit
// Ignore Metadata
lines = lines.Where (l => !l.StartsWith ("[")).ToArray ();
Assert.AreEqual (5, lines.Length, "#1");
Assert.AreEqual (4, lines.Length, "#1");
Assert.IsTrue (lines [1].Contains ("---"), "#2");
}
}
[Test]
[Category ("InterpreterNotWorking")]
[Category ("NotWorkingRuntimeInterpreter")]
public void ExceptionHandlingWithExceptionDispatchInfo ()
{
var method = new DynamicMethod ("", typeof(void), new[] { typeof(int) }, typeof (DynamicMethodTest));
@@ -652,7 +652,7 @@ namespace MonoTests.System.Reflection.Emit
}
[Test] //see bxc #59334
[Category ("InterpreterNotWorking")]
[Category ("NotWorkingRuntimeInterpreter")]
public void ExceptionWrapping ()
{
AssemblyBuilder ab = AppDomain.CurrentDomain.DefineDynamicAssembly (new AssemblyName ("ehatevfheiw"), AssemblyBuilderAccess.Run);

View File

@@ -1024,7 +1024,7 @@ namespace MonoTests.System.Reflection.Emit
}
[Test]//bug #626441
[Category ("InterpreterNotWorking")]
[Category ("NotWorkingRuntimeInterpreter")]
public void CanCallVarargMethods ()
{
var tb = module.DefineType ("foo");

View File

@@ -1 +1 @@
ebc7cb573f5753e3f100ca4c101dcba11135eb86
ecf68042d94f42b229e1001ff274a325aa6d0f14

View File

@@ -1883,6 +1883,16 @@ public class AssemblyNameTest {
Assert.AreEqual (0xE0, t [6], "#4.6");
Assert.AreEqual (0x89, t [7], "#4.7");
}
[Test]
public void TestSettingCultureName ()
{
AssemblyName aname = Assembly.GetExecutingAssembly ().GetName ();
aname.CultureName = null;
Assert.IsFalse(aname.ToString().Contains("en-US"));
aname.CultureName = "en-US";
Assert.IsTrue(aname.ToString().Contains("en-US"));
}
}
}

View File

@@ -192,6 +192,7 @@ namespace MonoTests.System.Runtime.CompilerServices {
}
[Test]
[Category ("MultiThreaded")]
public void Reachability () {
if (GC.MaxGeneration == 0) /*Boehm doesn't handle ephemerons */
Assert.Ignore ("Not working on Boehm.");
@@ -241,6 +242,7 @@ namespace MonoTests.System.Runtime.CompilerServices {
}
[Test]
[Category ("MultiThreaded")]
public void InsertStress () {
if (GC.MaxGeneration == 0) /*Boehm doesn't handle ephemerons */
Assert.Ignore ("Not working on Boehm.");
@@ -289,6 +291,7 @@ namespace MonoTests.System.Runtime.CompilerServices {
}
[Test]
[Category ("MultiThreaded")]
public void OldGenStress () {
if (GC.MaxGeneration == 0) /*Boehm doesn't handle ephemerons */
Assert.Ignore ("Not working on Boehm.");
@@ -431,6 +434,7 @@ namespace MonoTests.System.Runtime.CompilerServices {
}
[Test]
[Category ("MultiThreaded")]
public void FinalizableObjectsThatRetainDeadKeys ()
{
if (GC.MaxGeneration == 0) /*Boehm doesn't handle ephemerons */

View File

@@ -205,6 +205,7 @@ namespace MonoTests.System.Runtime.CompilerServices {
}
[Test]
[Category ("MultiThreaded")]
public void TestEnsureSufficientExecutionStack ()
{
var t = new Thread (() => {

View File

@@ -66,7 +66,7 @@ namespace MonoTests.System.Runtime.ExceptionServices
}
[Test]
[Category ("InterpreterNotWorking")]
[Category ("NotWorkingRuntimeInterpreter")]
public void Throw ()
{
Exception orig = null;
@@ -86,14 +86,14 @@ namespace MonoTests.System.Runtime.ExceptionServices
Assert.Fail ("#0");
} catch (Exception e) {
var s = GetLines (e.StackTrace);
Assert.AreEqual (4, s.Length, "#1");
Assert.AreEqual (3, s.Length, "#1");
Assert.AreEqual (orig, e, "#2");
Assert.AreNotEqual (orig_stack, e.StackTrace, "#3");
}
}
[Test]
[Category ("InterpreterNotWorking")]
[Category ("NotWorkingRuntimeInterpreter")]
public void ThrowWithEmptyFrames ()
{
var edi = ExceptionDispatchInfo.Capture (new OperationCanceledException ());
@@ -103,12 +103,12 @@ namespace MonoTests.System.Runtime.ExceptionServices
} catch (OperationCanceledException e) {
Assert.IsTrue (!e.StackTrace.Contains("---"));
var lines = GetLines (e.StackTrace);
Assert.AreEqual (2, lines.Length, "#1");
Assert.AreEqual (1, lines.Length, "#1");
}
}
[Test]
[Category ("InterpreterNotWorking")]
[Category ("NotWorkingRuntimeInterpreter")]
public void LastThrowWins ()
{
Exception e;
@@ -134,13 +134,13 @@ namespace MonoTests.System.Runtime.ExceptionServices
edi.Throw ();
} catch (Exception ex) {
var lines = GetLines (ex.StackTrace);
Assert.AreEqual (4, lines.Length, "#1");
Assert.AreEqual (3, lines.Length, "#1");
Assert.IsTrue (lines [1].Contains ("---"), "#2");
}
}
[Test]
[Category ("InterpreterNotWorking")]
[Category ("NotWorkingRuntimeInterpreter")]
public void ThrowMultipleCaptures ()
{
Exception e;
@@ -162,14 +162,14 @@ namespace MonoTests.System.Runtime.ExceptionServices
edi.Throw ();
} catch (Exception ex) {
var lines = GetLines (ex.StackTrace);
Assert.AreEqual (7, lines.Length, "#1");
Assert.AreEqual (5, lines.Length, "#1");
Assert.IsTrue (lines [1].Contains ("---"), "#2");
Assert.IsTrue (lines [4].Contains ("---"), "#3");
Assert.IsTrue (lines [3].Contains ("---"), "#3");
}
}
[Test]
[Category ("InterpreterNotWorking")]
[Category ("NotWorkingRuntimeInterpreter")]
public void StackTraceUserCopy ()
{
try {
@@ -182,7 +182,7 @@ namespace MonoTests.System.Runtime.ExceptionServices
} catch (Exception ex) {
var st = new StackTrace (ex, true);
var lines = GetLines (st.ToString ());
Assert.AreEqual (4, lines.Length, "#1");
Assert.AreEqual (3, lines.Length, "#1");
Assert.IsTrue (lines [1].Contains ("---"), "#2");
}
}

View File

@@ -963,7 +963,7 @@ namespace MonoTests.System.Runtime.InteropServices
}
[Test]
[Category ("InterpreterNotWorking")]
[Category ("NotWorkingRuntimeInterpreter")]
public void CheckPtrToStructureWithFixedArrayAndBaseClassFields()
{
const int arraySize = 6;

View File

@@ -28,7 +28,7 @@ namespace MonoTests.System.Runtime.Remoting.Proxies {
}
[Test]
[Category ("InterpreterNotWorking")]
[Category ("NotWorkingRuntimeInterpreter")]
public void InterfaceProxyGetTypeOkay ()
{
// Regression test for #17325

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