-
Notifications
You must be signed in to change notification settings - Fork 947
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
Fix mask write register #961
Fix mask write register #961
Conversation
According to the spec the "Mask Write Register" function ands the or-mask with ~and-mask. See section 6.16 of the specification (v1.1b3): ``` Result = (Current Contents AND And_Mask) OR (Or_Mask AND (NOT And_Mask)) ```
I couldn't really find a place to add a test. If you let me know where that should go I can try to add it. |
please add a test in the test directory. |
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.
Change is correct, I will approve as soon as a couple of tests are added.
Can you point me to the file that tests the behavior of the functions? |
look in the test directory! the file names tells what the file test. You are also welcome to add a new file. |
I did look in the test directory, but could not find one test that tests the behavior of the server; |
I never said there were tests specifically for masks, on the contrary I asked you to add tests. |
You could actually just search for the función call. |
I know where the test for the mask is: I was assuming that there is a test somewhere where the behavior of the server is tested. Something that makes sure that |
We do not have functional tests in place yet to test the behaviour of both server and client. For now unit tests should suffice. Thanks for the PR. |
I have added a test. |
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 modifying a single test, this however does not seem sufficient to test the and/or functionally.
The test uses the 4 nibbles of the 16-bit values to test the combinations:
That should cover all possible mask possibilities. |
Thanks for your contribution (I just added a comment copying your explanation). We hope you are motivated to do more patches, an easy one, but also a bit bigger is to
|
Thanks for merging. I'm not really a Python coder, and there is plenty to do on our open-source project, so I doubt I will find time to contribute here. |
According to the spec the "Mask Write Register" function ands the
or-mask with ~and-mask.
See section 6.16 of the specification (v1.1b3):