@@ -14,8 +14,6 @@ namespace System.Threading.Tests
1414 /// </summary>
1515 public class SemaphoreSlimTests
1616 {
17- private const uint TimerMaxSupportedTimeout = 0xfffffffe ;
18-
1917 /// <summary>
2018 /// SemaphoreSlim public methods and properties to be tested
2119 /// </summary>
@@ -62,16 +60,14 @@ public static void RunSemaphoreSlimTest1_Wait()
6260 RunSemaphoreSlimTest1_Wait_Helper ( 10 , 10 , 10 , true , null ) ;
6361 RunSemaphoreSlimTest1_Wait_Helper ( 1 , 10 , 10 , true , null ) ;
6462 RunSemaphoreSlimTest1_Wait_Helper ( 0 , 10 , 10 , false , null ) ;
65- RunSemaphoreSlimTest1_Wait_Helper ( 1 , 10 , TimeSpan . FromMilliseconds ( TimerMaxSupportedTimeout ) , true , null ) ;
63+ RunSemaphoreSlimTest1_Wait_Helper ( 1 , 10 , TimeSpan . FromMilliseconds ( uint . MaxValue ) , true , null ) ;
6664 }
6765
6866 [ Fact ]
6967 public static void RunSemaphoreSlimTest1_Wait_NegativeCases ( )
7068 {
7169 // Invalid timeout
7270 RunSemaphoreSlimTest1_Wait_Helper ( 10 , 10 , - 10 , true , typeof ( ArgumentOutOfRangeException ) ) ;
73- RunSemaphoreSlimTest1_Wait_Helper
74- ( 10 , 10 , TimeSpan . FromMilliseconds ( TimerMaxSupportedTimeout + 1 ) , true , typeof ( ArgumentOutOfRangeException ) ) ;
7571 }
7672
7773 [ ConditionalFact ( typeof ( PlatformDetection ) , nameof ( PlatformDetection . IsThreadingSupported ) ) ]
@@ -90,7 +86,7 @@ public static void RunSemaphoreSlimTest1_WaitAsync()
9086 RunSemaphoreSlimTest1_WaitAsync_Helper ( 10 , 10 , 10 , true , null ) ;
9187 RunSemaphoreSlimTest1_WaitAsync_Helper ( 1 , 10 , 10 , true , null ) ;
9288 RunSemaphoreSlimTest1_WaitAsync_Helper ( 0 , 10 , 10 , false , null ) ;
93- RunSemaphoreSlimTest1_WaitAsync_Helper ( 1 , 10 , TimeSpan . FromMilliseconds ( TimerMaxSupportedTimeout ) , true , null ) ;
89+ RunSemaphoreSlimTest1_WaitAsync_Helper ( 1 , 10 , TimeSpan . FromMilliseconds ( uint . MaxValue ) , true , null ) ;
9490 }
9591
9692 [ ConditionalFact ( typeof ( PlatformDetection ) , nameof ( PlatformDetection . IsThreadingSupported ) ) ]
@@ -99,8 +95,6 @@ public static void RunSemaphoreSlimTest1_WaitAsync_NegativeCases()
9995 {
10096 // Invalid timeout
10197 RunSemaphoreSlimTest1_WaitAsync_Helper ( 10 , 10 , - 10 , true , typeof ( ArgumentOutOfRangeException ) ) ;
102- RunSemaphoreSlimTest1_WaitAsync_Helper
103- ( 10 , 10 , TimeSpan . FromMilliseconds ( TimerMaxSupportedTimeout + 1 ) , true , typeof ( ArgumentOutOfRangeException ) ) ;
10498 RunSemaphoreSlimTest1_WaitAsync2 ( ) ;
10599 }
106100
0 commit comments