コード例 #1
0
 public static void SkipWhile_Indexed_NotPipelined_Longrunning(Labeled <ParallelQuery <int> > labeled, int count, int skip)
 {
     SkipWhile_Indexed_NotPipelined(labeled, count, skip);
 }
コード例 #2
0
ファイル: JoinTests.cs プロジェクト: zielmicha/corefx
 public static void Join_CustomComparator_LeftWithOrderingColisions_UnorderedRight_Longrunning(Labeled <ParallelQuery <int> > left, int leftCount, Labeled <ParallelQuery <int> > right, int rightCount)
 {
     Join_CustomComparator_LeftWithOrderingColisions_UnorderedRight(left, leftCount, right, rightCount);
 }
コード例 #3
0
ファイル: AverageTests.cs プロジェクト: lodejard/AllNetCore
 public static void Average_Float_Longrunning(Labeled <ParallelQuery <int> > labeled, int count, float average)
 {
     Average_Float(labeled, count, average);
 }
コード例 #4
0
ファイル: JoinTests.cs プロジェクト: zielmicha/corefx
 public static void Join_Multiple_LeftWithOrderingColisions_Longrunning(Labeled <ParallelQuery <int> > left, int leftCount, Labeled <ParallelQuery <int> > right, int rightCount)
 {
     Join_Multiple_LeftWithOrderingColisions(left, leftCount, right, rightCount);
 }
コード例 #5
0
ファイル: JoinTests.cs プロジェクト: zielmicha/corefx
 public static void Join_CustomComparator_Longrunning(Labeled <ParallelQuery <int> > left, int leftCount, Labeled <ParallelQuery <int> > right, int rightCount)
 {
     Join_CustomComparator(left, leftCount, right, rightCount);
 }
コード例 #6
0
ファイル: ForAllTests.cs プロジェクト: stevenlius/corefx
 public static void ForAll_Longrunning(Labeled <ParallelQuery <int> > labeled, int count)
 {
     ForAll(labeled, count);
 }
コード例 #7
0
ファイル: JoinTests.cs プロジェクト: zielmicha/corefx
        public static void Join_Multiple(Labeled <ParallelQuery <int> > left, int leftCount, Labeled <ParallelQuery <int> > right, int rightCount)
        {
            ParallelQuery <int> leftQuery  = left.Item;
            ParallelQuery <int> rightQuery = right.Item;
            int seen = 0;

            Assert.All(leftQuery.Join(rightQuery, x => x, y => y / KeyFactor, (x, y) => KeyValuePair.Create(x, y)),
                       p =>
            {
                Assert.Equal(p.Key, p.Value / KeyFactor);
                Assert.Equal(seen++, p.Value);
            });
            Assert.Equal(Math.Min(leftCount * KeyFactor, rightCount), seen);
        }
コード例 #8
0
 public static void Cast_Valid_NotPipelined_Longrunning(Labeled <ParallelQuery <int> > labeled, int count)
 {
     Cast_Valid(labeled, count);
 }
コード例 #9
0
        public static void WithExecutionMode_ArgumentException(Labeled <ParallelQuery <int> > labeled, int count)
        {
            ParallelQuery <int> query = labeled.Item;

            AssertExtensions.Throws <ArgumentException>(null, () => query.WithExecutionMode((ParallelExecutionMode)2));
        }
コード例 #10
0
 public static void Cast_Assignable_InvalidCastException(Labeled <ParallelQuery <int> > labeled, int count)
 {
     Functions.AssertThrowsWrapped <InvalidCastException>(() => labeled.Item.Select(x => (Int32)x).Cast <Castable>().ForAll(x => {; }));
     Functions.AssertThrowsWrapped <InvalidCastException>(() => labeled.Item.Select(x => (Int32)x).Cast <Castable>().ToList());
 }
コード例 #11
0
 public static void Cast_Unordered_Valid_Longrunning(Labeled <ParallelQuery <int> > labeled, int count)
 {
     Cast_Unordered_Valid(labeled, count);
 }
コード例 #12
0
 public static void Skip_Longrunning(Labeled <ParallelQuery <int> > labeled, int count, int skip)
 {
     Skip(labeled, count, skip);
 }
コード例 #13
0
 public static void SkipWhile_SomeFalse_Longrunning(Labeled <ParallelQuery <int> > labeled, int count, int[] skip)
 {
     SkipWhile_SomeFalse(labeled, count, skip);
 }
コード例 #14
0
 public static void SkipWhile_AllTrue_Longrunning(Labeled <ParallelQuery <int> > labeled, int count, int skip)
 {
     SkipWhile_AllTrue(labeled, count, skip);
 }
コード例 #15
0
ファイル: ConcatTests.cs プロジェクト: layomia/dotnet_runtime
        public static void Concat(Labeled <ParallelQuery <int> > left, int leftCount, Labeled <ParallelQuery <int> > right, int rightCount)
        {
            // The ordering of Concat is only guaranteed when both operands are ordered,
            // however the current implementation manages to perform ordering if either operand is ordered _in most cases_.
            // If this test starts failing, consider revising the operators and mention the change in release notes.
            ParallelQuery <int> leftQuery  = left.Item;
            ParallelQuery <int> rightQuery = right.Item;
            int seen = 0;

            foreach (int i in leftQuery.Concat(rightQuery))
            {
                Assert.Equal(seen++, i);
            }
            Assert.Equal(seen, leftCount + rightCount);
        }
コード例 #16
0
 private static IEnumerable <Labeled <Action <UsedTaskTracker, ParallelQuery <int> > > > EasyOrderedQueries(int count)
 {
     yield return(Labeled.Label <Action <UsedTaskTracker, ParallelQuery <int> > >("Where+Select+Concat(AsOrdered+Where)+ToList",
                                                                                  (verifier, query) => query.Where(x => true).Select(x => verifier.AddCurrent(x)).Concat(Enumerable.Range(0, count).AsParallel().AsOrdered().Where(x => true)).ToList()));
 }
コード例 #17
0
ファイル: ConcatTests.cs プロジェクト: layomia/dotnet_runtime
 public static void Concat_Longrunning(Labeled <ParallelQuery <int> > left, int leftCount, Labeled <ParallelQuery <int> > right, int rightCount)
 {
     Concat(left, leftCount, right, rightCount);
 }
コード例 #18
0
 public static void OfType_Unordered_AllValid_Longrunning(Labeled <ParallelQuery <int> > labeled, int count)
 {
     OfType_Unordered_AllValid(labeled, count);
 }
コード例 #19
0
ファイル: ForAllTests.cs プロジェクト: stevenlius/corefx
 public static void ForAll_AggregateException(Labeled <ParallelQuery <int> > labeled, int count)
 {
     Functions.AssertThrowsWrapped <DeliberateTestException>(() => labeled.Item.ForAll(x => { throw new DeliberateTestException(); }));
     Functions.AssertThrowsWrapped <DeliberateTestException>(() => labeled.Item.Select((Func <int, int>)(x => { throw new DeliberateTestException(); })).ForAll(x => { }));
 }
コード例 #20
0
 public static void OfType_SomeNull_Longrunning(Labeled <ParallelQuery <int> > labeled, int count)
 {
     OfType_SomeNull(labeled, count);
 }
コード例 #21
0
ファイル: JoinTests.cs プロジェクト: zielmicha/corefx
        public static void Join_Multiple_LeftWithOrderingColisions(Labeled <ParallelQuery <int> > left, int leftCount, Labeled <ParallelQuery <int> > right, int rightCount)
        {
            LeftOrderingCollisionTestWithOrderedRight validator = new LeftOrderingCollisionTestWithOrderedRight();

            validator.Validate(left.Item, leftCount, right.Item, rightCount);
        }
コード例 #22
0
 public static void OfType_AllValid_NotPipelined_Longrunning(Labeled <ParallelQuery <int> > labeled, int count)
 {
     OfType_AllValid_NotPipelined(labeled, count);
 }
