Skip to content
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

Evaluate and refine conversions between Register, ErrorCode, and ReturnVariant. #328

Open
jrvanwhy opened this issue Sep 4, 2021 · 0 comments
Assignees

Comments

@jrvanwhy
Copy link
Collaborator

jrvanwhy commented Sep 4, 2021

The unit tests and system call implementations have some awkward conversions between Register and the ErrorCode and ReturnVariant types. In particular, calling assert_eq!() on the results of a system call can be very awkward, as the type inference doesn't play well with the Into and PartialEq invocations involved.

After all the system calls are implemented in libtock_unittest and libtock_platform, I will do a survey of conversions to and from Register and see if I can refine them to make the code cleaner. This issue is to remind me to do that.

@jrvanwhy jrvanwhy self-assigned this Sep 4, 2021
bors bot added a commit that referenced this issue Sep 13, 2021
329: Implement Subscribe in `libtock_unittest::fake::Kernel`. r=jrvanwhy a=jrvanwhy

Like #326 , this does not have a full unit test suite because it was getting too large. Instead, I'll be adding the unit tests that need additional infrastructure (a `fake::Driver`) later, and have a TODO to remind myself.

I added some conversions between `Register`, `ErrorCode`, and `ReturnVariant`. I'm not sure what these conversions should look like (some of the code is kind of awkward), so I opened #328 to take another look in the future.

Co-authored-by: Johnathan Van Why <[email protected]>
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

No branches or pull requests

1 participant