Skip to content

Commit

Permalink
add check for overflows in parallel for
Browse files Browse the repository at this point in the history
  • Loading branch information
computablee committed Nov 26, 2023
1 parent 6a0539d commit 94200ed
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions DotMP-Tests/ParallelTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1609,6 +1609,18 @@ public void Improper_taskwait_should_except()
});
}

/// <summary>
/// Ensures that overflows in the schedulers properly throw exceptions.
/// </summary>
[Fact]
public void Boundary_parallelfor_should_except()
{
Assert.Throws<DotMP.Exceptions.InternalSchedulerException>(() =>
{
DotMP.Parallel.ParallelFor(0, int.MaxValue, i => { });
});
}

/// <summary>
/// A sample workload for DotMP.Parallel.ParallelFor().
/// </summary>
Expand Down

0 comments on commit 94200ed

Please sign in to comment.