コード例 #23
0
ファイル: JoinTests.cs プロジェクト: zielmicha/corefx
        public static void Join_CustomComparator(Labeled <ParallelQuery <int> > left, int leftCount, Labeled <ParallelQuery <int> > right, int rightCount)
        {
            ParallelQuery <int> leftQuery  = left.Item;
            ParallelQuery <int> rightQuery = right.Item;
            int seenOuter     = 0;
            int previousOuter = -1;
            int seenInner     = Math.Max(previousOuter % KeyFactor, rightCount - KeyFactor + previousOuter % KeyFactor);

            Assert.All(leftQuery.Join(rightQuery, x => x, y => y,
                                      (x, y) => KeyValuePair.Create(x, y), new ModularCongruenceComparer(KeyFactor)),
                       p =>
            {
                if (p.Key != previousOuter)
                {
                    Assert.Equal(seenOuter, p.Key);
                    Assert.Equal(p.Key % 8, p.Value);
                    // If there aren't sufficient elements in the RHS (< 8), the LHS skips an entry at the end of the mod cycle.
                    seenOuter = Math.Min(leftCount, seenOuter + (p.Key % KeyFactor + 1 == rightCount ? KeyFactor - p.Key % KeyFactor : 1));
                    Assert.Equal(Math.Max(previousOuter % KeyFactor, rightCount - KeyFactor + previousOuter % KeyFactor), seenInner);
                    previousOuter = p.Key;
                    seenInner     = (p.Key % KeyFactor) - KeyFactor;
                }
                Assert.Equal(p.Key % KeyFactor, p.Value % KeyFactor);
                Assert.Equal(seenInner += KeyFactor, p.Value);
            });
            Assert.Equal(rightCount == 0 ? 0 : leftCount, seenOuter);
            Assert.Equal(Math.Max(previousOuter % KeyFactor, rightCount - KeyFactor + previousOuter % KeyFactor), seenInner);
        }
コード例 #24
0
        public static void OfType_NoneValid(Labeled <ParallelQuery <int> > labeled, int count)
        {
            ParallelQuery <int> query = labeled.Item;

            Assert.Empty(query.OfType <long>());
        }
コード例 #25
0
ファイル: JoinTests.cs プロジェクト: zielmicha/corefx
        public static void Join_CustomComparator_LeftWithOrderingColisions_UnorderedRight(Labeled <ParallelQuery <int> > left, int leftCount, Labeled <ParallelQuery <int> > right, int rightCount)
        {
            LeftOrderingCollisionTestWithUnorderedRightAndCustomComparator validator = new LeftOrderingCollisionTestWithUnorderedRightAndCustomComparator();

            validator.Validate(left.Item, leftCount, right.Item, rightCount);
        }
コード例 #26
0
 public static void Distinct_Longrunning(Labeled <ParallelQuery <int> > labeled, int count)
 {
     Distinct(labeled, count);
 }
コード例 #27
0
ファイル: JoinTests.cs プロジェクト: zielmicha/corefx
 public static void Join_Longrunning(Labeled <ParallelQuery <int> > left, int leftCount, int rightCount)
 {
     Join(left, leftCount, rightCount);
 }
コード例 #28
0
 public static void Distinct_Unordered_NotPipelined_Longrunning(Labeled <ParallelQuery <int> > labeled, int count)
 {
     Distinct_Unordered_NotPipelined(labeled, count);
 }
コード例 #29
0
ファイル: AverageTests.cs プロジェクト: lodejard/AllNetCore
 public static void Average_Double_Longrunning(Labeled <ParallelQuery <int> > labeled, int count, double average)
 {
     Average_Double(labeled, count, average);
 }
コード例 #30
0
 public static void Select_NotPipelined_Longrunning(Labeled <ParallelQuery <int> > labeled, int count)
 {
     Select_NotPipelined(labeled, count);
 }