Skip to content

Commit a6cc40c

Browse files
committed
fixup: riscv: fix tests for read-only registers
Fixes previous read-write tests for the MIP and SIP CSRs, which are now read-only.
1 parent 2885cc1 commit a6cc40c

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

riscv/src/register/mip.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -84,15 +84,11 @@ mod tests {
8484

8585
#[test]
8686
fn test_mip() {
87-
let mut m = Mip::from_bits(0);
87+
let mip = Mip::from_bits(0);
8888

89-
test_csr_field!(m, ssoft);
90-
test_csr_field!(m, stimer);
91-
test_csr_field!(m, sext);
92-
93-
assert!(!m.msoft());
94-
assert!(!m.mtimer());
95-
assert!(!m.mext());
89+
assert!(!mip.msoft());
90+
assert!(!mip.mtimer());
91+
assert!(!mip.mext());
9692

9793
assert!(Mip::from_bits(1 << 3).msoft());
9894
assert!(Mip::from_bits(1 << 7).mtimer());

riscv/src/register/sip.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,8 @@ mod tests {
6060

6161
#[test]
6262
fn test_sip() {
63-
let mut sip = Sip::from_bits(0);
63+
let sip = Sip::from_bits(0);
6464

65-
test_csr_field!(sip, ssoft);
6665
assert!(!sip.stimer());
6766
assert!(!sip.sext());
6867

0 commit comments

Comments
 (0)