Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 4f5db27

Browse files
committed
Update Linq.Parallel tests for latest xUnit.
The latest xunit requires that MemberData attributes and their methods have the same exact signature. I've changed some object[] parameters to their exact int[] type to account for this behavior change.
1 parent a392417 commit 4f5db27

30 files changed

+61
-61
lines changed

src/System.Linq.Parallel/tests/ExchangeTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public class ExchangeTests
2626
/// <returns>Entries for test data.
2727
/// The first element is the Labeled{ParallelQuery{int}} range,
2828
/// the second element is the count, and the third is the number of partitions or degrees of parallelism to use.</returns>
29-
public static IEnumerable<object[]> PartitioningData(object[] counts)
29+
public static IEnumerable<object[]> PartitioningData(int[] counts)
3030
{
3131
foreach (object[] results in Sources.Ranges(counts.Cast<int>(), x => new[] { 1, 2, 4 }))
3232
{
@@ -42,7 +42,7 @@ public static IEnumerable<object[]> PartitioningData(object[] counts)
4242
/// <returns>Entries for test data.
4343
/// The first element is the Labeled{ParallelQuery{int}} range,
4444
/// the second element is the count, and the third is the ParallelMergeOption to use.</returns>
45-
public static IEnumerable<object[]> MergeData(object[] counts)
45+
public static IEnumerable<object[]> MergeData(int[] counts)
4646
{
4747
foreach (object[] results in Sources.Ranges(counts.Cast<int>(), x => Options))
4848
{
@@ -57,7 +57,7 @@ public static IEnumerable<object[]> MergeData(object[] counts)
5757
/// <returns>Entries for test data.
5858
/// The first element is the Labeled{ParallelQuery{int}} range,
5959
/// the second element is the count, and the third is the ParallelMergeOption to use.</returns>
60-
public static IEnumerable<object[]> ThrowOnCount_AllMergeOptions_MemberData(object[] counts)
60+
public static IEnumerable<object[]> ThrowOnCount_AllMergeOptions_MemberData(int[] counts)
6161
{
6262
foreach (int count in counts.Cast<int>())
6363
{

src/System.Linq.Parallel/tests/Helpers/Sources.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public static IEnumerable<object[]> Ranges(int start, IEnumerable<int> counts)
1818
}
1919

2020
// Wrapper for attribute calls
21-
public static IEnumerable<object[]> Ranges(object[] counts)
21+
public static IEnumerable<object[]> Ranges(int[] counts)
2222
{
2323
foreach (object[] parms in Ranges(counts.Cast<int>())) yield return parms;
2424
}

src/System.Linq.Parallel/tests/Helpers/UnorderedSources.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public static IEnumerable<object[]> Ranges(int start, IEnumerable<int> counts)
4848
/// <returns>Entries for test data.
4949
/// The first element is the Labeled{ParallelQuery{int}} range,
5050
/// and the second element is the count</returns>
51-
public static IEnumerable<object[]> Ranges(object[] counts)
51+
public static IEnumerable<object[]> Ranges(int[] counts)
5252
{
5353
foreach (object[] parms in Ranges(counts.Cast<int>())) yield return parms;
5454
}
@@ -62,7 +62,7 @@ public static IEnumerable<object[]> Ranges(object[] counts)
6262
/// <returns>Entries for test data.
6363
/// The first element is the Labeled{ParallelQuery{int}} range,
6464
/// the second element is the count, and the third is the start.</returns>
65-
public static IEnumerable<object[]> Ranges(int start, object[] counts)
65+
public static IEnumerable<object[]> Ranges(int start, int[] counts)
6666
{
6767
foreach (object[] parms in Ranges(start, counts.Cast<int>())) yield return parms;
6868
}
@@ -76,7 +76,7 @@ public static IEnumerable<object[]> Ranges(int start, object[] counts)
7676
/// <returns>Entries for test data.
7777
/// The first element is the left Labeled{ParallelQuery{int}} range, the second element is the left count,
7878
/// the third element is the right Labeled{ParallelQuery{int}} range, and the fourth element is the right count, .</returns>
79-
public static IEnumerable<object[]> BinaryRanges(object[] leftCounts, object[] rightCounts)
79+
public static IEnumerable<object[]> BinaryRanges(int[] leftCounts, int[] rightCounts)
8080
{
8181
foreach (object[] parms in BinaryRanges(leftCounts.Cast<int>(), rightCounts.Cast<int>())) yield return parms;
8282
}

src/System.Linq.Parallel/tests/PlinqModesTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ private static IEnumerable<Labeled<Action<ParVerifier, ParallelQuery<int>>>> Eas
6969
/// <returns>Entries for test data.
7070
/// The first element is the Labeled{ParallelQuery{int}} range,
7171
/// the second element is the count, and the third is the execution mode.</returns>
72-
public static IEnumerable<object[]> EasyQueryData(object[] counts, object[] modes)
72+
public static IEnumerable<object[]> EasyQueryData(int[] counts, int[] modes)
7373
{
7474
// Test doesn't apply to DOP == 1. It verifies that work is actually
7575
// happening in parallel, which won't be the case with DOP == 1.
@@ -122,7 +122,7 @@ private static IEnumerable<Labeled<Action<ParVerifier, ParallelQuery<int>>>> Har
122122
/// <returns>Entries for test data.
123123
/// The first element is the Labeled{ParallelQuery{int}} range,
124124
/// the second element is the count, and the third is the execution mode.</returns>
125-
public static IEnumerable<object[]> HardQueryData(object[] counts, object[] modes)
125+
public static IEnumerable<object[]> HardQueryData(int[] counts, ParallelExecutionMode[] modes)
126126
{
127127
// Test doesn't apply to DOP == 1. It verifies that work is actually
128128
// happening in parallel, which won't be the case with DOP == 1.

src/System.Linq.Parallel/tests/QueryOperators/AggregateTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public class AggregateTests
1414
{
1515
private const int ResultFuncModifier = 17;
1616

17-
public static IEnumerable<object[]> AggregateExceptionData(object[] counts)
17+
public static IEnumerable<object[]> AggregateExceptionData(int[] counts)
1818
{
1919
foreach (object[] results in UnorderedSources.Ranges(counts.Cast<int>()))
2020
{

src/System.Linq.Parallel/tests/QueryOperators/AllTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ namespace Test
1111
{
1212
public class AllTests
1313
{
14-
public static IEnumerable<object[]> OnlyOneData(object[] counts)
14+
public static IEnumerable<object[]> OnlyOneData(int[] counts)
1515
{
1616
Func<int, IEnumerable<int>> positions = x => new[] { 0, x / 2, Math.Max(0, x - 1) }.Distinct();
1717
foreach (object[] results in UnorderedSources.Ranges(counts.Cast<int>(), positions)) yield return results;

src/System.Linq.Parallel/tests/QueryOperators/AnyTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ namespace Test
1111
{
1212
public class AnyTests
1313
{
14-
public static IEnumerable<object[]> OnlyOneData(object[] counts)
14+
public static IEnumerable<object[]> OnlyOneData(int[] counts)
1515
{
1616
Func<int, IEnumerable<int>> positions = x => new[] { 0, x / 2, Math.Max(0, x - 1) }.Distinct();
1717
foreach (object[] results in UnorderedSources.Ranges(counts.Cast<int>(), positions)) yield return results;

src/System.Linq.Parallel/tests/QueryOperators/AverageTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public class AverageTests
1616
//
1717

1818
// Get a set of ranges from 0 to each count, with an extra parameter containing the expected average.
19-
public static IEnumerable<object[]> AverageData(object[] counts)
19+
public static IEnumerable<object[]> AverageData(int[] counts)
2020
{
2121
Func<int, double> average = x => (x - 1) / 2.0;
2222
foreach (object[] results in UnorderedSources.Ranges(counts.Cast<int>(), average)) yield return results;

src/System.Linq.Parallel/tests/QueryOperators/ConcatTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ namespace Test
1010
{
1111
public class ConcatTests
1212
{
13-
public static IEnumerable<object[]> ConcatUnorderedData(object[] counts)
13+
public static IEnumerable<object[]> ConcatUnorderedData(int[] counts)
1414
{
1515
foreach (object[] parms in UnorderedSources.BinaryRanges(counts.Cast<int>(), (left, right) => left, counts.Cast<int>())) yield return parms.Take(4).ToArray();
1616
}
1717

18-
public static IEnumerable<object[]> ConcatData(object[] counts)
18+
public static IEnumerable<object[]> ConcatData(int[] counts)
1919
{
2020
foreach (object[] parms in ConcatUnorderedData(counts))
2121
{

src/System.Linq.Parallel/tests/QueryOperators/ContainsTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ namespace Test
1111
{
1212
public class ContainsTests
1313
{
14-
public static IEnumerable<object[]> OnlyOneData(object[] counts)
14+
public static IEnumerable<object[]> OnlyOneData(int[] counts)
1515
{
1616
Func<int, IEnumerable<int>> positions = x => new[] { 0, x / 2, Math.Max(0, x - 1) }.Distinct();
1717
foreach (object[] results in UnorderedSources.Ranges(counts.Cast<int>(), positions)) yield return results;

0 commit comments

Comments
 (0)