-
Notifications
You must be signed in to change notification settings - Fork 59
Implement WASI fd_pread and fd_pwrite #571
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
Conversation
wasi/src/test/java/com/dylibso/chicory/wasi/WasiPreview1Test.java
Outdated
Show resolved
Hide resolved
|
@electrum I rebased your branch and added a commit on top to have the failure kind of "unit tested". Let me know if you agree with this way forward! |
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 for updating the test. We should squash it into the commit that adds the pread/pwrite methods.
wasi/src/test/java/com/dylibso/chicory/wasi/WasiPreview1Test.java
Outdated
Show resolved
Hide resolved
wasi/src/test/java/com/dylibso/chicory/wasi/WasiPreview1Test.java
Outdated
Show resolved
Hide resolved
wasi/src/test/java/com/dylibso/chicory/wasi/WasiPreview1Test.java
Outdated
Show resolved
Hide resolved
|
@andreaTP Thanks for updating the test. I cleaned it up a bit and squashed it into the commit that adds the methods. I also rebased the branch and added another commit to cleanup the |
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.
LGTM, good to go!
Thanks!
| assertEquals(WasiErrno.ESUCCESS.value(), result); | ||
|
|
||
| int fd = memory.readInt(fdPtr); | ||
| assertEquals(4, fd); |
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.
I'm going to forget what is this 4 in a couple of hours 😅
But it's an improvement over my version of it 👍
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.
It's the next open descriptor (0-2 are stdin/out/err, 3 is the pre-opened directory). We don't actually need to assert this, but doesn't hurt to validate anyway.
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.
Yeah, I know because I wrote the test with the debugger on my side 😅 but I'm going to forget about it quickly.
No description provided.