Imported Upstream version 6.0.0.172

Former-commit-id: f3cc9b82f3e5bd8f0fd3ebc098f789556b44e9cd
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2019-04-12 14:10:50 +00:00
parent 8016999e4d
commit 64ac736ec5
32155 changed files with 3981439 additions and 75368 deletions

View File

@@ -40,6 +40,7 @@ namespace MonoTests.System.Threading.Tasks
TaskFactory factory;
[Test]
[Category ("MultiThreaded")]
public void BasicExclusiveUsageTest ()
{
schedPair = new ConcurrentExclusiveSchedulerPair (TaskScheduler.Default, 4);
@@ -53,6 +54,7 @@ namespace MonoTests.System.Threading.Tasks
}
[Test]
[Category ("MultiThreaded")]
public void BasicConcurrentUsageTest ()
{
schedPair = new ConcurrentExclusiveSchedulerPair (TaskScheduler.Default, 4);
@@ -66,6 +68,7 @@ namespace MonoTests.System.Threading.Tasks
}
[Test]
[Category ("MultiThreaded")]
public void ExclusiveUsageTest ()
{
schedPair = new ConcurrentExclusiveSchedulerPair (TaskScheduler.Default, 4);
@@ -89,6 +92,7 @@ namespace MonoTests.System.Threading.Tasks
}
[Test]
[Category ("MultiThreaded")]
public void ConcurrentUsageTest ()
{
schedPair = new ConcurrentExclusiveSchedulerPair (TaskScheduler.Default, 4);
@@ -115,6 +119,7 @@ namespace MonoTests.System.Threading.Tasks
}
[Test]
[Category ("MultiThreaded")]
public void ConcurrentUsageWithExclusiveExecutingTest ()
{
schedPair = new ConcurrentExclusiveSchedulerPair (TaskScheduler.Default, 4);
@@ -145,6 +150,7 @@ namespace MonoTests.System.Threading.Tasks
}
[Test]
[Category ("MultiThreaded")]
public void ExclusiveUsageWithConcurrentExecutingTest ()
{
schedPair = new ConcurrentExclusiveSchedulerPair (TaskScheduler.Default, 4);

View File

@@ -42,6 +42,7 @@ namespace MonoTests.System.Threading.Tasks
public class ParallelTests
{
[Test]
[Category ("MultiThreaded")]
public void ParallelForTestCase ()
{
int[] expected = Enumerable.Range (1, 1000).Select ((e) => e * 2).ToArray ();
@@ -58,12 +59,14 @@ namespace MonoTests.System.Threading.Tasks
}
[Test, ExpectedException (typeof (AggregateException))]
[Category ("MultiThreaded")]
public void ParallelForExceptionTestCase ()
{
Parallel.For(1, 100, delegate (int i) { throw new Exception("foo"); });
}
[Test]
[Category ("MultiThreaded")]
public void ParallelForSmallRangeTest ()
{
ParallelTestHelper.Repeat (() => {
@@ -75,6 +78,7 @@ namespace MonoTests.System.Threading.Tasks
}
[Test]
[Category ("MultiThreaded")]
public void ParallelForNoOperationTest ()
{
bool launched = false;
@@ -83,6 +87,7 @@ namespace MonoTests.System.Threading.Tasks
}
[Test]
[Category ("MultiThreaded")]
public void ParallelForNestedTest ()
{
bool[] launched = new bool[6 * 20 * 10];
@@ -98,6 +103,7 @@ namespace MonoTests.System.Threading.Tasks
}
[Test]
[Category ("MultiThreaded")]
public void ParallelForEachTestCase ()
{
ParallelTestHelper.Repeat (() => {
@@ -115,6 +121,7 @@ namespace MonoTests.System.Threading.Tasks
}
[Test]
[Category ("MultiThreaded")]
public void ParallelForEachTestCaseWithIndex ()
{
var list = new List<int> { 0, 1, 2, 3, 4 };
@@ -131,6 +138,7 @@ namespace MonoTests.System.Threading.Tasks
}
[Test]
[Category ("MultiThreaded")]
public void ParallerForEach_UserType ()
{
var values = new[] {
@@ -154,6 +162,7 @@ namespace MonoTests.System.Threading.Tasks
}
[Test, ExpectedException (typeof (AggregateException))]
[Category ("MultiThreaded")]
public void ParallelForEachExceptionTestCase ()
{
IEnumerable<int> e = Enumerable.Repeat (1, 10);
@@ -161,6 +170,7 @@ namespace MonoTests.System.Threading.Tasks
}
[Test]
[Category ("MultiThreaded")]
public void BasicInvokeTest ()
{
int val1 = 0, val2 = 0;
@@ -171,6 +181,7 @@ namespace MonoTests.System.Threading.Tasks
}
[Test]
[Category ("MultiThreaded")]
public void InvokeWithOneNullActionTest ()
{
int val1 = 0, val2 = 0;
@@ -186,6 +197,7 @@ namespace MonoTests.System.Threading.Tasks
}
[Test]
[Category ("MultiThreaded")]
public void OneActionInvokeTest ()
{
int val = 0;
@@ -207,6 +219,7 @@ namespace MonoTests.System.Threading.Tasks
}
[Test]
[Category ("MultiThreaded")]
public void InvokeWithExceptions ()
{
try {

View File

@@ -152,6 +152,7 @@ namespace MonoTests.System.Threading.Tasks
}
[Test]
[Category ("MultiThreaded")]
public void ContinuationTest ()
{
bool result = false;
@@ -198,6 +199,7 @@ namespace MonoTests.System.Threading.Tasks
[Test]
[Ignore ("#4550, Mono GC is lame")]
[Category ("MultiThreaded")]
public void SetExceptionAndUnobservedEvent ()
{
bool notFromMainThread = false;
@@ -225,6 +227,7 @@ namespace MonoTests.System.Threading.Tasks
}
[Test]
[Category ("MultiThreaded")]
public void WaitingTest ()
{
var tcs = new TaskCompletionSource<int> ();

View File

@@ -134,6 +134,7 @@ namespace MonoTests.System.Threading.Tasks
}
[Test]
[Category ("MultiThreaded")]
public void StartNewTest ()
{
bool result = false;
@@ -148,6 +149,7 @@ namespace MonoTests.System.Threading.Tasks
}
[Test]
[Category ("MultiThreaded")]
public void ContinueWhenAll_Simple ()
{
var mre = new ManualResetEventSlim (false);
@@ -173,6 +175,7 @@ namespace MonoTests.System.Threading.Tasks
}
[Test]
[Category ("MultiThreaded")]
public void ContinueWhenAll_WithMixedCompletionState ()
{
var mre = new ManualResetEventSlim ();
@@ -237,6 +240,7 @@ namespace MonoTests.System.Threading.Tasks
}
[Test]
[Category ("MultiThreaded")]
public void ContinueWhenAll_WithExceptions ()
{
var t1 = Task.Factory.StartNew (() => { throw new ApplicationException ("Foo"); });
@@ -251,6 +255,7 @@ namespace MonoTests.System.Threading.Tasks
}
[Test]
[Category ("MultiThreaded")]
public void ContinueWhenAny_Simple ()
{
var t1 = new ManualResetEvent (false);
@@ -279,6 +284,7 @@ namespace MonoTests.System.Threading.Tasks
}
[Test]
[Category ("MultiThreaded")]
public void ContinueWhenAny_WithResult ()
{
var tcs = new TaskCompletionSource<int>();
@@ -334,6 +340,7 @@ namespace MonoTests.System.Threading.Tasks
}
[Test]
[Category ("MultiThreaded")]
public void FromAsyncBeginInvoke_WithResult ()
{
bool result = false;
@@ -351,6 +358,7 @@ namespace MonoTests.System.Threading.Tasks
}
[Test]
[Category ("MultiThreaded")]
public void FromAsyncBeginMethod_DirectResult ()
{
bool result = false;
@@ -368,6 +376,7 @@ namespace MonoTests.System.Threading.Tasks
}
[Test]
[Category ("MultiThreaded")]
public void FromAsyncBeginMethod_Exception ()
{
bool result = false;
@@ -444,6 +453,7 @@ namespace MonoTests.System.Threading.Tasks
}
[Test]
[Category ("MultiThreaded")]
public void FromAsync_Completed ()
{
var completed = new CompletedAsyncResult ();
@@ -457,6 +467,7 @@ namespace MonoTests.System.Threading.Tasks
}
[Test]
[Category ("MultiThreaded")]
public void FromAsync_CompletedWithException ()
{
var completed = new CompletedAsyncResult ();
@@ -469,6 +480,7 @@ namespace MonoTests.System.Threading.Tasks
}
[Test]
[Category ("MultiThreaded")]
public void FromAsync_CompletedCanceled ()
{
var completed = new CompletedAsyncResult ();
@@ -482,6 +494,7 @@ namespace MonoTests.System.Threading.Tasks
}
[Test]
[Category ("MultiThreaded")]
public void FromAsync_SimpleAsyncResult ()
{
var result = new TestAsyncResult ();
@@ -496,6 +509,7 @@ namespace MonoTests.System.Threading.Tasks
}
[Test]
[Category ("MultiThreaded")]
public void FromAsync_ResultException ()
{
var result = new TestAsyncResult ();
@@ -513,6 +527,7 @@ namespace MonoTests.System.Threading.Tasks
}
[Test]
[Category ("MultiThreaded")]
public void FromAsync_ReturnInt ()
{
var result = new TestAsyncResult ();
@@ -529,6 +544,7 @@ namespace MonoTests.System.Threading.Tasks
}
[Test]
[Category ("MultiThreaded")]
public void FromAsync_Scheduler_Explicit ()
{
var result = new TestAsyncResult ();
@@ -545,6 +561,7 @@ namespace MonoTests.System.Threading.Tasks
}
[Test]
[Category ("MultiThreaded")]
public void FromAsync_Scheduler_Implicit ()
{
var result = new TestAsyncResult ();
@@ -565,6 +582,7 @@ namespace MonoTests.System.Threading.Tasks
}
[Test]
[Category ("MultiThreaded")]
public void FromAsync_BeginCallback ()
{
bool called = false;
@@ -596,6 +614,7 @@ namespace MonoTests.System.Threading.Tasks
}
[Test]
[Category ("MultiThreaded")]
public void StartNewCancelled ()
{
var ct = new CancellationToken (true);

View File

@@ -195,6 +195,7 @@ namespace MonoTests.System.Threading.Tasks
}
[Test]
[Category ("MultiThreaded")]
public void FromAsync_SimpleAsyncResult ()
{
var result = new TestAsyncResult ();
@@ -217,6 +218,7 @@ namespace MonoTests.System.Threading.Tasks
}
[Test]
[Category ("MultiThreaded")]
public void FromAsync_CompletedSynchronously ()
{
var factory = new TaskFactory<string> ();
@@ -239,6 +241,7 @@ namespace MonoTests.System.Threading.Tasks
}
[Test]
[Category ("MultiThreaded")]
public void FromAsync_CompletedSynchronously_with_Callback ()
{
var factory = new TaskFactory<string> ();
@@ -249,6 +252,7 @@ namespace MonoTests.System.Threading.Tasks
}
[Test]
[Category ("MultiThreaded")]
public void StartNewCancelled ()
{
var ct = new CancellationToken (true);

View File

@@ -37,6 +37,7 @@ using NUnit.Framework;
namespace MonoTests.System.Threading.Tasks
{
[TestFixture]
[Category ("MultiThreaded")]
public class TaskTests
{
class MockScheduler : TaskScheduler

View File

@@ -40,6 +40,7 @@ namespace MonoTests.System.Threading.Tasks
}
[Test]
[Category ("MultiThreaded")]
public void SimpleTaskTestCase ()
{
Task<int> f = InitTestTask ();
@@ -49,6 +50,7 @@ namespace MonoTests.System.Threading.Tasks
}
[Test]
[Category ("MultiThreaded")]
public void TaskContinueWithTestCase ()
{
bool result = false;
@@ -73,6 +75,7 @@ namespace MonoTests.System.Threading.Tasks
}
[Test]
[Category ("MultiThreaded")]
public void NestedFutureTest ()
{
ParallelTestHelper.Repeat (delegate {
@@ -87,6 +90,7 @@ namespace MonoTests.System.Threading.Tasks
}
[Test]
[Category ("MultiThreaded")]
public void FaultedFutureTest ()
{
var thrown = new ApplicationException ();