You've already forked linux-packaging-mono
Imported Upstream version 5.4.0.167
Former-commit-id: 5624ac747d633e885131e8349322922b6a59baaa
This commit is contained in:
parent
e49d6f06c0
commit
536cd135cc
@@ -1,9 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\dir.props" />
|
||||
<PropertyGroup>
|
||||
<AssemblyVersion>4.0.3.0</AssemblyVersion>
|
||||
<AssemblyKey>MSFT</AssemblyKey>
|
||||
<IsNETCoreApp>true</IsNETCoreApp>
|
||||
<IsUAP>true</IsUAP>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
</Project>
|
||||
|
||||
@@ -80,20 +80,10 @@ namespace System.Linq.Parallel
|
||||
// Accessor the key selector.
|
||||
//
|
||||
|
||||
internal Func<TInputOutput, TSortKey> KeySelector
|
||||
{
|
||||
get { return _keySelector; }
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------
|
||||
// Accessor the key comparer.
|
||||
//
|
||||
|
||||
internal IComparer<TSortKey> KeyComparer
|
||||
{
|
||||
get { return _comparer; }
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------
|
||||
// Opens the current operator. This involves opening the child operator tree, enumerating
|
||||
// the results, sorting them, and then returning an enumerator that walks the result.
|
||||
@@ -216,11 +206,6 @@ namespace System.Linq.Parallel
|
||||
// Accessor for the key comparison routine.
|
||||
//
|
||||
|
||||
public IComparer<TSortKey> KeyComparer
|
||||
{
|
||||
get { return _keyComparer; }
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------
|
||||
// Moves to the next element in the sorted output. When called for the first time, the
|
||||
// descendents in the sort's child tree are executed entirely, the results accumulated
|
||||
|
||||
@@ -76,35 +76,6 @@ namespace System.Linq.Parallel
|
||||
comparer.Equals(key1, key2));
|
||||
}
|
||||
|
||||
// If value is in set, remove it and return true; otherwise return false
|
||||
internal bool Remove(TKey key)
|
||||
{
|
||||
int hashCode = GetKeyHashCode(key);
|
||||
int bucket = hashCode % buckets.Length;
|
||||
int last = -1;
|
||||
for (int i = buckets[bucket] - 1; i >= 0; last = i, i = slots[i].next)
|
||||
{
|
||||
if (slots[i].hashCode == hashCode && AreKeysEqual(slots[i].key, key))
|
||||
{
|
||||
if (last < 0)
|
||||
{
|
||||
buckets[bucket] = slots[i].next + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
slots[last].next = slots[i].next;
|
||||
}
|
||||
slots[i].hashCode = -1;
|
||||
slots[i].key = default(TKey);
|
||||
slots[i].value = default(TValue);
|
||||
slots[i].next = freeList;
|
||||
freeList = i;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private bool Find(TKey key, bool add, bool set, ref TValue value)
|
||||
{
|
||||
int hashCode = GetKeyHashCode(key);
|
||||
|
||||
@@ -1 +1 @@
|
||||
b37713bd2d573801dc90d99ba3f2a5d85a1dba09
|
||||
94170e573aeb0655ddc335f1fa0a3f39ed981a0f
|
||||
@@ -776,6 +776,7 @@ namespace System.Linq.Parallel.Tests
|
||||
[MemberData(nameof(UnaryCancelingOperators))]
|
||||
[MemberData(nameof(BinaryCancelingOperators))]
|
||||
[MemberData(nameof(OrderCancelingOperators))]
|
||||
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, ".NET Core bug fix https://github.com/dotnet/corefx/pull/2307")]
|
||||
public static void ToArray_OperationCanceledException_PreCanceled(Labeled<Func<ParallelQuery<int>, Action, ParallelQuery<int>>> operation)
|
||||
{
|
||||
AssertThrows.AlreadyCanceled(source => operation.Item(source, () => { }).ToArray());
|
||||
|
||||
@@ -95,11 +95,23 @@ namespace System.Linq.Parallel.Tests
|
||||
[MemberData(nameof(OrderFailingOperators))]
|
||||
public static void First_AggregateException(Labeled<Operation> source, Labeled<Operation> operation)
|
||||
{
|
||||
// Concat seems able to return the first element when the left query does not fail ("first" query).
|
||||
// This test might be flaky in the case that it decides to run the right query too...
|
||||
if (operation.ToString().Contains("Concat-Left"))
|
||||
{
|
||||
Assert.InRange(operation.Item(DefaultStart, DefaultSize, source.Item).First(), DefaultStart, DefaultStart + DefaultSize);
|
||||
// The vast majority of the time, the operation returns a result instead of failing.
|
||||
// Sufficient cores on a test machine may make the optimizer start enumerating the results.
|
||||
int? result = null;
|
||||
var exception = Record.Exception(() => { result = operation.Item(DefaultStart, DefaultSize, source.Item).First(); });
|
||||
if (result.HasValue)
|
||||
{
|
||||
Assert.Null(exception);
|
||||
Assert.InRange(result.Value, DefaultStart, DefaultStart + DefaultSize);
|
||||
}
|
||||
else
|
||||
{
|
||||
Assert.NotNull(exception);
|
||||
var ae = Assert.IsType<AggregateException>(exception);
|
||||
Assert.All(ae.InnerExceptions, e => Assert.IsType<DeliberateTestException>(e));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -115,11 +127,23 @@ namespace System.Linq.Parallel.Tests
|
||||
[MemberData(nameof(OrderFailingOperators))]
|
||||
public static void FirstOrDefault_AggregateException(Labeled<Operation> source, Labeled<Operation> operation)
|
||||
{
|
||||
// Concat seems able to return the first element when the left query does not fail ("first" query).
|
||||
// This test might be flaky in the case that it decides to run the right query too...
|
||||
if (operation.ToString().Contains("Concat-Left"))
|
||||
{
|
||||
Assert.InRange(operation.Item(DefaultStart, DefaultSize, source.Item).FirstOrDefault(), DefaultStart, DefaultStart + DefaultSize);
|
||||
// The vast majority of the time, the operation returns a result instead of failing.
|
||||
// Sufficient cores on a test machine may make the optimizer start enumerating the results.
|
||||
int? result = null;
|
||||
var exception = Record.Exception(() => { result = operation.Item(DefaultStart, DefaultSize, source.Item).FirstOrDefault(); });
|
||||
if (result.HasValue)
|
||||
{
|
||||
Assert.Null(exception);
|
||||
Assert.InRange(result.Value, DefaultStart, DefaultStart + DefaultSize);
|
||||
}
|
||||
else
|
||||
{
|
||||
Assert.NotNull(exception);
|
||||
var ae = Assert.IsType<AggregateException>(exception);
|
||||
Assert.All(ae.InnerExceptions, e => Assert.IsType<DeliberateTestException>(e));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -147,7 +147,7 @@ namespace System.Linq.Parallel.Tests
|
||||
[Fact]
|
||||
public static void DegreeOfParallelism_ArgumentNullException()
|
||||
{
|
||||
Assert.Throws<ArgumentNullException>("source", () => ((ParallelQuery<bool>)null).WithDegreeOfParallelism(2));
|
||||
AssertExtensions.Throws<ArgumentNullException>("source", () => ((ParallelQuery<bool>)null).WithDegreeOfParallelism(2));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -187,7 +187,7 @@ namespace System.Linq.Parallel.Tests
|
||||
[Fact]
|
||||
public static void Merge_ArgumentNullException()
|
||||
{
|
||||
Assert.Throws<ArgumentNullException>("source", () => ((ParallelQuery<int>)null).WithMergeOptions(ParallelMergeOptions.AutoBuffered));
|
||||
AssertExtensions.Throws<ArgumentNullException>("source", () => ((ParallelQuery<int>)null).WithMergeOptions(ParallelMergeOptions.AutoBuffered));
|
||||
}
|
||||
|
||||
// The plinq chunk partitioner takes an IEnumerator over the source, and disposes the
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace System.Linq.Parallel.Tests
|
||||
{
|
||||
foreach (T mod in modifiers((int)parms[1]))
|
||||
{
|
||||
yield return parms.Append(mod).ToArray();
|
||||
yield return parms.Concat(new object[] { mod }).ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -194,7 +194,7 @@ namespace System.Linq.Parallel.Tests
|
||||
foreach (object[] parms in Ranges(counts))
|
||||
{
|
||||
int count = (int)parms[1];
|
||||
yield return parms.Append(modifiers(count)).ToArray();
|
||||
yield return parms.Concat(new object[] { modifiers(count) }).ToArray();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -217,7 +217,7 @@ namespace System.Linq.Parallel.Tests
|
||||
{
|
||||
foreach (T mod in modifiers((int)parms[1]))
|
||||
{
|
||||
yield return parms.Append(mod).ToArray();
|
||||
yield return parms.Concat(new object[] { mod }).ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,14 +17,14 @@ namespace System.Linq.Parallel.Tests
|
||||
[Fact]
|
||||
public static void NullQuery()
|
||||
{
|
||||
Assert.Throws<ArgumentNullException>("source", () => ((IEnumerable<int>)null).AsParallel());
|
||||
Assert.Throws<ArgumentNullException>("source", () => ((IEnumerable)null).AsParallel());
|
||||
Assert.Throws<ArgumentNullException>("source", () => ((Partitioner<int>)null).AsParallel());
|
||||
Assert.Throws<ArgumentNullException>("source", () => ((int[])null).AsParallel());
|
||||
AssertExtensions.Throws<ArgumentNullException>("source", () => ((IEnumerable<int>)null).AsParallel());
|
||||
AssertExtensions.Throws<ArgumentNullException>("source", () => ((IEnumerable)null).AsParallel());
|
||||
AssertExtensions.Throws<ArgumentNullException>("source", () => ((Partitioner<int>)null).AsParallel());
|
||||
AssertExtensions.Throws<ArgumentNullException>("source", () => ((int[])null).AsParallel());
|
||||
|
||||
Assert.Throws<ArgumentNullException>("source", () => ParallelEnumerable.AsOrdered((ParallelQuery<int>)null));
|
||||
Assert.Throws<ArgumentNullException>("source", () => ParallelEnumerable.AsOrdered((ParallelQuery)null));
|
||||
Assert.Throws<ArgumentNullException>("source", () => ParallelEnumerable.AsUnordered<int>((ParallelQuery<int>)null));
|
||||
AssertExtensions.Throws<ArgumentNullException>("source", () => ParallelEnumerable.AsOrdered((ParallelQuery<int>)null));
|
||||
AssertExtensions.Throws<ArgumentNullException>("source", () => ParallelEnumerable.AsOrdered((ParallelQuery)null));
|
||||
AssertExtensions.Throws<ArgumentNullException>("source", () => ParallelEnumerable.AsUnordered<int>((ParallelQuery<int>)null));
|
||||
}
|
||||
|
||||
//
|
||||
@@ -259,6 +259,7 @@ namespace System.Linq.Parallel.Tests
|
||||
|
||||
[Theory]
|
||||
[MemberData(nameof(EmptyData))]
|
||||
[SkipOnTargetFramework(TargetFrameworkMonikers.UapAot, "This causes assertion failure on UAPAoT")]
|
||||
public static void Empty<T>(T def)
|
||||
{
|
||||
Assert.Empty(ParallelEnumerable.Empty<T>());
|
||||
|
||||
@@ -167,7 +167,7 @@ namespace System.Linq.Parallel.Tests
|
||||
[Fact]
|
||||
public static void WithExecutionMode_ArgumentNullException()
|
||||
{
|
||||
Assert.Throws<ArgumentNullException>("source", () => ((ParallelQuery<int>)null).WithExecutionMode(ParallelExecutionMode.Default));
|
||||
AssertExtensions.Throws<ArgumentNullException>("source", () => ((ParallelQuery<int>)null).WithExecutionMode(ParallelExecutionMode.Default));
|
||||
}
|
||||
|
||||
/// <summary>Tracks all of the Tasks from which AddCurrent is called.</summary>
|
||||
|
||||
@@ -343,26 +343,26 @@ namespace System.Linq.Parallel.Tests
|
||||
[Fact]
|
||||
public static void Aggregate_ArgumentNullException()
|
||||
{
|
||||
Assert.Throws<ArgumentNullException>("source", () => ((ParallelQuery<int>)null).Aggregate((i, j) => i));
|
||||
Assert.Throws<ArgumentNullException>("func", () => UnorderedSources.Default(1).Aggregate(null));
|
||||
AssertExtensions.Throws<ArgumentNullException>("source", () => ((ParallelQuery<int>)null).Aggregate((i, j) => i));
|
||||
AssertExtensions.Throws<ArgumentNullException>("func", () => UnorderedSources.Default(1).Aggregate(null));
|
||||
|
||||
Assert.Throws<ArgumentNullException>("source", () => ((ParallelQuery<int>)null).Aggregate(0, (i, j) => i));
|
||||
Assert.Throws<ArgumentNullException>("func", () => UnorderedSources.Default(1).Aggregate(0, null));
|
||||
AssertExtensions.Throws<ArgumentNullException>("source", () => ((ParallelQuery<int>)null).Aggregate(0, (i, j) => i));
|
||||
AssertExtensions.Throws<ArgumentNullException>("func", () => UnorderedSources.Default(1).Aggregate(0, null));
|
||||
|
||||
Assert.Throws<ArgumentNullException>("source", () => ((ParallelQuery<int>)null).Aggregate(0, (i, j) => i, i => i));
|
||||
Assert.Throws<ArgumentNullException>("func", () => UnorderedSources.Default(1).Aggregate(0, null, i => i));
|
||||
Assert.Throws<ArgumentNullException>("resultSelector", () => UnorderedSources.Default(1).Aggregate<int, int, int>(0, (i, j) => i, null));
|
||||
AssertExtensions.Throws<ArgumentNullException>("source", () => ((ParallelQuery<int>)null).Aggregate(0, (i, j) => i, i => i));
|
||||
AssertExtensions.Throws<ArgumentNullException>("func", () => UnorderedSources.Default(1).Aggregate(0, null, i => i));
|
||||
AssertExtensions.Throws<ArgumentNullException>("resultSelector", () => UnorderedSources.Default(1).Aggregate<int, int, int>(0, (i, j) => i, null));
|
||||
|
||||
Assert.Throws<ArgumentNullException>("source", () => ((ParallelQuery<int>)null).Aggregate(0, (i, j) => i, (i, j) => i, i => i));
|
||||
Assert.Throws<ArgumentNullException>("updateAccumulatorFunc", () => UnorderedSources.Default(1).Aggregate(0, null, (i, j) => i, i => i));
|
||||
Assert.Throws<ArgumentNullException>("combineAccumulatorsFunc", () => UnorderedSources.Default(1).Aggregate(0, (i, j) => i, null, i => i));
|
||||
Assert.Throws<ArgumentNullException>("resultSelector", () => UnorderedSources.Default(1).Aggregate<int, int, int>(0, (i, j) => i, (i, j) => i, null));
|
||||
AssertExtensions.Throws<ArgumentNullException>("source", () => ((ParallelQuery<int>)null).Aggregate(0, (i, j) => i, (i, j) => i, i => i));
|
||||
AssertExtensions.Throws<ArgumentNullException>("updateAccumulatorFunc", () => UnorderedSources.Default(1).Aggregate(0, null, (i, j) => i, i => i));
|
||||
AssertExtensions.Throws<ArgumentNullException>("combineAccumulatorsFunc", () => UnorderedSources.Default(1).Aggregate(0, (i, j) => i, null, i => i));
|
||||
AssertExtensions.Throws<ArgumentNullException>("resultSelector", () => UnorderedSources.Default(1).Aggregate<int, int, int>(0, (i, j) => i, (i, j) => i, null));
|
||||
|
||||
Assert.Throws<ArgumentNullException>("source", () => ((ParallelQuery<int>)null).Aggregate(() => 0, (i, j) => i, (i, j) => i, i => i));
|
||||
Assert.Throws<ArgumentNullException>("seedFactory", () => UnorderedSources.Default(1).Aggregate<int, int, int>(null, (i, j) => i, (i, j) => i, i => i));
|
||||
Assert.Throws<ArgumentNullException>("updateAccumulatorFunc", () => UnorderedSources.Default(1).Aggregate(() => 0, null, (i, j) => i, i => i));
|
||||
Assert.Throws<ArgumentNullException>("combineAccumulatorsFunc", () => UnorderedSources.Default(1).Aggregate(() => 0, (i, j) => i, null, i => i));
|
||||
Assert.Throws<ArgumentNullException>("resultSelector", () => UnorderedSources.Default(1).Aggregate<int, int, int>(() => 0, (i, j) => i, (i, j) => i, null));
|
||||
AssertExtensions.Throws<ArgumentNullException>("source", () => ((ParallelQuery<int>)null).Aggregate(() => 0, (i, j) => i, (i, j) => i, i => i));
|
||||
AssertExtensions.Throws<ArgumentNullException>("seedFactory", () => UnorderedSources.Default(1).Aggregate<int, int, int>(null, (i, j) => i, (i, j) => i, i => i));
|
||||
AssertExtensions.Throws<ArgumentNullException>("updateAccumulatorFunc", () => UnorderedSources.Default(1).Aggregate(() => 0, null, (i, j) => i, i => i));
|
||||
AssertExtensions.Throws<ArgumentNullException>("combineAccumulatorsFunc", () => UnorderedSources.Default(1).Aggregate(() => 0, (i, j) => i, null, i => i));
|
||||
AssertExtensions.Throws<ArgumentNullException>("resultSelector", () => UnorderedSources.Default(1).Aggregate<int, int, int>(() => 0, (i, j) => i, (i, j) => i, null));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,8 +117,8 @@ namespace System.Linq.Parallel.Tests
|
||||
[Fact]
|
||||
public static void All_ArgumentNullException()
|
||||
{
|
||||
Assert.Throws<ArgumentNullException>("source", () => ((ParallelQuery<bool>)null).All(x => x));
|
||||
Assert.Throws<ArgumentNullException>("predicate", () => ParallelEnumerable.Empty<bool>().All(null));
|
||||
AssertExtensions.Throws<ArgumentNullException>("source", () => ((ParallelQuery<bool>)null).All(x => x));
|
||||
AssertExtensions.Throws<ArgumentNullException>("predicate", () => ParallelEnumerable.Empty<bool>().All(null));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -146,8 +146,8 @@ namespace System.Linq.Parallel.Tests
|
||||
[Fact]
|
||||
public static void Any_ArgumentNullException()
|
||||
{
|
||||
Assert.Throws<ArgumentNullException>("source", () => ((ParallelQuery<bool>)null).Any(x => x));
|
||||
Assert.Throws<ArgumentNullException>("predicate", () => ParallelEnumerable.Empty<bool>().Any(null));
|
||||
AssertExtensions.Throws<ArgumentNullException>("source", () => ((ParallelQuery<bool>)null).Any(x => x));
|
||||
AssertExtensions.Throws<ArgumentNullException>("predicate", () => ParallelEnumerable.Empty<bool>().Any(null));
|
||||
}
|
||||
|
||||
private static IEnumerable<int> InfiniteEnumerable()
|
||||
|
||||
@@ -84,7 +84,7 @@ namespace System.Linq.Parallel.Tests
|
||||
[Fact]
|
||||
public static void AsEnumerable_ArgumentNullException()
|
||||
{
|
||||
Assert.Throws<ArgumentNullException>("source", () => ((ParallelQuery<int>)null).AsEnumerable());
|
||||
AssertExtensions.Throws<ArgumentNullException>("source", () => ((ParallelQuery<int>)null).AsEnumerable());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ namespace System.Linq.Parallel.Tests
|
||||
[Fact]
|
||||
public static void AsSequential_ArgumentNullException()
|
||||
{
|
||||
Assert.Throws<ArgumentNullException>("source", () => ((ParallelQuery<int>)null).AsSequential());
|
||||
AssertExtensions.Throws<ArgumentNullException>("source", () => ((ParallelQuery<int>)null).AsSequential());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -324,30 +324,30 @@ namespace System.Linq.Parallel.Tests
|
||||
[Fact]
|
||||
public static void Average_ArgumentNullException()
|
||||
{
|
||||
Assert.Throws<ArgumentNullException>("source", () => ((ParallelQuery<int>)null).Average());
|
||||
Assert.Throws<ArgumentNullException>("selector", () => ParallelEnumerable.Repeat(0, 1).Average((Func<int, int>)null));
|
||||
Assert.Throws<ArgumentNullException>("source", () => ((ParallelQuery<int?>)null).Average());
|
||||
Assert.Throws<ArgumentNullException>("selector", () => ParallelEnumerable.Repeat((int?)0, 1).Average((Func<int?, int?>)null));
|
||||
AssertExtensions.Throws<ArgumentNullException>("source", () => ((ParallelQuery<int>)null).Average());
|
||||
AssertExtensions.Throws<ArgumentNullException>("selector", () => ParallelEnumerable.Repeat(0, 1).Average((Func<int, int>)null));
|
||||
AssertExtensions.Throws<ArgumentNullException>("source", () => ((ParallelQuery<int?>)null).Average());
|
||||
AssertExtensions.Throws<ArgumentNullException>("selector", () => ParallelEnumerable.Repeat((int?)0, 1).Average((Func<int?, int?>)null));
|
||||
|
||||
Assert.Throws<ArgumentNullException>("source", () => ((ParallelQuery<long>)null).Average());
|
||||
Assert.Throws<ArgumentNullException>("selector", () => ParallelEnumerable.Repeat((long)0, 1).Average((Func<long, long>)null));
|
||||
Assert.Throws<ArgumentNullException>("source", () => ((ParallelQuery<long?>)null).Average());
|
||||
Assert.Throws<ArgumentNullException>("selector", () => ParallelEnumerable.Repeat((long?)0, 1).Average((Func<long?, long?>)null));
|
||||
AssertExtensions.Throws<ArgumentNullException>("source", () => ((ParallelQuery<long>)null).Average());
|
||||
AssertExtensions.Throws<ArgumentNullException>("selector", () => ParallelEnumerable.Repeat((long)0, 1).Average((Func<long, long>)null));
|
||||
AssertExtensions.Throws<ArgumentNullException>("source", () => ((ParallelQuery<long?>)null).Average());
|
||||
AssertExtensions.Throws<ArgumentNullException>("selector", () => ParallelEnumerable.Repeat((long?)0, 1).Average((Func<long?, long?>)null));
|
||||
|
||||
Assert.Throws<ArgumentNullException>("source", () => ((ParallelQuery<float>)null).Average());
|
||||
Assert.Throws<ArgumentNullException>("selector", () => ParallelEnumerable.Repeat((float)0, 1).Average((Func<float, float>)null));
|
||||
Assert.Throws<ArgumentNullException>("source", () => ((ParallelQuery<float?>)null).Average());
|
||||
Assert.Throws<ArgumentNullException>("selector", () => ParallelEnumerable.Repeat((float?)0, 1).Average((Func<float?, float?>)null));
|
||||
AssertExtensions.Throws<ArgumentNullException>("source", () => ((ParallelQuery<float>)null).Average());
|
||||
AssertExtensions.Throws<ArgumentNullException>("selector", () => ParallelEnumerable.Repeat((float)0, 1).Average((Func<float, float>)null));
|
||||
AssertExtensions.Throws<ArgumentNullException>("source", () => ((ParallelQuery<float?>)null).Average());
|
||||
AssertExtensions.Throws<ArgumentNullException>("selector", () => ParallelEnumerable.Repeat((float?)0, 1).Average((Func<float?, float?>)null));
|
||||
|
||||
Assert.Throws<ArgumentNullException>("source", () => ((ParallelQuery<double>)null).Average());
|
||||
Assert.Throws<ArgumentNullException>("selector", () => ParallelEnumerable.Repeat((double)0, 1).Average((Func<double, double>)null));
|
||||
Assert.Throws<ArgumentNullException>("source", () => ((ParallelQuery<double?>)null).Average());
|
||||
Assert.Throws<ArgumentNullException>("selector", () => ParallelEnumerable.Repeat((double?)0, 1).Average((Func<double?, double?>)null));
|
||||
AssertExtensions.Throws<ArgumentNullException>("source", () => ((ParallelQuery<double>)null).Average());
|
||||
AssertExtensions.Throws<ArgumentNullException>("selector", () => ParallelEnumerable.Repeat((double)0, 1).Average((Func<double, double>)null));
|
||||
AssertExtensions.Throws<ArgumentNullException>("source", () => ((ParallelQuery<double?>)null).Average());
|
||||
AssertExtensions.Throws<ArgumentNullException>("selector", () => ParallelEnumerable.Repeat((double?)0, 1).Average((Func<double?, double?>)null));
|
||||
|
||||
Assert.Throws<ArgumentNullException>("source", () => ((ParallelQuery<decimal>)null).Average());
|
||||
Assert.Throws<ArgumentNullException>("selector", () => ParallelEnumerable.Repeat((decimal)0, 1).Average((Func<decimal, decimal>)null));
|
||||
Assert.Throws<ArgumentNullException>("source", () => ((ParallelQuery<decimal?>)null).Average());
|
||||
Assert.Throws<ArgumentNullException>("selector", () => ParallelEnumerable.Repeat((decimal?)0, 1).Average((Func<decimal?, decimal?>)null));
|
||||
AssertExtensions.Throws<ArgumentNullException>("source", () => ((ParallelQuery<decimal>)null).Average());
|
||||
AssertExtensions.Throws<ArgumentNullException>("selector", () => ParallelEnumerable.Repeat((decimal)0, 1).Average((Func<decimal, decimal>)null));
|
||||
AssertExtensions.Throws<ArgumentNullException>("source", () => ((ParallelQuery<decimal?>)null).Average());
|
||||
AssertExtensions.Throws<ArgumentNullException>("selector", () => ParallelEnumerable.Repeat((decimal?)0, 1).Average((Func<decimal?, decimal?>)null));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -144,9 +144,10 @@ namespace System.Linq.Parallel.Tests
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, ".NET Core bug fix https://github.com/dotnet/corefx/pull/1970 not available in desktop")]
|
||||
public static void Cast_ArgumentNullException()
|
||||
{
|
||||
Assert.Throws<ArgumentNullException>("source", () => ((ParallelQuery<object>)null).Cast<int>());
|
||||
AssertExtensions.Throws<ArgumentNullException>("source", () => ((ParallelQuery<object>)null).Cast<int>());
|
||||
}
|
||||
|
||||
private class Castable
|
||||
|
||||
@@ -138,8 +138,8 @@ namespace System.Linq.Parallel.Tests
|
||||
[Fact]
|
||||
public static void Concat_ArgumentNullException()
|
||||
{
|
||||
Assert.Throws<ArgumentNullException>("first", () => ((ParallelQuery<int>)null).Concat(ParallelEnumerable.Range(0, 1)));
|
||||
Assert.Throws<ArgumentNullException>("second", () => ParallelEnumerable.Range(0, 1).Concat(null));
|
||||
AssertExtensions.Throws<ArgumentNullException>("first", () => ((ParallelQuery<int>)null).Concat(ParallelEnumerable.Range(0, 1)));
|
||||
AssertExtensions.Throws<ArgumentNullException>("second", () => ParallelEnumerable.Range(0, 1).Concat(null));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user