-
Notifications
You must be signed in to change notification settings - Fork 5.3k
[API Implementation]: Use TimeSpan everywhere we use an int for seconds, milliseconds, and timeouts (Group 1/3) #64860
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
75 commits
Select commit
Hold shift + click to select a range
377d39c
Add GC (CoreCLR) `TimeSpan` overloads
deeprobin 4d5b632
Add `CancellationToken` overload for `Wait`
deeprobin 3477de9
Add `MatchTimeout` property to `RegularExpressionAttribute`
deeprobin ca4e786
Add tests for `RegularExpressionAttribute.MatchTimeout`
deeprobin 98664c6
Add `TimeSpan` overloads for `WaitForInputIdle` and `WaitForExit`
deeprobin 94412fd
Add `TimeSpan` overload for `Timer` constructor
deeprobin 31b2210
Add `TimeSpan` overload for `ServiceBase.RequestAdditionalTime`
deeprobin a3d856b
Add `TimeSpan` overload for `NetworkStream.Close`
deeprobin 77e959b
Add `TimeSpan` overloads for `Socket.Poll` and `Socket.Select`
deeprobin ea86b67
Add `TimeSpan` overload for `FileSystemWatcher.WaitForChanged`
deeprobin 517b8e7
Add `TimeSpan` overloads for `NamedPipeClientStram.Connect` and `Name…
deeprobin 47cb9f8
Add `TimeSpan` overloads for `Ping.Send` and `Ping.SendPingAsync`
deeprobin 829d412
Add more tests for `Ping.Send` and `Ping.SendPingAsync`
deeprobin f413126
Add tests for `NamedPipeClientStream.Connect` and `NamedPipeClientStr…
deeprobin 516041c
Add more `Task.Wait` tests
deeprobin 74fb1d9
Add ref
deeprobin 7deaa98
Refactor RunContinuationCancelTest_TimeSpan test
deeprobin 6827e20
Remove redundant code duplication
deeprobin 615b66e
Remove extra line
deeprobin 6413304
Use meaningful timeSpan
deeprobin 004914c
Use Timeout.InfiniteTimeSpan
deeprobin 091c289
Inline method call
deeprobin 70c4efa
Use checked `Close`
deeprobin eeeb61b
Use expression body style in System.Net.Ping
deeprobin 7446821
Implement CancellationTokenHandling to `SendPingAsync`
deeprobin 5fba0ab
Fix PingTest
deeprobin 738b9e2
Use expression-body method style for `GC`
deeprobin e6d68f9
Use expression-body method style for `Process`
deeprobin 4a35788
Use expression-body method style for `FileSystemWatcher`
deeprobin 486a761
Use expression-body method style for `NamedPipeStream`
deeprobin 0a0794f
Merge branch 'issue-14336' of https://github.com/deeprobin/runtime in…
deeprobin 9ffe1ae
Fix `NamedPipeTest.Specific`
deeprobin 7d4af1d
Use expression-body method style for `NetworkStream` and `Socket`
deeprobin 27fa0ce
Fix syntax errors in `PingTest`
deeprobin abea06f
Add `GC` implementation for NativeAOT (CoreRT)
deeprobin 340e5eb
Add Mono `GC` implementation
deeprobin 0ff42de
Next try to fix `RemoteExecutor` tests
deeprobin e61acf0
Fix `RemoteExecutor` tests
deeprobin 5279de8
Fix net48 tests
deeprobin aad5405
Move ref into only-core ref & add cond. compilation
deeprobin 1529601
Move `Timer`-`TimeSpan` overload in the right assembly
deeprobin c3ea515
Update `Task.Wait` so that it verifies the `CancellationToken` before…
deeprobin 53bed23
Use `ToTimeoutMilliseconds` instead of a checked cast to int
deeprobin 80f10be
Remove redundant TimerConstructor test
deeprobin 6805ad4
Add setter to `RegularExpressionAttribute.MatchTimeout`
deeprobin f5e4844
Use `ToTimeoutMilliseconds` in `WaitForInputIdle`
deeprobin cf68f4d
Merge branch 'main' into issue-14336
deeprobin ff9c0e6
Use legacy syntax instead of pattern matching
deeprobin 3be4f23
Merge branch 'main' into issue-14336
deeprobin 099aacb
Remove setter from `RegularExpressionAttribute.MatchTimeout`
deeprobin d659806
Centralize `GC` methods
deeprobin eef5d71
Apply suggestions
deeprobin b9aca93
Add doc comment to `Process.WaitForInputIdle`
deeprobin ca7edd2
Reduce test duplication to reduce opportunities to flake out
deeprobin 3a47e9d
Reduce test duplication for NamedPipes
deeprobin a469722
Reduce PingTests
deeprobin 6251c56
Re-order `System.Net.Sockets` ref assembly entry
deeprobin a888f6e
Fix time unit conversion in `NetworkStream` & `Socket`
deeprobin c6a6c05
Use new overload in `Task.Wait(TimeSpan)`
deeprobin cfba2b9
Remove redundant test
deeprobin 75b8554
Fix ping tests
deeprobin 03aa02d
Fix Pipe tests
deeprobin 25484a4
Use simpler validation and remove redundant resx-resources
deeprobin 4c06f93
Remove unintentional changes
deeprobin ea03c06
Use `timeout.Ticks / 10` instead of floating-point multiplication
deeprobin 4d2e023
Style fix
deeprobin bba4bd3
Improve naming: `timeoutMillis` -> `timeoutMilliseconds`
deeprobin c774885
Add tests
deeprobin 2f47067
Fix file ending
deeprobin 0d0015f
Fix sol file
deeprobin 77f921f
Inline `ToTimeoutMilliseconds`
deeprobin a97f7d3
Fix coding style
deeprobin 7cdf76c
Improve test maintainability of `System.Net.Sockets`
deeprobin 4a73007
Apply suggestions
deeprobin f56905d
Update src/libraries/System.ServiceProcess.ServiceController/tests/Se…
danmoseley File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
...tions/tests/System/ComponentModel/DataAnnotations/RegularExpressionAttributeTests.Core.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the MIT license. | ||
|
|
||
| using System.ComponentModel.DataAnnotations; | ||
| using Xunit; | ||
|
|
||
| namespace System.ComponentModel.Annotations.Tests.System.ComponentModel.DataAnnotations | ||
| { | ||
| public sealed partial class RegularExpressionAttributeTests | ||
| { | ||
| [Theory] | ||
| [InlineData(12345)] | ||
| [InlineData(-1)] | ||
| public static void MatchTimeout_Get_ReturnsExpected(int newValue) | ||
| { | ||
| var attribute = new RegularExpressionAttribute("SomePattern") { MatchTimeoutInMilliseconds = newValue }; | ||
| Assert.Equal(TimeSpan.FromMilliseconds(newValue), attribute.MatchTimeout); | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.