Skip to content

Commit

Permalink
fixup: riscv: fix mstatus test
Browse files Browse the repository at this point in the history
Fixes the assignment in the `mstatus` unti tests.
  • Loading branch information
rmsyn committed May 21, 2024
1 parent f7afa99 commit 8567963
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions riscv/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
### Fixed

- Fixed `sip::set_ssoft` and `sip::clear_ssoft` using wrong address
- Fixed assignment in `mstatus` unit tests.

## [v0.11.1] - 2024-02-15

Expand Down
6 changes: 3 additions & 3 deletions riscv/src/register/mstatus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -602,11 +602,11 @@ mod test {
#[test]
fn test_mpp() {
let mut mstatus = Mstatus { bits: 0 };
mstatus = mstatus.set_mpp(MPP::User);
mstatus.set_mpp(MPP::User);
assert_eq!(mstatus.mpp(), MPP::User);
mstatus = mstatus.set_mpp(MPP::Machine);
mstatus.set_mpp(MPP::Machine);
assert_eq!(mstatus.mpp(), MPP::Machine);
mstatus = mstatus.set_mpp(MPP::Supervisor);
mstatus.set_mpp(MPP::Supervisor);
assert_eq!(mstatus.mpp(), MPP::Supervisor);
}
}

0 comments on commit 8567963

Please sign in to comment.