-
Notifications
You must be signed in to change notification settings - Fork 1.2k
make TestHTTPServer choose the port automatically rather than guessing #1185
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
make TestHTTPServer choose the port automatically rather than guessing #1185
Conversation
TestFoundation/HTTPServer.swift
Outdated
this is the same as nthos which is a C macro which isn't available from Swift :\. | ||
*/ | ||
static func from(networkByteOrder input: UInt16) -> UInt16 { | ||
var val: UInt16 = input |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this just UInt16(bigEndian:)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, thanks, fixed.
TestFoundation/HTTPServer.swift
Outdated
and little endian machines. | ||
Cf. https://commandcenter.blogspot.co.uk/2012/04/byte-order-fallacy.html | ||
|
||
this is the same as nthos which is a C macro which isn't available from Swift :\. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a small typo here? did you mean ntohs
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, removed as of @spevans comment
@swift-ci please test |
|
@swift-ci please test |
1 similar comment
@swift-ci please test |
@pushkarnk @spevans I'm actually expect the tests to fail in |
@swift-ci please test and merge |
1 similar comment
@swift-ci please test and merge |
cc @saiHemak |
the loop to find a free port is ugly, error-prone and makes the tests less robust
fixing this here