Skip to content

Commit 8567963

Browse files
committed
fixup: riscv: fix mstatus test
Fixes the assignment in the `mstatus` unti tests.
1 parent f7afa99 commit 8567963

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

riscv/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
2020
### Fixed
2121

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

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

riscv/src/register/mstatus.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -602,11 +602,11 @@ mod test {
602602
#[test]
603603
fn test_mpp() {
604604
let mut mstatus = Mstatus { bits: 0 };
605-
mstatus = mstatus.set_mpp(MPP::User);
605+
mstatus.set_mpp(MPP::User);
606606
assert_eq!(mstatus.mpp(), MPP::User);
607-
mstatus = mstatus.set_mpp(MPP::Machine);
607+
mstatus.set_mpp(MPP::Machine);
608608
assert_eq!(mstatus.mpp(), MPP::Machine);
609-
mstatus = mstatus.set_mpp(MPP::Supervisor);
609+
mstatus.set_mpp(MPP::Supervisor);
610610
assert_eq!(mstatus.mpp(), MPP::Supervisor);
611611
}
612612
}

0 commit comments

Comments
 (0)