Skip to content

Conversation

@electrum
Copy link
Collaborator

No description provided.

@andreaTP
Copy link
Collaborator

@electrum I rebased your branch and added a commit on top to have the failure kind of "unit tested".
It's a much more "white box" test than I usually like, but, in this case, the integration test seemed a bit artificial too ...

Let me know if you agree with this way forward!

Copy link
Collaborator Author

@electrum electrum left a 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.

@electrum
Copy link
Collaborator Author

@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 withOptions() builder method name.

Copy link
Collaborator

@andreaTP andreaTP left a 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);
Copy link
Collaborator

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 👍

Copy link
Collaborator Author

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.

Copy link
Collaborator

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.

@andreaTP andreaTP merged commit 9bae2f2 into dylibso:main Oct 29, 2024
13 checks passed
@electrum electrum deleted the wasi branch October 29, 2024 16:01
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.

2 participants