Currently, test_32 and test_16 closure are placed each unit test module.
|
let test_32 = |inst_32: u32, |
|
op: OpcodeKind, |
|
rd: Option<usize>, |
|
rs1: Option<usize>, |
|
rs2: Option<usize>, |
|
imm: Option<i32>| { |
|
let op_32 = inst_32.parse_opcode(Isa::Rv64).unwrap(); |
|
assert!(matches!(&op_32, op)); |
|
assert_eq!(inst_32.parse_rd(&op_32).unwrap(), rd); |
|
assert_eq!(inst_32.parse_rs1(&op_32).unwrap(), rs1); |
|
assert_eq!(inst_32.parse_rs2(&op_32).unwrap(), rs2); |
|
assert_eq!(inst_32.parse_imm(&op_32, Isa::Rv64).unwrap(), imm); |
|
}; |
It should be replaced with a common function and add more information.
Currently,
test_32andtest_16closure are placed each unit test module.raki/src/decode/base_i.rs
Lines 349 to 361 in 754a26e
It should be replaced with a common function and add more information.