(fields: &'a [&'a str])
| 112 | .map(|(name, offset)| ((*name).to_owned(), *offset)) |
| 113 | .collect(), |
| 114 | } |
| 115 | } |
| 116 | |
| 117 | #[test] |
| 118 | fn pcb_and_trap_frame_struct_layout_matches_offsets() { |
| 119 | let source = os_runtime::module_source("kernel/core/kernel_abi.hll").unwrap(); |
| 120 | let mut trap_fields: Vec<_> = (0..32) |
| 121 | .map(|index| (format!("x{index}"), index * 8)) |
| 122 | .collect(); |
| 123 | trap_fields.extend([ |