Skip to content

[android] Do not try to turn EOF into an UInt8 #24175

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

Conversation

drodriguez
Copy link
Contributor

Android is one of those platforms that define the symbol EOF as a
negative number. Trying to turn it into an UInt8 will only crash the
test. Move the transformation after we have checked for EOF first. In my
opinion, in other platforms, having the EOF attached to the getline
result was also invalid, and that's probably why the two test that use
EOF were sending an extra newline.

Even with this, the tests do not pass on Android because it deadlocks
waiting for input/output from the child process, which never happens. I
haven't find why this happens, but only happens if the last test of the
suite closes stdin. I will try to fix that in another PR.

Android is one of those platforms that define the symbol EOF as a
negative number. Trying to turn it into an UInt8 will only crash the
test. Move the transformation after we have checked for EOF first. In my
opinion, in other platforms, having the EOF attached to the getline
result was also invalid, and that's probably why the two test that use
EOF were sending an extra newline.

Even with this, the tests do not pass on Android because it deadlocks
waiting for input/output from the child process, which never happens. I
haven't find why this happens, but only happens if the last test of the
suite closes stdin. I will try to fix that in another PR.
@drodriguez drodriguez requested a review from compnerd April 20, 2019 00:31
@compnerd
Copy link
Member

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 5835ceb

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 5835ceb

@compnerd
Copy link
Member

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 5835ceb

@compnerd
Copy link
Member

@swift-ci please test macOS platform

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 5835ceb

@drodriguez

This comment has been minimized.

@drodriguez
Copy link
Contributor Author

@swift-ci please test macOS platform

@drodriguez drodriguez merged commit fa5d66c into swiftlang:master Apr 29, 2019
@drodriguez drodriguez deleted the android-dont-append-negative-EOF branch July 16, 2019 23:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants