Alexandre Courbot
2025-Oct-04 00:38 UTC
[PATCH v5 6/9] rust: bitfield: Add KUNIT tests for bitfield
On Sat Oct 4, 2025 at 12:23 AM JST, Joel Fernandes wrote:>> - The right field is actually written (i.e. if the offset is off by one, >> the getter will return the expected result even though the bitfield >> has the wrong value), >> - No other field has been affected. >> >> So something like: >> >> pte = pte.set_present(true); >> assert!(pte.present()); >> assert(pte.into(), 0x1u64); >> >> pte = pte.set_writable(true); >> assert!(pte.writable()); >> assert(pte.into(), 0x3u64); >> >> It might look a bit gross, but it is ok since these are not doctests >> that users are going to take as a reference, so we case improve test >> coverage at the detriment of readability. >> > > Ack. I will add these. > > Thanks for the review! (I am assuming with these changes you're Ok with me > carrying your Reviewed-by tag on this patch as well, but please let me know if > there is a concern.)Please do not add tags that haven't been explicitly given. If we start assuming one another's stance about patches, the trust we can have in these tags is significantly reduced. Doing so also doesn't achieve anything in terms of efficiency; if I am ok with v3 I can give my Reviewed-by on it, and the tag can be picked up along with the patch when it is applied.