Skip to content

Commit e2cfa4f

Browse files
committed
riscv: use CSR test macro for mcounteren range
Uses the CSR test helper macro for `mcounteren` range fields.
1 parent fd6c947 commit e2cfa4f

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

riscv/src/register/mcounteren.rs

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -117,18 +117,7 @@ mod tests {
117117
test_csr_field!(m, tm);
118118
test_csr_field!(m, ir);
119119

120-
(3..32).for_each(|i| {
121-
assert!(!m.hpm(i));
122-
assert_eq!(m.try_hpm(i), Ok(false));
123-
124-
m.set_hpm(i, true);
125-
assert!(m.hpm(i));
126-
127-
assert_eq!(m.try_set_hpm(i, false), Ok(()));
128-
assert_eq!(m.try_hpm(i), Ok(false));
129-
130-
assert!(!m.hpm(i));
131-
});
120+
(3..32).for_each(|i| test_csr_field!(m, hpm, i));
132121

133122
(0..3).chain(32..64).for_each(|index| {
134123
assert_eq!(

0 commit comments

Comments
 (0)