Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
/ corefx Public archive

Add DateTime Leap Seconds Tests #33939

Merged
merged 4 commits into from
Dec 12, 2018

Conversation

tarekgh
Copy link
Member

@tarekgh tarekgh commented Dec 9, 2018

@tarekgh
Copy link
Member Author

tarekgh commented Dec 9, 2018

@jkotas this is the leap seconds tests you have requested in your review in the attached coreclr PR. thanks.

fileTime = now.ToFileTime();
roundTrippedDateTime = DateTime.FromFileTime(fileTime);
Assert.Equal(now, roundTrippedDateTime);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need a similar test for DateTimeOffset?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DateTimeOffset is using DateTime for such operations.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't that an implementation detail?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

internal ushort wSecond;
internal ushort wMillisecond;
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have or need tests that constructs a specific leap second time and validates that the right things happen?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we can do that in the current time as we don't have a system with a leap seconds.

@tarekgh
Copy link
Member Author

tarekgh commented Dec 11, 2018

@stephentoub @jkotas let me know if the last commit addressed your concern. thanks.

@tarekgh
Copy link
Member Author

tarekgh commented Dec 12, 2018

merging this one as I am not sure I'll be able to do more follow up in current time. if there is any pending concerns we can track it with an issue if needed. thanks all.

@tarekgh tarekgh merged commit 65c580a into dotnet:master Dec 12, 2018
jlennox pushed a commit to jlennox/corefx that referenced this pull request Dec 16, 2018
* Add DateTime Leap Seconds Tests

* Fix the comment

* Address the feedback

* small fix
@karelz karelz added this to the 3.0 milestone Dec 21, 2018
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
* Add DateTime Leap Seconds Tests

* Fix the comment

* Address the feedback

* small fix


Commit migrated from dotnet/corefx@65c580a
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants