From 85679633202409a31c5a6d96c74872e7a5c7776a Mon Sep 17 00:00:00 2001 From: rmsyn Date: Tue, 21 May 2024 17:10:54 +0000 Subject: [PATCH] fixup: riscv: fix `mstatus` test Fixes the assignment in the `mstatus` unti tests. --- riscv/CHANGELOG.md | 1 + riscv/src/register/mstatus.rs | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/riscv/CHANGELOG.md b/riscv/CHANGELOG.md index 8b26cf7f..22e0ddec 100644 --- a/riscv/CHANGELOG.md +++ b/riscv/CHANGELOG.md @@ -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 diff --git a/riscv/src/register/mstatus.rs b/riscv/src/register/mstatus.rs index e01388a9..5aadc33a 100644 --- a/riscv/src/register/mstatus.rs +++ b/riscv/src/register/mstatus.rs @@ -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); } }