@@ -14,8 +14,6 @@ namespace System.Threading.Tests
14
14
/// </summary>
15
15
public class SemaphoreSlimTests
16
16
{
17
- private const uint TimerMaxSupportedTimeout = 0xfffffffe ;
18
-
19
17
/// <summary>
20
18
/// SemaphoreSlim public methods and properties to be tested
21
19
/// </summary>
@@ -62,16 +60,14 @@ public static void RunSemaphoreSlimTest1_Wait()
62
60
RunSemaphoreSlimTest1_Wait_Helper ( 10 , 10 , 10 , true , null ) ;
63
61
RunSemaphoreSlimTest1_Wait_Helper ( 1 , 10 , 10 , true , null ) ;
64
62
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 ) ;
66
64
}
67
65
68
66
[ Fact ]
69
67
public static void RunSemaphoreSlimTest1_Wait_NegativeCases ( )
70
68
{
71
69
// Invalid timeout
72
70
RunSemaphoreSlimTest1_Wait_Helper ( 10 , 10 , - 10 , true , typeof ( ArgumentOutOfRangeException ) ) ;
73
- RunSemaphoreSlimTest1_Wait_Helper
74
- ( 10 , 10 , TimeSpan . FromMilliseconds ( TimerMaxSupportedTimeout + 1 ) , true , typeof ( ArgumentOutOfRangeException ) ) ;
75
71
}
76
72
77
73
[ ConditionalFact ( typeof ( PlatformDetection ) , nameof ( PlatformDetection . IsThreadingSupported ) ) ]
@@ -90,7 +86,7 @@ public static void RunSemaphoreSlimTest1_WaitAsync()
90
86
RunSemaphoreSlimTest1_WaitAsync_Helper ( 10 , 10 , 10 , true , null ) ;
91
87
RunSemaphoreSlimTest1_WaitAsync_Helper ( 1 , 10 , 10 , true , null ) ;
92
88
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 ) ;
94
90
}
95
91
96
92
[ ConditionalFact ( typeof ( PlatformDetection ) , nameof ( PlatformDetection . IsThreadingSupported ) ) ]
@@ -99,8 +95,6 @@ public static void RunSemaphoreSlimTest1_WaitAsync_NegativeCases()
99
95
{
100
96
// Invalid timeout
101
97
RunSemaphoreSlimTest1_WaitAsync_Helper ( 10 , 10 , - 10 , true , typeof ( ArgumentOutOfRangeException ) ) ;
102
- RunSemaphoreSlimTest1_WaitAsync_Helper
103
- ( 10 , 10 , TimeSpan . FromMilliseconds ( TimerMaxSupportedTimeout + 1 ) , true , typeof ( ArgumentOutOfRangeException ) ) ;
104
98
RunSemaphoreSlimTest1_WaitAsync2 ( ) ;
105
99
}
106
100
0 commit comments